xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char **argv) {
  long sum_squares = 0;
  long sum = 0;
  for (long i = 1; i <= 100; ++i) {
    sum_squares += i * i;
    sum += i;
  }
  printf("%ld\n", (sum * sum - sum_squares));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
cmpq   $0x64,-0x28(%rbp)
jg     1177 <main+0x67>
mov    -0x28(%rbp),%rax
imul   -0x28(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    113e <main+0x2e>
mov    -0x20(%rbp),%rsi
imul   -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x17ff976,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
store i64 1, i64* %8
br label %9
9: ; preds = %21, %2
%10 = load i64, i64* %8
%11 = icmp sle i64 %10, 100
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i64, i64* %8
%14 = load i64, i64* %8
%15 = mul nsw i64 %13, %14
%16 = load i64, i64* %6
%17 = add nsw i64 %16, %15
store i64 %17, i64* %6
%18 = load i64, i64* %8
%19 = load i64, i64* %7
%20 = add nsw i64 %19, %18
store i64 %20, i64* %7
br label %21
21: ; preds = %12
%22 = load i64, i64* %8
%23 = add nsw i64 %22, 1
store i64 %23, i64* %8
br label %9
24: ; preds = %9
%25 = load i64, i64* %7
%26 = load i64, i64* %7
%27 = mul nsw i64 %25, %26
%28 = load i64, i64* %6
%29 = sub nsw i64 %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %29)
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 25164150)
ret i32 0
}
void avpriv_mpeg4audio_get_config() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_mpeg4audio_get_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ unlink(char *);
void client_socket_close(int fd, char *scktmp) {
  close(fd);
  unlink(scktmp);
}


x86 assembly (clang, -O0):
<client_socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_socket_close>:
push   %rbx
mov    %rsi,%rbx
call   1040 <close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define void @client_socket_close(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @unlink(i8* %7)
ret void
}

LLVM IR (-O2):
define void @client_socket_close(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @close(i32 %0)
%4 = tail call i32 @unlink(i8* %1)
ret void
}
void hcf(void) {
catch_fire:
  goto catch_fire;
}


x86 assembly (clang, -O0):
<hcf>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <hcf+0x9>
jmp    1109 <hcf+0x9>

x86 assembly (clang, -O2):
<hcf>:
jmp    1100 <hcf>

