xunge/DecIR huggingface dataset:
int getDistance(int value, int startVertex, int start, int *shortestPath) {
  if (start == startVertex) {
    return value;
  } else {
    return shortestPath[start] + value;
  }
}


x86 assembly (clang, -O0):
<getDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1128 <getDistance+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <getDistance+0x39>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDistance>:
mov    %edi,%eax
cmp    %esi,%edx
je     110c <getDistance+0xc>
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
ret

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

LLVM IR (-O2):
define i32 @getDistance(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = icmp eq i32 %2, %1
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %3, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %0
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ %10, %6 ], [ %0, %4 ]
ret i32 %12
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (y < 1) {
    while (x >= 0) {
      x = x - y;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    115f <main+0x4f>
jmp    1142 <main+0x32>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x4a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jg     1134 <main+0x24>
test   %ebx,%ebx
js     1134 <main+0x24>
nopl   0x0(%rax)
sub    %eax,%ebx
jns    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp slt i32 %2, 1
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %1, %0 ]
%8 = sub nsw i32 %7, %2
%9 = icmp sgt i32 %8, -1
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
void foo551() {}


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

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

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

LLVM IR (-O2):
define void @foo551() {
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
double myrand(double dummy) {
  double res;
  res = 1.0 * rand() / RAND_MAX;
  return res;
}


x86 assembly (clang, -O0):
<myrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2eae(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @myrand(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @rand()
%5 = fmul double 1.000000e+00, %4
%6 = load double, double* @RAND_MAX
%7 = fdiv double %5, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @myrand(double %0) {
%2 = tail call double (...) @rand()
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
int sched_component_release() {}


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

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

LLVM IR (-O0):
define i32 @sched_component_release() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @sched_component_release() {
ret i32 undef
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int n, i, a = 1;
  if (scanf("%d", &n) != 1) {
    a = 0;
  }
  if (a) {
    printf("%d \n", is_prime(n));
  } else {
    printf("%d \n", -1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1166 <main+0x36>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     118b <main+0x5b>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    119c <main+0x6c>
lea    0xe71(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0xffffffff,%esi
cmp    $0x1,%eax
jne    1157 <main+0x27>
mov    0x4(%rsp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\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 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @is_prime(i32 %6)
br label %8
8: ; preds = %0, %5
%9 = phi i32 [ %7, %5 ], [ -1, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ CreateData();
int /*<<< orphan*/ DataInit();
scalar_t__ ModifyData();
int /*<<< orphan*/ PrintSomeData();
void Debug() {
  DataInit();
  if (CreateData())
    if (ModifyData())
      PrintSomeData();
}


x86 assembly (clang, -O0):
<Debug>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DataInit@plt>
mov    $0x0,%al
call   1060 <CreateData@plt>
cmp    $0x0,%rax
je     1179 <Debug+0x39>
mov    $0x0,%al
call   1040 <ModifyData@plt>
cmp    $0x0,%rax
je     1174 <Debug+0x34>
mov    $0x0,%al
call   1050 <PrintSomeData@plt>
jmp    1179 <Debug+0x39>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Debug>:
push   %rax
xor    %eax,%eax
call   1030 <DataInit@plt>
xor    %eax,%eax
call   1060 <CreateData@plt>
test   %rax,%rax
je     1168 <Debug+0x28>
xor    %eax,%eax
call   1040 <ModifyData@plt>
test   %rax,%rax
je     1168 <Debug+0x28>
xor    %eax,%eax
pop    %rcx
jmp    1050 <PrintSomeData@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @Debug() {
%1 = call i32 (...) @DataInit()
%2 = call i64 (...) @CreateData()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = call i64 (...) @ModifyData()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @PrintSomeData()
br label %9
9: ; preds = %7, %4
br label %10
10: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @Debug() {
%1 = tail call i32 (...) @DataInit()
%2 = tail call i64 (...) @CreateData()
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i64 (...) @ModifyData()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (...) @PrintSomeData()
br label %9
9: ; preds = %4, %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deviceIf_getColourBuffer(void **, int *, unsigned int *);
int /*<<< orphan*/ printf(char *);
void get_cbuf(void **start, unsigned int *used) {
  int length;
  printf("calling deviceIf_getColourBuffer\n");
  deviceIf_getColourBuffer(start, &length, used);
}


x86 assembly (clang, -O0):
<get_cbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1040 <deviceIf_getColourBuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cbuf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <deviceIf_getColourBuffer@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"calling deviceIf_getColourBuffer\0A\00"
define void @get_cbuf(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i32
store i8** %0, i8*** %3
store i32* %1, i32** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = load i8**, i8*** %3
%8 = load i32*, i32** %4
%9 = call i32 @deviceIf_getColourBuffer(i8** %7, i32* %5, i32* %8)
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"calling deviceIf_getColourBuffer\00"
define void @get_cbuf(i8** %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%6 = call i32 @deviceIf_getColourBuffer(i8** %0, i32* %3, i32* %1)
ret void
}
unsigned int slog(unsigned int block) {
  int i;
  for (i = 9; i <= 16; i++)
    if (block == (1 << i))
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<slog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jg     114d <slog+0x4d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    113a <slog+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <slog+0x54>
jmp    113f <slog+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <slog+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slog>:
cmp    $0x1fff,%edi
jg     112b <slog+0x2b>
cmp    $0x7ff,%edi
jg     1149 <slog+0x49>
mov    $0x9,%eax
cmp    $0x200,%edi
je     1174 <slog+0x74>
cmp    $0x400,%edi
jne    1187 <slog+0x87>
mov    $0xa,%eax
ret
cmp    $0x7fff,%edi
jg     115f <slog+0x5f>
cmp    $0x2000,%edi
je     1175 <slog+0x75>
cmp    $0x4000,%edi
jne    1187 <slog+0x87>
mov    $0xe,%eax
ret
cmp    $0x800,%edi
je     117b <slog+0x7b>
cmp    $0x1000,%edi
jne    1187 <slog+0x87>
mov    $0xc,%eax
ret
cmp    $0x8000,%edi
je     1181 <slog+0x81>
cmp    $0x10000,%edi
jne    1187 <slog+0x87>
mov    $0x10,%eax
ret
mov    $0xd,%eax
ret
mov    $0xb,%eax
ret
mov    $0xf,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @slog(i32 %0) {
switch i32 %0, label %2 [
i32 512, label %10
i32 1024, label %3
i32 2048, label %4
i32 4096, label %5
i32 8192, label %6
i32 16384, label %7
i32 32768, label %8
i32 65536, label %9
]
2: ; preds = %1
br label %10
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3, %2
%11 = phi i32 [ 9, %1 ], [ 0, %2 ], [ 10, %3 ], [ 11, %4 ], [ 12, %5 ], [ 13, %6 ], [ 14, %7 ], [ 15, %8 ], [ 16, %9 ]
ret i32 %11
}
int hello2(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<hello2>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @hello2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int uiplib_ipaddrconv(char const *, int, int /*<<< orphan*/ *);
void ipaddrconv(const char *parameter, const char *addrstr, uint8_t *ipaddr) {
  int result = uiplib_ipaddrconv(addrstr, 16, ipaddr);
  if (result == 0) {
    fprintf(stderr, "Error: %s: invalid argument\n", parameter);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<ipaddrconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x10,%esi
call   1030 <uiplib_ipaddrconv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1186 <ipaddrconv+0x56>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipaddrconv>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x10,%esi
call   1030 <uiplib_ipaddrconv@plt>
test   %eax,%eax
je     1147 <ipaddrconv+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define void @ipaddrconv(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i32 @uiplib_ipaddrconv(i8* %8, i32 16, i32* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define void @ipaddrconv(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @uiplib_ipaddrconv(i8* %1, i32 16, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
int getpid(void) { return 0x1337; }


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

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

LLVM IR (-O0):
define i32 @getpid() {
ret i32 4919
}

LLVM IR (-O2):
define i32 @getpid() {
ret i32 4919
}
/* Variables and functions */
int gpio_dir(unsigned int, int /*<<< orphan*/);
int gpio_dir_in(unsigned gpio) { return gpio_dir(gpio, 0); }


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

x86 assembly (clang, -O2):
<gpio_dir_in>:
xor    %esi,%esi
jmp    1030 <gpio_dir@plt>

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

LLVM IR (-O2):
define i32 @gpio_dir_in(i32 %0) {
%2 = tail call i32 @gpio_dir(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int t1_3d_init_spb(unsigned int);
int t1_3d_getspb(unsigned int f) {
  return t1_3d_init_spb(
      (f & (0x00000010 | 0x00000020 | 0x00000040 | 0x00000080 | 0x00000100 |
            0x00000200)) |
      ((f >> 16) & (0x0400 | 0x0800 | 0x1000 | 0x2000 | 0x4000 | 0x8000)));
}


x86 assembly (clang, -O0):
<t1_3d_getspb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x3f0,%edi
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xfc00,%eax
or     %eax,%edi
call   1030 <t1_3d_init_spb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_3d_getspb>:
mov    %edi,%eax
and    $0x3f0,%eax
shr    $0x10,%edi
and    $0xfc00,%edi
or     %eax,%edi
jmp    1030 <t1_3d_init_spb@plt>

LLVM IR (-O0):
define i32 @t1_3d_getspb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1008
%5 = load i32, i32* %2
%6 = lshr i32 %5, 16
%7 = and i32 %6, 64512
%8 = or i32 %4, %7
%9 = call i32 @t1_3d_init_spb(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @t1_3d_getspb(i32 %0) {
%2 = and i32 %0, 1008
%3 = lshr i32 %0, 16
%4 = and i32 %3, 64512
%5 = or i32 %4, %2
%6 = tail call i32 @t1_3d_init_spb(i32 %5)
ret i32 %6
}
unsigned short int f46(unsigned short int x, unsigned long int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned short) - y));
}


x86 assembly (clang, -O0):
<f46>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f46>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f46(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub i64 16, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f46(i16 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i16
%4 = tail call i16 @llvm.fshr.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
void gen_tabs(void) {}


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

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

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

LLVM IR (-O2):
define void @gen_tabs() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_mixed_volume(int i, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(90, &i, mv, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_mixed_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5a,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_mixed_volume>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x5a,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_mixed_volume(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 90, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_mixed_volume(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 90, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void throw(int n) {
  fprintf(stderr, "throw called (%d)\n", n);
  _exit(1);
}


x86 assembly (clang, -O0):
<throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<throw>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"throw called (%d)\0A\00"
define void @throw(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
int /*<<< orphan*/ printf(char *, int);
void getI(int ID) {
  int iVal;
  iVal = dxl_read_byte(ID, 27);
  if (0)
    printf("dynamixel iVal %d\n", iVal);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<getI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1b,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getI>:
push   %rax
mov    $0x1b,%esi
call   1040 <dxl_read_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @getI(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 27)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @getI(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 27)
%3 = tail call i32 (...) @PrintErrorCode()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int sumsqrs(int);
int main(int argc, char *argv[]) {
  printf("sumsqrs(3) = %d, sumsqrs(6) = %d, sumsqrs(9) = %d\n", sumsqrs(3),
         sumsqrs(6), sumsqrs(9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <sumsqrs@plt>
mov    %eax,-0x18(%rbp)
mov    $0x6,%edi
call   1040 <sumsqrs@plt>
mov    %eax,-0x14(%rbp)
mov    $0x9,%edi
call   1040 <sumsqrs@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <sumsqrs@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1040 <sumsqrs@plt>
mov    %eax,%ebp
mov    $0x9,%edi
call   1040 <sumsqrs@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [51 x i8] c"sumsqrs(3) = %d, sumsqrs(6) = %d, sumsqrs(9) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sumsqrs(i32 3)
%4 = tail call i32 @sumsqrs(i32 6)
%5 = tail call i32 @sumsqrs(i32 9)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
char *msg();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", msg());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <msg@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @msg()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ print_iflist(int);
int /*<<< orphan*/ rec_log(char *, long);
void sigusr1_handler(int sig) {
  rec_log("info: SIGUSR1 called(PID: %ld)", (long)getpid());
  print_iflist(1);
  print_iflist(2);
}


x86 assembly (clang, -O0):
<sigusr1_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1050 <rec_log@plt>
mov    $0x1,%edi
call   1030 <print_iflist@plt>
mov    $0x2,%edi
call   1030 <print_iflist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigusr1_handler>:
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1050 <rec_log@plt>
mov    $0x1,%edi
call   1030 <print_iflist@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <print_iflist@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"info: SIGUSR1 called(PID: %ld)\00"
define void @sigusr1_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @getpid()
%4 = call i32 @rec_log(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 @print_iflist(i32 1)
%6 = call i32 @print_iflist(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"info: SIGUSR1 called(PID: %ld)\00"
define void @sigusr1_handler(i32 %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i32 @rec_log(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @print_iflist(i32 1)
%5 = tail call i32 @print_iflist(i32 2)
ret void
}
int wlan_11h_get_random_num(t_void) { return 112233; }


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

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

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

LLVM IR (-O2):
define i32 @wlan_11h_get_random_num(i32 %0) {
ret i32 112233
}
/* Variables and functions */
int /*<<< orphan*/ machine_init();
int mode_init(void) {
  machine_init();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @mode_init() {
%1 = call i32 (...) @machine_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @mode_init() {
%1 = tail call i32 (...) @machine_init()
ret i32 0
}
/* Variables and functions */
scalar_t__ memcmp(unsigned char *, char *, int);
int loader_BASICODE_check(const char *filename, unsigned char *data,
                          long size) {
  if (size >= 5)
    if (memcmp(data, "1000 ", 5) == 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<loader_BASICODE_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x5,-0x20(%rbp)
jl     115f <loader_BASICODE_check+0x4f>
mov    -0x18(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    115a <loader_BASICODE_check+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1166 <loader_BASICODE_check+0x56>
jmp    115f <loader_BASICODE_check+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_BASICODE_check>:
cmp    $0x5,%rdx
jl     1138 <loader_BASICODE_check+0x28>
push   %rax
lea    0xee2(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x5,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     113b <loader_BASICODE_check+0x2b>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1000 \00"
define i32 @loader_BASICODE_check(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = icmp sge i64 %8, 5
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i64 @memcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %4
br label %17
15: ; preds = %10
br label %16
16: ; preds = %15, %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"1000 \00"
define i32 @loader_BASICODE_check(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = icmp sgt i64 %2, 4
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i64 @memcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5, %3
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %10
}
unsigned long long max(long long unsigned a, long long unsigned b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void debug_print_spaces(int n) {
  while (n--)
    printk("   ");
}


x86 assembly (clang, -O0):
<debug_print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <debug_print_spaces+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printk@plt>
jmp    111b <debug_print_spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_print_spaces>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <debug_print_spaces+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printk@plt>
add    $0xffffffff,%ebx
jne    1130 <debug_print_spaces+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
define void @debug_print_spaces(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
define void @debug_print_spaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void md_run_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @md_run_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_tuxcall;
scalar_t__ syscall(int /*<<< orphan*/, unsigned long);
void *netmalloc(unsigned long size) {
  return (void *)((intptr_t)syscall(__NR_tuxcall, size));
}


x86 assembly (clang, -O0):
<netmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmalloc>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_tuxcall = global i32 0
define i8* @netmalloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @__NR_tuxcall
%4 = load i64, i64* %2
%5 = call i64 @syscall(i32 %3, i64 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
@__NR_tuxcall = global i32 0
define i8* @netmalloc(i64 %0) {
%2 = load i32, i32* @__NR_tuxcall
%3 = tail call i64 @syscall(i32 %2, i64 %0)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void writeByteToPort(unsigned short portNumber, unsigned char value) {
  asm volatile("outb %1, %0" : : "dN"(portNumber), "a"(value));
}


x86 assembly (clang, -O0):
<writeByteToPort>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeByteToPort>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @writeByteToPort(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
int int_shifts_are_arithmetic(void) {
  int x = ~0;
  return (x >> 1) == x;
}


x86 assembly (clang, -O0):
<int_shifts_are_arithmetic>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_shifts_are_arithmetic() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = ashr i32 %2, 1
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @int_shifts_are_arithmetic() {
ret i32 1
}
/* Variables and functions */
char *calloc(int, int);
void clean(char **s) { *s = calloc(sizeof(char), 255); }


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @clean(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @calloc(i32 1, i32 255)
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
ret void
}

LLVM IR (-O2):
define void @clean(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(255) i8* @calloc(i32 1, i32 255)
store i8* %2, i8** %0
ret void
}
float vector2_dot(const float lhs[], const float rhs[]) {
  return lhs[0] * rhs[0] + lhs[1] * rhs[1];
}


x86 assembly (clang, -O0):
<vector2_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector2_dot>:
movss  0x4(%rdi),%xmm1
mulss  0x4(%rsi),%xmm1
movss  (%rdi),%xmm0
mulss  (%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vector2_dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
ret float %18
}

LLVM IR (-O2):
define float @vector2_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
ret float %10
}
void reloadFirstHalf() {}


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

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

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

LLVM IR (-O2):
define void @reloadFirstHalf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_23(void) {
  fprintf(stderr, "test_ais_23() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_23>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_23>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_23() failed: Not Written\0A\00"
define i32 @test_ais_23() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"test_ais_23() failed: Not Written\0A\00"
define i32 @test_ais_23() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void in_close(void *p_user) {}


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

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

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

LLVM IR (-O2):
define void @in_close(i8* nocapture %0) {
ret void
}
unsigned long EEPROMBlockCountGet(void) {
  return (((((*((volatile unsigned long *)(0x400AF000)))) & 0x07FF0000) >> 16));
}


x86 assembly (clang, -O0):
<EEPROMBlockCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400af000,%eax
mov    (%rax),%rax
and    $0x7ff0000,%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockCountGet>:
mov    0x400af000,%rax
40
shr    $0x10,%eax
and    $0x7ff,%eax
ret

LLVM IR (-O0):
define i64 @EEPROMBlockCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = and i64 %1, 134152192
%3 = lshr i64 %2, 16
ret i64 %3
}

LLVM IR (-O2):
define i64 @EEPROMBlockCountGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = lshr i64 %1, 16
%3 = and i64 %2, 2047
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f1(void) { printf("in f1()\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"in f1()\00"
define void @f1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SUB_HOST_REG_L(int, int);
int /*<<< orphan*/ addbyte(int);
int CMP_HOST_REG_L(int dst_reg, int src_reg) {
  if (dst_reg & 8) {
    addbyte(0x44);
    addbyte(0x89);
    addbyte(0xc0 | ((dst_reg & 7) << 3) | 2);
    dst_reg = 2;
  }
  SUB_HOST_REG_L(dst_reg, src_reg);
  return dst_reg;
}


x86 assembly (clang, -O0):
<CMP_HOST_REG_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     116f <CMP_HOST_REG_L+0x4f>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     $0x2,%edi
call   1030 <addbyte@plt>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <SUB_HOST_REG_L@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_HOST_REG_L>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   $0x8,%bpl
je     1158 <CMP_HOST_REG_L+0x38>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     $0xc2,%ebp
movzbl %bpl,%edi
call   1030 <addbyte@plt>
mov    $0x2,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <SUB_HOST_REG_L@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @CMP_HOST_REG_L(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 @addbyte(i32 68)
%10 = call i32 @addbyte(i32 137)
%11 = load i32, i32* %3
%12 = and i32 %11, 7
%13 = shl i32 %12, 3
%14 = or i32 192, %13
%15 = or i32 %14, 2
%16 = call i32 @addbyte(i32 %15)
store i32 2, i32* %3
br label %17
17: ; preds = %8, %2
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @SUB_HOST_REG_L(i32 %18, i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @CMP_HOST_REG_L(i32 %0, i32 %1) {
%3 = and i32 %0, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @addbyte(i32 68)
%7 = tail call i32 @addbyte(i32 137)
%8 = shl i32 %0, 3
%9 = and i32 %8, 56
%10 = or i32 %9, 194
%11 = tail call i32 @addbyte(i32 %10)
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 2, %5 ], [ %0, %2 ]
%14 = tail call i32 @SUB_HOST_REG_L(i32 %13, i32 %1)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ trap_MemFree(void *, char *, int);
void CG_GS_Free(void *data) {
  trap_MemFree(data,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/"
               "heads/master/cgame/cg_main.c",
               232);
}


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

x86 assembly (clang, -O2):
<CG_GS_Free>:
lea    0xee9(%rip),%rsi
mov    $0xe8,%edx
jmp    1030 <trap_MemFree@plt>

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/cgame/cg_main.c\00"
define void @CG_GS_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @trap_MemFree(i8* %3, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 232)
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ptitSeb/warsow-pandora/refs/heads/master/cgame/cg_main.c\00"
define void @CG_GS_Free(i8* %0) {
%2 = tail call i32 @trap_MemFree(i8* %0, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 232)
ret void
}