; ModuleID = 'Main'
source_filename = "simple.ed"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nonlazybind
define i64 @main(i64 %0) #0 !dbg !2 {
entry:
call void @llvm.dbg.value(metadata i64 %0, metadata !8, metadata !DIExpression()), !dbg !11
%return_ptr = alloca i64, align 8, !dbg !12
%argc = alloca i64, align 8, !dbg !11
store i64 %0, ptr %argc, align 4, !dbg !11
%a = alloca i64, align 8, !dbg !13
%"3" = alloca i64, align 8, !dbg !13
%"4" = alloca i64, align 8, !dbg !13
%"5" = alloca i1, align 1, !dbg !13
br label %block_0, !dbg !13
block_0: ; preds = %entry
call void @llvm.dbg.declare(metadata ptr %a, metadata !10, metadata !DIExpression()), !dbg !13
call void @llvm.dbg.value(metadata i64 0, metadata !10, metadata !DIExpression()), !dbg !13
store i64 0, ptr %a, align 4, !dbg !13
%1 = load i64, ptr %argc, align 4, !dbg !13
store i64 %1, ptr %"3", align 4, !dbg !13
store i64 2, ptr %"4", align 4, !dbg !13
%2 = load i64, ptr %"3", align 4, !dbg !13
%3 = load i64, ptr %"4", align 4, !dbg !13
%4 = icmp sgt i64 %2, %3, !dbg !13
store i1 %4, ptr %"5", align 1, !dbg !13
%5 = load i1, ptr %"5", align 1, !dbg !13
switch i1 %5, label %block_1 [
i1 false, label %block_2
], !dbg !13
block_1: ; preds = %block_0
call void @llvm.dbg.value(metadata i64 1, metadata !10, metadata !DIExpression()), !dbg !14
store i64 1, ptr %a, align 4, !dbg !14
br label %block_3, !dbg !14
block_2: ; preds = %block_0
br label %block_3, !dbg !14
block_3: ; preds = %block_2, %block_1
%6 = load i64, ptr %a, align 4, !dbg !14
store i64 %6, ptr %return_ptr, align 4, !dbg !14
%7 = load i64, ptr %return_ptr, align 4, !dbg !14
ret i64 %7, !dbg !14
}
mod Main {
pub fn main(argc: i64) -> i64 {
let mut a: i64 = 0;
if argc > 2 {
a = 1;
}
return a;
}
}
0000000000001050 <main>:
1050: 48 89 7c 24 f0 mov %rdi,-0x10(%rsp)
1055: 48 c7 44 24 d8 00 00 movq $0x0,-0x28(%rsp)
105c: 00 00
105e: 48 89 7c 24 e8 mov %rdi,-0x18(%rsp)
1063: 48 c7 44 24 e0 02 00 movq $0x2,-0x20(%rsp)
106a: 00 00
106c: 48 83 ff 03 cmp $0x3,%rdi
1070: 0f 9d 44 24 d7 setge -0x29(%rsp)
1075: 7c 09 jl 1080 <main+0x30>
1077: 48 c7 44 24 d8 01 00 movq $0x1,-0x28(%rsp)
107e: 00 00
1080: 48 8b 44 24 d8 mov -0x28(%rsp),%rax
1085: 48 89 44 24 f8 mov %rax,-0x8(%rsp)
108a: c3 ret
it compiles to this btwLD_LIBRARY_PATH
but why does it crash anyways?*** This mod was originally created by '3DA'
*** Now it is maintained & re-coded by:
*** '[Egypt]GreYFoX@GTi' and '[BlackTee]den'
*** Others Helping on the code: 'heinrich5991', 'ravomavain', 'Trust o_0 Aeeeh ?!', 'noother', '<3 fisted <3' & 'LemonFace'
*** Documentation: Zeta-Hoernchen & Learath2, Entities: Fisico
*** Code (in the past): '3DA' and 'Fluxid'
*** Please check the changelog on DDRace.info.
*** Also the commit log on github.com/GreYFoX/teeworlds .
(edited)*** This mod was originally created by '3DA'
*** Now it is maintained & re-coded by:
*** '[Egypt]GreYFoX@GTi' and '[BlackTee]den'
*** Others Helping on the code: 'heinrich5991', 'ravomavain', 'Trust o_0 Aeeeh ?!', 'noother', '<3 fisted <3' & 'LemonFace'
*** Documentation: Zeta-Hoernchen & Learath2, Entities: Fisico
*** Code (in the past): '3DA' and 'Fluxid'
*** Please check the changelog on DDRace.info.
*** Also the commit log on github.com/GreYFoX/teeworlds .
(edited) "git clone --recrusive https://github.com/ddnet/ddnet.git && cd ddnet && mkdir build && cd build && cmake .. -GNinja -DMYSQL=ON && ninja"
(edited)#define TIME_CODE_BLOCK(block) \
do { \
auto start = std::chrono::high_resolution_clock::now(); \
block; \
auto end = std::chrono::high_resolution_clock::now(); \
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start); \
dbg_msg("Timer", "Time taken by code block: %ldms", duration.count()); \
} while(0)
if only there was a better way to profile ddnet code #define TIME_CODE_BLOCK(block) \
do { \
auto start = std::chrono::high_resolution_clock::now(); \
block; \
auto end = std::chrono::high_resolution_clock::now(); \
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start); \
dbg_msg("Timer", "Time taken by code block: %ldms", duration.count()); \
} while(0)
if only there was a better way to profile ddnet code emerge --sync && emerge -uDUavt --deep --with-bdeps=y @world
shell_*
, os_*
, secure_*
, cmdline_*
, windows_*
and related functions.
Move open_link
and open_file
declarations to shell group, to the same relative position as their function definitions.
emerge --sync && emerge -uDUavt --deep --with-bdeps=y @world