xunge/DecIR huggingface dataset:
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/interface.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/interface.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/interface.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void intern__fre__key_delete(void *key) {
  if (key != NULL)
    free(key);
}


x86 assembly (clang, -O0):
<intern__fre__key_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <intern__fre__key_delete+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intern__fre__key_delete>:
test   %rdi,%rdi
je     111a <intern__fre__key_delete+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @intern__fre__key_delete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mf_write_midi_event(int, int, char *, int);
void copy_program(int chan, int c1) {
  char data[1];
  data[0] = (char)c1;
  mf_write_midi_event(0xc0, chan, data, 1);
}


x86 assembly (clang, -O0):
<copy_program>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x9(%rbp),%rdx
mov    $0xc0,%edi
mov    $0x1,%ecx
call   1030 <mf_write_midi_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_program>:
push   %rax
mov    %edi,%eax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0xc0,%edi
mov    %eax,%esi
mov    $0x1,%ecx
call   1030 <mf_write_midi_event@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_program(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%11 = call i32 @mf_write_midi_event(i32 192, i32 %9, i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @copy_program(i32 %0, i32 %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = call i32 @mf_write_midi_event(i32 192, i32 %0, i8* %4, i32 1)
ret void
}
int relativeCoord(int absolute) {
  int relative;
  relative = (absolute < 0) ? 2 + ((absolute + 1) % 3) : (absolute % 3);
  return relative;
}


x86 assembly (clang, -O0):
<relativeCoord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <relativeCoord+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x2,%edx
mov    %edx,-0xc(%rbp)
jmp    1138 <relativeCoord+0x38>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<relativeCoord>:
test   %edi,%edi
js     111b <relativeCoord+0x1b>
mov    %edi,%eax
mov    $0xaaaaaaab,%ecx
imul   %rax,%rcx
shr    $0x21,%rcx
lea    (%rcx,%rcx,2),%eax
sub    %eax,%edi
mov    %edi,%eax
ret
not    %edi
mov    $0xaaaaaaab,%eax
imul   %rdi,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
sub    %edi,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @relativeCoord(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, 3
%10 = add nsw i32 2, %9
br label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = srem i32 %12, 3
br label %14
14: ; preds = %11, %6
%15 = phi i32 [ %10, %6 ], [ %13, %11 ]
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @relativeCoord(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = xor i32 %0, -1
%5 = urem i32 %4, 3
%6 = sub nuw nsw i32 2, %5
br label %9
7: ; preds = %1
%8 = urem i32 %0, 3
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
long double __qtan(long double);
long double __q_tan(long double *arg) { return (__qtan(*arg)); }


x86 assembly (clang, -O0):
<__q_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qtan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_tan>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qtan@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @__q_tan(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qtan(x86_fp80 %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i = 2, k = 1;
  if (i > 0 && k > 0)
    if ((i) < (k))
      printf("First is smaller");
    else
      ;
  else
    printf("Numbers not greater than 0\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1168 <main+0x58>
cmpl   $0x0,-0xc(%rbp)
jle    1168 <main+0x58>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <main+0x4e>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <main+0x53>
jmp    1163 <main+0x53>
jmp    1174 <main+0x64>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"First is smaller\00"
@.str.1 = [28 x i8] c"Numbers not greater than 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %16
15: ; preds = %9
br label %16
16: ; preds = %15, %13
br label %19
17: ; preds = %6, %0
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %16
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: cslob <command>\n\n");
  printf("    info      Inspect SLOB and print basic information\n");
  printf("    find      Find items\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: cslob <command>\0A\0A\00"
@.str.1 = [56 x i8] c" info Inspect SLOB and print basic information\0A\00"
@.str.2 = [26 x i8] c" find Find items\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Usage: cslob <command>\0A\00"
@str.3 = [55 x i8] c" info Inspect SLOB and print basic information\00"
@str.4 = [25 x i8] c" find Find items\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sudoku_judge1(int, int);
int sudoku_judge2(int, int);
int sudoku_judge3(int, int);
int sudoku_judge(int i, int j) {
  if ((sudoku_judge1(i, j) == 1) && (sudoku_judge2(i, j) == 1) &&
      (sudoku_judge3(i, j) == 1)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sudoku_judge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <sudoku_judge1@plt>
cmp    $0x1,%eax
jne    1186 <sudoku_judge+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <sudoku_judge2@plt>
cmp    $0x1,%eax
jne    1186 <sudoku_judge+0x56>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <sudoku_judge3@plt>
cmp    $0x1,%eax
jne    1186 <sudoku_judge+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118d <sudoku_judge+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudoku_judge>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <sudoku_judge1@plt>
cmp    $0x1,%eax
jne    1164 <sudoku_judge+0x34>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <sudoku_judge2@plt>
cmp    $0x1,%eax
jne    1164 <sudoku_judge+0x34>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <sudoku_judge3@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1166 <sudoku_judge+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sudoku_judge(i32 %0, i32 %1) {
%3 = tail call i32 @sudoku_judge1(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i32 @sudoku_judge2(i32 %0, i32 %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @sudoku_judge3(i32 %0, i32 %1)
%10 = icmp eq i32 %9, 1
br i1 %10, label %12, label %11
11: ; preds = %8, %5, %2
br label %12
12: ; preds = %8, %11
%13 = phi i32 [ 0, %11 ], [ 1, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ McuSleepC__McuPowerState__update();
void HplAtm128AdcP__McuPowerState__update(void) {
  McuSleepC__McuPowerState__update();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128AdcP__McuPowerState__update() {
%1 = tail call i32 (...) @McuSleepC__McuPowerState__update()
ret void
}
unsigned int getIp4NtwAddr(unsigned int ip, unsigned int mask) {
  return ip & mask;
}


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

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

LLVM IR (-O0):
define i32 @getIp4NtwAddr(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 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @getIp4NtwAddr(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
void onBit(char *byteSet, int bitSet) { *byteSet = (*byteSet | (1 << bitSet)); }


x86 assembly (clang, -O0):
<onBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<onBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %al,(%rdi)
ret

LLVM IR (-O0):
define void @onBit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @onBit(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = shl nuw i32 1, %1
%5 = trunc i32 %4 to i8
%6 = or i8 %3, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int ejtag_switch(int, int /*<<< orphan*/);
int mips_ejtag_version() { return ejtag_switch(0x1003, 0); }


x86 assembly (clang, -O0):
<mips_ejtag_version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1003,%edi
xor    %esi,%esi
call   1030 <ejtag_switch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_ejtag_version>:
mov    $0x1003,%edi
xor    %esi,%esi
jmp    1030 <ejtag_switch@plt>

LLVM IR (-O0):
define i32 @mips_ejtag_version() {
%1 = call i32 @ejtag_switch(i32 4099, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mips_ejtag_version() {
%1 = tail call i32 @ejtag_switch(i32 4099, i32 0)
ret i32 %1
}
void foo_2_1_1_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_2_2_2() {
ret void
}
void a_store(volatile int *p, int x) {
  __asm__("movl %1, %0 ; lock ; orl $0,(%%esp)" : "=m"(*p) : "r"(x) : "memory");
}


x86 assembly (clang, -O0):
<a_store>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,(%rax)
lock orl $0x0,(%esp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_store>:
mov    %esi,(%rdi)
lock orl $0x0,(%esp)
ret

LLVM IR (-O0):
define void @a_store(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
ret void
}

LLVM IR (-O2):
define void @a_store(i32* %0, i32 %1) {
tail call void asm "movl $1, $0 ; lock ; orl $$0,(%esp)", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1)
ret void
}
/* Variables and functions */
bool fspath_copy(const char path[], char *location) { return false; }


x86 assembly (clang, -O0):
<fspath_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fspath_copy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int error(int, char *);
int /*<<< orphan*/ putmem();
int b_alloc(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  putmem();
  return 0;
}


x86 assembly (clang, -O0):
<b_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <b_alloc+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1040 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1160 <b_alloc+0x40>
mov    $0x0,%al
call   1030 <putmem@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_alloc>:
push   %rax
cmp    $0x2,%edi
jl     1134 <b_alloc+0x14>
mov    (%rsi),%rsi
mov    $0x1,%edi
pop    %rax
jmp    1040 <error@plt>
xor    %eax,%eax
call   1030 <putmem@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b_alloc(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 (...) @putmem()
store i32 0, i32* %3
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @b_alloc(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @putmem()
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %10
}
int d_blg_mm1(double *a1, double *a2) {
  return (__builtin_islessgreater(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_blg_mm1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_mm1>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @d_blg_mm1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp one double %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_blg_mm1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp one double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int es_digito(char caracter) {
  int toreturn = 0;
  switch (caracter) {
  case '0' ... '9':
    toreturn = 1;
  }
  return toreturn;
}


x86 assembly (clang, -O0):
<es_digito>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x9,%eax
ja     112d <es_digito+0x2d>
jmp    1126 <es_digito+0x26>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_digito>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @es_digito(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
i32 56, label %6
i32 57, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @es_digito(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World..!!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Hello World..!!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t millis(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @millis() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ swp(int *, int /*<<< orphan*/, int);
void heap_sort(int *a, int len) {
  for (int i = len - 1; i > 0; i--) {
    swp(a, 0, i);
    heapify(a, i, 0);
  }
}


x86 assembly (clang, -O0):
<heap_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    116c <heap_sort+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <swp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1040 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <heap_sort+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_sort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1163 <heap_sort+0x43>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <swp@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1140 <heap_sort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heap_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = call i32 @swp(i32* %12, i32 0, i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = call i32 @heapify(i32* %15, i32 %16, i32 0)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @heap_sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @swp(i32* %0, i32 0, i32 %7)
%9 = tail call i32 @heapify(i32* %0, i32 %7, i32 0)
%10 = icmp ugt i32 %6, 2
br i1 %10, label %5, label %4
}
void gtk_text_child_anchor_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_child_anchor_get_type() {
ret void
}
int fibonacci(int num) {
  if (num <= 0)
    return 0;
  else if (num == 1)
    return 1;
  else
    return fibonacci(num - 1) + fibonacci(num - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fibonacci+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fibonacci+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fibonacci+0x10>
xor    %eax,%eax
jmp    114a <fibonacci+0x3a>
xor    %r14d,%r14d
jmp    114d <fibonacci+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fibonacci(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
void *_threadpool_thread(void *threadpool) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @_threadpool_thread(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
void boot_memset(char *dst, char val, size_t size) {
  for (size_t i = 0; i < size; ++i) {
    dst[i] = val;
  }
}


x86 assembly (clang, -O0):
<boot_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1147 <boot_memset+0x47>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111a <boot_memset+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boot_memset>:
test   %rdx,%rdx
je     1123 <boot_memset+0x13>
push   %rax
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @boot_memset(i8* nocapture writeonly %0, i8 signext %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %5, %3
ret void
}
void copy_steppingstone_to_sdram(void) {
  unsigned int *pdwSrc = (unsigned int *)0;
  unsigned int *pdwDest = (unsigned int *)0x30000000;
  while (pdwSrc < (unsigned int *)4096) {
    *pdwDest = *pdwSrc;
    pdwDest++;
    pdwSrc++;
  }
}


x86 assembly (clang, -O0):
<copy_steppingstone_to_sdram>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    $0x30000000,%eax
mov    %rax,-0x10(%rbp)
mov    $0x1000,%eax
cmp    %rax,-0x8(%rbp)
jae    114d <copy_steppingstone_to_sdram+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <copy_steppingstone_to_sdram+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_steppingstone_to_sdram>:
push   %rax
mov    $0x30000000,%edi
mov    $0x1000,%edx
xor    %esi,%esi
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @copy_steppingstone_to_sdram() {
%1 = alloca i32*
%2 = alloca i32*
store i32* null, i32** %1
store i32* inttoptr (i64 805306368 to i32*), i32** %2
br label %3
3: ; preds = %6, %0
%4 = load i32*, i32** %1
%5 = icmp ult i32* %4, inttoptr (i64 4096 to i32*)
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %2
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @copy_steppingstone_to_sdram() {
ret void
}
int id_sort_compare_key(const void *a, const void *b) {
  if (*((unsigned long *)a) < *((unsigned long *)b))
    return -1;
  if (*((unsigned long *)a) > *((unsigned long *)b))
    return +1;
  return 0;
}


x86 assembly (clang, -O0):
<id_sort_compare_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <id_sort_compare_key+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <id_sort_compare_key+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    114c <id_sort_compare_key+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <id_sort_compare_key+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_sort_compare_key>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @id_sort_compare_key(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ shex8(char *, int);
void print32(int val) {
  char buf[9];
  shex8(buf, val);
  buf[8] = '\0';
  serial_puts(buf);
}


x86 assembly (clang, -O0):
<print32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <shex8@plt>
movb   $0x0,-0x5(%rbp)
lea    -0xd(%rbp),%rdi
call   1040 <serial_puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print32>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <shex8@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
call   1040 <serial_puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print32(i32 %0) {
%2 = alloca i32
%3 = alloca [9 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @shex8(i8* %4, i32 %5)
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 8
store i8 0, i8* %7
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%9 = call i32 @serial_puts(i8* %8)
ret void
}

LLVM IR (-O2):
define void @print32(i32 %0) {
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%4 = call i32 @shex8(i8* %3, i32 %0)
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i32 @serial_puts(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abc(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int i = 5, j = 10;
  abc(&i, &j);
  printf("%d %d", i, j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <abc@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
movl   $0xa,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <abc@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 10, i32* %2
%5 = call i32 @abc(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_trivial_box();
int /*<<< orphan*/ decr();
int /*<<< orphan*/ incr();
void test1() {
  create_trivial_box();
  incr();
  incr();
  decr();
  decr();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <create_trivial_box@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1050 <incr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
mov    $0x0,%al
call   1030 <decr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
xor    %eax,%eax
call   1040 <create_trivial_box@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
call   1050 <incr@plt>
xor    %eax,%eax
call   1030 <decr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <decr@plt>

LLVM IR (-O0):
define void @test1() {
%1 = call i32 (...) @create_trivial_box()
%2 = call i32 (...) @incr()
%3 = call i32 (...) @incr()
%4 = call i32 (...) @decr()
%5 = call i32 (...) @decr()
ret void
}

LLVM IR (-O2):
define void @test1() {
%1 = tail call i32 (...) @create_trivial_box()
%2 = tail call i32 (...) @incr()
%3 = tail call i32 (...) @incr()
%4 = tail call i32 (...) @decr()
%5 = tail call i32 (...) @decr()
ret void
}
void sample_process_console() {
  unsigned int getNextComand = 1;
  unsigned char command[500];
  command[0] = '\0';
  while (getNextComand) {
  }
}


x86 assembly (clang, -O0):
<sample_process_console>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x1,-0x4(%rbp)
movb   $0x0,-0x200(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1128 <sample_process_console+0x28>
jmp    1119 <sample_process_console+0x19>
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_process_console>:
jmp    1100 <sample_process_console>

LLVM IR (-O0):
define void @sample_process_console() {
%1 = alloca i32
%2 = alloca [500 x i8]
store i32 1, i32* %1
%3 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
br label %4
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @sample_process_console() {
br label %1
1: ; preds = %1, %0
br label %1
}
int lm_lock_dlm(struct lockspace *ls, struct resource *r, int ld_mode,
                struct val_blk *vb_out, int adopt) {
  return -1;
}


x86 assembly (clang, -O0):
<lm_lock_dlm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lockspace = type opaque
%struct.resource = type opaque
%struct.val_blk = type opaque
define i32 @lm_lock_dlm(%struct.lockspace* %0, %struct.resource* %1, i32 %2, %struct.val_blk* %3, i32 %4) {
%6 = alloca %struct.lockspace*
%7 = alloca %struct.resource*
%8 = alloca i32
%9 = alloca %struct.val_blk*
%10 = alloca i32
store %struct.lockspace* %0, %struct.lockspace** %6
store %struct.resource* %1, %struct.resource** %7
store i32 %2, i32* %8
store %struct.val_blk* %3, %struct.val_blk** %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
%struct.lockspace = type opaque
%struct.resource = type opaque
%struct.val_blk = type opaque
define i32 @lm_lock_dlm(%struct.lockspace* nocapture readnone %0, %struct.resource* nocapture readnone %1, i32 %2, %struct.val_blk* nocapture readnone %3, i32 %4) {
ret i32 -1
}
/* Variables and functions */
int abs(int);
float calculatePowerOfCruiser(int c_x, int c_y, int c_z, int x, int y, int z,
                              int p) {
  return (abs(x - c_x) + abs(y - c_y) + abs(z - c_z) / p);
}


x86 assembly (clang, -O0):
<calculatePowerOfCruiser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x10(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
cltd
idivl  0x10(%rbp)
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculatePowerOfCruiser>:
sub    %edi,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
sub    %esi,%r8d
mov    %r8d,%ecx
neg    %ecx
cmovs  %r8d,%ecx
add    %eax,%ecx
sub    %edx,%r9d
mov    %r9d,%eax
neg    %eax
cmovs  %r9d,%eax
cltd
idivl  0x8(%rsp)
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @calculatePowerOfCruiser(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %11
%16 = load i32, i32* %8
%17 = sub nsw i32 %15, %16
%18 = call i32 @abs(i32 %17)
%19 = load i32, i32* %12
%20 = load i32, i32* %9
%21 = sub nsw i32 %19, %20
%22 = call i32 @abs(i32 %21)
%23 = add nsw i32 %18, %22
%24 = load i32, i32* %13
%25 = load i32, i32* %10
%26 = sub nsw i32 %24, %25
%27 = call i32 @abs(i32 %26)
%28 = load i32, i32* %14
%29 = sdiv i32 %27, %28
%30 = add nsw i32 %23, %29
%31 = sitofp i32 %30 to float
ret float %31
}

LLVM IR (-O2):
define float @calculatePowerOfCruiser(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = sub nsw i32 %3, %0
%9 = tail call i32 @llvm.abs.i32(i32 %8, i1 true)
%10 = sub nsw i32 %4, %1
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
%12 = add nuw nsw i32 %11, %9
%13 = sub nsw i32 %5, %2
%14 = tail call i32 @llvm.abs.i32(i32 %13, i1 true)
%15 = sdiv i32 %14, %6
%16 = add nsw i32 %12, %15
%17 = sitofp i32 %16 to float
ret float %17
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc8735gv0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFFF000)) == ((0x8730b000) & (0xFFFFF000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc8735gv0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
cmp    $0x8730b000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc8735gv0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
xor    %ecx,%ecx
cmp    $0x8730b000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8735gv0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026852352
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8735gv0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026852352
%6 = zext i1 %5 to i32
ret i32 %6
}
extern int shmem_int_g(int *addr, int pe) { return *addr; }


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

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

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

LLVM IR (-O2):
define i32 @shmem_int_g(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
ret i32 %3
}