xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
fail(int dev) {
  printf("    test failed at %d\n", dev);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c" test failed at %d\0A\00"
define i32 @fail(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int bit_count(int /*<<< orphan*/);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int mask2prefix(struct in_addr mask) { return bit_count(ntohl(mask.s_addr)); }


x86 assembly (clang, -O0):
<mask2prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,%edi
call   1030 <bit_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask2prefix>:
push   %rax
call   1040 <ntohl@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <bit_count@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @mask2prefix(i32 %0) {
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohl(i32 %5)
%7 = call i32 @bit_count(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mask2prefix(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i32 @bit_count(i32 %2)
ret i32 %3
}
int execute_tee() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_tee() {
ret i32 0
}
int test_imm_54uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x54 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_54uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x54,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_54uint64_midword_reg>:
test   $0x540000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_54uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5505024
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int Idx(int x[4], int mu) {
  int offset = 0, nsites = 1;
  for (int i = 0; i < 4; i++) {
    offset += x[i] * nsites;
    nsites *= 16;
  };
  return offset + mu * nsites;
}


x86 assembly (clang, -O0):
<Idx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    1156 <Idx+0x56>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
imul   -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <Idx+0x20>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Idx>:
mov    0x4(%rdi),%eax
shl    $0x4,%eax
add    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
add    %eax,%ecx
mov    0xc(%rdi),%eax
shl    $0xc,%eax
add    %ecx,%eax
shl    $0x10,%esi
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Idx(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 4
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl nsw i32 %9, 8
%11 = add nsw i32 %10, %7
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = shl nsw i32 %13, 12
%15 = add nsw i32 %14, %11
%16 = shl nsw i32 %1, 16
%17 = add nsw i32 %16, %15
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void load_mod2() { printf("load mod2\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"load mod2\00"
define void @load_mod2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ state;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned get_XEvent_xkey_state(void *_p) {
  return (unsigned)((XEvent *)_p)->xkey.state;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define i32 @get_XEvent_xkey_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEvent_xkey_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void accept() { printf("Accepted\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Accepted\00"
define void @accept() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int returnSigned();
void signed_int() {
  int x = returnSigned();
  if (x < 0) {
    int y = 1 / 0;
  }
}


x86 assembly (clang, -O0):
<signed_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <returnSigned@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112f <signed_int+0x1f>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @signed_int() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @returnSigned()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 poison, i32* %2
br label %7
7: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @signed_int() {
%1 = tail call i32 (...) @returnSigned()
ret void
}
/* Variables and functions */
int rand();
void non_short_circuit() {
  int a, b;
  a = rand();
  b = rand();
  if ((a < b) & (b > a)) {
    a += b;
    return;
  }
  b += a;
  return;
}


x86 assembly (clang, -O0):
<non_short_circuit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
cmp    -0x4(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1162 <non_short_circuit+0x52>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <non_short_circuit+0x5b>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<non_short_circuit>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rand@plt>

LLVM IR (-O0):
define void @non_short_circuit() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
store i32 %3, i32* %1
%4 = call i32 (...) @rand()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = icmp sgt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = and i32 %8, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = load i32, i32* %2
%17 = load i32, i32* %1
%18 = add nsw i32 %17, %16
store i32 %18, i32* %1
br label %23
19: ; preds = %0
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
br label %23
23: ; preds = %19, %15
ret void
}

LLVM IR (-O2):
define void @non_short_circuit() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 (...) @rand()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m4f_copy_m4fo(float *, float *);
int /*<<< orphan*/ m4f_mul_m4fo(float const *, float *, float *);
void m4f_mul_m4f(const float *in, float *in_out) {
  float temp[16];
  m4f_mul_m4fo(in, in_out, temp);
  m4f_copy_m4fo(temp, in_out);
}


x86 assembly (clang, -O0):
<m4f_mul_m4f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <m4f_mul_m4fo@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <m4f_copy_m4fo@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m4f_mul_m4f>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rdx
call   1040 <m4f_mul_m4fo@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <m4f_copy_m4fo@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @m4f_mul_m4f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [16 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%9 = call i32 @m4f_mul_m4fo(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%11 = load float*, float** %4
%12 = call i32 @m4f_copy_m4fo(float* %10, float* %11)
ret void
}

LLVM IR (-O2):
define void @m4f_mul_m4f(float* %0, float* %1) {
%3 = alloca [16 x float]
%4 = bitcast [16 x float]* %3 to i8*
%5 = getelementptr inbounds [16 x float], [16 x float]* %3, i64 0, i64 0
%6 = call i32 @m4f_mul_m4fo(float* %0, float* %1, float* %5)
%7 = call i32 @m4f_copy_m4fo(float* %5, float* %1)
ret void
}
int gagne(int lettreTrouvee[]) {
  int i = 0;
  int joueurGagne = 1;
  for (i = 0; i < 6; i++) {
    if (lettreTrouvee[i] == 0)
      joueurGagne = 0;
  }
  return joueurGagne;
}


x86 assembly (clang, -O0):
<gagne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1153 <gagne+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1140 <gagne+0x40>
movl   $0x0,-0x10(%rbp)
jmp    1145 <gagne+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <gagne+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gagne>:
cmpl   $0x0,(%rdi)
setne  %al
cmpl   $0x0,0x4(%rdi)
setne  %cl
movdqu 0x8(%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqd %xmm0,%xmm1
movmskps %xmm1,%edx
test   %edx,%edx
sete   %dl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @gagne(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = freeze <4 x i32> %9
%11 = icmp eq <4 x i32> %10, zeroinitializer
%12 = bitcast <4 x i1> %11 to i4
%13 = icmp eq i4 %12, 0
%14 = select i1 %13, i1 %6, i1 false
%15 = select i1 %14, i1 %3, i1 false
%16 = zext i1 %15 to i32
ret i32 %16
}
void glUniform2ui(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform2ui() {
ret void
}
void write_be16(unsigned short in, unsigned char *out) {
  out[0] = (in >> 8) & 0xFF;
  out[1] = in & 0xFF;
}


x86 assembly (clang, -O0):
<write_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be16>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

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

LLVM IR (-O2):
define void @write_be16(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_modgolang(int /*<<< orphan*/);
void loop_modgolang(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_modgolang(range);
  }
}


x86 assembly (clang, -O0):
<loop_modgolang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1165 <loop_modgolang+0x55>
mov    -0xc(%rbp),%edi
call   1030 <ranged_random_modgolang@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x18(%rbp)
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <loop_modgolang+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_modgolang>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <loop_modgolang+0x35>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edi
call   1030 <ranged_random_modgolang@plt>
mov    %eax,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <loop_modgolang+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @loop_modgolang(i64 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = phi i32* [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @ranged_random_modgolang(i32 %1)
%10 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %9, i32* %8
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %0
br i1 %12, label %5, label %6
}
int iarr_cmp(int *a, int *b) { return *a - *b; }


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

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

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

LLVM IR (-O2):
define i32 @iarr_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int main(void) {
  pause();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pause()
ret i32 0
}
long getSoftDataLimit(void) { return ((long)67108864); }


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

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

LLVM IR (-O0):
define i64 @getSoftDataLimit() {
ret i64 67108864
}

LLVM IR (-O2):
define i64 @getSoftDataLimit() {
ret i64 67108864
}
void func5() {}


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

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

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

LLVM IR (-O2):
define void @func5() {
ret void
}
/* Variables and functions */
int bar(int);
int foo(int i) { return bar(i); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ler_arquivo();
int main() {
  ler_arquivo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ler_arquivo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
const char *usb_dir_find(void) {
  static char udev_usb_path[] = "/dev/bus/usb";
  if (access(udev_usb_path, F_OK) == 0)
    return udev_usb_path;
  return NULL;
}


x86 assembly (clang, -O0):
<usb_dir_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    1147 <usb_dir_find+0x37>
lea    0x2eea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <usb_dir_find+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_dir_find>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x2f07(%rip),%rbx
mov    %rbx,%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@usb_dir_find.udev_usb_path = internal global [13 x i8] c"/dev/bus/usb\00"
@F_OK = global i32 0
define i8* @usb_dir_find() {
%1 = alloca i8*
%2 = load i32, i32* @F_OK
%3 = call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usb_dir_find.udev_usb_path, i64 0, i64 0), i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usb_dir_find.udev_usb_path, i64 0, i64 0), i8** %1
br label %7
6: ; preds = %0
store i8* null, i8** %1
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@usb_dir_find.udev_usb_path = internal global [13 x i8] c"/dev/bus/usb\00"
@F_OK = global i32 0
define i8* @usb_dir_find() {
%1 = load i32, i32* @F_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usb_dir_find.udev_usb_path, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @usb_dir_find.udev_usb_path, i64 0, i64 0), i8* null
ret i8* %4
}
/* Variables and functions */
char *strdup(char const *);
char *callsystem_path_to_unix(const char *str) { return strdup(str); }


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

x86 assembly (clang, -O2):
<callsystem_path_to_unix>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @callsystem_path_to_unix(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void dl_G_LOADTILE() {}


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

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

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

LLVM IR (-O2):
define void @dl_G_LOADTILE() {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
size_t envlen(const char *var, const char *dir, const char *file) {
  return (strlen(var) + strlen(dir) + strlen(file));
}


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

x86 assembly (clang, -O2):
<envlen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
add    %r12,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @envlen(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %5
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %8, %10
%12 = load i8*, i8** %6
%13 = call i64 @strlen(i8* %12)
%14 = add i64 %11, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @envlen(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add i64 %5, %4
%7 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%8 = add i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ MCG_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void MCG_IRQHandler(void) {
  MCG_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @MCG_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @MCG_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @MCG_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @MCG_DriverIRQHandler()
ret void
}
void lgtd_proto_set_light_from_hsbk(
    struct lgtd_client *client, const struct lgtd_proto_target_list *targets,
    int hue, int saturation, int brightness, int kelvin, int transition_msecs) {
  (void)client;
  (void)targets;
  (void)hue;
  (void)saturation;
  (void)brightness;
  (void)kelvin;
  (void)transition_msecs;
}


x86 assembly (clang, -O0):
<lgtd_proto_set_light_from_hsbk>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_set_light_from_hsbk(%struct.lgtd_client* %0, %struct.lgtd_proto_target_list* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.lgtd_client*
%9 = alloca %struct.lgtd_proto_target_list*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.lgtd_client* %0, %struct.lgtd_client** %8
store %struct.lgtd_proto_target_list* %1, %struct.lgtd_proto_target_list** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load %struct.lgtd_client*, %struct.lgtd_client** %8
%16 = load %struct.lgtd_proto_target_list*, %struct.lgtd_proto_target_list** %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
ret void
}

LLVM IR (-O2):
%struct.lgtd_client = type opaque
%struct.lgtd_proto_target_list = type opaque
define void @lgtd_proto_set_light_from_hsbk(%struct.lgtd_client* nocapture %0, %struct.lgtd_proto_target_list* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *find_user_keys(int /*<<< orphan*/ const *, int);
int has_user_keys(const wchar_t *keys, int mode) {
  return find_user_keys(keys, mode) != NULL;
}


x86 assembly (clang, -O0):
<has_user_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <find_user_keys@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_user_keys>:
push   %rax
call   1030 <find_user_keys@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @has_user_keys(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* @find_user_keys(i32* %5, i32 %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @has_user_keys(i32* %0, i32 %1) {
%3 = tail call i32* @find_user_keys(i32* %0, i32 %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getNext();
void skip(unsigned int datasize) {
  int i;
  for (i = 0; i < datasize; i++) {
    getNext();
  }
  return;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1143 <skip+0x33>
mov    $0x0,%al
call   1030 <getNext@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <skip+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rbx
test   %edi,%edi
je     112c <skip+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getNext@plt>
add    $0xffffffff,%ebx
jne    1120 <skip+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skip(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 (...) @getNext()
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPDIF_DriverIRQHandler();
__attribute__((weak)) void SPDIF_IRQHandler(void) { SPDIF_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @SPDIF_IRQHandler() {
%1 = call i32 (...) @SPDIF_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SPDIF_IRQHandler() {
%1 = tail call i32 (...) @SPDIF_DriverIRQHandler()
ret void
}
/* Variables and functions */
double log(int);
double log10(int);
double log2(int);
int /*<<< orphan*/ printf(char *, int, double, double, double);
void testLog() {
  const int HISTORY_SIZE = 2000;
  int i;
  for (i = 0; i < HISTORY_SIZE; i++) {
    printf("\n%d # l: %f # l10: %f # l2: %f", i, log(i), log10(i), log2(i));
  }
}


x86 assembly (clang, -O0):
<testLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7d0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x7d0,-0x8(%rbp)
jge    11b5 <testLog+0x75>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <log2@plt>
mov    -0x1c(%rbp),%esi
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <testLog+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLog>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %ebx,%ebx
lea    0xeb0(%rip),%r14
mov    %ebx,%edi
call   1050 <log@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
call   1060 <log10@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <log2@plt>
movaps %xmm0,%xmm2
mov    %r14,%rdi
mov    %ebx,%esi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x7d0,%ebx
jne    1150 <testLog+0x10>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A%d # l: %f # l10: %f # l2: %f\00"
define void @testLog() {
%1 = alloca i32
%2 = alloca i32
store i32 2000, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2000
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call double @log(i32 %8)
%10 = load i32, i32* %2
%11 = call double @log10(i32 %10)
%12 = load i32, i32* %2
%13 = call double @log2(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %7, double %9, double %11, double %13)
br label %15
15: ; preds = %6
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A%d # l: %f # l10: %f # l2: %f\00"
define void @testLog() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call double @log(i32 %2)
%4 = tail call double @log10(i32 %2)
%5 = tail call double @log2(i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, double %3, double %4, double %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 2000
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
char *malloc(int const);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *xstrndup(const char *s) {
  const int SIZE = 4088;
  int len = strlen(s);
  char *ret = malloc(SIZE);
  strcpy(ret + SIZE - (len + 1), s);
  return ret + SIZE - (len + 1);
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xff8,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    $0xff8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0xff8,%rdi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0xff8,%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    $0xff8,%edi
call   1050 <malloc@plt>
not    %ebp
movslq %ebp,%rcx
lea    (%rax,%rcx,1),%rbp
add    $0xff8,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @xstrndup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
store i32 4088, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = call i8* @malloc(i32 4088)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 4088
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = sub i64 0, %13
%15 = getelementptr inbounds i8, i8* %10, i64 %14
%16 = load i8*, i8** %2
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 4088
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i8, i8* %19, i64 %23
ret i8* %24
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call dereferenceable_or_null(4088) i8* @malloc(i32 4088)
%4 = getelementptr inbounds i8, i8* %3, i64 4088
%5 = xor i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
ret i8* %7
}
void Friction(double *F, double *q, double *qdot) {}


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

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

LLVM IR (-O0):
define void @Friction(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
ret void
}

LLVM IR (-O2):
define void @Friction(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
ret void
}
int test22(int a, int b, int c, int d) {
  int x = a != b;
  int y = c == 0;
  return x + y;
}


x86 assembly (clang, -O0):
<test22>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test22>:
xor    %ecx,%ecx
cmp    %esi,%edi
setne  %cl
xor    %eax,%eax
test   %edx,%edx
sete   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test22(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test22(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp eq i32 %2, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %8, %6
ret i32 %9
}
int of_overlay_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @of_overlay_init() {
ret i32 0
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void mysleep(long nsecs) {
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = nsecs * 1000;
  nanosleep(&ts, NULL);
  return;
}


x86 assembly (clang, -O0):
<mysleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%rdi,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @mysleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i64, i64* %2
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @mysleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul nsw i64 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %5, i64* %6
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decrypt(int);
int /*<<< orphan*/ print_ch(int /*<<< orphan*/);
int scanf(char *, int *);
int main() {
  int n, read;
  read = scanf("%i", &n);
  while (read == 1) {
    print_ch(decrypt(n));
    read = scanf("%i", &n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1183 <main+0x53>
mov    -0x8(%rbp),%edi
call   1030 <decrypt@plt>
mov    %eax,%edi
call   1040 <print_ch@plt>
lea    0xe8e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x22>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1180 <main+0x50>
lea    0xeaf(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
call   1030 <decrypt@plt>
mov    %eax,%edi
call   1040 <print_ch@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\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 %11
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @decrypt(i32 %6)
%8 = call i32 @print_ch(i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp eq i32 %9, 1
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
void Socket_Init() {}


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

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

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

LLVM IR (-O2):
define void @Socket_Init() {
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_flags;
};

/* Variables and functions */
int /*<<< orphan*/ SA_NOCLDWAIT;
int /*<<< orphan*/ SIGCHLD;
int sigaction(int /*<<< orphan*/, struct sigaction *, struct sigaction *);
void set_not_wait_on_child() {
  int action_success;
  struct sigaction chld_action;
  action_success = sigaction(SIGCHLD, NULL, &chld_action);
  chld_action.sa_flags |= SA_NOCLDWAIT;
  action_success = sigaction(SIGCHLD, &chld_action, NULL);
}


x86 assembly (clang, -O0):
<set_not_wait_on_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sigaction@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_not_wait_on_child>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
mov    %rsp,%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <sigaction@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
or     %eax,(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIGCHLD = global i32 0
@SA_NOCLDWAIT = global i32 0
define void @set_not_wait_on_child() {
%1 = alloca i32
%2 = alloca %struct.sigaction
%3 = load i32, i32* @SIGCHLD
%4 = call i32 @sigaction(i32 %3, %struct.sigaction* null, %struct.sigaction* %2)
store i32 %4, i32* %1
%5 = load i32, i32* @SA_NOCLDWAIT
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = or i32 %7, %5
store i32 %8, i32* %6
%9 = load i32, i32* @SIGCHLD
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %2, %struct.sigaction* null)
store i32 %10, i32* %1
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIGCHLD = global i32 0
@SA_NOCLDWAIT = global i32 0
define void @set_not_wait_on_child() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = load i32, i32* @SIGCHLD
%4 = call i32 @sigaction(i32 %3, %struct.sigaction* null, %struct.sigaction* %1)
%5 = load i32, i32* @SA_NOCLDWAIT
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = or i32 %7, %5
store i32 %8, i32* %6
%9 = load i32, i32* @SIGCHLD
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %1, %struct.sigaction* null)
ret void
}