xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ access_int(void *, int);
void *alloc_int(int);
void nowarn_alloc_access_anti_range_int(int n1, int n2) {
  if (n1 == 3)
    n1 = 4;
  void *p = alloc_int(n1);
  if (n2 == 7)
    n2 = 8;
  access_int(p, n2);
}


x86 assembly (clang, -O0):
<nowarn_alloc_access_anti_range_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113f <nowarn_alloc_access_anti_range_int+0x1f>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_int@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    115c <nowarn_alloc_access_anti_range_int+0x3c>
movl   $0x8,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <access_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nowarn_alloc_access_anti_range_int>:
push   %rbx
mov    %esi,%ebx
cmp    $0x3,%edi
mov    $0x4,%eax
cmove  %eax,%edi
call   1030 <alloc_int@plt>
cmp    $0x7,%ebx
mov    $0x8,%esi
cmovne %ebx,%esi
mov    %rax,%rdi
pop    %rbx
jmp    1040 <access_int@plt>

LLVM IR (-O0):
define void @nowarn_alloc_access_anti_range_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 4, i32* %3
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %3
%11 = call i8* @alloc_int(i32 %10)
store i8* %11, i8** %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 7
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 8, i32* %4
br label %15
15: ; preds = %14, %9
%16 = load i8*, i8** %5
%17 = load i32, i32* %4
%18 = call i32 @access_int(i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @nowarn_alloc_access_anti_range_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 3
%4 = select i1 %3, i32 4, i32 %0
%5 = tail call i8* @alloc_int(i32 %4)
%6 = icmp eq i32 %1, 7
%7 = select i1 %6, i32 8, i32 %1
%8 = tail call i32 @access_int(i8* %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ncore_timer_disable();
void timer_term(void) { ncore_timer_disable(); }


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

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

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

LLVM IR (-O2):
define void @timer_term() {
%1 = tail call i32 (...) @ncore_timer_disable()
ret void
}
int __test() {
  int x = 3;
  short y = 1337;
  int z = x + y;
  return z & 0xff;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movw   $0x539,-0x6(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
store i32 3, i32* %1
store i16 1337, i16* %2
%4 = load i32, i32* %1
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = add nsw i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 60
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int age;
  scanf("%d", &age);
  if (age >= 21) {
    printf("yes\n");
  } else {
    printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x15,-0x8(%rbp)
jl     115a <main+0x3a>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x15,0x4(%rsp)
lea    0xec8(%rip),%rax
lea    0xebe(%rip),%rdi
cmovge %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 21
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 20
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
int main(void) {
  int a = 42, b = (!0xDD8FB8CEL) ? 7 : 14, c = (0xDD8FB8CEL || 0),
      d = (0xDD8FB8CEL && 1);
  if (1) {
    a = 4;
  } else {
    a = 14;
  }
  return a + b + c + d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0xe,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 14, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
store i32 4, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 20
}
yyErr(n, l) { yyAbort(n, "code", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyErr>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <yyAbort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"code\00"
define i32 @yyErr(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 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"code\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_DigLeft(void) { WriteInstruction("call digl"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"call digl\00"
define void @CR_DigLeft() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int);
int /*<<< orphan*/ println(int *, int);
int main() {
  int arr[] = {121, 3225, 3249, 1253, 62, 9, 12, 133};
  int len = sizeof(arr) / sizeof(*arr);
  println(arr, len);
  merge_sort(arr, len);
  println(arr, len);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <println@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <merge_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <println@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <merge_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <println@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 121, i32 3225, i32 3249, i32 1253, i32 62, i32 9, i32 12, i32 133]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @println(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @merge_sort(i32* %8, i32 %9)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @println(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 121, i32 3225, i32 3249, i32 1253, i32 62, i32 9, i32 12, i32 133]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @println(i32* %3, i32 8)
%5 = call i32 @merge_sort(i32* %3, i32 8)
%6 = call i32 @println(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int open(const char *name, int flags, ...) { svcPanic(); }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %eax,%eax
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_add();
int /*<<< orphan*/ test_codec();
int /*<<< orphan*/ test_mul();
int main(void) {
  test_codec();
  test_mul();
  test_add();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_codec()
%2 = tail call i32 (...) @test_mul()
%3 = tail call i32 (...) @test_add()
ret i32 0
}
void GFX_unloadFont(int handle) {}


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

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

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

LLVM IR (-O2):
define void @GFX_unloadFont(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_random_tile();
int /*<<< orphan*/ move_line(int, int);
void move_board(int start, int stride, int next_stride) {
  int i, end = start + next_stride * 4;
  for (i = start; i != end; i += next_stride)
    move_line(i, stride);
  add_random_tile();
}


x86 assembly (clang, -O0):
<move_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     116a <move_board+0x4a>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <move_line@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <move_board+0x25>
mov    $0x0,%al
call   1040 <add_random_tile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_board>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
je     1153 <move_board+0x33>
mov    %edx,%r12d
mov    %esi,%r14d
mov    %edi,%r15d
lea    0x0(,%r12,4),%ebp
xor    %ebx,%ebx
nop
lea    (%r15,%rbx,1),%edi
mov    %r14d,%esi
call   1030 <move_line@plt>
add    %r12d,%ebx
cmp    %ebx,%ebp
jne    1140 <move_board+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <add_random_tile@plt>

LLVM IR (-O0):
define void @move_board(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = mul nsw i32 %10, 4
%12 = add nsw i32 %9, %11
store i32 %12, i32* %8
%13 = load i32, i32* %4
store i32 %13, i32* %7
br label %14
14: ; preds = %22, %3
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load i32, i32* %7
%20 = load i32, i32* %5
%21 = call i32 @move_line(i32 %19, i32 %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = add nsw i32 %24, %23
store i32 %25, i32* %7
br label %14
26: ; preds = %14
%27 = call i32 (...) @add_random_tile()
ret void
}

LLVM IR (-O2):
define void @move_board(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = add nsw i32 %4, %0
%6 = icmp eq i32 %2, 0
br i1 %6, label %12, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %0, %3 ]
%9 = tail call i32 @move_line(i32 %8, i32 %1)
%10 = add nsw i32 %8, %2
%11 = icmp eq i32 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %3
%13 = tail call i32 (...) @add_random_tile()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(long, int /*<<< orphan*/ *);
void WriteLong(long fptr, FILE *fileid) {
  int i;
  for (i = 0; i < 4; i++) {
    fputc(fptr & 255, fileid);
    fptr >>= 8;
  }
}


x86 assembly (clang, -O0):
<WriteLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    115f <WriteLong+0x4f>
mov    -0x8(%rbp),%rdi
and    $0xff,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <WriteLong+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl %bl,%edi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @WriteLong(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32
store i64 %0, i64* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i64, i64* %3
%11 = and i64 %10, 255
%12 = load i32*, i32** %4
%13 = call i32 @fputc(i64 %11, i32* %12)
%14 = load i64, i64* %3
%15 = ashr i64 %14, 8
store i64 %15, i64* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @WriteLong(i64 %0, i32* nocapture %1) {
%3 = and i64 %0, 255
%4 = tail call i32 @fputc(i64 %3, i32* %1)
%5 = lshr i64 %0, 8
%6 = and i64 %5, 255
%7 = tail call i32 @fputc(i64 %6, i32* %1)
%8 = lshr i64 %0, 16
%9 = and i64 %8, 255
%10 = tail call i32 @fputc(i64 %9, i32* %1)
%11 = lshr i64 %0, 24
%12 = and i64 %11, 255
%13 = tail call i32 @fputc(i64 %12, i32* %1)
ret void
}
char *_Locale_time_name(const void *__DUMMY_PAR1, char *__DUMMY_PAR) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @_Locale_time_name(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
short int CiHwWrite(unsigned char chan, short int offset, unsigned char *val) {
  return -8;
}


x86 assembly (clang, -O0):
<CiHwWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0xfff8,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<CiHwWrite>:
mov    $0xfff8,%ax
ret

LLVM IR (-O0):
define signext i16 @CiHwWrite(i8 zeroext %0, i16 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca i8*
store i8 %0, i8* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
ret i16 -8
}

LLVM IR (-O2):
define signext i16 @CiHwWrite(i8 zeroext %0, i16 signext %1, i8* nocapture readnone %2) {
ret i16 -8
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR69_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR69_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR69_swap(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 i32, i32* %4
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR69_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct utsname {
  char *sysname;
  char *nodename;
  char *release;
  char *machine;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ uname(struct utsname *);
int main(int argc, char **argv) {
  struct utsname buf;
  uname(&buf);
  printf("%s %s %s %s\n", buf.sysname, buf.nodename, buf.release, buf.machine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x20(%rsp),%r8
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8* }
@.str = [13 x i8] c"%s %s %s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utsname
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @uname(%struct.utsname* %6)
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 2
%13 = load i8*, i8** %12
%14 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 3
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11, i8* %13, i8* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8* }
@.str = [13 x i8] c"%s %s %s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 3
%13 = load i8*, i8** %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9, i8* %11, i8* %13)
ret i32 0
}
/* Variables and functions */
int rand();
void genRandom(char userInput[2], int numPages, int *page) {
  *page = rand() % numPages;
  userInput[0] = (rand() % 6) + 'A';
  userInput[1] = (rand() % 3) + '1';
}


x86 assembly (clang, -O0):
<genRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %edx,(%rax)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x31,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genRandom>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
mov    %edx,(%rbx)
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
sub    %ecx,%eax
add    $0x41,%al
mov    %al,(%r14)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
add    $0x31,%al
mov    %al,0x1(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @genRandom(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = call i32 (...) @rand()
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 6
%13 = add nsw i32 %12, 65
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
%17 = call i32 (...) @rand()
%18 = srem i32 %17, 3
%19 = add nsw i32 %18, 49
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
define void @genRandom(i8* nocapture writeonly %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %1
store i32 %5, i32* %2
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 6
%8 = trunc i32 %7 to i8
%9 = add nsw i8 %8, 65
store i8 %9, i8* %0
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 3
%12 = trunc i32 %11 to i8
%13 = add nsw i8 %12, 49
%14 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %13, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int sum = 0;
  for (i = 0; i < 100000; i++) {
    sum++;
  }
  assert(i == 100000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x186a0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA(unsigned short, unsigned char *);
int /*<<< orphan*/ RegWriteA(unsigned short, unsigned char);
void BsyWit(unsigned short UsTrgAdr, unsigned char UcTrgDat) {
  unsigned char UcFlgVal;
  RegWriteA(UsTrgAdr, UcTrgDat);
  UcFlgVal = 1;
  while (UcFlgVal) {
    RegReadA(UsTrgAdr, &UcFlgVal);
    UcFlgVal &= (UcTrgDat & 0x0F);
  };
}


x86 assembly (clang, -O0):
<BsyWit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzbl -0x3(%rbp),%esi
call   1040 <RegWriteA@plt>
movb   $0x1,-0x4(%rbp)
cmpb   $0x0,-0x4(%rbp)
je     1175 <BsyWit+0x55>
lea    -0x4(%rbp),%rsi
movzwl -0x2(%rbp),%edi
call   1030 <RegReadA@plt>
movzbl -0x3(%rbp),%ecx
and    $0xf,%ecx
movzbl -0x4(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x4(%rbp)
jmp    1149 <BsyWit+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BsyWit>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <RegWriteA@plt>
movb   $0x1,0xf(%rsp)
and    $0xf,%bl
movzwl %bp,%ebp
lea    0xf(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <RegReadA@plt>
and    %bl,0xf(%rsp)
jne    1150 <BsyWit+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @BsyWit(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%6 = load i16, i16* %3
%7 = load i8, i8* %4
%8 = call i32 @RegWriteA(i16 zeroext %6, i8 zeroext %7)
store i8 1, i8* %5
br label %9
9: ; preds = %12, %2
%10 = load i8, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %9
%13 = load i16, i16* %3
%14 = call i32 @RegReadA(i16 zeroext %13, i8* %5)
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = and i32 %16, 15
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = and i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %5
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @BsyWit(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = tail call i32 @RegWriteA(i16 zeroext %0, i8 zeroext %1)
store i8 1, i8* %3
%5 = and i8 %1, 15
br label %6
6: ; preds = %2, %6
%7 = call i32 @RegReadA(i16 zeroext %0, i8* %3)
%8 = load i8, i8* %3
%9 = and i8 %5, %8
store i8 %9, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
/* Variables and functions */
void *mxml_get_sibling(void *);
void *cfg_memory_get_next_area(void *area) {
  void *next_area = ((void *)0);
  if (((void *)0) != area) {
    next_area = mxml_get_sibling(area);
  }
  return next_area;
}


x86 assembly (clang, -O0):
<cfg_memory_get_next_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     113d <cfg_memory_get_next_area+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <mxml_get_sibling@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @cfg_memory_get_next_area(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @mxml_get_sibling(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int ioCanSetFileTypeOfSize(char *pathString, int pathStringLength) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ioCanSetFileTypeOfSize(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ pthread_cond_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void xcond_destroy(pthread_cond_t *c) {
  if (pthread_cond_destroy(c)) {
    fputs("xcond_destroy\n", stderr);
    abort();
  }
}


x86 assembly (clang, -O0):
<xcond_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_cond_destroy@plt>
cmp    $0x0,%rax
je     116b <xcond_destroy+0x3b>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcond_destroy>:
push   %rax
call   1050 <pthread_cond_destroy@plt>
test   %rax,%rax
jne    113d <xcond_destroy+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"xcond_destroy\0A\00"
@stderr = global i32 0
define void @xcond_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_cond_destroy(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"xcond_destroy\0A\00"
@stderr = global i32 0
define void @xcond_destroy(i32* %0) {
%2 = tail call i64 @pthread_cond_destroy(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
struct vtimes {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_CHILDREN;
int /*<<< orphan*/ RUSAGE_SELF;
scalar_t__ vtimes_one(struct vtimes *, int /*<<< orphan*/);
int vtimes(struct vtimes *current, struct vtimes *child) {
  if (vtimes_one(current, RUSAGE_SELF) < 0 ||
      vtimes_one(child, RUSAGE_CHILDREN) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<vtimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <vtimes_one@plt>
cmp    $0x0,%rax
jl     1158 <vtimes+0x48>
mov    -0x18(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <vtimes_one@plt>
cmp    $0x0,%rax
jge    1164 <vtimes+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <vtimes+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtimes>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
call   1030 <vtimes_one@plt>
test   %rax,%rax
js     113e <vtimes+0x2e>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <vtimes_one@plt>
sar    $0x3f,%rax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vtimes = type { i32 }
@RUSAGE_SELF = global i32 0
@RUSAGE_CHILDREN = global i32 0
define i32 @vtimes(%struct.vtimes* %0, %struct.vtimes* %1) {
%3 = alloca i32
%4 = alloca %struct.vtimes*
%5 = alloca %struct.vtimes*
store %struct.vtimes* %0, %struct.vtimes** %4
store %struct.vtimes* %1, %struct.vtimes** %5
%6 = load %struct.vtimes*, %struct.vtimes** %4
%7 = load i32, i32* @RUSAGE_SELF
%8 = call i64 @vtimes_one(%struct.vtimes* %6, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load %struct.vtimes*, %struct.vtimes** %5
%12 = load i32, i32* @RUSAGE_CHILDREN
%13 = call i64 @vtimes_one(%struct.vtimes* %11, i32 %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10, %2
store i32 -1, i32* %3
br label %17
16: ; preds = %10
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.vtimes = type { i32 }
@RUSAGE_SELF = global i32 0
@RUSAGE_CHILDREN = global i32 0
define i32 @vtimes(%struct.vtimes* %0, %struct.vtimes* %1) {
%3 = load i32, i32* @RUSAGE_SELF
%4 = tail call i64 @vtimes_one(%struct.vtimes* %0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @RUSAGE_CHILDREN
%8 = tail call i64 @vtimes_one(%struct.vtimes* %1, i32 %7)
%9 = ashr i64 %8, 63
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ -1, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menu_error() { printf("Wrong choice!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Wrong choice!\00"
define void @menu_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_ptr_not_equal_(char *, int, int *, int *);
void test_ptr_not_equal_pass() {
  int x = 1, y = 2;
  int *p1 = &x, *p2 = &y;
  assert_ptr_not_equal_("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/"
                        "assertive/refs/heads/master/test/pass_test.c",
                        54, (p1), (p2));
}


x86 assembly (clang, -O0):
<test_ptr_not_equal_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
mov    $0x36,%esi
call   1030 <assert_ptr_not_equal_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ptr_not_equal_pass>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x36,%esi
call   1030 <assert_ptr_not_equal_@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_ptr_not_equal_pass() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 1, i32* %1
store i32 2, i32* %2
store i32* %1, i32** %3
store i32* %2, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @assert_ptr_not_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 54, i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_ptr_not_equal_pass() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @assert_ptr_not_equal_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 54, i32* %1, i32* %2)
ret void
}
unsigned long long sectors_to_MB(unsigned long long n) {
  n <<= 9;
  ({
    unsigned long __upper, __low, __high, __mod, __base;
    __base = (1000000);
    asm("" : "=a"(__low), "=d"(__high) : "A"(n));
    __upper = __high;
    if (__high) {
      __upper = __high % (__base);
      __high = __high / (__base);
    }
    asm("divl %2"
        : "=a"(__low), "=d"(__mod)
        : "rm"(__base), "0"(__low), "1"(__upper));
    asm("" : "=A"(n) : "a"(__low), "d"(__high));
    __mod;
  });
  return n;
}


x86 assembly (clang, -O0):
<sectors_to_MB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x9,%rax
mov    %rax,-0x8(%rbp)
movq   $0xf4240,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115b <sectors_to_MB+0x5b>
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x30(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdx
mov    %rcx,-0x40(%rbp)
divl   -0x40(%rbp)
mov    %rax,-0x18(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i64 @sectors_to_MB(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %2
%9 = load i64, i64* %2
%10 = shl i64 %9, 9
store i64 %10, i64* %2
store i64 1000000, i64* %7
%11 = load i64, i64* %2
%12 = call { i64, i64 } asm "", "={ax},={dx},A,~{dirflag},~{fpsr},~{flags}"(i64 %11)
%13 = extractvalue { i64, i64 } %12, 0
%14 = extractvalue { i64, i64 } %12, 1
store i64 %13, i64* %4
store i64 %14, i64* %5
%15 = load i64, i64* %5
store i64 %15, i64* %3
%16 = load i64, i64* %5
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %1
%19 = load i64, i64* %5
%20 = load i64, i64* %7
%21 = urem i64 %19, %20
store i64 %21, i64* %3
%22 = load i64, i64* %5
%23 = load i64, i64* %7
%24 = udiv i64 %22, %23
store i64 %24, i64* %5
br label %25
25: ; preds = %18, %1
%26 = load i64, i64* %7
%27 = load i64, i64* %4
%28 = load i64, i64* %3
%29 = call { i64, i64 } asm "divl $2", "={ax},={dx},rm,0,1,~{dirflag},~{fpsr},~{flags}"(i64 %26, i64 %27, i64 %28)
%30 = extractvalue { i64, i64 } %29, 0
%31 = extractvalue { i64, i64 } %29, 1
store i64 %30, i64* %4
store i64 %31, i64* %6
%32 = load i64, i64* %4
%33 = load i64, i64* %5
%34 = call i64 asm "", "=A,{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i64 %32, i64 %33)
store i64 %34, i64* %2
%35 = load i64, i64* %6
store i64 %35, i64* %8
%36 = load i64, i64* %8
%37 = load i64, i64* %2
ret i64 %37
}

LLVM IR (-O2):
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct phonethdr {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_network_header(struct sk_buff *);
struct phonethdr *pn_hdr(struct sk_buff *skb) {
  return (struct phonethdr *)skb_network_header(skb);
}


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

x86 assembly (clang, -O2):
<pn_hdr>:
jmp    1030 <skb_network_header@plt>

LLVM IR (-O0):
%struct.phonethdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.phonethdr* @pn_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_network_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.phonethdr*
ret %struct.phonethdr* %5
}

LLVM IR (-O2):
%struct.phonethdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.phonethdr* @pn_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_network_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.phonethdr*
ret %struct.phonethdr* %3
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void writeemul(int value) { outb(value, 0x333); }


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

x86 assembly (clang, -O2):
<writeemul>:
mov    $0x333,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @writeemul(i32 %0) {
%2 = tail call i32 @outb(i32 %0, i32 819)
ret void
}
int nfs3_proc_setacl(struct inode *inode, int type, struct posix_acl *acl) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.posix_acl = type opaque
define i32 @nfs3_proc_setacl(%struct.inode* %0, i32 %1, %struct.posix_acl* %2) {
%4 = alloca %struct.inode*
%5 = alloca i32
%6 = alloca %struct.posix_acl*
store %struct.inode* %0, %struct.inode** %4
store i32 %1, i32* %5
store %struct.posix_acl* %2, %struct.posix_acl** %6
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.posix_acl = type opaque
define i32 @nfs3_proc_setacl(%struct.inode* nocapture readnone %0, i32 %1, %struct.posix_acl* nocapture readnone %2) {
ret i32 0
}
long IS_ERR(const void *ptr) {
  return ((unsigned long)ptr > (unsigned long)-1000L);
}


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffffc18,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @IS_ERR(i8* readnone %0) {
%2 = icmp ugt i8* %0, inttoptr (i64 -1000 to i8*)
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
int cbmarch_iec_wait(int, int, int);
int cbm_iec_wait(int HandleDevice, int Line, int State) {
  ;
  return cbmarch_iec_wait(HandleDevice, Line, State);
}


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

x86 assembly (clang, -O2):
<cbm_iec_wait>:
jmp    1030 <cbmarch_iec_wait@plt>

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

LLVM IR (-O2):
define i32 @cbm_iec_wait(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @cbmarch_iec_wait(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debugPrintStr(char *, char *);
void newContactGroupRecvd(char *line) {
  debugPrintStr("command parser: newContactGroupRecvd: ", line);
}


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

x86 assembly (clang, -O2):
<newContactGroupRecvd>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <debugPrintStr@plt>

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

LLVM IR (-O2):
@.str = [39 x i8] c"command parser: newContactGroupRecvd: \00"
define void @newContactGroupRecvd(i8* %0) {
%2 = tail call i32 @debugPrintStr(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pro_clear();
void classic_clear(void) { pro_clear(); }


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

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

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

LLVM IR (-O2):
define void @classic_clear() {
%1 = tail call i32 (...) @pro_clear()
ret void
}
void fpsimd_enable_trap(void) {}


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

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

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

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