xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0;
  signed long long s = 9223372036854775807;
  assert(s > 9223372036854775806);
  signed long long t = s + 2;
  assert(t == -9223372036854775807);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
cmp    %rax,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
movabs $0x8000000000000001,%rax
cmp    %rax,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %2
store i64 9223372036854775807, i64* %3
%5 = load i64, i64* %3
%6 = icmp sgt i64 %5, 9223372036854775806
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %3
%10 = add nsw i64 %9, 2
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, -9223372036854775807
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__default__initTimerB();
void Msp430ClockP__Msp430ClockInit__initTimerB(void) {
  Msp430ClockP__Msp430ClockInit__default__initTimerB();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__initTimerB() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__default__initTimerB()
ret void
}
void i2d_OCSP_REQUEST(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_REQUEST() {
ret void
}
void generate_machine_code(
    struct instructions const *__restrict const instructions) {}


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

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

LLVM IR (-O0):
%struct.instructions = type opaque
define void @generate_machine_code(%struct.instructions* noalias %0) {
%2 = alloca %struct.instructions*
store %struct.instructions* %0, %struct.instructions** %2
ret void
}

LLVM IR (-O2):
%struct.instructions = type opaque
define void @generate_machine_code(%struct.instructions* noalias nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ idiv64(int /*<<< orphan*/, int /*<<< orphan*/);
int32_t idiv(int32_t num, int32_t den) { return (int32_t)idiv64(num, den); }


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

x86 assembly (clang, -O2):
<idiv>:
jmp    1030 <idiv64@plt>

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

LLVM IR (-O2):
define i32 @idiv(i32 %0, i32 %1) {
%3 = tail call i32 @idiv64(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  int a, b;
  float c, d;
  a = 13;
  b = 5;
  c = a / b;
  d = (float)a / (float)b;
  printf("[integers]\t a = %d\tb = %d\n", a, b);
  printf("[floats]\t c = %f\td = %f\n", c, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xd,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
movss  0xecc(%rip),%xmm0
movss  0xec8(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"[integers]\09 a = %d\09b = %d\0A\00"
@.str.1 = [25 x i8] c"[floats]\09 c = %f\09d = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 13, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to float
store float %8, float* %3
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to float
%13 = fdiv float %10, %12
store float %13, float* %4
%14 = load i32, i32* %1
%15 = sitofp i32 %14 to float
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to float
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), float %15, float %17)
%19 = load float, float* %3
%20 = load float, float* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), float %19, float %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"[integers]\09 a = %d\09b = %d\0A\00"
@.str.1 = [25 x i8] c"[floats]\09 c = %f\09d = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), float 1.300000e+01, float 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), float 2.000000e+00, float 0x4004CCCCC0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print0(int);
void parent() {
  int i = 100;
  while (i--) {
    print0(100);
  }
}


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1142 <parent+0x32>
mov    $0x64,%edi
call   1030 <print0@plt>
jmp    111f <parent+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
push   %rbx
mov    $0xffffff9c,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <print0@plt>
inc    %ebx
jne    1120 <parent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @parent() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -1
%4 = tail call i32 @print0(i32 100)
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int f2();
int f1() {
  int x;
  x = f2();
  return 1 + x;
}


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

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

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca i32
%2 = call i32 (...) @f2()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @f1() {
%1 = tail call i32 (...) @f2()
%2 = add nsw i32 %1, 1
ret i32 %2
}
char *strcat(char *restrict s1, const char *restrict s2) {
  char *rc = s1;
  if (*s1) {
    while (*++s1)
      ;
  }
  while ((*s1++ = *s2++))
    ;
  return rc;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <strcat+0x49>
jmp    1126 <strcat+0x26>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
je     1144 <strcat+0x44>
jmp    1126 <strcat+0x26>
jmp    1149 <strcat+0x49>
jmp    114e <strcat+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     117d <strcat+0x7d>
jmp    114e <strcat+0x4e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     111d <strcat+0x1d>
mov    %rax,%rdx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rdx),%rdi
cmpb   $0x0,0x1(%rdx)
mov    %rdi,%rdx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nop
movzbl (%rsi,%rdx,1),%ecx
mov    %cl,(%rdi,%rdx,1)
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %7, %5 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i8* [ %0, %2 ], [ %7, %5 ]
br label %12
12: ; preds = %10, %12
%13 = phi i8* [ %15, %12 ], [ %1, %10 ]
%14 = phi i8* [ %17, %12 ], [ %11, %10 ]
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %13
%17 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %16, i8* %14
%18 = icmp eq i8 %16, 0
br i1 %18, label %19, label %12
19: ; preds = %12
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ sh_setenv(char *, char *);
int /*<<< orphan*/ unset_local_var(char *);
void export_and_set(char *name, char *value) {
  unset_local_var(name);
  sh_setenv(name, value);
}


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

x86 assembly (clang, -O2):
<export_and_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <unset_local_var@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sh_setenv@plt>

LLVM IR (-O0):
define void @export_and_set(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @unset_local_var(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sh_setenv(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @export_and_set(i8* %0, i8* %1) {
%3 = tail call i32 @unset_local_var(i8* %0)
%4 = tail call i32 @sh_setenv(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STC31xx_WriteByte8(int, int);
void STC311x_Reset(void) { STC31xx_WriteByte8(0x01, 0x11); }


x86 assembly (clang, -O0):
<STC311x_Reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x11,%esi
call   1030 <STC31xx_WriteByte8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC311x_Reset>:
mov    $0x1,%edi
mov    $0x11,%esi
jmp    1030 <STC31xx_WriteByte8@plt>

LLVM IR (-O0):
define void @STC311x_Reset() {
%1 = call i32 @STC31xx_WriteByte8(i32 1, i32 17)
ret void
}

LLVM IR (-O2):
define void @STC311x_Reset() {
%1 = tail call i32 @STC31xx_WriteByte8(i32 1, i32 17)
ret void
}
/* Variables and functions */
char *read_file_line(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *read_line(void) { return read_file_line(stdin); }


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

x86 assembly (clang, -O2):
<read_line>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <read_file_line@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i8* @read_line() {
%1 = load i32, i32* @stdin
%2 = call i8* @read_file_line(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @read_line() {
%1 = load i32, i32* @stdin
%2 = tail call i8* @read_file_line(i32 %1)
ret i8* %2
}
int my_div(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<my_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @my_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int fun1334() { return 1334; }


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

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

LLVM IR (-O0):
define i32 @fun1334() {
ret i32 1334
}

LLVM IR (-O2):
define i32 @fun1334() {
ret i32 1334
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ seed;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
uint64_t seedgen(void) {
  uint64_t seed = 0;
  FILE *urandom = fopen("/dev/urandom", "rb");
  int r = fread(&seed, sizeof(seed), 1, urandom);
  (void)r;
  assert(r == 1);
  fclose(urandom);
  return seed;
}


x86 assembly (clang, -O0):
<seedgen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedgen>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeac(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @seedgen() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fread(i32* %1, i32 4, i32 1, i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32*, i32** %2
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [3 x i8] c"rb\00"
define i32 @seedgen() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fread(i32* %1, i32 4, i32 1, i32* %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @fclose(i32* %3)
%9 = load i32, i32* %1
ret i32 %9
}
/* Variables and functions */
bool glmAll3(const bool x[3]) { return x[0] && x[1] && x[2]; }


x86 assembly (clang, -O0):
<glmAll3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
je     113b <glmAll3+0x3b>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x0,0x4(%rcx)
mov    %al,-0x9(%rbp)
je     113b <glmAll3+0x3b>
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmAll3>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
je     1116 <glmAll3+0x16>
cmpl   $0x0,0x4(%rdi)
je     1116 <glmAll3+0x16>
xor    %eax,%eax
cmpl   $0x0,0x8(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @glmAll3(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %7, %1
%18 = phi i1 [ false, %7 ], [ false, %1 ], [ %16, %12 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @glmAll3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from deeper.c\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello from deeper.c\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 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Hello from deeper.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *(cstrchr)(const char *s, int c) {
  while (*s != '\0' && *s != (char)c)
    s++;
  return ((*s == c) ? (char *)s : 0);
}


x86 assembly (clang, -O0):
<cstrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1135 <cstrchr+0x35>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <cstrchr+0x45>
jmp    1156 <cstrchr+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <cstrchr+0xb>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1173 <cstrchr+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117e <cstrchr+0x7e>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117e <cstrchr+0x7e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrchr>:
mov    (%rdi),%al
test   %al,%al
je     1123 <cstrchr+0x23>
movsbl %sil,%ecx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edx
cmp    %edx,%ecx
je     1125 <cstrchr+0x25>
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <cstrchr+0x10>
xor    %eax,%eax
movsbl %al,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @cstrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ %0, %2 ], [ %14, %13 ], [ %10, %8 ]
%19 = phi i8 [ 0, %2 ], [ 0, %13 ], [ %9, %8 ]
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, %1
%22 = select i1 %21, i8* %18, i8* null
ret i8* %22
}
void _glapi_check_table(const struct _glapi_table *table) {}


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

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

LLVM IR (-O0):
%struct._glapi_table = type opaque
define void @_glapi_check_table(%struct._glapi_table* %0) {
%2 = alloca %struct._glapi_table*
store %struct._glapi_table* %0, %struct._glapi_table** %2
ret void
}

LLVM IR (-O2):
%struct._glapi_table = type opaque
define void @_glapi_check_table(%struct._glapi_table* nocapture %0) {
ret void
}
/* Variables and functions */
double exp(double);
void vexp(double *a, double *b, int n) {
  int i;
  for (i = 0; i < n; i++) {
    a[i] = exp(b[i]);
  }
}


x86 assembly (clang, -O0):
<vexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1163 <vexp+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <vexp+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vexp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    114a <vexp+0x3a>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <vexp+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vexp(double* nocapture writeonly %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = tail call double @exp(double %10)
%12 = getelementptr inbounds double, double* %0, i64 %8
store double %11, double* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tokenization_error(int, char *, char *);
void not_in_dict(char *stat_name) {
  tokenization_error(0x04000000, "Word  %s  is not in dictionary.\n",
                     stat_name);
}


x86 assembly (clang, -O0):
<not_in_dict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x4000000,%edi
lea    0xed4(%rip),%rsi
call   1030 <tokenization_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_in_dict>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x4000000,%edi
jmp    1030 <tokenization_error@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Word %s is not in dictionary.\0A\00"
define void @not_in_dict(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tokenization_error(i32 67108864, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Word %s is not in dictionary.\0A\00"
define void @not_in_dict(i8* %0) {
%2 = tail call i32 @tokenization_error(i32 67108864, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reopen_logs();
void logrotate_signal(int signo) { reopen_logs(); }


x86 assembly (clang, -O0):
<logrotate_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reopen_logs@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @logrotate_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @reopen_logs()
ret void
}

LLVM IR (-O2):
define void @logrotate_signal(i32 %0) {
%2 = tail call i32 (...) @reopen_logs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int lower_middle_free(void *ctx) {
  do
    if (ctx) {
      free(ctx);
      (ctx) = NULL;
    }
  while (0);
  return 0;
}


x86 assembly (clang, -O0):
<lower_middle_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <lower_middle_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    113d <lower_middle_free+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_middle_free>:
test   %rdi,%rdi
je     111f <lower_middle_free+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lower_middle_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret i32 0
}
int gcd_algorithm(int x, int y) {
  if (x == 0) {
    return y;
  }
  return gcd_algorithm((y % x), x);
}


x86 assembly (clang, -O0):
<gcd_algorithm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd_algorithm+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd_algorithm+0x37>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd_algorithm@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_algorithm>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd_algorithm+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_algorithm+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd_algorithm(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %6, %4 ]
ret i32 %10
}
unsigned int MDIOPhyAliveStatusGet(unsigned int baseAddr) {
  return ((*((volatile unsigned int *)(baseAddr + (0x8)))));
}


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

x86 assembly (clang, -O2):
<MDIOPhyAliveStatusGet>:
add    $0x8,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @MDIOPhyAliveStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @MDIOPhyAliveStatusGet(i32 %0) {
%2 = add i32 %0, 8
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ toupper(char);
void capitalize(char *str, int len) {
  int i;
  for (i = 0; i < len; i++) {
    str[i] = (char)toupper(str[i]);
  }
}


x86 assembly (clang, -O0):
<capitalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <capitalize+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <capitalize+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capitalize>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <capitalize+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <capitalize+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @capitalize(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @toupper(i8 signext %9)
%11 = trunc i64 %10 to i8
store i8 %11, i8* %8
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int check_abs(char *path, char *name) {
  if (path[0] != '/') {
    fprintf(stderr, "ERROR: %s path is not absolute\n", name);
    printf("ERROR\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1171 <check_abs+0x51>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <check_abs+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_abs>:
push   %rax
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
je     1151 <check_abs+0x31>
mov    %rsi,%rdx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: %s path is not absolute\0A\00"
@.str.1 = [7 x i8] c"ERROR\0A\00"
define i32 @check_abs(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 47
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %5
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: %s path is not absolute\0A\00"
@str = [6 x i8] c"ERROR\00"
define i32 @check_abs(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 47
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %10
}
extern unsigned long long PassULongLong(unsigned long long *llg) {
  return *llg;
}


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

x86 assembly (clang, -O2):
<PassULongLong>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @PassULongLong(i64* nocapture %0) {
%2 = load i64, i64* %0
ret i64 %2
}
void pause() { __asm__ __volatile__("pause"); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
double pow(int, double);
double round(double);
double round_digits(double a, double exp) {
  return round(a * pow(10, exp)) / pow(10, exp);
}


x86 assembly (clang, -O0):
<round_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <round@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_digits>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
movapd %xmm1,%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
call   1040 <round@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0xa,%edi
movsd  0x10(%rsp),%xmm0
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @round_digits(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @pow(i32 10, double %6)
%8 = fmul double %5, %7
%9 = call double @llvm.round.f64(double %8)
%10 = load double, double* %4
%11 = call double @pow(i32 10, double %10)
%12 = fdiv double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @round_digits(double %0, double %1) {
%3 = tail call double @pow(i32 10, double %1)
%4 = fmul double %3, %0
%5 = tail call double @llvm.round.f64(double %4)
%6 = tail call double @pow(i32 10, double %1)
%7 = fdiv double %5, %6
ret double %7
}
unsigned int bsp_coresight_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bsp_coresight_init() {
ret i32 0
}
/* Variables and functions */
bool isPowerOfTwo(int n) {
  if (n < 0x01) {
    return false;
  }
  if (0x01 == n)
    return true;
  while (0x00 == n % 2) {
    if (0x01 == (n = n / 2)) {
      return true;
    }
  };
  return false;
}


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <isPowerOfTwo+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1186 <isPowerOfTwo+0x86>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1137 <isPowerOfTwo+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1186 <isPowerOfTwo+0x86>
jmp    113c <isPowerOfTwo+0x3c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    117f <isPowerOfTwo+0x7f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x1,%eax
cmp    %ecx,%eax
jne    117a <isPowerOfTwo+0x7a>
movl   $0x1,-0x4(%rbp)
jmp    1186 <isPowerOfTwo+0x86>
jmp    113c <isPowerOfTwo+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
xor    %eax,%eax
test   %edi,%edi
jle    112e <isPowerOfTwo+0x2e>
cmp    $0x1,%edi
je     1129 <isPowerOfTwo+0x29>
nopl   0x0(%rax,%rax,1)
test   $0x1,%dil
jne    112e <isPowerOfTwo+0x2e>
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
and    $0xfffffffe,%edi
cmp    $0x2,%edi
mov    %ecx,%edi
jne    1110 <isPowerOfTwo+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 1
br i1 %4, label %13, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ %0, %3 ]
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = sdiv i32 %6, 2
%11 = and i32 %6, -2
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}
void av_strlcpy() {}


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

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

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

LLVM IR (-O2):
define void @av_strlcpy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_div(unsigned long long, unsigned int);
unsigned long ps_to_hz(unsigned int psvalue) {
  unsigned long long numerator = 1000 * 1000 * 1000 * 1000ULL;
  do_div(numerator, psvalue);
  return (unsigned long)numerator;
}


x86 assembly (clang, -O0):
<ps_to_hz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movabs $0xe8d4a51000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <do_div@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_to_hz>:
push   %rbx
mov    %edi,%esi
movabs $0xe8d4a51000,%rbx
mov    %rbx,%rdi
call   1030 <do_div@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ps_to_hz(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 1000000000000, i64* %3
%4 = load i64, i64* %3
%5 = load i32, i32* %2
%6 = call i32 @do_div(i64 %4, i32 %5)
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @ps_to_hz(i32 %0) {
%2 = tail call i32 @do_div(i64 1000000000000, i32 %0)
ret i64 1000000000000
}
int test_imm_CEint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xce,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEint64_highword_mem>:
testb  $0xce,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CEint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 206
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_CEint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 884763262976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void put_unaligned_be32(uint32_t val, void *ptr) {
  uint8_t *p = ptr;
  p[0] = val >> 24;
  p[1] = val >> 16;
  p[2] = val >> 8;
  p[3] = val;
}


x86 assembly (clang, -O0):
<put_unaligned_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_unaligned_be32>:
mov    %edi,%eax
sar    $0x18,%eax
mov    %eax,(%rsi)
mov    %edi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rsi)
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rsi)
mov    %edi,0xc(%rsi)
ret

LLVM IR (-O0):
define void @put_unaligned_be32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = ashr i32 %8, 24
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %3
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32, i32* %3
%17 = ashr i32 %16, 8
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %3
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @put_unaligned_be32(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 24
store i32 %4, i32* %3
%5 = ashr i32 %0, 16
%6 = getelementptr inbounds i8, i8* %1, i64 4
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
%8 = ashr i32 %0, 8
%9 = getelementptr inbounds i8, i8* %1, i64 8
%10 = bitcast i8* %9 to i32*
store i32 %8, i32* %10
%11 = getelementptr inbounds i8, i8* %1, i64 12
%12 = bitcast i8* %11 to i32*
store i32 %0, i32* %12
ret void
}