xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ checkUnique(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  for (int i = 2; i <= 1000000000; i++) {
    if (checkUnique(i)) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x3b9aca00,-0x8(%rbp)
jg     1177 <main+0x57>
mov    -0x8(%rbp),%edi
call   1040 <checkUnique@plt>
cmp    $0x0,%rax
je     1164 <main+0x44>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x3b9aca01,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1040 <checkUnique@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 1000000000
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @checkUnique(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %6
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %3
17: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %2
1: ; preds = %8
ret i32 0
2: ; preds = %0, %8
%3 = phi i32 [ 2, %0 ], [ %9, %8 ]
%4 = tail call i64 @checkUnique(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %8
8: ; preds = %2, %6
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 1000000001
br i1 %10, label %1, label %2
}
unsigned int zc_hashtable_str_hash(const void *str) {
  unsigned int h = 5381;
  const char *p = (const char *)str;
  while (*p != '\0')
    h = ((h << 5) + h) + (*p++);
  return h;
}


x86 assembly (clang, -O0):
<zc_hashtable_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <zc_hashtable_str_hash+0x4c>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <zc_hashtable_str_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zc_hashtable_str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <zc_hashtable_str_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <zc_hashtable_str_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @zc_hashtable_str_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i32 %9, %8
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int getDatacenterId(int);
int getDateTime();
int getIncrement();
int getMachineId();
uint64_t getSerialid(int datacenter_id) {
  uint64_t s = getDateTime();
  uint64_t d = getDatacenterId(datacenter_id);
  uint64_t m = getMachineId();
  uint64_t i = getIncrement();
  return s * 1000000 + (d << ((2) + (15))) + (m << (15)) + i;
}


x86 assembly (clang, -O0):
<getSerialid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getDateTime@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <getDatacenterId@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getMachineId@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getIncrement@plt>
mov    %eax,-0x14(%rbp)
imul   $0xf4240,-0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x11,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0xf,%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSerialid>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getDateTime@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1060 <getDatacenterId@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getMachineId@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <getIncrement@plt>
imul   $0xf4240,%r14d,%ecx
shl    $0x11,%ebx
add    %ecx,%ebx
shl    $0xf,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getSerialid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = call i32 (...) @getDateTime()
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @getDatacenterId(i32 %8)
store i32 %9, i32* %4
%10 = call i32 (...) @getMachineId()
store i32 %10, i32* %5
%11 = call i32 (...) @getIncrement()
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 1000000
%14 = load i32, i32* %4
%15 = shl i32 %14, 17
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %5
%18 = shl i32 %17, 15
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @getSerialid(i32 %0) {
%2 = tail call i32 (...) @getDateTime()
%3 = tail call i32 @getDatacenterId(i32 %0)
%4 = tail call i32 (...) @getMachineId()
%5 = tail call i32 (...) @getIncrement()
%6 = mul nsw i32 %2, 1000000
%7 = shl i32 %3, 17
%8 = add nsw i32 %7, %6
%9 = shl i32 %4, 15
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, %5
ret i32 %11
}
int bad_int_size_is_32() {
  int set_msb = 1 << 31;
  int beyond_msb = 1 << 32;
  return set_msb && !beyond_msb;
}


x86 assembly (clang, -O0):
<bad_int_size_is_32>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1129 <bad_int_size_is_32+0x29>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bad_int_size_is_32() {
%1 = alloca i32
%2 = alloca i32
store i32 -2147483648, i32* %1
store i32 poison, i32* %2
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br label %9
9: ; preds = %5, %0
%10 = phi i1 [ false, %0 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bad_int_size_is_32() {
ret i32 poison
}
int f_bge_cr1(float a1) { return (__builtin_isgreaterequal(100, a1)); }


x86 assembly (clang, -O0):
<f_bge_cr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bge_cr1>:
movss  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_bge_cr1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f_bge_cr1(float %0) {
%2 = fcmp ole float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ csum(void *, size_t);
uint16_t calc_csum(void *addr, size_t len) { return csum(addr, len >> 1); }


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

x86 assembly (clang, -O2):
<calc_csum>:
shr    %rsi
jmp    1030 <csum@plt>

LLVM IR (-O0):
define i32 @calc_csum(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = lshr i64 %6, 1
%8 = call i32 @csum(i8* %5, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @calc_csum(i8* %0, i64 %1) {
%3 = lshr i64 %1, 1
%4 = tail call i32 @csum(i8* %0, i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *);
int f_sys(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local, const char *arg1) {
  fatal_error("User Defined Functions are not installed", "");
  return 1;
}


x86 assembly (clang, -O0):
<f_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec7(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sys>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_sys(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6) {
%8 = alloca i32
%9 = alloca i8**
%10 = alloca float*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8**
%14 = alloca i8*
store i32 %0, i32* %8
store i8** %1, i8*** %9
store float* %2, float** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8** %5, i8*** %13
store i8* %6, i8** %14
%15 = call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_sys(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* nocapture readnone %6) {
%8 = tail call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *str_pfind(char const *, char const *);
char *str_plast(const char *in, const char *what) {
  const char *last = in, *found = NULL;
  while ((found = str_pfind(last, what)))
    last = found + 1;
  return last != in ? (char *)last - 1 : NULL;
}


x86 assembly (clang, -O0):
<str_plast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <str_pfind@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     115c <str_plast+0x4c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <str_plast+0x20>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     117b <str_plast+0x6b>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    1186 <str_plast+0x76>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1186 <str_plast+0x76>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_plast>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdi,%rcx
xchg   %ax,%ax
mov    %rcx,%rbx
mov    %rcx,%rdi
mov    %r15,%rsi
call   1030 <str_pfind@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
jne    1120 <str_plast+0x10>
lea    -0x1(%rbx),%rcx
xor    %eax,%eax
cmp    %r14,%rbx
cmovne %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_plast(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
store i8* null, i8** %6
br label %8
8: ; preds = %13, %2
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @str_pfind(i8* %9, i8* %10)
store i8* %11, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %5
br label %8
16: ; preds = %8
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = icmp ne i8* %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i64 -1
br label %24
23: ; preds = %16
br label %24
24: ; preds = %23, %20
%25 = phi i8* [ %22, %20 ], [ null, %23 ]
ret i8* %25
}

LLVM IR (-O2):
define i8* @str_plast(i8* %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = tail call i8* @str_pfind(i8* %4, i8* %1)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = icmp eq i8* %4, %0
%10 = getelementptr inbounds i8, i8* %4, i64 -1
%11 = select i1 %9, i8* null, i8* %10
ret i8* %11
}
int clickplc_exe_EndOfMain_dec(unsigned char *stream, void *obj) {
  int encsize = 4;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_EndOfMain_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clickplc_exe_EndOfMain_dec(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ CheckTimer(unsigned long);
unsigned long GetTimer(unsigned long);
void WaitTimer(unsigned long time) {
  time = GetTimer(time);
  while (!CheckTimer(time))
    ;
}


x86 assembly (clang, -O0):
<WaitTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <GetTimer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CheckTimer@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1157 <WaitTimer+0x37>
jmp    115c <WaitTimer+0x3c>
jmp    1139 <WaitTimer+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitTimer>:
push   %rbx
call   1040 <GetTimer@plt>
mov    %rax,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <CheckTimer@plt>
test   %eax,%eax
je     1130 <WaitTimer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @WaitTimer(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @GetTimer(i64 %3)
store i64 %4, i64* %2
br label %5
5: ; preds = %10, %1
%6 = load i64, i64* %2
%7 = call i32 @CheckTimer(i64 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @WaitTimer(i64 %0) {
%2 = tail call i64 @GetTimer(i64 %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i32 @CheckTimer(i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
/* Variables and functions */
double M_PI;
double sin(double);
double backEaseOutd(double p) {
  double f = (1 - p);
  return 1 - (f * f * f - f * sin(f * M_PI));
}


x86 assembly (clang, -O0):
<backEaseOutd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2e8a(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backEaseOutd>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x2ead(%rip),%rax
movsd  (%rax),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0xe98(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @backEaseOutd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = load double, double* %3
%11 = load double, double* %3
%12 = load double, double* @M_PI
%13 = fmul double %11, %12
%14 = call double @sin(double %13)
%15 = fmul double %10, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %8, double %9, double %16)
%18 = fsub double 1.000000e+00, %17
ret double %18
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @backEaseOutd(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %2
%4 = load double, double* @M_PI
%5 = fmul double %2, %4
%6 = tail call double @sin(double %5)
%7 = fneg double %2
%8 = fmul double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %3, double %2, double %8)
%10 = fsub double 1.000000e+00, %9
ret double %10
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void waiton_sem(int id, int num) {
  struct sembuf sb;
  sb.sem_num = num;
  sb.sem_flg = 0;
  sb.sem_op = -1;
  semop(id, &sb, 1);
  sb.sem_op = 0;
  semop(id, &sb, 1);
}


x86 assembly (clang, -O0):
<waiton_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waiton_sem>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
mov    %esi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movl   $0xffffffff,0xc(%rsp)
ff
lea    0x8(%rsp),%r14
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
movl   $0x0,0xc(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @waiton_sem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 -1, i32* %9
%10 = load i32, i32* %3
%11 = call i32 @semop(i32 %10, %struct.sembuf* %5, i32 1)
%12 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 0, i32* %12
%13 = load i32, i32* %3
%14 = call i32 @semop(i32 %13, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @waiton_sem(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 -1, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
store i32 0, i32* %7
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
double AIC(const double lk, const int k) { return -2 * lk + 2 * k; }


x86 assembly (clang, -O0):
<AIC>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AIC>:
add    %edi,%edi
cvtsi2sd %edi,%xmm1
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AIC(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %5, double %8)
ret double %9
}

LLVM IR (-O2):
define double @AIC(double %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void b_float_print_16(short idx, short *cells, int size) {
  float value = cells[idx] / 100.0;
  printf("%.2f", value);
}


x86 assembly (clang, -O0):
<b_float_print_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_float_print_16>:
movslq %edi,%rax
movswl (%rsi,%rax,2),%eax
cvtsi2sd %eax,%xmm0
divsd  0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @b_float_print_16(i16 signext %0, i16* %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i32
%7 = alloca float
store i16 %0, i16* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%8 = load i16*, i16** %5
%9 = load i16, i16* %4
%10 = sext i16 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 1.000000e+02
%16 = fptrunc double %15 to float
store float %16, float* %7
%17 = load float, float* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %17)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @b_float_print_16(i16 signext %0, i16* nocapture %1, i32 %2) {
%4 = sext i16 %0 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to double
%8 = fdiv double %7, 1.000000e+02
%9 = fptrunc double %8 to float
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %9)
ret void
}
__attribute__((visibility("default"))) const double xfmax(double x, double y) {
  return y != y ? x : (x > y ? x : y);
}


x86 assembly (clang, -O0):
<xfmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1129 <xfmax+0x29>
jp     1129 <xfmax+0x29>
jmp    1138 <xfmax+0x38>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116b <xfmax+0x6b>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <xfmax+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1161 <xfmax+0x61>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfmax>:
movapd %xmm1,%xmm2
cmpunordsd %xmm1,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm0,%xmm3
maxsd  %xmm1,%xmm0
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @xfmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %4
%7 = fcmp une double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %20
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fcmp ogt double %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load double, double* %3
br label %18
16: ; preds = %10
%17 = load double, double* %4
br label %18
18: ; preds = %16, %14
%19 = phi double [ %15, %14 ], [ %17, %16 ]
br label %20
20: ; preds = %18, %8
%21 = phi double [ %9, %8 ], [ %19, %18 ]
ret double %21
}

LLVM IR (-O2):
define double @xfmax(double %0, double %1) {
%3 = fcmp uno double %1, 0.000000e+00
%4 = fcmp ogt double %0, %1
%5 = or i1 %3, %4
%6 = select i1 %5, double %0, double %1
ret double %6
}
void ct_exit_callback_do_nothing(struct ct_model *model,
                                 struct ct_section **pointer_to_set_as_parent,
                                 struct ct_section *section) {}


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

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

LLVM IR (-O0):
%struct.ct_model = type opaque
%struct.ct_section = type opaque
define void @ct_exit_callback_do_nothing(%struct.ct_model* %0, %struct.ct_section** %1, %struct.ct_section* %2) {
%4 = alloca %struct.ct_model*
%5 = alloca %struct.ct_section**
%6 = alloca %struct.ct_section*
store %struct.ct_model* %0, %struct.ct_model** %4
store %struct.ct_section** %1, %struct.ct_section*** %5
store %struct.ct_section* %2, %struct.ct_section** %6
ret void
}

LLVM IR (-O2):
%struct.ct_model = type opaque
%struct.ct_section = type opaque
define void @ct_exit_callback_do_nothing(%struct.ct_model* nocapture %0, %struct.ct_section** nocapture %1, %struct.ct_section* nocapture %2) {
ret void
}
int fun769() { return 769; }


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

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

LLVM IR (-O0):
define i32 @fun769() {
ret i32 769
}

LLVM IR (-O2):
define i32 @fun769() {
ret i32 769
}
/* Variables and functions */
int /*<<< orphan*/ test_pad_to(char *, int, int);
int main(void) {
  test_pad_to("abc\n"
              "this is a test",
              20, 0x26);
  test_pad_to("abcadfadsfasdfasdfagf\n"
              "this is a test\n"
              "and another!\n"
              "\n"
              "another!!!!",
              20, 0x26);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
mov    $0x26,%edx
call   1030 <test_pad_to@plt>
lea    0xee2(%rip),%rdi
mov    $0x14,%esi
mov    $0x26,%edx
call   1030 <test_pad_to@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"abc\0Athis is a test\00"
@.str.1 = [63 x i8] c"abcadfadsfasdfasdfagf\0Athis is a test\0Aand another!\0A\0Aanother!!!!\00"
define i32 @main() {
%1 = call i32 @test_pad_to(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20, i32 38)
%2 = call i32 @test_pad_to(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 38)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"abc\0Athis is a test\00"
@.str.1 = [63 x i8] c"abcadfadsfasdfasdfagf\0Athis is a test\0Aand another!\0A\0Aanother!!!!\00"
define i32 @main() {
%1 = tail call i32 @test_pad_to(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 20, i32 38)
%2 = tail call i32 @test_pad_to(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0), i32 20, i32 38)
ret i32 0
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2))
    s1++, s2++;
  return *s1 + *s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%ecx
movsbl (%rsi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = add nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = add nsw i32 %21, %19
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *openFile(char const *, char *);
FILE *openFileForWriting(const char *file) { return openFile(file, "w"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32* @openFileForWriting(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @openFile(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"w\00"
define i32* @openFileForWriting(i8* %0) {
%2 = tail call i32* @openFile(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int lduw_le_p(const void *ptr) { return *(uint16_t *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @lduw_le_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("FIXME\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"FIXME\0A\00"
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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"FIXME\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _fwrite(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  static const char hello[] = "Hello, World!\n";
  _fwrite(hello, sizeof hello - 1, stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
lea    0xed1(%rip),%rdi
mov    $0xe,%esi
call   1030 <_fwrite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
mov    $0xe,%esi
call   1030 <_fwrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.hello = internal constant [15 x i8] c"Hello, World!\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @_fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.hello, i64 0, i64 0), i32 14, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@main.hello = internal constant [15 x i8] c"Hello, World!\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @_fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @main.hello, i64 0, i64 0), i32 14, i32 %1)
ret i32 0
}
void change(char *str) {
  while (*str) {
    *str = *str + 1;
    str++;
  }
}


x86 assembly (clang, -O0):
<change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1138 <change+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <change+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<change>:
mov    (%rdi),%al
test   %al,%al
je     1120 <change+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0x1,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <change+0x10>
ret

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

LLVM IR (-O2):
define void @change(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add i8 %5, 1
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
char getchar();
int get_int() {
  int integer_value = 0;
  char c;
  while ((c = getchar()) != '\n') {
    integer_value = (integer_value * 10) + (c - 48);
  }
  return integer_value;
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     114a <get_int+0x3a>
imul   $0xa,-0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <get_int+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1137 <get_int+0x27>
xor    %ebx,%ebx
movsbl %al,%eax
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <get_int+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_int() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 10
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
%13 = add nsw i32 %9, %12
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_int() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %10, %3 ], [ %1, %0 ]
%5 = phi i32 [ %9, %3 ], [ 0, %0 ]
%6 = sext i8 %4 to i32
%7 = mul nsw i32 %5, 10
%8 = add i32 %7, -48
%9 = add i32 %8, %6
%10 = tail call signext i8 (...) @getchar()
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %0
%13 = phi i32 [ 0, %0 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ set_carry_flag(int);
void handle_carry_flag_add(const int value1, const int value2) {
  set_carry_flag((value1 + value2) > 0xFF);
}


x86 assembly (clang, -O0):
<handle_carry_flag_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0xff,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_carry_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_carry_flag_add>:
add    %esi,%edi
xor    %eax,%eax
cmp    $0x100,%edi
setge  %al
mov    %eax,%edi
jmp    1030 <set_carry_flag@plt>

LLVM IR (-O0):
define void @handle_carry_flag_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = icmp sgt i32 %7, 255
%9 = zext i1 %8 to i32
%10 = call i32 @set_carry_flag(i32 %9)
ret void
}

LLVM IR (-O2):
define void @handle_carry_flag_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp sgt i32 %3, 255
%5 = zext i1 %4 to i32
%6 = tail call i32 @set_carry_flag(i32 %5)
ret void
}
/* Variables and functions */
int temper_type_exit(char **);
bool tempered_exit(char **error) { return temper_type_exit(error); }


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

x86 assembly (clang, -O2):
<tempered_exit>:
jmp    1030 <temper_type_exit@plt>

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

LLVM IR (-O2):
define i32 @tempered_exit(i8** %0) {
%2 = tail call i32 @temper_type_exit(i8** %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ glLightiv(unsigned int, unsigned int, int *);
void Lightiv(unsigned int l, unsigned int p, int v[4]) { glLightiv(l, p, v); }


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

x86 assembly (clang, -O2):
<Lightiv>:
jmp    1030 <glLightiv@plt>

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

LLVM IR (-O2):
define void @Lightiv(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @glLightiv(i32 %0, i32 %1, i32* %2)
ret void
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int nmt_get_nodeid(const struct can_frame *frame) { return frame->data[1]; }


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

x86 assembly (clang, -O2):
<nmt_get_nodeid>:
mov    (%rdi),%rax
mov    0x4(%rax),%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @nmt_get_nodeid(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i32 @nmt_get_nodeid(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}
void bu_compile_argQ(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 2)
    goto er;
  EMIT1ATM("ARG?");
  EMITEND();
  return;
er:
  cerror("arg?: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_argQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1169 <bu_compile_argQ+0x29>
jmp    1183 <bu_compile_argQ+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_argQ+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_argQ>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x2,%eax
jne    1166 <bu_compile_argQ+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [5 x i8] c"ARG?\00"
@.str.1 = [22 x i8] c"arg?: wrong # of args\00"
define void @bu_compile_argQ(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [5 x i8] c"ARG?\00"
@.str.1 = [22 x i8] c"arg?: wrong # of args\00"
define void @bu_compile_argQ(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}