LLVM IR (-O0):
define void @hcf() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @hcf() {
br label %1
1: ; preds = %1, %0
br label %1
}
double floor(double x __attribute__((unused))) { return 0.0; }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @floor(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ rl_free_undo_list();
void free_undo_list() { rl_free_undo_list(); }


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

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

LLVM IR (-O0):
define void @free_undo_list() {
%1 = call i32 (...) @rl_free_undo_list()
ret void
}

LLVM IR (-O2):
define void @free_undo_list() {
%1 = tail call i32 (...) @rl_free_undo_list()
ret void
}
int declare_fun_1(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<declare_fun_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_fun_1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @declare_fun_1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @declare_fun_1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x77() {
  Assert_real((isprint(119)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              600, ("isprint should be 1 for w"));
}


x86 assembly (clang, -O0):
<t_isprint_0x77>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x258,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x258,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for w\00"
define void @t_isprint_0x77() {
%1 = call i32 @isprint(i32 119)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for w\00"
define void @t_isprint_0x77() {
%1 = tail call i32 @isprint(i32 119)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x52() {
  Assert_real((isalnum(82)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              415, ("isalnum should be 1 for R"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x52>:
push   %rbp
mov    %rsp,%rbp
mov    $0x52,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x19f,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x52>:
push   %rax
mov    $0x52,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x19f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for R\00"
define void @t_isalnum_0x52() {
%1 = call i32 @isalnum(i32 82)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for R\00"
define void @t_isalnum_0x52() {
%1 = tail call i32 @isalnum(i32 82)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int getDaysInYear(int year) {
  if (((year % 4) == 0) && (((year % 100) != 0) || ((year % 400) == 0)))
    return 366;
  else
    return 365;
}


x86 assembly (clang, -O0):
<getDaysInYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <getDaysInYear+0x4f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <getDaysInYear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <getDaysInYear+0x4f>
movl   $0x16e,-0x4(%rbp)
jmp    1156 <getDaysInYear+0x56>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDaysInYear>:
test   $0x3,%dil
jne    1143 <getDaysInYear+0x43>
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x16e,%eax
cmp    $0x28f5c28,%ecx
ja     1148 <getDaysInYear+0x48>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     1148 <getDaysInYear+0x48>
mov    $0x16d,%eax
ret

LLVM IR (-O0):
define i32 @getDaysInYear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = srem i32 %12, 400
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i32 366, i32* %2
br label %17
16: ; preds = %11, %1
store i32 365, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @getDaysInYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %4, %10
%12 = phi i32 [ 365, %10 ], [ 366, %4 ]
ret i32 %12
}
int rarr(int a[restrict 3]) { return a[2]; }


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

x86 assembly (clang, -O2):
<rarr>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rarr(i32* noalias %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rarr(i32* noalias nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
int test_40_4(int *mem) { return __atomic_fetch_add(mem + 4, 1, 4); }


x86 assembly (clang, -O0):
<test_40_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
lock xadd %eax,0x10(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_40_4>:
mov    $0x1,%eax
lock xadd %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define i32 @test_40_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 4
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw add i32* %6, i32 %7 acq_rel
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_40_4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = atomicrmw add i32* %2, i32 1 acq_rel
ret i32 %3
}
void do_state_13(char c, int *state, char *word, int *length) {
  word[(*length)++] = c;
  if (c == '\'') {
    *state = 14;
  } else {
    *state = -1;
  }
}


x86 assembly (clang, -O0):
<do_state_13>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
cmp    $0x27,%eax
jne    114c <do_state_13+0x4c>
mov    -0x10(%rbp),%rax
movl   $0xe,(%rax)
jmp    1156 <do_state_13+0x56>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_13>:
movslq (%rcx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rcx)
mov    %dil,(%rdx,%r8,1)
cmp    $0x27,%dil
mov    $0xe,%eax
mov    $0xffffffff,%ecx
cmove  %eax,%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @do_state_13(i8 signext %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i8
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
store i8 %0, i8* %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8, i8* %5
%10 = load i8*, i8** %7
%11 = load i32*, i32** %8
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 %9, i8* %15
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 39
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32*, i32** %6
store i32 14, i32* %20
br label %23
21: ; preds = %4
%22 = load i32*, i32** %6
store i32 -1, i32* %22
br label %23
23: ; preds = %21, %19
ret void
}

LLVM IR (-O2):
define void @do_state_13(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8 %0, i8* %8
%9 = icmp eq i8 %0, 39
%10 = select i1 %9, i32 14, i32 -1
store i32 %10, i32* %1
ret void
}
void XcmsCIELuvQueryMaxLC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELuvQueryMaxLC() {
ret void
}
void agt_statline(const char *s) { return; }


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

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

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

LLVM IR (-O2):
define void @agt_statline(i8* nocapture %0) {
ret void
}
int imin(int x, int y) {
  if (x < y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<imin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <imin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <imin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imin(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @imin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ PTHREAD_MUTEX_RECURSIVE_NP;
int pthread_mutex_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutexattr_settype(int /*<<< orphan*/ *, int);
unsigned int OSAL_MutexCreate(pthread_mutex_t *mutex) {
  pthread_mutexattr_t attr;
  pthread_mutexattr_init(&attr);
  pthread_mutexattr_settype((pthread_mutexattr_t *)&attr,
                            (int)PTHREAD_MUTEX_RECURSIVE_NP);
  int result = pthread_mutex_init(mutex, &attr);
  return result;
}


x86 assembly (clang, -O0):
<OSAL_MutexCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    %eax,%esi
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSAL_MutexCreate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_mutexattr_init@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <pthread_mutexattr_settype@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <pthread_mutex_init@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_RECURSIVE_NP = global i64 0
define i32 @OSAL_MutexCreate(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @pthread_mutexattr_init(i32* %3)
%6 = load i64, i64* @PTHREAD_MUTEX_RECURSIVE_NP
%7 = trunc i64 %6 to i32
%8 = call i32 @pthread_mutexattr_settype(i32* %3, i32 %7)
%9 = load i32*, i32** %2
%10 = call i32 @pthread_mutex_init(i32* %9, i32* %3)
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_MUTEX_RECURSIVE_NP = global i64 0
define i32 @OSAL_MutexCreate(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_mutexattr_init(i32* %2)
%5 = load i64, i64* @PTHREAD_MUTEX_RECURSIVE_NP
%6 = trunc i64 %5 to i32
%7 = call i32 @pthread_mutexattr_settype(i32* %2, i32 %6)
%8 = call i32 @pthread_mutex_init(i32* %0, i32* %2)
ret i32 %8
}
unsigned short *range_ushort(unsigned short *val, unsigned short min,
                             unsigned short max) {
  if (*val < min || max < *val)
    __builtin_abort();
  return val;
}


x86 assembly (clang, -O0):
<range_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
movzwl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jl     1150 <range_ushort+0x40>
movzwl -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jge    1155 <range_ushort+0x45>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_ushort>:
push   %rax
movzwl (%rdi),%eax
cmp    %si,%ax
jb     1123 <range_ushort+0x13>
cmp    %dx,%ax
ja     1123 <range_ushort+0x13>
mov    %rdi,%rax
pop    %rcx
ret
call   1030 <abort@plt>

LLVM IR (-O0):
define i16* @range_ushort(i16* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16*
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = zext i16 %8 to i32
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = icmp slt i32 %9, %11
br i1 %12, label %20, label %13
13: ; preds = %3
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = load i16*, i16** %4
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = icmp slt i32 %15, %18
br i1 %19, label %20, label %21
20: ; preds = %13, %3
unreachable
21: ; preds = %13
%22 = load i16*, i16** %4
ret i16* %22
}

LLVM IR (-O2):
define i16* @range_ushort(i16* returned %0, i16 zeroext %1, i16 zeroext %2) {
%4 = load i16, i16* %0
%5 = icmp ult i16 %4, %1
%6 = icmp ugt i16 %4, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @abort()
unreachable
9: ; preds = %3
ret i16* %0
}
/* Variables and functions */
int **buildMat(int *, int, int);
int /*<<< orphan*/ deleteMat(int **, int);
int /*<<< orphan*/ spiral_print_mat(int **, int, int);
void test_spiral_print_mat() {
  int r = 3, c = 4;
  int elems[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
  int **xs = buildMat(elems, r, c);
  spiral_print_mat(xs, r, c);
  deleteMat(xs, r);
}


x86 assembly (clang, -O0):
<test_spiral_print_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1060 <buildMat@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <spiral_print_mat@plt>
mov    -0x48(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <deleteMat@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spiral_print_mat>:
push   %rbx
sub    $0x30,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1050 <buildMat@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <spiral_print_mat@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <deleteMat@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_spiral_print_mat.elems = [12 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12]
define void @test_spiral_print_mat() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i32]
%4 = alloca i32**
store i32 3, i32* %1
store i32 4, i32* %2
%5 = bitcast [12 x i32]* %3 to i8*
%6 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32** @buildMat(i32* %6, i32 %7, i32 %8)
store i32** %9, i32*** %4
%10 = load i32**, i32*** %4
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @spiral_print_mat(i32** %10, i32 %11, i32 %12)
%14 = load i32**, i32*** %4
%15 = load i32, i32* %1
%16 = call i32 @deleteMat(i32** %14, i32 %15)
ret void
}

LLVM IR (-O2):
@__const.test_spiral_print_mat.elems = [12 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12]
define void @test_spiral_print_mat() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32** @buildMat(i32* %3, i32 3, i32 4)
%5 = call i32 @spiral_print_mat(i32** %4, i32 3, i32 4)
%6 = call i32 @deleteMat(i32** %4, i32 3)
ret void
}
/* Type definitions */
struct lframe {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ machine_restore_frame(struct lemon *, struct lframe *);
void lemon_machine_restore_frame(struct lemon *lemon, struct lframe *frame) {
  machine_restore_frame(lemon, frame);
}


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

x86 assembly (clang, -O2):
<lemon_machine_restore_frame>:
jmp    1030 <machine_restore_frame@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define void @lemon_machine_restore_frame(%struct.lemon* %0, %struct.lframe* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lframe*
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lframe* %1, %struct.lframe** %4
%5 = load %struct.lemon*, %struct.lemon** %3
%6 = load %struct.lframe*, %struct.lframe** %4
%7 = call i32 @machine_restore_frame(%struct.lemon* %5, %struct.lframe* %6)
ret void
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lframe = type { i32 }
define void @lemon_machine_restore_frame(%struct.lemon* %0, %struct.lframe* %1) {
%3 = tail call i32 @machine_restore_frame(%struct.lemon* %0, %struct.lframe* %1)
ret void
}
/* Variables and functions */
int is_little_endian();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("IS_LITTLE_ENDIAN: %d\n", is_little_endian()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <is_little_endian@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <is_little_endian@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"IS_LITTLE_ENDIAN: %d\0A\00"
define i32 @main() {
%1 = call i32 (...) @is_little_endian()
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"IS_LITTLE_ENDIAN: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @is_little_endian()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int ioctl(int, int, long);
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
  return ioctl(fd, 0x5402, (long)termios_p);
}


x86 assembly (clang, -O0):
<tcsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x5402,%esi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsetattr>:
mov    $0x5402,%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
%7 = load i32, i32* %4
%8 = load %struct.termios*, %struct.termios** %6
%9 = ptrtoint %struct.termios* %8 to i64
%10 = call i32 @ioctl(i32 %7, i32 21506, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = ptrtoint %struct.termios* %2 to i64
%5 = tail call i32 @ioctl(i32 %0, i32 21506, i64 %4)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
int get_XWindowChanges_y(void *_p) { return (int)((XWindowChanges *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XWindowChanges_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowChanges_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowChanges_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ compound_test();
int /*<<< orphan*/ for_test();
int /*<<< orphan*/ if_test();
int /*<<< orphan*/ return_test();
int main() {
  compound_test();
  if_test();
  for_test();
  return_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <compound_test@plt>
mov    $0x0,%al
call   1060 <if_test@plt>
mov    $0x0,%al
call   1030 <for_test@plt>
mov    $0x0,%al
call   1040 <return_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <compound_test@plt>
xor    %eax,%eax
call   1060 <if_test@plt>
xor    %eax,%eax
call   1030 <for_test@plt>
xor    %eax,%eax
call   1040 <return_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @compound_test()
%3 = call i32 (...) @if_test()
%4 = call i32 (...) @for_test()
%5 = call i32 (...) @return_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @compound_test()
%2 = tail call i32 (...) @if_test()
%3 = tail call i32 (...) @for_test()
%4 = tail call i32 (...) @return_test()
ret i32 0
}
/* Type definitions */
typedef unsigned char uint8_t;

/* Variables and functions */
uint8_t adc_channel(void) { return *(unsigned char *)0x5400 & 0x0F; }


x86 assembly (clang, -O0):
<adc_channel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5400,%eax
movzbl (%rax),%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_channel>:
mov    0x5400,%al
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @adc_channel() {
%1 = load i8, i8* inttoptr (i64 21504 to i8*)
%2 = zext i8 %1 to i32
%3 = and i32 %2, 15
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @adc_channel() {
%1 = load i8, i8* inttoptr (i64 21504 to i8*)
%2 = and i8 %1, 15
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumberFromRoutine(int /*<<< orphan*/, char *);
void wBuiltinSqr() {
  wStackPushNumberFromRoutine(sqrt(wStackPopNumber()), "Sqr");
}


x86 assembly (clang, -O0):
<wBuiltinSqr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
mov    %eax,%edi
lea    0xeb5(%rip),%rsi
call   1040 <wStackPushNumberFromRoutine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinSqr>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
lea    0xeba(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumberFromRoutine@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Sqr\00"
define void @wBuiltinSqr() {
%1 = call i32 (...) @wStackPopNumber()
%2 = call i32 @sqrt(i32 %1)
%3 = call i32 @wStackPushNumberFromRoutine(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Sqr\00"
define void @wBuiltinSqr() {
%1 = tail call i32 (...) @wStackPopNumber()
%2 = tail call i32 @sqrt(i32 %1)
%3 = tail call i32 @wStackPushNumberFromRoutine(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct packet {
  int dummy;
};

/* Variables and functions */
unsigned char *create_kv_packet(unsigned char const *, int,
                                unsigned char const *, size_t, struct packet *,
                                unsigned char *);
unsigned char *create_vid_packet(const unsigned char *vid, size_t vid_sz,
                                 struct packet *pkt, unsigned char *ptr) {
  return create_kv_packet((const unsigned char *)"vid", (sizeof("vid") - 1),
                          vid, vid_sz, pkt, ptr);
}


x86 assembly (clang, -O0):
<create_vid_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xec1(%rip),%rdi
mov    $0x3,%esi
call   1030 <create_kv_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_vid_packet>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xedd(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <create_kv_packet@plt>

LLVM IR (-O0):
%struct.packet = type { i32 }
@.str = [4 x i8] c"vid\00"
define i8* @create_vid_packet(i8* %0, i64 %1, %struct.packet* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.packet*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store %struct.packet* %2, %struct.packet** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load %struct.packet*, %struct.packet** %7
%12 = load i8*, i8** %8
%13 = call i8* @create_kv_packet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* %9, i64 %10, %struct.packet* %11, i8* %12)
ret i8* %13
}

LLVM IR (-O2):
%struct.packet = type { i32 }
@.str = [4 x i8] c"vid\00"
define i8* @create_vid_packet(i8* %0, i64 %1, %struct.packet* %2, i8* %3) {
%5 = tail call i8* @create_kv_packet(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3, i8* %0, i64 %1, %struct.packet* %2, i8* %3)
ret i8* %5
}
/* Variables and functions */
int write(int const, unsigned char *, int);
int irlink_write(const int port, unsigned char *buffer, int bufferSize) {
  if (port == -1) {
    return -1;
  }
  return write(port, buffer, bufferSize);
}


x86 assembly (clang, -O0):
<irlink_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1138 <irlink_write+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <irlink_write+0x3a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irlink_write>:
cmp    $0xffffffff,%edi
je     111a <irlink_write+0xa>
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @irlink_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 -1, i32* %4
br label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @write(i32 %12, i8* %13, i32 %14)
store i32 %15, i32* %4
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @irlink_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %0, -1
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ -1, %3 ]
ret i32 %8
}
void msg(s) char *s;
{
  gotocmd((1), 0);
  outstr(s);
  flushbuf();
}


x86 assembly (clang, -O0):
<msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <gotocmd@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <outstr@plt>
mov    $0x0,%al
call   1040 <flushbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <gotocmd@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <outstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <flushbuf@plt>

LLVM IR (-O0):
define void @msg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gotocmd to i32 (i32, i32, ...)*)(i32 1, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (...) @flushbuf()
ret void
}

LLVM IR (-O2):
define void @msg(i8* %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gotocmd to i32 (i32, i32, ...)*)(i32 1, i32 0)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @flushbuf()
ret void
}
void swap1(int a, int b) {
  int temp = a;
  a = b;
  b = temp;
}


x86 assembly (clang, -O0):
<swap1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @swap1(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int _rename(const char *oldpath, const char *newpath) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rename>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool LCDRasterEnabled(uint32_t ui32Base) {
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x00000028))) & 0x00000001)
              ? 1
              : 0);
}


x86 assembly (clang, -O0):
<LCDRasterEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rdx
and    $0x1,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterEnabled>:
mov    0x28(%rdi),%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @LCDRasterEnabled(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 40
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 1
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @LCDRasterEnabled(i64 %0) {
%2 = add nsw i64 %0, 40
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  char text[10] = "Hello";
  char text2[10] = "Hi,my name is Anna";
  printf("%s\n", text);
  printf("%s\n", text2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed0(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x1c(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x24(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x6f6c6c6548,%rax
mov    %rax,0x10(%rsp)
movw   $0x0,0x18(%rsp)
movabs $0x616e20796d2c6948,%rax
20 6e 61
mov    %rax,(%rsp)
movw   $0x656d,0x8(%rsp)
lea    0xecd(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.text = [10 x i8] c"Hello\00\00\00\00\00"
@__const.main.text2 = [10 x i8] c"Hi,my name"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [10 x i8]* %6 to i8*
%9 = bitcast [10 x i8]* %7 to i8*
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [10 x i8] c"Hello\00\00\00\00\00"
@__const.main.text2 = [10 x i8] c"Hi,my name"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_callbacks();
void test_traps() { test_callbacks(); }


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

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

LLVM IR (-O0):
define void @test_traps() {
%1 = call i32 (...) @test_callbacks()
ret void
}

LLVM IR (-O2):
define void @test_traps() {
%1 = tail call i32 (...) @test_callbacks()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int _execve(char *name, char **argv, char **env) {
  name = name;
  argv = argv;
  env = env;
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_execve>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
store i8* %7, i8** %4
%8 = load i8**, i8*** %5
store i8** %8, i8*** %5
%9 = load i8**, i8*** %6
store i8** %9, i8*** %6
%10 = load i32, i32* @ENOMEM
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
void init_sub_mask_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_mask_color_span_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wsf_mbed_os_critical_section_enter();
void WsfCsEnter(void) { wsf_mbed_os_critical_section_enter(); }


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

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

LLVM IR (-O0):
define void @WsfCsEnter() {
%1 = call i32 (...) @wsf_mbed_os_critical_section_enter()
ret void
}

LLVM IR (-O2):
define void @WsfCsEnter() {
%1 = tail call i32 (...) @wsf_mbed_os_critical_section_enter()
ret void
}
/* Variables and functions */
int atoi(char const *);
char *opt_get_string(char const *, char const *, int /*<<< orphan*/ *);
int opt_get_int(const char *section, const char *key, int defvalue) {
  const char *value;
  value = opt_get_string(section, key, NULL);
  if (value != NULL)
    return atoi(value);
  else
    return defvalue;
}


x86 assembly (clang, -O0):
<opt_get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <opt_get_string@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1164 <opt_get_int+0x44>
mov    -0x28(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    116a <opt_get_int+0x4a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_get_int>:
push   %rbx
mov    %edx,%ebx
xor    %edx,%edx
call   1030 <opt_get_string@plt>
test   %rax,%rax
je     1138 <opt_get_int+0x18>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @opt_get_int(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @opt_get_string(i8* %0, i8* %1, i32* null)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_spr(int);
void spr_write_generic(void *opaque, int sprn) { gen_op_store_spr(sprn); }


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

x86 assembly (clang, -O2):
<spr_write_generic>:
mov    %esi,%edi
jmp    1030 <gen_op_store_spr@plt>

LLVM IR (-O0):
define void @spr_write_generic(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @gen_op_store_spr(i32 %5)
ret void
}

LLVM IR (-O2):
define void @spr_write_generic(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @gen_op_store_spr(i32 %1)
ret void
}