xunge/DecIR huggingface dataset:
int foo(int parm) {
  int varj, varm;
  for (varj = 0; varj < 10; varj++) {
    if (varj == 5)
      continue;
    if (varj == 7 && !parm)
      goto exitlab;
    if (varj == 9)
      break;
    varm = varj;
  }
exitlab:
  return varm;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1163 <foo+0x63>
cmpl   $0x5,-0x8(%rbp)
jne    1127 <foo+0x27>
jmp    1155 <foo+0x55>
cmpl   $0x7,-0x8(%rbp)
jne    1140 <foo+0x40>
cmpl   $0x0,-0x4(%rbp)
jne    1140 <foo+0x40>
jmp    1168 <foo+0x68>
cmpl   $0x9,-0x8(%rbp)
jne    114f <foo+0x4f>
jmp    1163 <foo+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <foo+0xe>
jmp    1168 <foo+0x68>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
jmp    1117 <foo+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%edx
add    $0x1,%ecx
mov    %edx,%eax
cmp    $0x5,%ecx
je     1110 <foo+0x10>
mov    %ecx,%edx
xor    $0x7,%edx
or     %edi,%edx
sete   %sil
cmp    $0x9,%ecx
je     1133 <foo+0x33>
mov    %ecx,%edx
test   %sil,%sil
je     1112 <foo+0x12>
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br label %3
3: ; preds = %1, %12
%4 = phi i32 [ 0, %1 ], [ %14, %12 ]
%5 = phi i32 [ undef, %1 ], [ %13, %12 ]
%6 = icmp eq i32 %4, 5
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = icmp eq i32 %4, 7
%9 = and i1 %2, %8
%10 = icmp eq i32 %4, 9
%11 = or i1 %10, %9
br i1 %11, label %15, label %12
12: ; preds = %7, %3
%13 = phi i32 [ %5, %3 ], [ %4, %7 ]
%14 = add nuw nsw i32 %4, 1
br label %3
15: ; preds = %7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int inicial, primo, final, total;
  inicial = 0;
  final = 0;
  total = 0;
  while (total < 1000) {
    primo = (2 * inicial) + 1;
    final = final + primo;
    total = total + 1;
    inicial++;
  }
  printf("la suma de todos los impares del 1 al 1000 es:\t%d\n", final);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    116d <main+0x5d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
mov    -0x10(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"la suma de todos los impares del 1 al 1000 es:\09%d\0A\00"
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 0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %2
%11 = mul nsw i32 2, %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %6
20: ; preds = %6
%21 = load i32, i32* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"la suma de todos los impares del 1 al 1000 es:\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 1000000)
ret i32 0
}
int Abs(int a) {
  if (a < 0)
    a = -a;
  return (a);
}


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <Abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @Abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int computePostfix(char *);
int /*<<< orphan*/ convertToPostfix(char *, char *);
char *malloc(int);
int compute(char *infix) {
  char *postfix = malloc(80 * sizeof(char));
  convertToPostfix(infix, postfix);
  return computePostfix(postfix);
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <convertToPostfix@plt>
mov    -0x10(%rbp),%rdi
call   1030 <computePostfix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <convertToPostfix@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <computePostfix@plt>

LLVM IR (-O0):
define i32 @compute(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 80)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @convertToPostfix(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @computePostfix(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compute(i8* %0) {
%2 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
%3 = tail call i32 @convertToPostfix(i8* %0, i8* %2)
%4 = tail call i32 @computePostfix(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
int /*<<< orphan*/ tranoutchar(int, int);
void flash_8() {
  int i;
  for (i = 5; i < 8; i++) {
    tranoutchar(i, 50);
    delay_ms(300);
    delay_ms(300);
  }
}


x86 assembly (clang, -O0):
<flash_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    1168 <flash_8+0x48>
mov    -0x4(%rbp),%edi
mov    $0x32,%esi
call   1040 <tranoutchar@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <flash_8+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_8>:
push   %rax
mov    $0x5,%edi
mov    $0x32,%esi
call   1040 <tranoutchar@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x6,%edi
mov    $0x32,%esi
call   1040 <tranoutchar@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x7,%edi
mov    $0x32,%esi
call   1040 <tranoutchar@plt>
mov    $0x12c,%edi
call   1030 <delay_ms@plt>
mov    $0x12c,%edi
pop    %rax
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @flash_8() {
%1 = alloca i32
store i32 5, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @tranoutchar(i32 %6, i32 50)
%8 = call i32 @delay_ms(i32 300)
%9 = call i32 @delay_ms(i32 300)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @flash_8() {
%1 = tail call i32 @tranoutchar(i32 5, i32 50)
%2 = tail call i32 @delay_ms(i32 300)
%3 = tail call i32 @delay_ms(i32 300)
%4 = tail call i32 @tranoutchar(i32 6, i32 50)
%5 = tail call i32 @delay_ms(i32 300)
%6 = tail call i32 @delay_ms(i32 300)
%7 = tail call i32 @tranoutchar(i32 7, i32 50)
%8 = tail call i32 @delay_ms(i32 300)
%9 = tail call i32 @delay_ms(i32 300)
ret void
}
/* Variables and functions */
int b2();
int c2() { return b2() + 1; }


x86 assembly (clang, -O0):
<c2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <b2@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2>:
push   %rax
xor    %eax,%eax
call   1030 <b2@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @c2() {
%1 = call i32 (...) @b2()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @c2() {
%1 = tail call i32 (...) @b2()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void mfence(void) { assert(!"mfence() NYI for ARM"); }


x86 assembly (clang, -O0):
<mfence>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfence>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"mfence() NYI for ARM\00"
define void @mfence() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @mfence() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SWAP_int(int *);
void SWAP_ints(int *val, int n) {
  while (n > 0) {
    SWAP_int(val);
    val++;
    n--;
  }
}


x86 assembly (clang, -O0):
<SWAP_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114c <SWAP_ints+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <SWAP_int@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <SWAP_ints+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP_ints>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <SWAP_ints+0x24>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
mov    %rbx,%rdi
call   1030 <SWAP_int@plt>
add    $0x4,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <SWAP_ints+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @SWAP_ints(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 @SWAP_int(i32* %6)
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = add nsw i32 %5, -1
%10 = icmp ugt i32 %5, 1
br i1 %10, label %4, label %11
11: ; preds = %4, %2
ret void
}
int d_bun_cr1(double a1) { return (__builtin_isunordered(100, a1)); }


x86 assembly (clang, -O0):
<d_bun_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bun_cr1>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

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

LLVM IR (-O2):
define i32 @d_bun_cr1(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
int main() {
  if (0) {
    return 1;
  } else if (0) {
  } else {
    if (1) {
      if (0)
        return 1;
      else
        return 0;
    } else {
      return 1;
    }
  }
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
unsigned long errno;
unsigned long __syscall_common(unsigned long err) {
  if (err < -4095UL)
    return err;
  errno = -err;
  return -1;
}


x86 assembly (clang, -O0):
<__syscall_common>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xfffffffffffff001,-0x10(%rbp)
ff
jae    1123 <__syscall_common+0x23>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113d <__syscall_common+0x3d>
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x10(%rbp),%rcx
mov    0x2eae(%rip),%rax
mov    %rcx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_common>:
mov    %rdi,%rax
cmp    $0xfffffffffffff001,%rdi
jb     1120 <__syscall_common+0x20>
neg    %rax
mov    0x2eca(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i64 0
define i64 @__syscall_common(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, -4095
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %3
store i64 %7, i64* %2
br label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = sub i64 0, %9
store i64 %10, i64* @errno
store i64 -1, i64* %2
br label %11
11: ; preds = %8, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
@errno = global i64 0
define i64 @__syscall_common(i64 %0) {
%2 = icmp ult i64 %0, -4095
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = sub nsw i64 0, %0
store i64 %4, i64* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ -1, %3 ], [ %0, %1 ]
ret i64 %6
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_bpf_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_ATTACH;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_attach(int prog_fd, int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.target_fd = target_fd;
  attr.attach_bpf_fd = prog_fd;
  attr.attach_type = type;
  return sys_bpf(BPF_PROG_ATTACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <bzero@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_attach>:
push   %rax
mov    %edx,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 @bzero(%union.bpf_attr* %7, i32 4)
%9 = load i32, i32* %5
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = bitcast %union.bpf_attr* %7 to i32*
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = bitcast %union.bpf_attr* %7 to i32*
store i32 %13, i32* %14
%15 = load i32, i32* @BPF_PROG_ATTACH
%16 = call i32 @sys_bpf(i32 %15, %union.bpf_attr* %7, i32 4)
ret i32 %16
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @BPF_PROG_ATTACH
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %4, i32 4)
ret i32 %8
}
void gtk_tree_view_row_expanded() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_row_expanded() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outdig(unsigned long);
void outnum(unsigned long num) {
  int i;
  for (i = 0; i < 8; i++) {
    outdig(num >> 28);
    num <<= 4;
  }
}


x86 assembly (clang, -O0):
<outnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1154 <outnum+0x44>
mov    -0x8(%rbp),%rdi
shr    $0x1c,%rdi
call   1030 <outdig@plt>
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <outnum+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outnum>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
shr    $0x1c,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0x18,%rdi
movabs $0xfffffffff,%r14
and    %r14,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0x14,%rdi
and    %r14,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0x10,%rdi
and    %r14,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0xc,%rdi
and    %r14,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0x8,%rdi
and    %r14,%rdi
call   1030 <outdig@plt>
mov    %rbx,%rdi
shr    $0x4,%rdi
and    %r14,%rdi
call   1030 <outdig@plt>
and    %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <outdig@plt>

LLVM IR (-O0):
define void @outnum(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i64, i64* %2
%9 = lshr i64 %8, 28
%10 = call i32 @outdig(i64 %9)
%11 = load i64, i64* %2
%12 = shl i64 %11, 4
store i64 %12, i64* %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @outnum(i64 %0) {
%2 = lshr i64 %0, 28
%3 = tail call i32 @outdig(i64 %2)
%4 = lshr i64 %0, 24
%5 = and i64 %4, 68719476735
%6 = tail call i32 @outdig(i64 %5)
%7 = lshr i64 %0, 20
%8 = and i64 %7, 68719476735
%9 = tail call i32 @outdig(i64 %8)
%10 = lshr i64 %0, 16
%11 = and i64 %10, 68719476735
%12 = tail call i32 @outdig(i64 %11)
%13 = lshr i64 %0, 12
%14 = and i64 %13, 68719476735
%15 = tail call i32 @outdig(i64 %14)
%16 = lshr i64 %0, 8
%17 = and i64 %16, 68719476735
%18 = tail call i32 @outdig(i64 %17)
%19 = lshr i64 %0, 4
%20 = and i64 %19, 68719476735
%21 = tail call i32 @outdig(i64 %20)
%22 = and i64 %0, 68719476735
%23 = tail call i32 @outdig(i64 %22)
ret void
}
void copy_refs(struct lisp *lisp, struct object *obj) {}


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

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

LLVM IR (-O0):
%struct.lisp = type opaque
%struct.object = type opaque
define void @copy_refs(%struct.lisp* %0, %struct.object* %1) {
%3 = alloca %struct.lisp*
%4 = alloca %struct.object*
store %struct.lisp* %0, %struct.lisp** %3
store %struct.object* %1, %struct.object** %4
ret void
}

LLVM IR (-O2):
%struct.lisp = type opaque
%struct.object = type opaque
define void @copy_refs(%struct.lisp* nocapture %0, %struct.object* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void event_handler(int sigum) {
  int value = 8;
  printf("bma150 got interrupt signal\n");
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"bma150 got interrupt signal\00"
define void @event_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function();
int main(void) {
  function();
  function();
  function();
  function();
  function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @function()
%2 = tail call i32 (...) @function()
%3 = tail call i32 (...) @function()
%4 = tail call i32 (...) @function()
%5 = tail call i32 (...) @function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void MacroTune(int devHandle, int channel) { fprintf(stderr, "MacroTune\n"); }


x86 assembly (clang, -O0):
<MacroTune>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MacroTune>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"MacroTune\0A\00"
define void @MacroTune(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"MacroTune\0A\00"
define void @MacroTune(i32 %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int container_compare(const void *a, const void *b) {
  const char *ar = *(const char **)a;
  const char *br = *(const char **)b;
  return strcmp(ar, br);
}


x86 assembly (clang, -O0):
<container_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<container_compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @container_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @container_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: calc [mathematical expression]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: calc [mathematical expression]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [38 x i8] c"Usage: calc [mathematical expression]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ mb();
int /*<<< orphan*/ outer_sync();
int /*<<< orphan*/ writel(unsigned int, unsigned int);
void dramc_reg_write(unsigned int addr, unsigned int value) {
  writel(value, addr);
  mb();
  outer_sync();
  mb();
}


x86 assembly (clang, -O0):
<dramc_reg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <writel@plt>
mov    $0x0,%al
call   1030 <mb@plt>
mov    $0x0,%al
call   1040 <outer_sync@plt>
mov    $0x0,%al
call   1030 <mb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dramc_reg_write>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1050 <writel@plt>
xor    %eax,%eax
call   1030 <mb@plt>
xor    %eax,%eax
call   1040 <outer_sync@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mb@plt>

LLVM IR (-O0):
define void @dramc_reg_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @writel(i32 %5, i32 %6)
%8 = call i32 (...) @mb()
%9 = call i32 (...) @outer_sync()
%10 = call i32 (...) @mb()
ret void
}

LLVM IR (-O2):
define void @dramc_reg_write(i32 %0, i32 %1) {
%3 = tail call i32 @writel(i32 %1, i32 %0)
%4 = tail call i32 (...) @mb()
%5 = tail call i32 (...) @outer_sync()
%6 = tail call i32 (...) @mb()
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
unsigned int recvfrom(int, char *, unsigned int, int /*<<< orphan*/,
                      struct sockaddr *, int /*<<< orphan*/ *);
unsigned int socket_get_packet(int fd, struct sockaddr_in *sa, socklen_t *salen,
                               char *buf, unsigned int bufsize) {
  return recvfrom(fd, buf, bufsize, 0, (struct sockaddr *)sa, salen);
}


x86 assembly (clang, -O0):
<socket_get_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
xor    %ecx,%ecx
call   1030 <recvfrom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_get_packet>:
mov    %rdx,%r9
mov    %rsi,%rax
mov    %rcx,%rsi
mov    %r8d,%edx
xor    %ecx,%ecx
mov    %rax,%r8
jmp    1030 <recvfrom@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_get_packet(i32 %0, %struct.sockaddr_in* %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.sockaddr_in*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %9
%13 = load i32, i32* %10
%14 = load %struct.sockaddr_in*, %struct.sockaddr_in** %7
%15 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%16 = load i32*, i32** %8
%17 = call i32 @recvfrom(i32 %11, i8* %12, i32 %13, i32 0, %struct.sockaddr* %15, i32* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @socket_get_packet(i32 %0, %struct.sockaddr_in* %1, i32* %2, i8* %3, i32 %4) {
%6 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%7 = tail call i32 @recvfrom(i32 %0, i8* %3, i32 %4, i32 0, %struct.sockaddr* %6, i32* %2)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t ecmgcw_get_cpnum(uint8_t *p_param) {
  return (p_param[0] << 8) | p_param[1];
}


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

x86 assembly (clang, -O2):
<ecmgcw_get_cpnum>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ecmgcw_get_cpnum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ecmgcw_get_cpnum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
void **_zero_arr_plus_voidstar_fn(void **, int, int, char const *,
                                  unsigned int);
void **_zero_arr_inplace_plus_voidstar_fn(void ***x, int orig_i,
                                          const char *filename,
                                          unsigned lineno) {
  *x = _zero_arr_plus_voidstar_fn(*x, 1, orig_i, filename, lineno);
  return *x;
}


x86 assembly (clang, -O0):
<_zero_arr_inplace_plus_voidstar_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%esi
call   1030 <_zero_arr_plus_voidstar_fn@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_inplace_plus_voidstar_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x1,%esi
call   1030 <_zero_arr_plus_voidstar_fn@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i8** @_zero_arr_inplace_plus_voidstar_fn(i8*** nocapture %0, i32 %1, i8* %2, i32 %3) {
%5 = load i8**, i8*** %0
%6 = tail call i8** @_zero_arr_plus_voidstar_fn(i8** %5, i32 1, i32 %1, i8* %2, i32 %3)
store i8** %6, i8*** %0
ret i8** %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t next_auth_code() {
  static uint32_t next = 114466;
  uint32_t retval = next;
  next = ((next >> 17) ^ (next << 3)) * 31337;
  return retval;
}


x86 assembly (clang, -O0):
<next_auth_code>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0x2f0d(%rip),%eax
sar    $0x11,%eax
mov    0x2f04(%rip),%ecx
shl    $0x3,%ecx
xor    %ecx,%eax
imul   $0x7a69,%eax,%eax
mov    %eax,0x2ef3(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_auth_code>:
mov    0x2f1a(%rip),%eax
lea    0x0(,%rax,8),%ecx
mov    %eax,%edx
sar    $0x11,%edx
xor    %edx,%ecx
imul   $0x7a69,%ecx,%ecx
mov    %ecx,0x2f00(%rip)
ret

LLVM IR (-O0):
@next_auth_code.next = internal global i32 114466
define i32 @next_auth_code() {
%1 = alloca i32
%2 = load i32, i32* @next_auth_code.next
store i32 %2, i32* %1
%3 = load i32, i32* @next_auth_code.next
%4 = ashr i32 %3, 17
%5 = load i32, i32* @next_auth_code.next
%6 = shl i32 %5, 3
%7 = xor i32 %4, %6
%8 = mul nsw i32 %7, 31337
store i32 %8, i32* @next_auth_code.next
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@next_auth_code.next = internal unnamed_addr global i32 114466
define i32 @next_auth_code() {
%1 = load i32, i32* @next_auth_code.next
%2 = ashr i32 %1, 17
%3 = shl i32 %1, 3
%4 = xor i32 %2, %3
%5 = mul nsw i32 %4, 31337
store i32 %5, i32* @next_auth_code.next
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ update_btv_sensor();
int /*<<< orphan*/ update_ir_sensors();
int /*<<< orphan*/ update_sr_sensors();
int /*<<< orphan*/ update_wl_sensors();
void update_all_sensors() {
  update_btv_sensor();
  update_wl_sensors();
  update_ir_sensors();
  update_sr_sensors();
}


x86 assembly (clang, -O0):
<update_all_sensors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <update_btv_sensor@plt>
mov    $0x0,%al
call   1030 <update_wl_sensors@plt>
mov    $0x0,%al
call   1060 <update_ir_sensors@plt>
mov    $0x0,%al
call   1040 <update_sr_sensors@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_all_sensors>:
push   %rax
xor    %eax,%eax
call   1050 <update_btv_sensor@plt>
xor    %eax,%eax
call   1030 <update_wl_sensors@plt>
xor    %eax,%eax
call   1060 <update_ir_sensors@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <update_sr_sensors@plt>

LLVM IR (-O0):
define void @update_all_sensors() {
%1 = call i32 (...) @update_btv_sensor()
%2 = call i32 (...) @update_wl_sensors()
%3 = call i32 (...) @update_ir_sensors()
%4 = call i32 (...) @update_sr_sensors()
ret void
}

LLVM IR (-O2):
define void @update_all_sensors() {
%1 = tail call i32 (...) @update_btv_sensor()
%2 = tail call i32 (...) @update_wl_sensors()
%3 = tail call i32 (...) @update_ir_sensors()
%4 = tail call i32 (...) @update_sr_sensors()
ret void
}
/* Variables and functions */
void *enmalloc(int, size_t);
void *emalloc(size_t size) { return enmalloc(1, size); }


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

x86 assembly (clang, -O2):
<emalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <enmalloc@plt>

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

LLVM IR (-O2):
define i8* @emalloc(i64 %0) {
%2 = tail call i8* @enmalloc(i32 1, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function(int i) {
  int j = i;
  printf("%d ", j);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @function(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void e820_mark_nosave_regions(void) {}


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

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

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

LLVM IR (-O2):
define void @e820_mark_nosave_regions() {
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int tswitch() { return syscall(6, 0, 0); }


x86 assembly (clang, -O0):
<tswitch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tswitch>:
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @tswitch() {
%1 = call i32 @syscall(i32 6, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @tswitch() {
%1 = tail call i32 @syscall(i32 6, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void qEmpty() {
  printf("Queue is empty\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Queue is empty\00"
define void @qEmpty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int isPower2(int x) {
  int mask = ~0;
  int sign = (x >> 31);
  return ((!(x & (x + mask))) & (!sign) & (!!x));
}


x86 assembly (clang, -O0):
<isPower2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0xc(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmpl   $0x0,-0x4(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPower2>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
test   %eax,%edi
sete   %cl
mov    %edi,%edx
not    %edx
shr    $0x1f,%edx
xor    %eax,%eax
test   %edi,%edi
setne  %al
and    %edx,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isPower2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = and i32 %7, %10
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = and i32 %14, %18
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = and i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @isPower2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
%5 = xor i32 %0, -1
%6 = lshr i32 %5, 31
%7 = icmp ne i32 %0, 0
%8 = zext i1 %7 to i32
%9 = and i32 %6, %8
%10 = and i32 %9, %4
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  time_t current_time;
  if (time(&current_time) < 0) {
    perror("time");
  }
  printf("%ld\n", current_time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <time@plt>
cmp    $0x0,%rax
jge    115e <main+0x2e>
lea    0xea7(%rip),%rdi
call   1050 <perror@plt>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
test   %rax,%rax
js     1154 <main+0x24>
mov    0x4(%rsp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
jmp    1140 <main+0x10>

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

LLVM IR (-O2):
@.str = [5 x i8] c"time\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @time(i32* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int fatorialQuadruplo(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O fatorial quaduplo de 5: %d", fatorialQuadruplo(5));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"O fatorial quaduplo de 5: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fatorialQuadruplo(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"O fatorial quaduplo de 5: %d\00"
define i32 @main() {
%1 = tail call i32 @fatorialQuadruplo(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Swap(int *, int, int);
void reverse(int Array[], int lo, int hi) {
  if (lo < hi) {
    Swap(Array, lo, hi);
    reverse(Array, lo + 1, hi - 1);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1162 <reverse+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1136 <reverse+0x26>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
nop
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <Swap@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebx,%ebp
jl     1120 <reverse+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @reverse(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* %5
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @Swap(i32* %11, i32 %12, i32 %13)
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
br label %20
20: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @reverse(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %2, %3 ]
%7 = phi i32 [ %9, %5 ], [ %1, %3 ]
%8 = tail call i32 @Swap(i32* %0, i32 %7, i32 %6)
%9 = add nsw i32 %7, 1
%10 = add nsw i32 %6, -1
%11 = icmp slt i32 %9, %10
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}