xunge/DecIR huggingface dataset:
_Bool eq_float_cr(float _Complex a, float b) { return a == b; }


x86 assembly (clang, -O0):
<eq_float_cr>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm1
sete   %al
setnp  %cl
and    %cl,%al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
sete   %cl
setnp  %dl
and    %dl,%cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_float_cr>:
ucomiss %xmm1,%xmm0
shufps $0x55,%xmm0,%xmm0
setnp  %al
sete   %cl
and    %al,%cl
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setnp  %dl
sete   %al
and    %dl,%al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @eq_float_cr(<2 x float> %0, float %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
store float %1, float* %4
%6 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%7 = load float, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%9 = load float, float* %8
%10 = load float, float* %4
%11 = fcmp oeq float %7, %10
%12 = fcmp oeq float %9, 0.000000e+00
%13 = and i1 %11, %12
ret i1 %13
}

LLVM IR (-O2):
define zeroext i1 @eq_float_cr(<2 x float> %0, float %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = extractelement <2 x float> %0, i64 1
%5 = fcmp oeq float %3, %1
%6 = fcmp oeq float %4, 0.000000e+00
%7 = and i1 %5, %6
ret i1 %7
}
int main() {
  int a = 0;
  if (0) {
    return 1;
  } else {
    a = 10;
  }
  if (a != 10)
    return 2;
  else {
    if (0)
      if (1)
        return 4;
      else
        return 5;
    return 0;
  }
  return 6;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     112f <main+0x2f>
movl   $0x2,-0x4(%rbp)
jmp    1136 <main+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isWaveNum(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (isWaveNum(n))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <isWaveNum@plt>
cmp    $0x0,%rax
je     1172 <main+0x42>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <main+0x4e>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <isWaveNum@plt>
test   %rax,%rax
lea    0xeae(%rip),%rax
lea    0xeaa(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"YES\0A\00"
@.str.2 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i64 @isWaveNum(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"NO\00"
@str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @isWaveNum(i32 %4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_file(int, char **);
int /*<<< orphan*/ read_sat();
int main(int argc, char **argv) {
  read_file(argc, argv);
  read_sat();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <read_file@plt>
mov    $0x0,%al
call   1040 <read_sat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(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 = load i8**, i8*** %4
%7 = call i32 @read_file(i32 %5, i8** %6)
%8 = call i32 (...) @read_sat()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @read_file(i32 %0, i8** %1)
%4 = tail call i32 (...) @read_sat()
ret i32 0
}
void g_io_channel_error_quark() {}


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

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

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

LLVM IR (-O2):
define void @g_io_channel_error_quark() {
ret void
}
/* Variables and functions */
int random();
int random_between(int min, int max) { return (random() % (max - min)) + min; }


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @random()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random_between(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void main2() {
  char *video_memory = (char *)0xb8004;
  *video_memory = 'Y';
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8004,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x59,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
movb   $0x59,0xb8004
59
ret

LLVM IR (-O0):
define void @main2() {
%1 = alloca i8*
store i8* inttoptr (i64 753668 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 89, i8* %2
ret void
}

LLVM IR (-O2):
define void @main2() {
store i8 89, i8* inttoptr (i64 753668 to i8*)
ret void
}
unsigned int h(unsigned int X, unsigned int Y, unsigned int Z) {
  return ((X ^ Y ^ Z));
}


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

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @h(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @h(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sockets_finalize();
void test2(int x) {
  if (x > 3) {
    sockets_finalize();
  }
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    112c <test2+0x1c>
mov    $0x0,%al
call   1030 <sockets_finalize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
cmp    $0x4,%edi
jl     111c <test2+0xc>
xor    %eax,%eax
jmp    1030 <sockets_finalize@plt>
ret

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

LLVM IR (-O2):
define void @test2(i32 %0) {
%2 = icmp sgt i32 %0, 3
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @sockets_finalize()
br label %5
5: ; preds = %3, %1
ret void
}
void g_param_spec_pool_lookup() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_pool_lookup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x82() {
  Assert_real((isdigit(130) == 0),
              "/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_isdigit.c",
              655, ("isdigit should be 0 for 0x82"));
}


x86 assembly (clang, -O0):
<t_isdigit_0x82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x82\00"
define void @t_isdigit_0x82() {
%1 = call i64 @isdigit(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x82\00"
define void @t_isdigit_0x82() {
%1 = tail call i64 @isdigit(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *v(size_t);
void *x(size_t n) { return v(n); }


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

x86 assembly (clang, -O2):
<x>:
jmp    1030 <v@plt>

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

LLVM IR (-O2):
define i8* @x(i64 %0) {
%2 = tail call i8* @v(i64 %0)
ret i8* %2
}
void naive_memset(void *p, char c, int n) {
  unsigned char *s = p;
  int i;
  for (i = 0; i < n; i++)
    s[i] = c;
}


x86 assembly (clang, -O0):
<naive_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1148 <naive_memset+0x48>
mov    -0x9(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <naive_memset+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<naive_memset>:
test   %edx,%edx
jle    1124 <naive_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @naive_memset(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_Grab1401(int fh) { return ioctl(fh, _IO(0xce, 25)); }


x86 assembly (clang, -O0):
<CED_Grab1401>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x19,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_Grab1401>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x19,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_Grab1401(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 25)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_Grab1401(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 25)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
int fun140() { return 140; }


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

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

LLVM IR (-O0):
define i32 @fun140() {
ret i32 140
}

LLVM IR (-O2):
define i32 @fun140() {
ret i32 140
}
/* Type definitions */
struct dir {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ op_closedir(struct dir *);
int /*<<< orphan*/ op_mkdir(int /*<<< orphan*/);
struct dir *op_opendir(int /*<<< orphan*/);
int /*<<< orphan*/ op_rmdir(int /*<<< orphan*/);
int /*<<< orphan*/ op_sync();
int /*<<< orphan*/ writeemptyfile(int);
void wl_rmdirdelayed(void) {
  struct dir *d;
  op_mkdir(0);
  writeemptyfile(1);
  op_sync();
  d = op_opendir(0);
  op_rmdir(0);
  op_closedir(d);
}


x86 assembly (clang, -O0):
<wl_rmdirdelayed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1030 <writeemptyfile@plt>
mov    $0x0,%al
call   1080 <op_sync@plt>
xor    %edi,%edi
call   1060 <op_opendir@plt>
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   1050 <op_rmdir@plt>
mov    -0x8(%rbp),%rdi
call   1070 <op_closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_rmdirdelayed>:
push   %rbx
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1030 <writeemptyfile@plt>
xor    %eax,%eax
call   1080 <op_sync@plt>
xor    %edi,%edi
call   1060 <op_opendir@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1050 <op_rmdir@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <op_closedir@plt>

LLVM IR (-O0):
%struct.dir = type { i32 }
define void @wl_rmdirdelayed() {
%1 = alloca %struct.dir*
%2 = call i32 @op_mkdir(i32 0)
%3 = call i32 @writeemptyfile(i32 1)
%4 = call i32 (...) @op_sync()
%5 = call %struct.dir* @op_opendir(i32 0)
store %struct.dir* %5, %struct.dir** %1
%6 = call i32 @op_rmdir(i32 0)
%7 = load %struct.dir*, %struct.dir** %1
%8 = call i32 @op_closedir(%struct.dir* %7)
ret void
}

LLVM IR (-O2):
%struct.dir = type { i32 }
define void @wl_rmdirdelayed() {
%1 = tail call i32 @op_mkdir(i32 0)
%2 = tail call i32 @writeemptyfile(i32 1)
%3 = tail call i32 (...) @op_sync()
%4 = tail call %struct.dir* @op_opendir(i32 0)
%5 = tail call i32 @op_rmdir(i32 0)
%6 = tail call i32 @op_closedir(%struct.dir* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
double subtract(double a, double b) {
  printf("inside subtract function \n");
  return a - b;
}


x86 assembly (clang, -O0):
<subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"inside subtract function \0A\00"
define double @subtract(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
ret double %8
}

LLVM IR (-O2):
@str = [26 x i8] c"inside subtract function \00"
define double @subtract(double %0, double %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = fsub double %0, %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short *);
int main() {
  short x = 4000;
  printf("x value is %d and x addr is %p\n", x, &x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xfa0,-0x6(%rbp)
lea    0xed4(%rip),%rdi
lea    -0x6(%rbp),%rdx
movswl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"x value is %d and x addr is %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 4000, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 signext %3, i16* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"x value is %d and x addr is %p\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 4000, i16* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 signext 4000, i16* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void UART7_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @UART7_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @UART7_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int funk(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = funk(2, 3);
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <funk@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @funk(i32 2, i32 3)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @funk(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int foo(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_fstr_sort_index(int *, int);
void fstr_sort_index_(int *index_data, int *n) {
  c_fstr_sort_index(index_data, *n);
}


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

x86 assembly (clang, -O2):
<fstr_sort_index_>:
mov    (%rsi),%esi
jmp    1030 <c_fstr_sort_index@plt>

LLVM IR (-O0):
define void @fstr_sort_index_(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 = load i32, i32* %6
%8 = call i32 @c_fstr_sort_index(i32* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @fstr_sort_index_(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @c_fstr_sort_index(i32* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ stdscr;
void initCurses() {
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, 1);
}


x86 assembly (clang, -O0):
<initCurses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <keypad@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initCurses>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <keypad@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @initCurses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @cbreak()
%3 = call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = call i32 @keypad(i32 %4, i32 1)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @initCurses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = tail call i32 @keypad(i32 %4, i32 1)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int zero_timespec(const struct timespec *ts) {
  return 0 == ts->tv_sec && 0 == ts->tv_nsec;
}


x86 assembly (clang, -O0):
<zero_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
jne    112c <zero_timespec+0x2c>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    0x8(%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_timespec>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <zero_timespec+0x9>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @zero_timespec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp eq i64 0, %10
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @zero_timespec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
int globusl_url_isextra(char x) {
  if (x == '!' || x == '*' || x == '\'' || x == '(' || x == ')' || x == ',') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<globusl_url_isextra>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x21,%eax
je     1158 <globusl_url_isextra+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1158 <globusl_url_isextra+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x27,%eax
je     1158 <globusl_url_isextra+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
je     1158 <globusl_url_isextra+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
je     1158 <globusl_url_isextra+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
jne    1164 <globusl_url_isextra+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <globusl_url_isextra+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globusl_url_isextra>:
add    $0xdf,%dil
xor    %eax,%eax
cmp    $0xb,%dil
ja     111a <globusl_url_isextra+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @globusl_url_isextra(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 33
br i1 %6, label %27, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 42
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 39
br i1 %14, label %27, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 40
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 41
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 44
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@switch.table.globusl_url_isextra = [12 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 0, i32 1]
define i32 @globusl_url_isextra(i8 signext %0) {
%2 = add i8 %0, -33
%3 = icmp ult i8 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.globusl_url_isextra, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void ifctrl_finish(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ es_fire(struct event_signal *, int);
void es_broadcast(struct event_signal *es) { es_fire(es, true); }


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

x86 assembly (clang, -O2):
<es_broadcast>:
mov    $0x1,%esi
jmp    1030 <es_fire@plt>

LLVM IR (-O0):
%struct.event_signal = type { i32 }
define void @es_broadcast(%struct.event_signal* %0) {
%2 = alloca %struct.event_signal*
store %struct.event_signal* %0, %struct.event_signal** %2
%3 = load %struct.event_signal*, %struct.event_signal** %2
%4 = call i32 @es_fire(%struct.event_signal* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.event_signal = type { i32 }
define void @es_broadcast(%struct.event_signal* %0) {
%2 = tail call i32 @es_fire(%struct.event_signal* %0, i32 1)
ret void
}
OP(dd, dc) {
  illegal_1();
  op_dc();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_dc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_dc()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ uint16Clear(int /*<<< orphan*/ *);
void uint16Destroy(uint16_t *data) {
  uint16Clear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<uint16Destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <uint16Clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uint16Destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @uint16Clear(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @uint16Destroy(i32* %0) {
%2 = tail call i32 @uint16Clear(i32* %0)
%3 = tail call i32 @free(i32* %0)
ret void
}
unsigned char GetMaxUnsignedChar(void) { return ((unsigned char)-1); }


x86 assembly (clang, -O0):
<GetMaxUnsignedChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxUnsignedChar>:
mov    $0xff,%al
ret

LLVM IR (-O0):
define zeroext i8 @GetMaxUnsignedChar() {
ret i8 -1
}

LLVM IR (-O2):
define zeroext i8 @GetMaxUnsignedChar() {
ret i8 -1
}
void autoboot_command(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @autoboot_command(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADXL362_stop();
int /*<<< orphan*/ cps_off(int);
int /*<<< orphan*/ delay(int);
void ADXL362_power_off() {
  ADXL362_stop();
  delay(100 * 10);
  cps_off(0x2);
  delay(100 * 200);
}


x86 assembly (clang, -O0):
<ADXL362_power_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ADXL362_stop@plt>
mov    $0x3e8,%edi
call   1040 <delay@plt>
mov    $0x2,%edi
call   1030 <cps_off@plt>
mov    $0x4e20,%edi
call   1040 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADXL362_power_off>:
push   %rax
xor    %eax,%eax
call   1050 <ADXL362_stop@plt>
mov    $0x3e8,%edi
call   1040 <delay@plt>
mov    $0x2,%edi
call   1030 <cps_off@plt>
mov    $0x4e20,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @ADXL362_power_off() {
%1 = call i32 (...) @ADXL362_stop()
%2 = call i32 @delay(i32 1000)
%3 = call i32 @cps_off(i32 2)
%4 = call i32 @delay(i32 20000)
ret void
}

LLVM IR (-O2):
define void @ADXL362_power_off() {
%1 = tail call i32 (...) @ADXL362_stop()
%2 = tail call i32 @delay(i32 1000)
%3 = tail call i32 @cps_off(i32 2)
%4 = tail call i32 @delay(i32 20000)
ret void
}
int fun272() { return 272; }


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

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

LLVM IR (-O0):
define i32 @fun272() {
ret i32 272
}

LLVM IR (-O2):
define i32 @fun272() {
ret i32 272
}
int iHxFacePinpadDispMsg(int iMsgType, int iConfirmFlag,
                         unsigned char *pszPrompt1, unsigned char *pszPrompt2,
                         unsigned char *pszLanguage) {
  return (0);
}


x86 assembly (clang, -O0):
<iHxFacePinpadDispMsg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iHxFacePinpadDispMsg(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @iHxFacePinpadDispMsg(i32 %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setPercussionEnabled(struct b_tonegen *, int);
void setPercEnableFromMIDI(void *d, unsigned char u) {
  struct b_tonegen *t = (struct b_tonegen *)d;
  setPercussionEnabled(t, u < 64 ? 0 : 1);
}


x86 assembly (clang, -O0):
<setPercEnableFromMIDI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movzbl -0x9(%rbp),%ecx
mov    $0x1,%esi
xor    %eax,%eax
cmp    $0x40,%ecx
cmovl  %eax,%esi
call   1030 <setPercussionEnabled@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPercEnableFromMIDI>:
xor    %eax,%eax
cmp    $0x40,%sil
setae  %al
mov    %eax,%esi
jmp    1030 <setPercussionEnabled@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setPercEnableFromMIDI(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca %struct.b_tonegen*
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.b_tonegen*
store %struct.b_tonegen* %7, %struct.b_tonegen** %5
%8 = load %struct.b_tonegen*, %struct.b_tonegen** %5
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 64
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
%14 = call i32 @setPercussionEnabled(%struct.b_tonegen* %8, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setPercEnableFromMIDI(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = icmp ugt i8 %1, 63
%5 = zext i1 %4 to i32
%6 = tail call i32 @setPercussionEnabled(%struct.b_tonegen* %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_timeline();
int main(void) {
  test_timeline();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_timeline@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_timeline()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_timeline()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ example1();
int /*<<< orphan*/ example2();
int /*<<< orphan*/ example3();
int /*<<< orphan*/ example4();
int main(void) {
  example1();
  example2();
  example3();
  example4();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <example1@plt>
mov    $0x0,%al
call   1040 <example2@plt>
mov    $0x0,%al
call   1060 <example3@plt>
mov    $0x0,%al
call   1030 <example4@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <example1@plt>
xor    %eax,%eax
call   1040 <example2@plt>
xor    %eax,%eax
call   1060 <example3@plt>
xor    %eax,%eax
call   1030 <example4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @example1()
%2 = call i32 (...) @example2()
%3 = call i32 (...) @example3()
%4 = call i32 (...) @example4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example1()
%2 = tail call i32 (...) @example2()
%3 = tail call i32 (...) @example3()
%4 = tail call i32 (...) @example4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ life_the_universe_and_everything();
int /*<<< orphan*/ puts(char *);
int main(void) {
  life_the_universe_and_everything();
  puts("All tests passed");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = call i32 (...) @life_the_universe_and_everything()
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @life_the_universe_and_everything()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void handle_55(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_55(i32 %0) {
ret void
}
/* Variables and functions */
double exp(double);
double example_7(double x, void *params) {
  (void)params;
  return exp(x * x);
}


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

x86 assembly (clang, -O2):
<example_7>:
mulsd  %xmm0,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @example_7(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = call double @exp(double %8)
ret double %9
}

LLVM IR (-O2):
define double @example_7(double %0, i8* nocapture readnone %1) {
%3 = fmul double %0, %0
%4 = tail call double @exp(double %3)
ret double %4
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t rgb555_to_rgb565(uint32_t val) {
  return (val & 0x1F) + ((((val >> 5) & 0x1f) << 1) << 5) +
         ((((val >> 10) & 0x1f)) << 11);
}


x86 assembly (clang, -O0):
<rgb555_to_rgb565>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1f,%ecx
shl    $0x1,%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0xa,%ecx
and    $0x1f,%ecx
shl    $0xb,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb555_to_rgb565>:
lea    (%rdi,%rdi,1),%eax
mov    %edi,%ecx
and    $0x1f,%ecx
mov    %eax,%edx
and    $0x7c0,%edx
or     %ecx,%edx
and    $0xf800,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb555_to_rgb565(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = load i32, i32* %2
%6 = ashr i32 %5, 5
%7 = and i32 %6, 31
%8 = shl i32 %7, 1
%9 = shl i32 %8, 5
%10 = add nsw i32 %4, %9
%11 = load i32, i32* %2
%12 = ashr i32 %11, 10
%13 = and i32 %12, 31
%14 = shl i32 %13, 11
%15 = add nsw i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @rgb555_to_rgb565(i32 %0) {
%2 = and i32 %0, 31
%3 = shl i32 %0, 1
%4 = and i32 %3, 1984
%5 = or i32 %4, %2
%6 = and i32 %3, 63488
%7 = or i32 %5, %6
ret i32 %7
}
int bit_shifter(long int x) {
  int i, n;
  for (i = n = 0; x && (i < (sizeof(long) * 8)); ++i, x >>= 1)
    n += (int)(x & 1L);
  return n;
}


x86 assembly (clang, -O0):
<bit_shifter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1134 <bit_shifter+0x34>
movslq -0xc(%rbp),%rax
cmp    $0x40,%rax
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1144 <bit_shifter+0x44>
jmp    116c <bit_shifter+0x6c>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <bit_shifter+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_shifter>:
xor    %eax,%eax
test   %rdi,%rdi
je     112c <bit_shifter+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %eax,%edx
mov    %edi,%eax
and    $0x1,%eax
add    %edx,%eax
cmp    $0x2,%rdi
jb     112c <bit_shifter+0x2c>
lea    0x1(%rcx),%edx
sar    %rdi
cmp    $0x3f,%ecx
mov    %edx,%ecx
jb     1110 <bit_shifter+0x10>
ret

LLVM IR (-O0):
define i32 @bit_shifter(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %10, 64
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %25
14: ; preds = %12
%15 = load i64, i64* %2
%16 = and i64 %15, 1
%17 = trunc i64 %16 to i32
%18 = load i32, i32* %4
%19 = add nsw i32 %18, %17
store i32 %19, i32* %4
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
%23 = load i64, i64* %2
%24 = ashr i64 %23, 1
store i64 %24, i64* %2
br label %5
25: ; preds = %12
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @bit_shifter(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = phi i64 [ %11, %3 ], [ %0, %1 ]
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 1
%9 = add nuw nsw i32 %4, %8
%10 = add nuw nsw i32 %5, 1
%11 = ashr i64 %6, 1
%12 = icmp ugt i64 %6, 1
%13 = icmp ult i32 %5, 63
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %3, label %15
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %16
}
double pathcon_nm7_sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<pathcon_nm7_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm7_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathcon_nm7_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int count_commas(const char *ptr) {
  int sum = 0;
  for (;;) {
    char ch = *ptr++;
    switch (ch) {
    case '\0':
      return sum;
    case ',':
      sum++;
      break;
    default:
      break;
    }
  }
}


x86 assembly (clang, -O0):
<count_commas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1148 <count_commas+0x48>
jmp    1137 <count_commas+0x37>
mov    -0x14(%rbp),%eax
sub    $0x2c,%eax
je     114d <count_commas+0x4d>
jmp    115b <count_commas+0x5b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <count_commas+0x60>
jmp    1160 <count_commas+0x60>
jmp    110f <count_commas+0xf>

x86 assembly (clang, -O2):
<count_commas>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
test   %ecx,%ecx
je     1125 <count_commas+0x25>
add    $0x1,%rdi
cmp    $0x2c,%ecx
jne    1110 <count_commas+0x10>
add    $0x1,%eax
jmp    1110 <count_commas+0x10>
ret

LLVM IR (-O0):
define i32 @count_commas(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
switch i32 %10, label %16 [
i32 0, label %11
i32 44, label %13
]
11: ; preds = %5
%12 = load i32, i32* %3
ret i32 %12
13: ; preds = %5
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %17
16: ; preds = %5
br label %17
17: ; preds = %16, %13
br label %5
}

LLVM IR (-O2):
define i32 @count_commas(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %7, %10 ], [ %0, %1 ]
%4 = phi i32 [ %11, %10 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
switch i32 %9, label %5 [
i32 0, label %12
i32 44, label %10
]
10: ; preds = %5
%11 = add nuw nsw i32 %4, 1
br label %2
12: ; preds = %5
ret i32 %4
}
void BN_mod_mul_reciprocal(void) {}


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

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

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

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