xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ diag(char *, double, double);
int /*<<< orphan*/ fail(char const *);
int /*<<< orphan*/ pass(char const *);
void is_d(double got, double expected, const char *description) {
  if (got == expected)
    pass(description);
  else {
    fail(description);
    diag("got %f but expected %f", got, expected);
  }
}


x86 assembly (clang, -O0):
<is_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    116a <is_d+0x3a>
jp     116a <is_d+0x3a>
mov    -0x18(%rbp),%rdi
call   1040 <pass@plt>
jmp    1189 <is_d+0x59>
mov    -0x18(%rbp),%rdi
call   1030 <fail@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe7c(%rip),%rdi
call   1050 <diag@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_d>:
ucomisd %xmm1,%xmm0
jne    113d <is_d+0xd>
jp     113d <is_d+0xd>
jmp    1040 <pass@plt>
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <fail@plt>
lea    0xea7(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1050 <diag@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"got %f but expected %f\00"
define void @is_d(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp oeq double %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i32 @pass(i8* %11)
br label %19
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = call i32 @fail(i8* %14)
%16 = load double, double* %4
%17 = load double, double* %5
%18 = call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %16, double %17)
br label %19
19: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"got %f but expected %f\00"
define void @is_d(double %0, double %1, i8* %2) {
%4 = fcmp oeq double %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @pass(i8* %2)
br label %10
7: ; preds = %3
%8 = tail call i32 @fail(i8* %2)
%9 = tail call i32 @diag(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %0, double %1)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ subunit_send_event(char *, char const *const,
                                      int /*<<< orphan*/ *);
void subunit_test_start(char const *const name) {
  subunit_send_event("test", name, NULL);
}


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

x86 assembly (clang, -O2):
<subunit_test_start>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <subunit_send_event@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define void @subunit_test_start(i8* %0) {
%2 = tail call i32 @subunit_send_event(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
ret void
}
adrreg0reg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0reg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1143 <adrreg0reg1+0x43>
movl   $0x1,-0x4(%rbp)
jmp    114a <adrreg0reg1+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1>:
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm1
04
setae  %al
ret

LLVM IR (-O0):
define i32 @adrreg0reg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = getelementptr inbounds double, double* %14, i64 10000000
%16 = load double, double* %15
%17 = load double, double* %9
%18 = fcmp ole double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrreg0reg1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = fcmp ole double %8, %1
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
double astro_julday_tm(struct tm *);
double astro_mjd_tm(struct tm *tm) { return astro_julday_tm(tm) - 2400000.5; }


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

x86 assembly (clang, -O2):
<astro_mjd_tm>:
push   %rax
call   1030 <astro_julday_tm@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define double @astro_mjd_tm(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call double @astro_julday_tm(%struct.tm* %3)
%5 = fsub double %4, 0x41424F8040000000
ret double %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define double @astro_mjd_tm(%struct.tm* %0) {
%2 = tail call double @astro_julday_tm(%struct.tm* %0)
%3 = fadd double %2, 0xC1424F8040000000
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fdx_tx(int /*<<< orphan*/);
void fdx_puts(char *s) {
  while (*s != 0) {
    fdx_tx(*s++);
  }
}


x86 assembly (clang, -O0):
<fdx_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <fdx_puts+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <fdx_tx@plt>
jmp    111c <fdx_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdx_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <fdx_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <fdx_tx@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <fdx_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @fdx_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @fdx_tx(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int atomic_get(volatile int *i) {
  return __sync_bool_compare_and_swap(i, 123897213, 123897213);
}


x86 assembly (clang, -O0):
<atomic_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x762857d,%edx
mov    %edx,%eax
lock cmpxchg %edx,(%rcx)
mov    %eax,%ecx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_get>:
mov    $0x762857d,%edx
xor    %ecx,%ecx
mov    $0x762857d,%eax
lock cmpxchg %edx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @atomic_get(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = cmpxchg i32* %3, i32 123897213, i32 123897213 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @atomic_get(i32* nocapture %0) {
%2 = cmpxchg i32* %0, i32 123897213, i32 123897213 seq_cst seq_cst
%3 = extractvalue { i32, i1 } %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int rand();
int randLevel() { return rand() % 6 + 1; }


x86 assembly (clang, -O0):
<randLevel>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<randLevel>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @randLevel() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @randLevel() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
int isNum(char *s) {
  if ((s == 0) || (*s == 0)) {
    return 0;
  }
  while (*s != 0) {
    if ((*s > '9') || (*s < '0')) {
      return 0;
    }
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <isNum+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <isNum+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1188 <isNum+0x88>
jmp    1134 <isNum+0x34>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1181 <isNum+0x81>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1164 <isNum+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jge    1170 <isNum+0x70>
movl   $0x0,-0x4(%rbp)
jmp    1188 <isNum+0x88>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <isNum+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
xor    %eax,%eax
test   %rdi,%rdi
je     1138 <isNum+0x38>
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <isNum+0x38>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1138 <isNum+0x38>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <isNum+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isNum(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8* [ %12, %11 ], [ %0, %3 ]
%8 = phi i8 [ %13, %11 ], [ %4, %3 ]
%9 = add i8 %8, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %1, %3
%16 = phi i32 [ 0, %3 ], [ 0, %1 ], [ 0, %6 ], [ 1, %11 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mylib_function() { printf("mylib_function\n"); }


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

x86 assembly (clang, -O2):
<mylib_function>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"mylib_function\0A\00"
define void @mylib_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"mylib_function\00"
define void @mylib_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int pthread_attr_setaffinity_np(pthread_attr_t attr, size_t cpusetsize,
                                const cpu_set_t *cpuset) {
  ;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_attr_setaffinity_np>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pthread_attr_setaffinity_np(i32 %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_attr_setaffinity_np(i32 %0, i64 %1, i32* nocapture readnone %2) {
ret i32 0
}
void copy_block(unsigned char *dst, const volatile unsigned char *src) {
  unsigned m;
  for (m = 0; m < 512; ++m)
    dst[m] = src[m];
}


x86 assembly (clang, -O0):
<copy_block>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x200,-0x14(%rbp)
jae    1142 <copy_block+0x42>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy_block+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_block>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,0x1(%rdi,%rax,1)
movzbl 0x2(%rsi,%rax,1),%ecx
mov    %cl,0x2(%rdi,%rax,1)
movzbl 0x3(%rsi,%rax,1),%ecx
mov    %cl,0x3(%rdi,%rax,1)
add    $0x4,%rax
cmp    $0x200,%rax
jne    1110 <copy_block+0x10>
ret

LLVM IR (-O0):
define void @copy_block(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 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 512
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load volatile i8, i8* %13
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %9
%20 = load i32, i32* %5
%21 = add i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copy_block(i8* nocapture writeonly %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %20, %3 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load volatile i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = or i64 %4, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load volatile i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %10, i8* %11
%12 = or i64 %4, 2
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load volatile i8, i8* %13
%15 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 %14, i8* %15
%16 = or i64 %4, 3
%17 = getelementptr inbounds i8, i8* %1, i64 %16
%18 = load volatile i8, i8* %17
%19 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 %18, i8* %19
%20 = add nuw nsw i64 %4, 4
%21 = icmp eq i64 %20, 512
br i1 %21, label %22, label %3
22: ; preds = %3
ret void
}
/* Variables and functions */
void *GLUT_STROKE_ROMAN;
int /*<<< orphan*/ glutStrokeCharacter(void *, char);
void drawStrokeString(char *string) {
  int cn;
  void *font;
  font = GLUT_STROKE_ROMAN;
  for (cn = 0; string[cn] != '\0'; cn++) {
    glutStrokeCharacter(font, string[cn]);
  }
}


x86 assembly (clang, -O0):
<drawStrokeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <drawStrokeString+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <glutStrokeCharacter@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <drawStrokeString+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawStrokeString>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <drawStrokeString+0x36>
mov    %rdi,%rbx
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%r14
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <glutStrokeCharacter@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <drawStrokeString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@GLUT_STROKE_ROMAN = global i8* null
define void @drawStrokeString(i8* nocapture %0) {
%2 = load i8*, i8** @GLUT_STROKE_ROMAN
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %3, %1 ]
%8 = tail call i32 @glutStrokeCharacter(i8* %2, i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doNext(int);
int main() {
  doNext(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doNext(i32 1)
ret i32 0
}
int cb_nop() { return 0; }


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

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

LLVM IR (-O0):
define i32 @cb_nop() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cb_nop() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int EAST_CD_3(int in) {
  FILE *fin = fopen("func_header.h.ecov", "a");
  if (fin) {
    fprintf(fin, "CD3:%d\n", in);
  }
  fclose(fin);
  return in;
}


x86 assembly (clang, -O0):
<EAST_CD_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <EAST_CD_3+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EAST_CD_3>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <EAST_CD_3+0x31>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD3:%d\0A\00"
define i32 @EAST_CD_3(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD3:%d\0A\00"
define i32 @EAST_CD_3(i32 returned %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret i32 %0
}
void debug_step_01() {
  int x = 1;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  x++;
  return;
}


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

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

LLVM IR (-O0):
define void @debug_step_01() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
ret void
}

LLVM IR (-O2):
define void @debug_step_01() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dnaUtilOpen();
int /*<<< orphan*/ htmEmptyShell(void (*)(), char *);
int /*<<< orphan*/ htmlEnd();
int /*<<< orphan*/ htmlStart(char *);
void htmShell(char *title, void (*doMiddle)(), char *method) {
  dnaUtilOpen();
  htmlStart(title);
  htmEmptyShell(doMiddle, method);
  htmlEnd();
}


x86 assembly (clang, -O0):
<htmShell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <dnaUtilOpen@plt>
mov    -0x8(%rbp),%rdi
call   1030 <htmlStart@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <htmEmptyShell@plt>
mov    $0x0,%al
call   1040 <htmlEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htmShell>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <dnaUtilOpen@plt>
mov    %rbx,%rdi
call   1030 <htmlStart@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <htmEmptyShell@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <htmlEnd@plt>

LLVM IR (-O0):
define void @htmShell(i8* %0, void (...)* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca void (...)*
%6 = alloca i8*
store i8* %0, i8** %4
store void (...)* %1, void (...)** %5
store i8* %2, i8** %6
%7 = call i32 (...) @dnaUtilOpen()
%8 = load i8*, i8** %4
%9 = call i32 @htmlStart(i8* %8)
%10 = load void (...)*, void (...)** %5
%11 = load i8*, i8** %6
%12 = call i32 @htmEmptyShell(void (...)* %10, i8* %11)
%13 = call i32 (...) @htmlEnd()
ret void
}

LLVM IR (-O2):
define void @htmShell(i8* %0, void (...)* %1, i8* %2) {
%4 = tail call i32 (...) @dnaUtilOpen()
%5 = tail call i32 @htmlStart(i8* %0)
%6 = tail call i32 @htmEmptyShell(void (...)* %1, i8* %2)
%7 = tail call i32 (...) @htmlEnd()
ret void
}
/* Variables and functions */
int strtoip_netmask(char const *, char *, int /*<<< orphan*/ *);
int strtoip(const char *str, char ip[4]) {
  return strtoip_netmask(str, ip, NULL);
}


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

x86 assembly (clang, -O2):
<strtoip>:
xor    %edx,%edx
jmp    1030 <strtoip_netmask@plt>

LLVM IR (-O0):
define i32 @strtoip(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 = call i32 @strtoip_netmask(i8* %5, i8* %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @strtoip(i8* %0, i8* %1) {
%3 = tail call i32 @strtoip_netmask(i8* %0, i8* %1, i32* null)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ checkAddress(int);
int sFLASH_ReadSingleByte(int);
uint8_t HAL_EEPROM_Read(uint32_t address) {
  if (checkAddress(address)) {
    if (sFLASH_ReadSingleByte(0x03E000 + 0x200) != 1) {
      return sFLASH_ReadSingleByte(0x03F000 + address);
    } else {
      return sFLASH_ReadSingleByte(0x03E000 + address);
    }
  } else {
    return 0xff;
  }
}


x86 assembly (clang, -O0):
<HAL_EEPROM_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <checkAddress@plt>
cmp    $0x0,%rax
je     117c <HAL_EEPROM_Read+0x5c>
mov    $0x3e200,%edi
call   1040 <sFLASH_ReadSingleByte@plt>
cmp    $0x1,%eax
je     1166 <HAL_EEPROM_Read+0x46>
mov    -0x8(%rbp),%edi
add    $0x3f000,%edi
call   1040 <sFLASH_ReadSingleByte@plt>
mov    %eax,-0x4(%rbp)
jmp    1183 <HAL_EEPROM_Read+0x63>
mov    -0x8(%rbp),%edi
add    $0x3e000,%edi
call   1040 <sFLASH_ReadSingleByte@plt>
mov    %eax,-0x4(%rbp)
jmp    1183 <HAL_EEPROM_Read+0x63>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HAL_EEPROM_Read>:
push   %rbx
mov    %edi,%ebx
call   1030 <checkAddress@plt>
test   %rax,%rax
je     1151 <HAL_EEPROM_Read+0x31>
mov    $0x3e200,%edi
call   1040 <sFLASH_ReadSingleByte@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
shl    $0xc,%ecx
lea    (%rcx,%rbx,1),%edi
add    $0x3e000,%edi
pop    %rbx
jmp    1040 <sFLASH_ReadSingleByte@plt>
mov    $0xff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HAL_EEPROM_Read(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @checkAddress(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = call i32 @sFLASH_ReadSingleByte(i32 254464)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 258048, %11
%13 = call i32 @sFLASH_ReadSingleByte(i32 %12)
store i32 %13, i32* %2
br label %19
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 253952, %15
%17 = call i32 @sFLASH_ReadSingleByte(i32 %16)
store i32 %17, i32* %2
br label %19
18: ; preds = %1
store i32 255, i32* %2
br label %19
19: ; preds = %18, %14, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @HAL_EEPROM_Read(i32 %0) {
%2 = tail call i64 @checkAddress(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @sFLASH_ReadSingleByte(i32 254464)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i32 253952, i32 258048
%8 = add nsw i32 %7, %0
%9 = tail call i32 @sFLASH_ReadSingleByte(i32 %8)
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 255, %1 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ s_scmp(void *, void *);
int str_cmp(void *tag1, void *tag2) { return (!s_scmp(tag1, tag2)); }


x86 assembly (clang, -O0):
<str_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <s_scmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cmp>:
push   %rax
call   1030 <s_scmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_cmp(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 = call i32 @s_scmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @s_scmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int scr_restore(char *);
int wrap_scr_restore(char *filename) { return scr_restore(filename); }


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

x86 assembly (clang, -O2):
<wrap_scr_restore>:
jmp    1030 <scr_restore@plt>

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

LLVM IR (-O2):
define i32 @wrap_scr_restore(i8* %0) {
%2 = tail call i32 @scr_restore(i8* %0)
ret i32 %2
}
/* Variables and functions */
int SioCmdportFd(int);
int /*<<< orphan*/ SioDelFdtbl(int);
int /*<<< orphan*/ close(int);
int sio_close(int fd) {
  close(SioCmdportFd(fd));
  close(fd);
  SioDelFdtbl(fd);
  return (0);
}


x86 assembly (clang, -O0):
<sio_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <SioCmdportFd@plt>
mov    %eax,%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x4(%rbp),%edi
call   1040 <SioDelFdtbl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_close>:
push   %rbx
mov    %edi,%ebx
call   1050 <SioCmdportFd@plt>
mov    %eax,%edi
call   1030 <close@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebx,%edi
call   1040 <SioDelFdtbl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sio_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @SioCmdportFd(i32 %3)
%5 = call i32 @close(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @SioDelFdtbl(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @sio_close(i32 %0) {
%2 = tail call i32 @SioCmdportFd(i32 %0)
%3 = tail call i32 @close(i32 %2)
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @SioDelFdtbl(i32 %0)
ret i32 0
}
/* Variables and functions */
char *strcasestr(char *, char *);
char *find_closed_a(char *buf) { return (strcasestr(buf, "</A")); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"</A\00"
define i8* @find_closed_a(i8* %0) {
%2 = tail call i8* @strcasestr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
double testClosureVrD(double (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrD>:
jmp    *%rdi

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

LLVM IR (-O2):
define double @testClosureVrD(double ()* nocapture %0) {
%2 = tail call double %0()
ret double %2
}
short convert_short(short i) {
  return (((i & 0xff) << 8) | ((i & 0xff00) >> 8));
}


x86 assembly (clang, -O0):
<convert_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movswl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_short>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @convert_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @convert_short(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void test_35_1(short *mem) { __atomic_fetch_xor(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_35_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
xor    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_35_1+0x5d>
jmp    1125 <test_35_1+0x25>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_35_1>:
lock xorw $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_35_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw xor i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_35_1(i16* nocapture %0) {
%2 = atomicrmw xor i16* %0, i16 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 100; i++) {
    printf("もやしを食べよう ");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%ebp
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\E3\82\82\E3\82\84\E3\81\97\E3\82\92\E9\A3\9F\E3\81\B9\E3\82\88\E3\81\86 \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\E3\82\82\E3\82\84\E3\81\97\E3\82\92\E9\A3\9F\E3\81\B9\E3\82\88\E3\81\86 \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void btktermio_refresh(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<btktermio_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
define void @btktermio_refresh() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @btktermio_refresh() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ms_log(int, char *);
void ms_record_handler_int(char *record, int reclen, void *ofp) {
  if (fwrite(record, reclen, 1, (FILE *)ofp) != 1) {
    ms_log(2, "Error writing to output file\n");
  }
}


x86 assembly (clang, -O0):
<ms_record_handler_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     1162 <ms_record_handler_int+0x42>
mov    $0x2,%edi
lea    0xea3(%rip),%rsi
call   1030 <ms_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms_record_handler_int>:
push   %rax
mov    %rdx,%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
jne    1135 <ms_record_handler_int+0x15>
pop    %rax
ret
lea    0xec4(%rip),%rsi
mov    $0x2,%edi
pop    %rax
jmp    1030 <ms_log@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Error writing to output file\0A\00"
define void @ms_record_handler_int(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = call i32 @fwrite(i8* %7, i32 %8, i32 1, i32* %10)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @ms_log(i32 2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Error writing to output file\0A\00"
define void @ms_record_handler_int(i8* nocapture %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fwrite(i8* %0, i32 %1, i32 1, i32* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @ms_log(i32 2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
void glutMotionFunc(void (*func)(int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutMotionFunc(void (i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  void hanoi(int n, char one, char two, char three);
  int m;
  printf("input the number of diskes:");
  scanf("%d", &m);
  printf("The step to move %d diskes:\n", m);
  hanoi(m, 'A', 'B', 'C');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"input the number of diskes:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"The step to move %d diskes:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"input the number of diskes:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"The step to move %d diskes:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
ret i32 0
}
void emit_utf8_end(struct processor_explicatory_state *process_state,
                   struct modern_stream *stream, void *stream_state,
                   struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_end(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_utf8_end(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}