xunge/DecIR huggingface dataset:
int fun1025() { return 1025; }


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

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

LLVM IR (-O0):
define i32 @fun1025() {
ret i32 1025
}

LLVM IR (-O2):
define i32 @fun1025() {
ret i32 1025
}
int foo_notinbranch(int *b, int c) { return *b + c; }


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

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

LLVM IR (-O0):
define i32 @foo_notinbranch(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* %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo_notinbranch(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
ret i32 %4
}
int get_leap_year(int year) {
  int ret;
  if (year % 4 == 0) {
    if (year % 100 == 0) {
      if (year % 400 == 0)
        ret = 1;
      else
        ret = 0;
    } else
      ret = 1;
  } else
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<get_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <get_leap_year+0x67>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115b <get_leap_year+0x5b>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <get_leap_year+0x4f>
movl   $0x1,-0x8(%rbp)
jmp    1156 <get_leap_year+0x56>
movl   $0x0,-0x8(%rbp)
jmp    1162 <get_leap_year+0x62>
movl   $0x1,-0x8(%rbp)
jmp    116e <get_leap_year+0x6e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <get_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <get_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @get_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %4, %7
%12 = phi i32 [ %10, %7 ], [ 1, %4 ], [ 0, %1 ]
ret i32 %12
}
void g_value_get_long() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_long() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello3() {
  printf("\nHello 33333 world this is a test");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"\0AHello 33333 world this is a test\00"
define i32 @hello3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0AHello 33333 world this is a test\00"
define i32 @hello3() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long f128_cmove(__float128 a, __float128 b, long c, long d) {
  return (a == b) ? c : d;
}


x86 assembly (clang, -O0):
<f128_cmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movaps %xmm0,-0x10(%rbp)
movaps %xmm1,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movaps -0x10(%rbp),%xmm0
movaps -0x20(%rbp),%xmm1
call   1160 <__eqtf2>
test   %eax,%eax
jne    113f <f128_cmove+0x3f>
jmp    1132 <f128_cmove+0x32>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1147 <f128_cmove+0x47>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<f128_cmove>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1120 <__eqtf2>
test   %eax,%eax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @f128_cmove(fp128 %0, fp128 %1, i64 %2, i64 %3) {
%5 = alloca fp128
%6 = alloca fp128
%7 = alloca i64
%8 = alloca i64
store fp128 %0, fp128* %5
store fp128 %1, fp128* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load fp128, fp128* %5
%10 = load fp128, fp128* %6
%11 = fcmp oeq fp128 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i64, i64* %7
br label %16
14: ; preds = %4
%15 = load i64, i64* %8
br label %16
16: ; preds = %14, %12
%17 = phi i64 [ %13, %12 ], [ %15, %14 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @f128_cmove(fp128 %0, fp128 %1, i64 %2, i64 %3) {
%5 = fcmp oeq fp128 %0, %1
%6 = select i1 %5, i64 %2, i64 %3
ret i64 %6
}
/* Type definitions */
typedef int u_int64_t;
typedef int u_int32_t;

/* Variables and functions */
char fls32(int);
char fls64(u_int64_t v) {
  u_int32_t h;
  if ((h = v >> 32))
    return 32 + fls32(h);
  else
    return fls32((u_int32_t)v);
}


x86 assembly (clang, -O0):
<fls64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1147 <fls64+0x37>
mov    -0xc(%rbp),%edi
call   1030 <fls32@plt>
movsbl %al,%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <fls64+0x42>
mov    -0x8(%rbp),%edi
call   1030 <fls32@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls64>:
jmp    1030 <fls32@plt>

LLVM IR (-O0):
define signext i8 @fls64(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = ashr i32 %5, 32
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %4
%10 = call signext i8 @fls32(i32 %9)
%11 = sext i8 %10 to i32
%12 = add nsw i32 32, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = call signext i8 @fls32(i32 %15)
store i8 %16, i8* %2
br label %17
17: ; preds = %14, %8
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @fls64(i32 %0) {
%2 = tail call signext i8 @fls32(i32 %0)
ret i8 %2
}
char inp_key_translate_idx(int idx) {
  if (idx <= 25)
    return idx + 0x61;
  else if (idx <= 35)
    return idx + 0x30;
  return -1;
}


x86 assembly (clang, -O0):
<inp_key_translate_idx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jg     111f <inp_key_translate_idx+0x1f>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <inp_key_translate_idx+0x40>
cmpl   $0x23,-0x8(%rbp)
jg     1137 <inp_key_translate_idx+0x37>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <inp_key_translate_idx+0x40>
jmp    113c <inp_key_translate_idx+0x3c>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inp_key_translate_idx>:
cmp    $0x19,%edi
jg     110b <inp_key_translate_idx+0xb>
add    $0x61,%dil
jmp    1116 <inp_key_translate_idx+0x16>
mov    $0xff,%al
cmp    $0x23,%edi
ja     1118 <inp_key_translate_idx+0x18>
add    $0x30,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @inp_key_translate_idx(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 25
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 97
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %19
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 35
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %10
br label %18
18: ; preds = %17
store i8 -1, i8* %2
br label %19
19: ; preds = %18, %13, %6
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @inp_key_translate_idx(i32 %0) {
%2 = icmp slt i32 %0, 26
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 97
br label %11
6: ; preds = %1
%7 = icmp ult i32 %0, 36
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = trunc i32 %0 to i8
%10 = add nuw nsw i8 %9, 48
br label %11
11: ; preds = %6, %8, %3
%12 = phi i8 [ %5, %3 ], [ %10, %8 ], [ -1, %6 ]
ret i8 %12
}
int main() {
  int a = a;
  a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double sin(arg)
double arg;
{
  double sinus();
  return (sinus(arg, 0));
}


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1030 <sinus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
xor    %edi,%edi
mov    $0x1,%al
jmp    1030 <sinus@plt>

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (double, i32, ...) bitcast (double (...)* @sinus to double (double, i32, ...)*)(double %3, i32 0)
ret double %4
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = tail call double (double, i32, ...) bitcast (double (...)* @sinus to double (double, i32, ...)*)(double %0, i32 0)
ret double %2
}
void printsignal(nr) int nr;
{ tprintf("%s", signame(nr)); }


x86 assembly (clang, -O0):
<printsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <signame@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsignal>:
push   %rax
xor    %eax,%eax
call   1040 <signame@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <tprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @printsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @signame to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printsignal(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @signame to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @tprintf to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int, int);
int main(int argc, char **argv) {
  foo(1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @foo(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 1, i32 2, i32 3)
ret i32 0
}
void rop3_122_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~*D;
  stk3 = S | stk4;
  stk2 = T & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_122_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_122_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
or     %sil,%cl
and    %dl,%cl
xor    %al,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_122_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = xor i32 %13, -1
%15 = trunc i32 %14 to i8
store i8 %15, i8* %10
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %10
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %9
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %7
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = load i8, i8* %5
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = trunc i32 %47 to i8
%49 = load i8*, i8** %4
store i8 %48, i8* %49
ret void
}

LLVM IR (-O2):
define void @rop3_122_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = and i8 %6, %2
%8 = xor i8 %7, %4
%9 = xor i8 %1, -1
%10 = and i8 %8, %9
%11 = and i8 %4, %1
%12 = or i8 %10, %11
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, size_t);
int /*<<< orphan*/ stderr;
void memfatal(const char *context, size_t attempted_size) {
  fprintf(stderr, "%s: failed to allocate %d bytes,memory exhausted.", context,
          attempted_size);
  exit(1);
}


x86 assembly (clang, -O0):
<memfatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<memfatal>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"%s: failed to allocate %d bytes,memory exhausted.\00"
define void @memfatal(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"%s: failed to allocate %d bytes,memory exhausted.\00"
define void @memfatal(i8* %0, i64 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int rightray(int mask, int pos) {
  int remainingbits = pos;
  int result = 0;
  int curindex = pos - 1;
  while (remainingbits > 0) {
    result |= (1 << curindex);
    if (mask & (1 << curindex)) {
      break;
    } else {
      remainingbits--;
      curindex--;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<rightray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1170 <rightray+0x70>
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1159 <rightray+0x59>
jmp    1170 <rightray+0x70>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <rightray+0x20>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightray>:
xor    %eax,%eax
test   %esi,%esi
jle    1122 <rightray+0x22>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rsi),%ecx
bts    %ecx,%eax
bt     %ecx,%edi
jb     1122 <rightray+0x22>
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <rightray+0x10>
ret

LLVM IR (-O0):
define i32 @rightray(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
store i32 %8, i32* %5
store i32 0, i32* %6
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %7
br label %11
11: ; preds = %30, %2
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %31
14: ; preds = %11
%15 = load i32, i32* %7
%16 = shl i32 1, %15
%17 = load i32, i32* %6
%18 = or i32 %17, %16
store i32 %18, i32* %6
%19 = load i32, i32* %3
%20 = load i32, i32* %7
%21 = shl i32 1, %20
%22 = and i32 %19, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %14
br label %31
25: ; preds = %14
%26 = load i32, i32* %5
%27 = add nsw i32 %26, -1
store i32 %27, i32* %5
%28 = load i32, i32* %7
%29 = add nsw i32 %28, -1
store i32 %29, i32* %7
br label %30
30: ; preds = %25
br label %11
31: ; preds = %24, %11
%32 = load i32, i32* %6
ret i32 %32
}

LLVM IR (-O2):
define i32 @rightray(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %9, %4 ], [ 0, %2 ]
%7 = add nsw i32 %5, -1
%8 = shl nuw i32 1, %7
%9 = or i32 %8, %6
%10 = and i32 %8, %0
%11 = icmp eq i32 %10, 0
%12 = icmp ugt i32 %5, 1
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %4, label %14
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free_definitions();
int /*<<< orphan*/ free_directives();
int /*<<< orphan*/ free_instructions();
void free_parsers(void) {
  free_instructions();
  free_directives();
  free_definitions();
}


x86 assembly (clang, -O0):
<free_parsers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <free_instructions@plt>
mov    $0x0,%al
call   1040 <free_directives@plt>
mov    $0x0,%al
call   1030 <free_definitions@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_parsers>:
push   %rax
xor    %eax,%eax
call   1050 <free_instructions@plt>
xor    %eax,%eax
call   1040 <free_directives@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <free_definitions@plt>

LLVM IR (-O0):
define void @free_parsers() {
%1 = call i32 (...) @free_instructions()
%2 = call i32 (...) @free_directives()
%3 = call i32 (...) @free_definitions()
ret void
}

LLVM IR (-O2):
define void @free_parsers() {
%1 = tail call i32 (...) @free_instructions()
%2 = tail call i32 (...) @free_directives()
%3 = tail call i32 (...) @free_definitions()
ret void
}
void gnrc_netif_init_devs(void) {
  if (0) {
    extern void auto_init_stm32_eth(void);
    auto_init_stm32_eth();
  }
  if (0) {
    extern void auto_init_at86rf215(void);
    auto_init_at86rf215();
  }
  if (0) {
    extern void auto_init_at86rf2xx(void);
    auto_init_at86rf2xx();
  }
  if (0) {
    extern void auto_init_atwinc15x0(void);
    auto_init_atwinc15x0();
  }
  if (0) {
    extern void auto_init_mrf24j40(void);
    auto_init_mrf24j40();
  }
  if (0) {
    extern void auto_init_cc110x(void);
    auto_init_cc110x();
  }
  if (0) {
    extern void auto_init_cc2420(void);
    auto_init_cc2420();
  }
  if (0) {
    extern void auto_init_encx24j600(void);
    auto_init_encx24j600();
  }
  if (0) {
    extern void auto_init_enc28j60(void);
    auto_init_enc28j60();
  }
  if (0) {
    extern void auto_init_esp_eth(void);
    auto_init_esp_eth();
  }
  if (0) {
    extern void auto_init_esp_now(void);
    auto_init_esp_now();
  }
  if (0) {
    extern void auto_init_esp_wifi(void);
    auto_init_esp_wifi();
  }
  if (0) {
    extern void auto_init_ethos(void);
    auto_init_ethos();
  }
  if (0) {
    extern void auto_init_dose(void);
    auto_init_dose();
  }
  if (0) {
    extern void auto_init_sam0_eth(void);
    auto_init_sam0_eth();
  }
  if (0) {
    extern void auto_init_slipdev(void);
    auto_init_slipdev();
  }
  if (0) {
    extern void auto_init_cc2538_rf(void);
    auto_init_cc2538_rf();
  }
  if (0) {
    extern void auto_init_xbee(void);
    auto_init_xbee();
  }
  if (0) {
    extern void auto_init_kw2xrf(void);
    auto_init_kw2xrf();
  }
  if (0) {
    extern void auto_init_kw41zrf(void);
    auto_init_kw41zrf();
  }
  if (0) {
    extern void auto_init_netdev_cdcecm(void);
    auto_init_netdev_cdcecm();
  }
  if (0) {
    extern void auto_init_netdev_tap(void);
    auto_init_netdev_tap();
  }
  if (0) {
    extern void auto_init_socket_zep(void);
    auto_init_socket_zep();
  }
  if (0) {
    extern void auto_init_nrf24l01p_ng(void);
    auto_init_nrf24l01p_ng();
  }
  if (0) {
    extern void gnrc_nrfmin_init(void);
    gnrc_nrfmin_init();
  }
  if (0) {
    extern void auto_init_w5100(void);
    auto_init_w5100();
  }
  if (0 && !0) {
    extern void auto_init_sx127x(void);
    auto_init_sx127x();
  }
  if (0) {
    extern void auto_init_nrf802154(void);
    auto_init_nrf802154();
  }
  if (0 && !0) {
    extern void auto_init_sx126x(void);
    auto_init_sx126x();
  }
}


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

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

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

LLVM IR (-O2):
define void @gnrc_netif_init_devs() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int /*<<< orphan*/ gptp(char *, int);
void g_pthread_key_t() { gptp("pthread_key_t", sizeof(pthread_key_t)); }


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

x86 assembly (clang, -O2):
<g_pthread_key_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <gptp@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"pthread_key_t\00"
define void @g_pthread_key_t() {
%1 = tail call i32 @gptp(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ service_packet_data_last(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
void service_packet_data_last0(uint8_t cnt) {
  service_packet_data_last(cnt, 0);
}


x86 assembly (clang, -O0):
<service_packet_data_last0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <service_packet_data_last@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<service_packet_data_last0>:
xor    %esi,%esi
jmp    1030 <service_packet_data_last@plt>

LLVM IR (-O0):
define void @service_packet_data_last0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @service_packet_data_last(i32 %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @service_packet_data_last0(i32 %0) {
%2 = tail call i32 @service_packet_data_last(i32 %0, i32 0)
ret void
}
OP(fd, a0) { op_a0(); }


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 <op_a0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_a0@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 (...) @op_a0()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a0()
ret i32 undef
}
double atan2(double y, double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  (void)(y);
  return 0;
}


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.atan2 = [6 x i8] c"atan2\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.atan2, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%9 = load double, double* %4
%10 = load double, double* %3
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.atan2 = [6 x i8] c"atan2\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @atan2(double %0, double %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.atan2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *dup = (char *)malloc(strlen(str) + 1);
  if (dup) {
    strcpy(dup, str);
  }
  return (dup);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void whatever() {}


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

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

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

LLVM IR (-O2):
define void @whatever() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutTimerFunc(int, void (*)(int), int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void timer(int value) {
  printf("timer called\n");
  glutTimerFunc(500, timer, 0);
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1f4,%edi
mov    0x2e9d(%rip),%rsi
xor    %edx,%edx
call   1040 <glutTimerFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rsi
mov    $0x1f4,%edi
xor    %edx,%edx
pop    %rax
jmp    1040 <glutTimerFunc@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"timer called\0A\00"
define void @timer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @glutTimerFunc(i32 500, void (i32)* @timer, i32 0)
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"timer called\00"
define void @timer(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @glutTimerFunc(i32 500, void (i32)* @timer, i32 0)
ret void
}
void Faster_clearing(short x, short y, unsigned short w, unsigned short h) {}


x86 assembly (clang, -O0):
<Faster_clearing>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Faster_clearing(i16 signext %0, i16 signext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
ret void
}

LLVM IR (-O2):
define void @Faster_clearing(i16 signext %0, i16 signext %1, i16 zeroext %2, i16 zeroext %3) {
ret void
}
void set_app_setting_bit_for_32bit_apps(void) {}


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

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

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

LLVM IR (-O2):
define void @set_app_setting_bit_for_32bit_apps() {
ret void
}
int test2(void) {
  int local = *(volatile int *)0x1234;
  return local;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
mov    0x1234,%eax
ret

LLVM IR (-O0):
define i32 @test2() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 4660 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test2() {
%1 = load volatile i32, i32* inttoptr (i64 4660 to i32*)
ret i32 %1
}
/* Variables and functions */
int is_divisible(int, int);
bool is_divisible_by_5(int number) { return is_divisible(number, 5); }


x86 assembly (clang, -O0):
<is_divisible_by_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x5,%esi
call   1030 <is_divisible@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_divisible_by_5>:
mov    $0x5,%esi
jmp    1030 <is_divisible@plt>

LLVM IR (-O0):
define i32 @is_divisible_by_5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_divisible(i32 %3, i32 5)
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_divisible_by_5(i32 %0) {
%2 = tail call i32 @is_divisible(i32 %0, i32 5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clean_up_backtrace_handler();
int /*<<< orphan*/ tor_log_close_sigsafe_err_fds();
void subsys_torerr_shutdown(void) {
  clean_up_backtrace_handler();
  tor_log_close_sigsafe_err_fds();
}


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

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

LLVM IR (-O0):
define void @subsys_torerr_shutdown() {
%1 = call i32 (...) @clean_up_backtrace_handler()
%2 = call i32 (...) @tor_log_close_sigsafe_err_fds()
ret void
}

LLVM IR (-O2):
define void @subsys_torerr_shutdown() {
%1 = tail call i32 (...) @clean_up_backtrace_handler()
%2 = tail call i32 (...) @tor_log_close_sigsafe_err_fds()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
unsigned int hash_ulongptr_hash(const void *to_ulong) {
  assert(to_ulong);
  return (unsigned int)*((unsigned long *)to_ulong);
}


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

x86 assembly (clang, -O2):
<hash_ulongptr_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash_ulongptr_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hash_ulongptr_hash(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
void g_convert() {}


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

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

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

LLVM IR (-O2):
define void @g_convert() {
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
int strListCompareAlpha(const void *arg1, const void *arg2) {
  return strcasecmp(*(char **)arg1, *(char **)arg2);
}


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

x86 assembly (clang, -O2):
<strListCompareAlpha>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @strListCompareAlpha(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcasecmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @strListCompareAlpha(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
int arch_intsize() { return 2; }


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

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

LLVM IR (-O0):
define i32 @arch_intsize() {
ret i32 2
}

LLVM IR (-O2):
define i32 @arch_intsize() {
ret i32 2
}
/* Variables and functions */
int log_init_internal(char *, char *);
int log_init(char *filename) { return log_init_internal(filename, "a"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @log_init(i8* %0) {
%2 = tail call i32 @log_init_internal(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void *eap_sim_db_init(const char *config,
                      void (*get_complete_cb)(void *ctx, void *session_ctx),
                      void *ctx) {
  return (void *)1;
}


x86 assembly (clang, -O0):
<eap_sim_db_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @eap_sim_db_init(i8* %0, void (i8*, i8*)* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca void (i8*, i8*)*
%6 = alloca i8*
store i8* %0, i8** %4
store void (i8*, i8*)* %1, void (i8*, i8*)** %5
store i8* %2, i8** %6
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @eap_sim_db_init(i8* nocapture readnone %0, void (i8*, i8*)* nocapture readnone %1, i8* nocapture readnone %2) {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ set_af(int /*<<< orphan*/);
int /*<<< orphan*/ set_cf(int /*<<< orphan*/);
void clear_ca(void) {
  set_cf(0);
  set_af(0);
}


x86 assembly (clang, -O0):
<clear_ca>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <set_cf@plt>
xor    %edi,%edi
call   1040 <set_af@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_ca>:
push   %rax
xor    %edi,%edi
call   1030 <set_cf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_af@plt>

LLVM IR (-O0):
define void @clear_ca() {
%1 = call i32 @set_cf(i32 0)
%2 = call i32 @set_af(i32 0)
ret void
}

LLVM IR (-O2):
define void @clear_ca() {
%1 = tail call i32 @set_cf(i32 0)
%2 = tail call i32 @set_af(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_fork;
long syscall1(int /*<<< orphan*/, int /*<<< orphan*/);
long fork(void) { return syscall1(SYS_fork, 0); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
@SYS_fork = global i32 0
define i64 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = call i64 @syscall1(i32 %1, i32 0)
ret i64 %2
}

LLVM IR (-O2):
@SYS_fork = global i32 0
define i64 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = tail call i64 @syscall1(i32 %1, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ usecsleep(int /*<<< orphan*/, int);
int main() { usecsleep(0, 500000); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x7a120,%esi
call   1030 <usecsleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x7a120,%esi
call   1030 <usecsleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @usecsleep(i32 0, i32 500000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @usecsleep(i32 0, i32 500000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Clear_Display();
char lcdClear(void *parameters) {
  Clear_Display();
  return 0;
}


x86 assembly (clang, -O0):
<lcdClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Clear_Display@plt>
xor    %eax,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @lcdClear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @Clear_Display()
ret i8 0
}

LLVM IR (-O2):
define signext i8 @lcdClear(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @Clear_Display()
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ _assert_true(int, char *, char *, int);
int /*<<< orphan*/ free(void *);
void free_value(const void *value, void *cleanup_value_data) {
  _assert_true((int)(value), "value",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ykaidong/calc/refs/heads/"
               "master/unit_test/cmockery/cmockery.c",
               423);
  free((void *)value);
}


x86 assembly (clang, -O0):
<free_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
lea    0xec3(%rip),%rsi
lea    0xec2(%rip),%rdx
mov    $0x1a7,%ecx
call   1040 <_assert_true@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0x1a7,%ecx
call   1040 <_assert_true@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"value\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ykaidong/calc/refs/heads/master/unit_test/cmockery/cmockery.c\00"
define void @free_value(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @_assert_true(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 423)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"value\00"
@.str.1 = [152 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ykaidong/calc/refs/heads/master/unit_test/cmockery/cmockery.c\00"
define void @free_value(i8* %0, i8* nocapture readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @_assert_true(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.1, i64 0, i64 0), i32 423)
%6 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BootComUartInit();
void BootComInit(void) { BootComUartInit(); }


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

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

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

LLVM IR (-O2):
define void @BootComInit() {
%1 = tail call i32 (...) @BootComUartInit()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t reference_mask_32(uint32_t a) {
  uint32_t mask = 1;
  while (mask < a)
    mask = mask << 1 | 1;
  return mask;
}


x86 assembly (clang, -O0):
<reference_mask_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112b <reference_mask_32+0x2b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <reference_mask_32+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reference_mask_32>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1119 <reference_mask_32+0x19>
mov    $0x1,%eax
nop
add    %eax,%eax
add    $0x1,%eax
cmp    %edi,%eax
jl     1110 <reference_mask_32+0x10>
ret

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

LLVM IR (-O2):
define i32 @reference_mask_32(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = shl i32 %4, 1
%6 = or i32 %5, 1
%7 = icmp slt i32 %6, %0
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %9
}