xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *substr(char *origin, int from) {
  int len = strlen(origin);
  char *result = (char *)malloc(sizeof(char) * (len - from + 1));
  strcpy(result, origin + from);
  return result;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
call   1040 <strlen@plt>
sub    %ebp,%eax
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movslq %ebp,%rsi
add    %r14,%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = mul i64 1, %13
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = call i32 @strcpy(i8* %18, i8* %22)
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sub i32 1, %1
%5 = add i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @strcpy(i8* %7, i8* %9)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ execute_word(char *, void *);
scalar_t__ init_forth();
int /*<<< orphan*/ init_io();
cforth() {
  void *up;
  init_io();
  up = (void *)init_forth();
  execute_word("app", up);
}


x86 assembly (clang, -O0):
<cforth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init_io@plt>
mov    $0x0,%al
call   1050 <init_forth@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <execute_word@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cforth>:
push   %rax
xor    %eax,%eax
call   1040 <init_io@plt>
xor    %eax,%eax
call   1050 <init_forth@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <execute_word@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"app\00"
define i32 @cforth() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 (...) @init_io()
%4 = call i64 (...) @init_forth()
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @execute_word(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"app\00"
define i32 @cforth() {
%1 = tail call i32 (...) @init_io()
%2 = tail call i64 (...) @init_forth()
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @execute_word(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcheck_register_freed(char *, int, void *);
void ht_destructor(void *what, void *user_data) {
  memcheck_register_freed(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/stefan-wolfsheimer/scheme-vm/refs/heads/"
      "master/src/test_util/test_hash_table.c",
      104, what);
}


x86 assembly (clang, -O0):
<ht_destructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
mov    $0x68,%esi
call   1030 <memcheck_register_freed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_destructor>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    $0x68,%esi
jmp    1030 <memcheck_register_freed@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/stefan-wolfsheimer/scheme-vm/refs/heads/master/src/test_util/test_hash_table.c\00"
define void @ht_destructor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @memcheck_register_freed(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 104, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/stefan-wolfsheimer/scheme-vm/refs/heads/master/src/test_util/test_hash_table.c\00"
define void @ht_destructor(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @memcheck_register_freed(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 104, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printStuff() { printf("Printing something!\n"); }


x86 assembly (clang, -O0):
<printStuff>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStuff>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Printing something!\0A\00"
define void @printStuff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Printing something!\00"
define void @printStuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_version() {
  fprintf(stderr, "MAC-Ping"
                  " "
                  "0.1"
                  "\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"MAC-Ping 0.1\0A\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"MAC-Ping 0.1\0A\00"
define void @print_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fd_list_clean();
int /*<<< orphan*/ signal_table_clean();
void event_uninit(void) {
  signal_table_clean();
  fd_list_clean();
}


x86 assembly (clang, -O0):
<event_uninit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <signal_table_clean@plt>
mov    $0x0,%al
call   1040 <fd_list_clean@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_uninit>:
push   %rax
xor    %eax,%eax
call   1030 <signal_table_clean@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fd_list_clean@plt>

LLVM IR (-O0):
define void @event_uninit() {
%1 = call i32 (...) @signal_table_clean()
%2 = call i32 (...) @fd_list_clean()
ret void
}

LLVM IR (-O2):
define void @event_uninit() {
%1 = tail call i32 (...) @signal_table_clean()
%2 = tail call i32 (...) @fd_list_clean()
ret void
}
void z_nop(void) {}


x86 assembly (clang, -O0):
<z_nop>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<z_nop>:
ret

LLVM IR (-O0):
define void @z_nop() {
ret void
}

LLVM IR (-O2):
define void @z_nop() {
ret void
}
void MUSIC_ResetMidiChannelVolumes(void) {}


x86 assembly (clang, -O0):
<MUSIC_ResetMidiChannelVolumes>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MUSIC_ResetMidiChannelVolumes>:
ret

LLVM IR (-O0):
define void @MUSIC_ResetMidiChannelVolumes() {
ret void
}

LLVM IR (-O2):
define void @MUSIC_ResetMidiChannelVolumes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) { printf("usage:%s [-a] [-o 0xOFFSET] dt.img\n", name); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"usage:%s [-a] [-o 0xOFFSET] dt.img\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"usage:%s [-a] [-o 0xOFFSET] dt.img\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int rom_present(char *);
int wd1002a_wx1_available(void) {
  return (rom_present(L"roms/hdd/st506/wd1002a_wx1-62-000094-032.bin"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <rom_present@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
jmp    1030 <rom_present@plt>

LLVM IR (-O0):
@.str = [45 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 119, i32 100, i32 49, i32 48, i32 48, i32 50, i32 97, i32 95, i32 119, i32 120, i32 49, i32 45, i32 54, i32 50, i32 45, i32 48, i32 48, i32 48, i32 48, i32 57, i32 52, i32 45, i32 48, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @wd1002a_wx1_available() {
%1 = call i32 @rom_present(i8* bitcast ([45 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [45 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 115, i32 116, i32 53, i32 48, i32 54, i32 47, i32 119, i32 100, i32 49, i32 48, i32 48, i32 50, i32 97, i32 95, i32 119, i32 120, i32 49, i32 45, i32 54, i32 50, i32 45, i32 48, i32 48, i32 48, i32 48, i32 57, i32 52, i32 45, i32 48, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @wd1002a_wx1_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([45 x i32]* @.str to i8*))
ret i32 %1
}
unsigned int Timer_Initialize(void) { return 0; }


x86 assembly (clang, -O0):
<Timer_Initialize>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer_Initialize>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Timer_Initialize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @Timer_Initialize() {
ret i32 0
}
void __attribute__((weak)) spi2_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<spi2_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi2_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.spi2_isr = [9 x i8] c"spi2_isr\00"
define weak void @spi2_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi2_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.spi2_isr = [9 x i8] c"spi2_isr\00"
define weak void @spi2_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.spi2_isr, i64 0, i64 0))
ret void
}
__attribute__((no)) int bar(struct A *b) { return 123; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x7b,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x7b,%eax
ret

LLVM IR (-O0):
%struct.A = type opaque
define i32 @bar(%struct.A* %0) {
%2 = alloca %struct.A*
store %struct.A* %0, %struct.A** %2
ret i32 123
}

LLVM IR (-O2):
%struct.A = type opaque
define i32 @bar(%struct.A* nocapture readnone %0) {
ret i32 123
}
/* Variables and functions */
unsigned long db_getsequencecount();
unsigned long ssa_db_get_sequence_count() { return db_getsequencecount(); }


x86 assembly (clang, -O0):
<ssa_db_get_sequence_count>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <db_getsequencecount@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssa_db_get_sequence_count>:
xor    %eax,%eax
jmp    1030 <db_getsequencecount@plt>

LLVM IR (-O0):
define i64 @ssa_db_get_sequence_count() {
%1 = call i64 (...) @db_getsequencecount()
ret i64 %1
}

LLVM IR (-O2):
define i64 @ssa_db_get_sequence_count() {
%1 = tail call i64 (...) @db_getsequencecount()
ret i64 %1
}
int ceilInt(float number) {
  float ret = (number - (int)number > 0) ? (number + 1.0) : (number);
  return (int)ret;
}


x86 assembly (clang, -O0):
<ceilInt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1146 <ceilInt+0x46>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1154 <ceilInt+0x54>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilInt>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movss  0xeea(%rip),%xmm1
addss  %xmm0,%xmm1
xorps  %xmm3,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
cvttss2si %xmm3,%eax
ret

LLVM IR (-O0):
define i32 @ceilInt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fptosi float %5 to i32
%7 = sitofp i32 %6 to float
%8 = fsub float %4, %7
%9 = fcmp ogt float %8, 0.000000e+00
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load float, float* %2
%12 = fpext float %11 to double
%13 = fadd double %12, 1.000000e+00
br label %17
14: ; preds = %1
%15 = load float, float* %2
%16 = fpext float %15 to double
br label %17
17: ; preds = %14, %10
%18 = phi double [ %13, %10 ], [ %16, %14 ]
%19 = fptrunc double %18 to float
store float %19, float* %3
%20 = load float, float* %3
%21 = fptosi float %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @ceilInt(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fcmp ogt float %4, 0.000000e+00
%6 = fadd float %0, 1.000000e+00
%7 = select i1 %5, float %6, float %0
%8 = fptosi float %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void *start(void *arg) {
  int i = 0;
  for (i = 0; i < 1000; i++) {
    void *h = malloc(13);
    if (h)
      free(h);
  }
  return 0;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    117c <start+0x5c>
mov    $0xd,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <start+0x49>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    116e <start+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <start+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rbx
mov    $0x3e8,%ebx
jmp    1135 <start+0x15>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
je     114e <start+0x2e>
mov    $0xd,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1130 <start+0x10>
mov    %rax,%rdi
call   1030 <free@plt>
jmp    1130 <start+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @start(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = call i8* @malloc(i32 13)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = call i32 @free(i8* %13)
br label %15
15: ; preds = %12, %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @start(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %8
%3 = phi i32 [ 0, %1 ], [ %9, %8 ]
%4 = tail call dereferenceable_or_null(13) i8* @malloc(i32 13)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %6, %2
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %11, label %2
11: ; preds = %8
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpenc(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x78));
}


x86 assembly (clang, -O0):
<read_pxpenc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x78,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpenc>:
shl    $0x8,%edi
mov    $0xb0010078,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpenc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 120
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpenc(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 120
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
int test_imm_63uint8_reg(unsigned char val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x63,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63uint8_reg>:
test   $0x63,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 99
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_63uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main() {
  struct stat *buf;
  double a, m, c;
  a = (double)0;
  m = (double)0;
  c = (double)0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat*
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ selfn_strdup(char **, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int const);
char *uinttostr(const unsigned val) {
  char buf[16], *str = NULL;
  memset(buf, 0, sizeof(buf));
  snprintf(buf, sizeof(buf), "%u", val);
  selfn_strdup(&str, buf);
  return str;
}


x86 assembly (clang, -O0):
<uinttostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x10,%esi
lea    0xe9a(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x28(%rbp),%rdi
call   1050 <selfn_strdup@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uinttostr>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    0xea3(%rip),%rdx
mov    %r14,%rdi
mov    $0x10,%esi
mov    %ebx,%ecx
call   1030 <snprintf@plt>
lea    0x8(%rsp),%rdi
mov    %r14,%rsi
call   1050 <selfn_strdup@plt>
mov    0x8(%rsp),%rax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i8* @uinttostr(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
%4 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %4
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 16)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @snprintf(i8* %7, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%11 = call i32 @selfn_strdup(i8** %4, i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i8* @uinttostr(i32 %0) {
%2 = alloca [16 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = call i32 @memset(i8* %4, i32 0, i32 16)
%7 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = call i32 @selfn_strdup(i8** %3, i8* %4)
%9 = load i8*, i8** %3
ret i8* %9
}
int test_imm_97uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x97,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97uint64_lowword_mem>:
testb  $0x97,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_97uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 151
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_97uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 151
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cli_puts(char *);
void cli_putsp(void) { cli_puts(" "); }


x86 assembly (clang, -O0):
<cli_putsp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <cli_puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_putsp>:
lea    0xee9(%rip),%rdi
jmp    1030 <cli_puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @cli_putsp() {
%1 = call i32 @cli_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @cli_putsp() {
%1 = tail call i32 @cli_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *ConvertVMFlags(unsigned long, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void PrintVMFlags(unsigned long flags) {
  char tmp_buffer[256];
  printf("%s", ConvertVMFlags(flags, tmp_buffer, 256));
}


x86 assembly (clang, -O0):
<PrintVMFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <ConvertVMFlags@plt>
mov    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintVMFlags>:
sub    $0x108,%rsp
mov    %rsp,%rsi
mov    $0x100,%edx
call   1040 <ConvertVMFlags@plt>
lea    0xec5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @PrintVMFlags(i64 %0) {
%2 = alloca i64
%3 = alloca [256 x i8]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i8* @ConvertVMFlags(i64 %4, i8* %5, i32 256)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @PrintVMFlags(i64 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i8* @ConvertVMFlags(i64 %0, i8* %3, i32 256)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_level() {
  int level = 1;
  while (rand() < RAND_MAX / 2 && level < 6)
    level++;
  return level;
}


x86 assembly (clang, -O0):
<rand_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jge    1152 <rand_level+0x42>
cmpl   $0x6,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1162 <rand_level+0x52>
jmp    1170 <rand_level+0x60>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <rand_level+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_level>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    (%r14),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%eax
jge    113f <rand_level+0x2f>
cmp    $0x6,%ebx
jb     1120 <rand_level+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_level() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %12, %0
%3 = call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sdiv i32 %4, 2
%6 = icmp slt i32 %3, %5
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 6
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %9, %1 ]
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sdiv i32 %4, 2
%6 = icmp slt i32 %3, %5
%7 = icmp ult i32 %2, 6
%8 = select i1 %6, i1 %7, i1 false
%9 = add nuw nsw i32 %2, 1
br i1 %8, label %1, label %10
10: ; preds = %1
ret i32 %2
}
void RTFileFromNative(void) {}


x86 assembly (clang, -O0):
<RTFileFromNative>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTFileFromNative>:
ret

LLVM IR (-O0):
define void @RTFileFromNative() {
ret void
}

LLVM IR (-O2):
define void @RTFileFromNative() {
ret void
}
void close_excalibur(void) {}


x86 assembly (clang, -O0):
<close_excalibur>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_excalibur>:
ret

LLVM IR (-O0):
define void @close_excalibur() {
ret void
}

LLVM IR (-O2):
define void @close_excalibur() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itc_net_connect_p();
int /*<<< orphan*/ itc_net_connect_p_multiple_clients();
int itc_net_connect_main(void) {
  itc_net_connect_p();
  itc_net_connect_p_multiple_clients();
  return 0;
}


x86 assembly (clang, -O0):
<itc_net_connect_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <itc_net_connect_p@plt>
mov    $0x0,%al
call   1040 <itc_net_connect_p_multiple_clients@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itc_net_connect_main>:
push   %rax
xor    %eax,%eax
call   1030 <itc_net_connect_p@plt>
xor    %eax,%eax
call   1040 <itc_net_connect_p_multiple_clients@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @itc_net_connect_main() {
%1 = call i32 (...) @itc_net_connect_p()
%2 = call i32 (...) @itc_net_connect_p_multiple_clients()
ret i32 0
}

LLVM IR (-O2):
define i32 @itc_net_connect_main() {
%1 = tail call i32 (...) @itc_net_connect_p()
%2 = tail call i32 (...) @itc_net_connect_p_multiple_clients()
ret i32 0
}
f(volatile char x) { x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %dil,-0x1(%rsp)
mov    -0x1(%rsp),%al
ret

LLVM IR (-O0):
define i32 @f(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store volatile i8 %0, i8* %3
%4 = load volatile i8, i8* %3
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i8 signext %0) {
%2 = alloca i8
store volatile i8 %0, i8* %2
%3 = load volatile i8, i8* %2
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long member_0;
  long long member_1;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long a, long long b) {
  lldiv_t ret = {a / b, a % b};
  return ret;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = sdiv i64 %7, %8
store i64 %9, i64* %6
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = srem i64 %11, %12
store i64 %13, i64* %10
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  char text[] = "I love my programmer\n";
  char *t;
  t = text;
  while (*t != '\0') {
    putchar(*t);
    t++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xecf(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117e <main+0x6e>
mov    -0x28(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1151 <main+0x41>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa72656d6d6172,%rax
mov    %rax,0xe(%rsp)
lea    0x1(%rsp),%rbx
mov    $0x49,%al
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.text = [22 x i8] c"I love my programmer\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [22 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [22 x i8]* %2 to i8*
%5 = getelementptr inbounds [22 x i8], [22 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
br label %6
6: ; preds = %11, %0
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32 @putchar(i8 signext %13)
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %6
17: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [22 x i8] c"I love my programmer\0A\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i8 [ %8, %3 ], [ 73, %0 ]
%5 = phi i8* [ %7, %3 ], [ %2, %0 ]
%6 = tail call i32 @putchar(i8 signext %4)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}
void debug_print(const char *message) {}


x86 assembly (clang, -O0):
<debug_print>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_print>:
ret

LLVM IR (-O0):
define void @debug_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @debug_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
void emit_fsub(int r) {
  assem_debug("fsub st%d\n", r);
  output_byte(0xd8);
  output_byte(0xe0 + r);
}


x86 assembly (clang, -O0):
<emit_fsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
mov    -0x4(%rbp),%edi
add    $0xe0,%edi
call   1040 <output_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fsub>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
add    $0xe0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"fsub st%d\0A\00"
define void @emit_fsub(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 216)
%6 = load i32, i32* %2
%7 = add nsw i32 224, %6
%8 = call i32 @output_byte(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"fsub st%d\0A\00"
define void @emit_fsub(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 216)
%4 = add nsw i32 %0, 224
%5 = tail call i32 @output_byte(i32 %4)
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ s_srrand(int /*<<< orphan*/);
void tsrand() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  s_srrand(tv.tv_usec);
}


x86 assembly (clang, -O0):
<tsrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <s_srrand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsrand>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <s_srrand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @tsrand() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i32 @s_srrand(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @tsrand() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @s_srrand(i32 %5)
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int randomNumber(int n) {
  srand(time(NULL));
  return rand() % n;
}


x86 assembly (clang, -O0):
<randomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomNumber>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @randomNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @randomNumber(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
void opcao_3(char *texto) {}


x86 assembly (clang, -O0):
<opcao_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcao_3>:
ret

LLVM IR (-O0):
define void @opcao_3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @opcao_3(i8* nocapture %0) {
ret void
}
void mmcif_update_progress(int nr) {}


x86 assembly (clang, -O0):
<mmcif_update_progress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcif_update_progress>:
ret

LLVM IR (-O0):
define void @mmcif_update_progress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @mmcif_update_progress(i32 %0) {
ret void
}
/* Variables and functions */
void *excl_dlmalloc(size_t);
void *malloc(size_t sz) { return excl_dlmalloc(sz); }


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <excl_dlmalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
jmp    1030 <excl_dlmalloc@plt>

LLVM IR (-O0):
define i8* @malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @excl_dlmalloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @excl_dlmalloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
float sgnoise1d(float);
float ugnoise1d(float position) { return (0.5f - 0.5f * sgnoise1d(position)); }


x86 assembly (clang, -O0):
<ugnoise1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sgnoise1d@plt>
movss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xec9(%rip),%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ugnoise1d>:
push   %rax
call   1030 <sgnoise1d@plt>
mulss  0xee2(%rip),%xmm0
addss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ugnoise1d(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sgnoise1d(float %3)
%5 = call float @llvm.fmuladd.f32(float -5.000000e-01, float %4, float 5.000000e-01)
ret float %5
}

LLVM IR (-O2):
define float @ugnoise1d(float %0) {
%2 = tail call float @sgnoise1d(float %0)
%3 = tail call float @llvm.fmuladd.f32(float %2, float -5.000000e-01, float 5.000000e-01)
ret float %3
}
char *stralloc(s)
char *s;
{ return strcpy(my_malloc(strlen(s) + 1, "stralloc"), s); }


x86 assembly (clang, -O0):
<stralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1030 <my_malloc@plt>
movslq %eax,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stralloc>:
push   %rbx
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
lea    0xebc(%rip),%rsi
xor    %eax,%eax
call   1030 <my_malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <strcpy@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"stralloc\00"
define i8* @stralloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add i64 %4, 1
%6 = call i32 (i64, i8*, ...) bitcast (i32 (...)* @my_malloc to i32 (i64, i8*, ...)*)(i64 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"stralloc\00"
define i8* @stralloc(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, i8*, ...) bitcast (i32 (...)* @my_malloc to i32 (i64, i8*, ...)*)(i64 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
int fun976() { return 976; }


x86 assembly (clang, -O0):
<fun976>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun976>:
mov    $0x3d0,%eax
ret

LLVM IR (-O0):
define i32 @fun976() {
ret i32 976
}

LLVM IR (-O2):
define i32 @fun976() {
ret i32 976
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ g_mk_temp_dir(int /*<<< orphan*/);
int g_fork(void) {
  int rv;
  rv = fork();
  if (rv == 0) {
    g_mk_temp_dir(0);
  }
  return rv;
}


x86 assembly (clang, -O0):
<g_fork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1143 <g_fork+0x23>
xor    %edi,%edi
call   1030 <g_mk_temp_dir@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_fork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1135 <g_fork+0x15>
xor    %edi,%edi
call   1030 <g_mk_temp_dir@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g_fork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @g_mk_temp_dir(i32 0)
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_fork() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @g_mk_temp_dir(i32 0)
br label %5
5: ; preds = %3, %0
ret i32 %1
}
void foo327() {}


x86 assembly (clang, -O0):
<foo327>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo327>:
ret

LLVM IR (-O0):
define void @foo327() {
ret void
}

LLVM IR (-O2):
define void @foo327() {
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void set_canonical(struct termios old) { tcsetattr(0, TCSANOW, &old); }


x86 assembly (clang, -O0):
<set_canonical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_canonical>:
push   %rax
mov    %edi,(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <tcsetattr@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @set_canonical(i32 %0) {
%2 = alloca %struct.termios
%3 = getelementptr inbounds %struct.termios, %struct.termios* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = load i32, i32* @TCSANOW
%5 = call i32 @tcsetattr(i32 0, i32 %4, %struct.termios* %2)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCSANOW = global i32 0
define void @set_canonical(i32 %0) {
%2 = alloca %struct.termios
%3 = getelementptr inbounds %struct.termios, %struct.termios* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = load i32, i32* @TCSANOW
%5 = call i32 @tcsetattr(i32 0, i32 %4, %struct.termios* %2)
ret void
}
/* Variables and functions */
size_t build_query(char *, size_t, int, char const *, int);
size_t dns_build_a_query(char *buf, size_t size, const char *dn, int edns) {
  return build_query(buf, size, 1, dn, edns);
}


x86 assembly (clang, -O0):
<dns_build_a_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edx
call   1030 <build_query@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_build_a_query>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <build_query@plt>

LLVM IR (-O0):
define i64 @dns_build_a_query(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i64 @build_query(i8* %9, i64 %10, i32 1, i8* %11, i32 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @dns_build_a_query(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i64 @build_query(i8* %0, i64 %1, i32 1, i8* %2, i32 %3)
ret i64 %5
}