xunge/DecIR huggingface dataset:
int main() {
  int a[3] = {1, 2, 3};
  int i = 1;
  ++a[i];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp,%rax,4)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 1, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MyThreadExit();
int /*<<< orphan*/ printf(char *);
void t1(void *dummy) {
  printf("t1\n");
  MyThreadExit();
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <MyThreadExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <MyThreadExit@plt>

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

LLVM IR (-O2):
@str = [3 x i8] c"t1\00"
define void @t1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @MyThreadExit()
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void ae_get_time(long *seconds, long *milliseconds) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  *seconds = tv.tv_sec;
  *milliseconds = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<ae_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ae_get_time>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @ae_get_time(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @ae_get_time(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  double nc;
  for (nc = 0; getchar() != '\n'; ++nc) {
    ;
  }
  printf("%.0f\n", nc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     116d <main+0x4d>
jmp    1156 <main+0x36>
movsd  0xea2(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113e <main+0x1e>
movsd  -0x18(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
xorpd  %xmm0,%xmm0
cmp    $0xa,%al
je     115d <main+0x3d>
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <getchar@plt>
movsd  (%rsp),%xmm0
cmp    $0xa,%al
jne    1140 <main+0x20>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
br label %7
7: ; preds = %12, %2
%8 = call signext i8 (...) @getchar()
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %15
11: ; preds = %7
br label %12
12: ; preds = %11
%13 = load double, double* %6
%14 = fadd double %13, 1.000000e+00
store double %14, double* %6
br label %7
15: ; preds = %7
%16 = load double, double* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.0f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi double [ %7, %5 ], [ 0.000000e+00, %2 ]
%7 = fadd double %6, 1.000000e+00
%8 = tail call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi double [ 0.000000e+00, %2 ], [ %7, %5 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
/* Variables and functions */
bool live_ptr_elem(void *p) { return (((uintptr_t)p) >> 1) != (uintptr_t)0; }


x86 assembly (clang, -O0):
<live_ptr_elem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<live_ptr_elem>:
xor    %eax,%eax
cmp    $0x2,%rdi
setae  %al
ret

LLVM IR (-O0):
define i32 @live_ptr_elem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = lshr i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @live_ptr_elem(i8* readnone %0) {
%2 = icmp ugt i8* %0, inttoptr (i64 1 to i8*)
%3 = zext i1 %2 to i32
ret i32 %3
}
int main() { return (3 + 4 <= 4 || 1 && 2 != 3 > 6); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void io_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @io_cleanup() {
ret void
}
OP(fd, b3) {
  illegal_1();
  op_b3();
}


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_b3@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_b3@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_b3()
%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_b3()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ papi_sleep(int);
void helper_func_1() {
  papi_sleep(100);
  return;
}


x86 assembly (clang, -O0):
<helper_func_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <papi_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_func_1>:
mov    $0x64,%edi
jmp    1030 <papi_sleep@plt>

LLVM IR (-O0):
define void @helper_func_1() {
%1 = call i32 @papi_sleep(i32 100)
ret void
}

LLVM IR (-O2):
define void @helper_func_1() {
%1 = tail call i32 @papi_sleep(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shuffle1(char const *, int, int);
int /*<<< orphan*/ shuffle2(char *);
void shuffle(const char *s, char *t, int l, int k) {
  shuffle1(s, l, k);
  shuffle2(t);
}


x86 assembly (clang, -O0):
<shuffle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <shuffle1@plt>
mov    -0x10(%rbp),%rdi
call   1030 <shuffle2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shuffle>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <shuffle1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <shuffle2@plt>

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

LLVM IR (-O2):
define void @shuffle(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @shuffle1(i8* %0, i32 %2, i32 %3)
%6 = tail call i32 @shuffle2(i8* %1)
ret void
}
int neg_julian_year_estimate(long n) {
  return (int)((4L * n - 6887153L) / 1461L);
}


x86 assembly (clang, -O0):
<neg_julian_year_estimate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
sub    $0x6916f1,%rax
mov    $0x5b5,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_julian_year_estimate>:
lea    -0x6916f1(,%rdi,4),%rax
ff
movabs $0xb36d8397914268c9,%rcx
83 6d b3
imul   %rcx
lea    (%rdx,%rdi,4),%rax
add    $0xffffffffff96e90f,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0xa,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @neg_julian_year_estimate(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 4, %3
%5 = sub nsw i64 %4, 6887153
%6 = sdiv i64 %5, 1461
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @neg_julian_year_estimate(i64 %0) {
%2 = shl nsw i64 %0, 2
%3 = add nsw i64 %2, -6887153
%4 = sdiv i64 %3, 1461
%5 = trunc i64 %4 to i32
ret i32 %5
}
int vclib_check_VRF(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @vclib_check_VRF() {
ret i32 1
}

LLVM IR (-O2):
define i32 @vclib_check_VRF() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cbaddext2(float *, float, float, float, int, int, int, int);
void cbaddext2_(float *bxy, float *omx, float *omy, float *omz, int *nx,
                int *ny, int *nxe, int *nye) {
  cbaddext2(bxy, *omx, *omy, *omz, *nx, *ny, *nxe, *nye);
  return;
}


x86 assembly (clang, -O0):
<cbaddext2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
mov    -0x30(%rbp),%rax
mov    (%rax),%edx
mov    0x10(%rbp),%rax
mov    (%rax),%ecx
mov    0x18(%rbp),%rax
mov    (%rax),%r8d
call   1030 <cbaddext2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbaddext2_>:
mov    0x10(%rsp),%r10
mov    0x8(%rsp),%rax
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
movss  (%rcx),%xmm2
mov    (%r8),%esi
mov    (%r9),%edx
mov    (%rax),%ecx
mov    (%r10),%r8d
jmp    1030 <cbaddext2@plt>

LLVM IR (-O0):
define void @cbaddext2_(float* %0, float* %1, float* %2, float* %3, i32* %4, i32* %5, i32* %6, i32* %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
store float* %0, float** %9
store float* %1, float** %10
store float* %2, float** %11
store float* %3, float** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%17 = load float*, float** %9
%18 = load float*, float** %10
%19 = load float, float* %18
%20 = load float*, float** %11
%21 = load float, float* %20
%22 = load float*, float** %12
%23 = load float, float* %22
%24 = load i32*, i32** %13
%25 = load i32, i32* %24
%26 = load i32*, i32** %14
%27 = load i32, i32* %26
%28 = load i32*, i32** %15
%29 = load i32, i32* %28
%30 = load i32*, i32** %16
%31 = load i32, i32* %30
%32 = call i32 @cbaddext2(float* %17, float %19, float %21, float %23, i32 %25, i32 %27, i32 %29, i32 %31)
ret void
}

LLVM IR (-O2):
define void @cbaddext2_(float* %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7) {
%9 = load float, float* %1
%10 = load float, float* %2
%11 = load float, float* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = tail call i32 @cbaddext2(float* %0, float %9, float %10, float %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 773635072U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1151 <RandomFunc+0x51>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%ecx
and    $0x2e1cbc00,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x214b400,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
%11 = and i64 %10, 914778474
%12 = shl i64 %11, 7
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %13, i32* %14
store i32 0, i32* %6
br label %15
15: ; preds = %21, %2
%16 = load i32, i32* %6
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = icmp ult i32 %16, %19
br i1 %20, label %21, label %31
21: ; preds = %15
%22 = load i32, i32* %6
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%27 = load i32, i32* %26
%28 = and i32 %27, %25
store i32 %28, i32* %26
%29 = load i32, i32* %6
%30 = add i32 %29, 1
store i32 %30, i32* %6
br label %15
31: ; preds = %15
%32 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%33 = load i32, i32* %32
%34 = and i32 %33, 773635072
%35 = load i32*, i32** %4
%36 = getelementptr inbounds i32, i32* %35, i64 0
store i32 %34, i32* %36
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 7
%5 = and i32 %4, 34911232
store i32 %5, i32* %1
ret void
}
__typeof__(fscanf(1, "")) test_fscanf_220(void) { return fscanf(1, ""); }


x86 assembly (clang, -O0):
<test_fscanf_220>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <fscanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fscanf_220>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <fscanf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_fscanf_220() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_fscanf_220() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @fscanf to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int test_imm_4Duint16_reg(unsigned short val) {
  return ((val) & (-0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint16_reg>:
test   $0xffb3,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -77
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int age(int number) { return number; }


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

x86 assembly (clang, -O2):
<age>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @age(i32 returned %0) {
ret i32 %0
}
const char *hw_get_device_model_name(void) { return "Dingoo A320"; }


x86 assembly (clang, -O0):
<hw_get_device_model_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_get_device_model_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Dingoo A320\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"Dingoo A320\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
int compare_float(void *a, void *b) {
  if (*(float *)a > *(float *)b)
    return 1;
  else if (*(float *)a == *(float *)b)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <compare_float+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    115b <compare_float+0x5b>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jne    1154 <compare_float+0x54>
jp     1154 <compare_float+0x54>
movl   $0x0,-0x4(%rbp)
jmp    115b <compare_float+0x5b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
ucomiss %xmm1,%xmm0
cmpneqss %xmm1,%xmm0
movd   %xmm0,%ecx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_float(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp ogt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp oeq float %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %24
23: ; preds = %14
store i32 -1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp une float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SetUpMemBanks();
__attribute__((no)) void Addr32_ChangeNtfy(void) { SetUpMemBanks(); }


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

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

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

LLVM IR (-O2):
define void @Addr32_ChangeNtfy() {
%1 = tail call i32 (...) @SetUpMemBanks()
ret void
}
void cond_dgp_update(const struct XCSF *xcsf, const struct Cl *c,
                     const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dgp_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @cond_dgp_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_data();
int /*<<< orphan*/ solve();
int /*<<< orphan*/ write_solution();
int main(void) {
  load_data();
  solve();
  write_solution();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @load_data()
%2 = tail call i32 (...) @solve()
%3 = tail call i32 (...) @write_solution()
ret i32 0
}
/* Variables and functions */
int bswap(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int r = bswap(0x12345678);
  printf("Output is %x\n", r);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Output is %x\0A\00"
define i32 @main() {
%1 = tail call i32 @bswap(i32 305419896)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void foo(void) {
  int i;
#pragma omp threadprivate(i)
  i = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @function3() {
ret void
}
/* Variables and functions */
scalar_t__ constant_time_select(unsigned char, unsigned char, unsigned char);
unsigned char constant_time_select_8(unsigned char mask, unsigned char a,
                                     unsigned char b) {
  return (unsigned char)(constant_time_select(mask, a, b));
}


x86 assembly (clang, -O0):
<constant_time_select_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <constant_time_select@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_select_8>:
push   %rax
call   1030 <constant_time_select@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @constant_time_select_8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = call i64 @constant_time_select(i8 zeroext %7, i8 zeroext %8, i8 zeroext %9)
%11 = trunc i64 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @constant_time_select_8(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i64 @constant_time_select(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2)
%5 = trunc i64 %4 to i8
ret i8 %5
}
double adddf3(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<adddf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adddf3>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @adddf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @adddf3(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void p(unsigned int index, unsigned int iter) {
  printf("%5d -> p[%2d]\n", iter, index);
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%5d -> p[%2d]\0A\00"
define void @p(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char const);
void disasm_imm8(char *dst, const unsigned char *src) {
  sprintf(dst, "%02X", src[0]);
}


x86 assembly (clang, -O0):
<disasm_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
lea    0xed1(%rip),%rsi
movzbl (%rax),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_imm8>:
movzbl (%rsi),%edx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02X\00"
define void @disasm_imm8(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 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @disasm_imm8(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void cgiMakeOnClickSubmitButton(char *command, char *name, char *value) {
  printf("<INPUT TYPE=SUBMIT NAME=\"%s\" VALUE=\"%s\" onClick=\"%s\">", name,
         value, command);
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"<INPUT TYPE=SUBMIT NAME=\22%s\22 VALUE=\22%s\22 onClick=\22%s\22>\00"
define void @cgiMakeOnClickSubmitButton(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"<INPUT TYPE=SUBMIT NAME=\22%s\22 VALUE=\22%s\22 onClick=\22%s\22>\00"
define void @cgiMakeOnClickSubmitButton(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %0)
ret void
}
int g_DUMMY_menu_append_submenu(int menu_id, char *label) {
  menu_id = menu_id;
  label = label;
  return -1;
}


x86 assembly (clang, -O0):
<g_DUMMY_menu_append_submenu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @g_DUMMY_menu_append_submenu(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
store i32 %5, i32* %3
%6 = load i8*, i8** %4
store i8* %6, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @g_DUMMY_menu_append_submenu(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
char cttk_hexdigit(int x, int uppercase) {
  unsigned off;
  off = (0x41 - 0x3A);
  if (!uppercase) {
    off += 0x20;
  }
  return (char)(0x30 + x + (off & ~(((unsigned)x - 10) >> 8)));
}


x86 assembly (clang, -O0):
<cttk_hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <cttk_hexdigit+0x24>
mov    -0xc(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    $0xa,%edx
shr    $0x8,%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cttk_hexdigit>:
xor    %ecx,%ecx
test   %esi,%esi
sete   %cl
shl    $0x5,%ecx
or     $0x7,%ecx
lea    0xfff6(%rdi),%eax
shr    $0x8,%eax
not    %eax
and    %ecx,%eax
add    %edi,%eax
add    $0x30,%al
ret

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

LLVM IR (-O2):
define signext i8 @cttk_hexdigit(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 39, i32 7
%5 = add nsw i32 %0, 48
%6 = add i32 %0, 65526
%7 = lshr i32 %6, 8
%8 = xor i32 %7, -1
%9 = and i32 %4, %8
%10 = add i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}
/* Variables and functions */
int logical_iterator(int, int, int *, unsigned short);
bool logical_and(unsigned short array_size, bool *boolean_list) {
  return logical_iterator(true, false, boolean_list, array_size);
}


x86 assembly (clang, -O0):
<logical_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
movzwl -0x2(%rbp),%ecx
call   1030 <logical_iterator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_and>:
mov    %rsi,%rdx
mov    %edi,%ecx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <logical_iterator@plt>

LLVM IR (-O0):
define i32 @logical_and(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i16, i16* %3
%7 = call i32 @logical_iterator(i32 1, i32 0, i32* %5, i16 zeroext %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @logical_and(i16 zeroext %0, i32* %1) {
%3 = tail call i32 @logical_iterator(i32 1, i32 0, i32* %1, i16 zeroext %0)
ret i32 %3
}
double humps(double x) {
  double f;
  f = 1. / ((x - 0.3) * (x - 0.3) + 0.01) +
      1. / ((x - 0.9) * (x - 0.9) + 0.04) - 6;
  return f;
}


x86 assembly (clang, -O0):
<humps>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xf12(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xf01(%rip),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee9(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xec4(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm3
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm2
movsd  0xe9b(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xe87(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe6f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<humps>:
unpcklpd %xmm0,%xmm0
addpd  0xef4(%rip),%xmm0
mulpd  %xmm0,%xmm0
addpd  0xef8(%rip),%xmm0
movapd 0xf00(%rip),%xmm1
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @humps(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 3.000000e-01
%6 = load double, double* %2
%7 = fsub double %6, 3.000000e-01
%8 = call double @llvm.fmuladd.f64(double %5, double %7, double 1.000000e-02)
%9 = fdiv double 1.000000e+00, %8
%10 = load double, double* %2
%11 = fsub double %10, 9.000000e-01
%12 = load double, double* %2
%13 = fsub double %12, 9.000000e-01
%14 = call double @llvm.fmuladd.f64(double %11, double %13, double 4.000000e-02)
%15 = fdiv double 1.000000e+00, %14
%16 = fadd double %9, %15
%17 = fsub double %16, 6.000000e+00
store double %17, double* %3
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @humps(double %0) {
%2 = insertelement <2 x double> poison, double %0, i64 0
%3 = shufflevector <2 x double> %2, <2 x double> poison, <2 x i32> zeroinitializer
%4 = fadd <2 x double> %3, <double -3.000000e-01, double -9.000000e-01>
%5 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %4, <2 x double> %4, <2 x double> <double 1.000000e-02, double 4.000000e-02>)
%6 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %5
%7 = shufflevector <2 x double> %6, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%8 = fadd <2 x double> %6, %7
%9 = extractelement <2 x double> %8, i64 0
%10 = fadd double %9, -6.000000e+00
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from prog1.c\n");
  func1();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from prog1.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @func1()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog1.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
int /*<<< orphan*/ h_free(void *);
void component_bullet_free(void *handle) {
  if (!handle) {
    debug_warning("[component_bullet_free] handle canont be NULL");
    return;
  }
  h_free(handle);
}


x86 assembly (clang, -O0):
<component_bullet_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <component_bullet_free+0x28>
lea    0xec2(%rip),%rdi
call   1040 <debug_warning@plt>
jmp    1151 <component_bullet_free+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <h_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_bullet_free>:
test   %rdi,%rdi
je     112a <component_bullet_free+0xa>
jmp    1030 <h_free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <debug_warning@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"[component_bullet_free] handle canont be NULL\00"
define void @component_bullet_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @debug_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @h_free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"[component_bullet_free] handle canont be NULL\00"
define void @component_bullet_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @debug_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @h_free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int randint(int a, int b) {
  double r, x, R = RAND_MAX;
  int i;
  r = rand();
  x = r / (R + 1);
  i = (int)(x * (b - a + 1));
  return a + i;
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
add    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2eca(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  (%rsp),%xmm1
addsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load double, double* @RAND_MAX
store double %9, double* %7
%10 = call double (...) @rand()
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %7
%13 = fadd double %12, 1.000000e+00
%14 = fdiv double %11, %13
store double %14, double* %6
%15 = load double, double* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = sitofp i32 %19 to double
%21 = fmul double %15, %20
%22 = fptosi double %21 to i32
store i32 %22, i32* %8
%23 = load i32, i32* %3
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0, i32 %1) {
%3 = load double, double* @RAND_MAX
%4 = tail call double (...) @rand()
%5 = fadd double %3, 1.000000e+00
%6 = fdiv double %4, %5
%7 = sub i32 1, %0
%8 = add i32 %7, %1
%9 = sitofp i32 %8 to double
%10 = fmul double %6, %9
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ saftyexit(int /*<<< orphan*/);
void interuppthandler(int signal) {
  (void)signal;
  saftyexit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<interuppthandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <saftyexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interuppthandler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <saftyexit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @interuppthandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @saftyexit(i32 %4)
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @interuppthandler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @saftyexit(i32 %2)
ret void
}
/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int flock(int, int);
int lock_exnb(int fd) { return flock(fd, LOCK_EX | LOCK_NB); }


x86 assembly (clang, -O0):
<lock_exnb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
or     (%rax),%esi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_exnb>:
mov    0x2ed1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @lock_exnb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_EX
%5 = load i32, i32* @LOCK_NB
%6 = or i32 %4, %5
%7 = call i32 @flock(i32 %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @lock_exnb(i32 %0) {
%2 = load i32, i32* @LOCK_EX
%3 = load i32, i32* @LOCK_NB
%4 = or i32 %3, %2
%5 = tail call i32 @flock(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, int);
int shim_fdatasync(int fd) { return shim_enosys(0, fd); }


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

x86 assembly (clang, -O2):
<shim_fdatasync>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_fdatasync(i32 %0) {
%2 = tail call i32 @shim_enosys(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned long native_save_fl();
__attribute__((always_)) unsigned long __raw_local_save_flags(void) {
  return native_save_fl();
}


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

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

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

LLVM IR (-O2):
define i64 @__raw_local_save_flags() {
%1 = tail call i64 (...) @native_save_fl()
ret i64 %1
}