xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ d3;
typedef int /*<<< orphan*/ d2;
typedef int /*<<< orphan*/ d1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct D1 {
    char c;
    int i;
    float f;
  };
  struct D1 d1;
  printf("%ld\n", sizeof(d1));
  struct D2 {
    int i;
    char c;
    float f;
  };
  struct D2 d2;
  printf("%ld\n", sizeof(d2));
  struct D3 {
    int i;
    float f;
    char c;
  };
  struct D3 d3;
  printf("%ld\n", sizeof(d3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.D1 = type { i8, i32, float }
%struct.D2 = type { i32, i8, float }
%struct.D3 = type { i32, float, i8 }
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.D1
%3 = alloca %struct.D2
%4 = alloca %struct.D3
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
%struct.D1 = type { i8, i32, float }
%struct.D2 = type { i32, i8, float }
%struct.D3 = type { i32, float, i8 }
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MFRC522_Set_Bit(int, int);
void MFRC522_AntennaOn() { MFRC522_Set_Bit(0x14, 0x03); }


x86 assembly (clang, -O0):
<MFRC522_AntennaOn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
mov    $0x3,%esi
call   1030 <MFRC522_Set_Bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MFRC522_AntennaOn>:
mov    $0x14,%edi
mov    $0x3,%esi
jmp    1030 <MFRC522_Set_Bit@plt>

LLVM IR (-O0):
define void @MFRC522_AntennaOn() {
%1 = call i32 @MFRC522_Set_Bit(i32 20, i32 3)
ret void
}

LLVM IR (-O2):
define void @MFRC522_AntennaOn() {
%1 = tail call i32 @MFRC522_Set_Bit(i32 20, i32 3)
ret void
}
void callfun(void (*fun)()) {
  fun();
  return;
}


x86 assembly (clang, -O0):
<callfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callfun>:
xor    %eax,%eax
jmp    *%rdi

LLVM IR (-O0):
define void @callfun(void (...)* %0) {
%2 = alloca void (...)*
store void (...)* %0, void (...)** %2
%3 = load void (...)*, void (...)** %2
ret void
}

LLVM IR (-O2):
define void @callfun(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Type definitions */
struct rcu_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pr_cont(char *, int);
void print_cpu_stall_info(struct rcu_state *rsp, int cpu) {
  pr_cont(" %d", cpu);
}


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

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

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

LLVM IR (-O2):
%struct.rcu_state = type { i32 }
@.str = [4 x i8] c" %d\00"
define void @print_cpu_stall_info(%struct.rcu_state* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @pr_cont(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int floateq(float f1, float f2) {
  float diff = f1 - f2;
  if (diff > 0 && diff < 0.005)
    return 1;
  if (diff < 0 && diff > -0.005)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<floateq>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1155 <floateq+0x55>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <floateq+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1190 <floateq+0x90>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1189 <floateq+0x89>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1189 <floateq+0x89>
movl   $0x1,-0x4(%rbp)
jmp    1190 <floateq+0x90>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floateq>:
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
cvtss2sd %xmm0,%xmm2
movsd  0xee7(%rip),%xmm3
ucomisd %xmm2,%xmm3
seta   %cl
and    %al,%cl
ucomiss %xmm0,%xmm1
seta   %al
ucomisd 0xed8(%rip),%xmm2
seta   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @floateq(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
store float %9, float* %6
%10 = load float, float* %6
%11 = fcmp ogt float %10, 0.000000e+00
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = fcmp olt double %14, 5.000000e-03
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %3
br label %26
17: ; preds = %12, %2
%18 = load float, float* %6
%19 = fcmp olt float %18, 0.000000e+00
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = fcmp ogt double %22, -5.000000e-03
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20, %17
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %16
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @floateq(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fcmp ogt float %3, 0.000000e+00
%5 = fpext float %3 to double
%6 = fcmp olt double %5, 5.000000e-03
%7 = and i1 %4, %6
%8 = fcmp olt float %3, 0.000000e+00
%9 = fcmp ogt double %5, -5.000000e-03
%10 = and i1 %8, %9
%11 = or i1 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xcirculaterequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xcirculaterequest_display(void *_p) {
  return (void *)((XEvent *)_p)->xcirculaterequest.display;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i8* @get_XEvent_xcirculaterequest_display(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 i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_XEvent_xcirculaterequest_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_halt(void) { op_write1(0x76); }


x86 assembly (clang, -O0):
<op_enc_halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x76,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_halt>:
mov    $0x76,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_halt() {
%1 = call i32 @op_write1(i32 118)
ret void
}

LLVM IR (-O2):
define void @op_enc_halt() {
%1 = tail call i32 @op_write1(i32 118)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_to_sr(char *);
void i_ori_sr(void) { op_to_sr("or"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"or\00"
define void @i_ori_sr() {
%1 = tail call i32 @op_to_sr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *const,
                           void const *const);
int system(char *);
int addr2line(char const *const program_name, void const *const addr) {
  char addr2line_cmd[512] = {0};
  sprintf(addr2line_cmd, "addr2line -f -p -e %.256s %p", program_name, addr);
  return system(addr2line_cmd);
}


x86 assembly (clang, -O0):
<addr2line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1040 <memset@plt>
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe94(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr2line>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    $0x200,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xea5(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %r15,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [29 x i8] c"addr2line -f -p -e %.256s %p\00"
define i32 @addr2line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast [512 x i8]* %5 to i8*
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @system(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"addr2line -f -p -e %.256s %p\00"
define i32 @addr2line(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret i32 %6
}
/* Type definitions */
struct foo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_bybitcount(struct foo *);
int /*<<< orphan*/ insert_bynumber(struct foo *);
struct foo *new_foo(int);
void new_entry(int number) {
  struct foo *p;
  p = new_foo(number);
  insert_bynumber(p);
  insert_bybitcount(p);
}


x86 assembly (clang, -O0):
<new_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <new_foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <insert_bynumber@plt>
mov    -0x10(%rbp),%rdi
call   1030 <insert_bybitcount@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_entry>:
push   %rbx
call   1040 <new_foo@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <insert_bynumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <insert_bybitcount@plt>

LLVM IR (-O0):
%struct.foo = type { i32 }
define void @new_entry(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.foo*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.foo* @new_foo(i32 %4)
store %struct.foo* %5, %struct.foo** %3
%6 = load %struct.foo*, %struct.foo** %3
%7 = call i32 @insert_bynumber(%struct.foo* %6)
%8 = load %struct.foo*, %struct.foo** %3
%9 = call i32 @insert_bybitcount(%struct.foo* %8)
ret void
}

LLVM IR (-O2):
%struct.foo = type { i32 }
define void @new_entry(i32 %0) {
%2 = tail call %struct.foo* @new_foo(i32 %0)
%3 = tail call i32 @insert_bynumber(%struct.foo* %2)
%4 = tail call i32 @insert_bybitcount(%struct.foo* %2)
ret void
}
cbuf9(f, n) int f, n;
{ cbuf(f, n, 9); }


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

x86 assembly (clang, -O2):
<cbuf9>:
mov    $0x9,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf9(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 9)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf9(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 9)
ret i32 undef
}
unsigned int read_timer(int x) {
  unsigned long count = 0;
  return count;
}


x86 assembly (clang, -O0):
<read_timer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_timer(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int /*<<< orphan*/ sqlite3_reset(int /*<<< orphan*/ *);
void finishedStmt(sqlite3_stmt *stmt) { sqlite3_reset(stmt); }


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

x86 assembly (clang, -O2):
<finishedStmt>:
jmp    1030 <sqlite3_reset@plt>

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

LLVM IR (-O2):
define void @finishedStmt(i32* %0) {
%2 = tail call i32 @sqlite3_reset(i32* %0)
ret void
}
void test_non_identifiers() {
  int i, x;
#pragma omp parallel
#pragma omp for;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp for linear(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp for private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp for, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1194 <test_non_identifiers+0x94>
jmp    1186 <test_non_identifiers+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <test_non_identifiers+0x77>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ShowHelp() {
  printf("Usage : simpiler [OPTION] .... \n\n"
         "A simple c compiler for SPIM\n\n"
         "Arguments:\n"
         "-i file \t\t Input file\n"
         "-o file \t\t Output file\n"
         "-t \t\t\t Dumps token list to stdout\n"
         "-s\t\t\t Dumps symbols list to stdout\n"
         "-h \t\t\t Show this help\n\n"
         "argument -i is mondatory\n\n"
         "Report bugs to pyapar@gmail.com\n\n");
}


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

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

LLVM IR (-O0):
@.str = [271 x i8] c"Usage : simpiler [OPTION] .... \0A\0AA simple c compiler for SPIM\0A\0AArguments:\0A-i file \09\09 Input file\0A-o file \09\09 Output file\0A-t \09\09\09 Dumps token list to stdout\0A-s\09\09\09 Dumps symbols list to stdout\0A-h \09\09\09 Show this help\0A\0Aargument -i is mondatory\0A\0AReport bugs to pyapar@gmail.com\0A\0A\00"
define void @ShowHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [270 x i8] c"Usage : simpiler [OPTION] .... \0A\0AA simple c compiler for SPIM\0A\0AArguments:\0A-i file \09\09 Input file\0A-o file \09\09 Output file\0A-t \09\09\09 Dumps token list to stdout\0A-s\09\09\09 Dumps symbols list to stdout\0A-h \09\09\09 Show this help\0A\0Aargument -i is mondatory\0A\0AReport bugs to pyapar@gmail.com\0A\00"
define void @ShowHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([270 x i8], [270 x i8]* @str, i64 0, i64 0))
ret void
}
void swaparoni(char *x, char *y) {
  char temp;
  temp = *x;
  *x = *y;
  *y = temp;
}


x86 assembly (clang, -O0):
<swaparoni>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swaparoni>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @swaparoni(i8* %0, i8* %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
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swaparoni(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int Operand_brall_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0 << 4)) != 0;
  *valp = *valp >> 4;
  return error;
}


x86 assembly (clang, -O0):
<Operand_brall_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_brall_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
shr    $0x4,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_brall_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 4
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_brall_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = lshr i32 %2, 4
store i32 %5, i32* %0
ret i32 %4
}
/* Variables and functions */
long double remainder(double, double);
__attribute__((weak)) long double remainderl(long double x, long double y) {
  return remainder((double)x, (double)y);
}


x86 assembly (clang, -O0):
<remainderl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <remainder@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainderl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <remainder@plt>

LLVM IR (-O0):
define weak x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @remainder(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define weak x86_fp80 @remainderl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @remainder(double %3, double %4)
ret x86_fp80 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int run_file(char *);
int /*<<< orphan*/ run_repl();
int main(int argc, char *argv[]) {
  if (argc > 1) {
    return run_file(argv[1]);
  } else {
    run_repl();
  }
  return EXIT_SUCCESS;
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <run_file@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <main+0x48>
mov    $0x0,%al
call   1040 <run_repl@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1030 <run_file@plt>
xor    %eax,%eax
call   1040 <run_repl@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @run_file(i8* %11)
store i32 %12, i32* %3
br label %17
13: ; preds = %2
%14 = call i32 (...) @run_repl()
br label %15
15: ; preds = %13
%16 = load i32, i32* @EXIT_SUCCESS
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @run_file(i8* %6)
br label %11
8: ; preds = %2
%9 = tail call i32 (...) @run_repl()
%10 = load i32, i32* @EXIT_SUCCESS
br label %11
11: ; preds = %8, %4
%12 = phi i32 [ %7, %4 ], [ %10, %8 ]
ret i32 %12
}
int foo3() { return 3; }


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

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

LLVM IR (-O0):
define i32 @foo3() {
ret i32 3
}

LLVM IR (-O2):
define i32 @foo3() {
ret i32 3
}
/* Variables and functions */
int natstrcmp(char const *const, char const *const);
int natcmp(const void *p1, const void *p2) {
  const char *const *ps1 = p1;
  const char *const *ps2 = p2;
  return natstrcmp(*ps1, *ps2);
}


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

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

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

LLVM IR (-O2):
define i32 @natcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @natstrcmp(i8* %5, i8* %6)
ret i32 %7
}
int isdigstr(s)
char *s;
{
  char *x;
  for (x = s; *x != 0; x++)
    if (!isdigit(*x))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<isdigstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <isdigstr+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1155 <isdigstr+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1172 <isdigstr+0x62>
jmp    115a <isdigstr+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <isdigstr+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigstr>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1126 <isdigstr+0x26>
add    $0x1,%rdi
nop
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jae    1127 <isdigstr+0x27>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isdigstr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isdigstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %7
4: ; preds = %7
%5 = load i8, i8* %13
%6 = icmp eq i8 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %13, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 10
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %4, label %14
14: ; preds = %7, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ clean_stdin();
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int choix() {
  int c;
  c = 0;
  printf("choix : ");
  if (scanf("%d", &c) == 1)
    ;
  else
    c = 0;
  clean_stdin();
  return c;
}


x86 assembly (clang, -O0):
<choix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1169 <choix+0x39>
jmp    1170 <choix+0x40>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <clean_stdin@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choix>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1163 <choix+0x33>
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1040 <clean_stdin@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"choix : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choix() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %0, %6
%8 = call i32 (...) @clean_stdin()
%9 = load i32, i32* %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int usage(int isError) {
  fprintf(isError ? stderr : stdout,
          "Usage: \n"
          " jfdb meta /db/path\n"
          " jfdb node /db/path [offset]\n"
          " jfdb keys /db/path [-n] [-p|-i] [prefix]\n"
          " jfdb find /db/path [-n] [-p|-i] [prefix]\n"
          " jfdb load /db/path\n"
          " jfdb wipe /db/path\n");
  return isError;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <usage+0x26>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <usage+0x32>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1120 <usage+0x10>
mov    0x2eba(%rip),%rax
jmp    1127 <usage+0x17>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [182 x i8] c"Usage: \0A jfdb meta /db/path\0A jfdb node /db/path [offset]\0A jfdb keys /db/path [-n] [-p|-i] [prefix]\0A jfdb find /db/path [-n] [-p|-i] [prefix]\0A jfdb load /db/path\0A jfdb wipe /db/path\0A\00"
define i32 @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [182 x i8] c"Usage: \0A jfdb meta /db/path\0A jfdb node /db/path [offset]\0A jfdb keys /db/path [-n] [-p|-i] [prefix]\0A jfdb find /db/path [-n] [-p|-i] [prefix]\0A jfdb load /db/path\0A jfdb wipe /db/path\0A\00"
define i32 @usage(i32 returned %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str, i64 0, i64 0))
ret i32 %0
}
/* Variables and functions */
int lw_sock_recv_buffer_ex(int *, char *, int);
int lw_sock_recv_buffer(int *sock, char *buffer, int len) {
  int result = 0;
  result = lw_sock_recv_buffer_ex(sock, buffer, len);
  return result;
}


x86 assembly (clang, -O0):
<lw_sock_recv_buffer>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lw_sock_recv_buffer_ex@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_sock_recv_buffer>:
jmp    1030 <lw_sock_recv_buffer_ex@plt>

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

LLVM IR (-O2):
define i32 @lw_sock_recv_buffer(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @lw_sock_recv_buffer_ex(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hammingWeight(uint32_t n) {
  int w = 0;
  while (n) {
    w++;
    n &= (n - 1);
  }
  return w;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <hammingWeight+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
je     111c <hammingWeight+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add nsw i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int bclr_l(int *, int *);
int intr_wrap_519(int p1, int p2) { return bclr_l(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_519>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <bclr_l@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_519(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @bclr_l(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_519(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @bclr_l(i32* %3, i32* %4)
ret i32 %5
}
/* Variables and functions */
int main_elastic_poll(unsigned int, char **);
int main(int argc, char **argv) {
  return main_elastic_poll((unsigned)argc, argv);
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main_elastic_poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <main_elastic_poll@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @main_elastic_poll(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @main_elastic_poll(i32 %0, i8** %1)
ret i32 %3
}
void abcdefghijklm8nopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcdefghijklm8nopqrstuvwxzy() {
ret void
}
int valueOfSymbol(char c) {
  switch (c) {
  case 'I':
    return 1;
  case 'V':
    return 5;
  case 'X':
    return 10;
  case 'L':
    return 50;
  case 'C':
    return 100;
  case 'D':
    return 500;
  case 'M':
    return 1000;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valueOfSymbol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x15,%eax
ja     1188 <valueOfSymbol+0x88>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x5,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0xa,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x32,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x64,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x1f4,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x3e8,-0x4(%rbp)
jmp    118f <valueOfSymbol+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueOfSymbol>:
add    $0xffffffbd,%edi
cmp    $0x15,%edi
ja     1129 <valueOfSymbol+0x29>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x64,%eax
ret
mov    $0x1f4,%eax
ret
xor    %eax,%eax
ret
mov    $0x32,%eax
ret
mov    $0x5,%eax
ret
mov    $0xa,%eax
ret
mov    $0x3e8,%eax
ret

LLVM IR (-O0):
define i32 @valueOfSymbol(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 73, label %6
i32 86, label %7
i32 88, label %8
i32 76, label %9
i32 67, label %10
i32 68, label %11
i32 77, label %12
]
6: ; preds = %1
store i32 1, i32* %2
br label %14
7: ; preds = %1
store i32 5, i32* %2
br label %14
8: ; preds = %1
store i32 10, i32* %2
br label %14
9: ; preds = %1
store i32 50, i32* %2
br label %14
10: ; preds = %1
store i32 100, i32* %2
br label %14
11: ; preds = %1
store i32 500, i32* %2
br label %14
12: ; preds = %1
store i32 1000, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @valueOfSymbol(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 73, label %10
i32 86, label %3
i32 88, label %4
i32 76, label %5
i32 67, label %6
i32 68, label %7
i32 77, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i32 [ 0, %9 ], [ 1000, %8 ], [ 500, %7 ], [ 100, %6 ], [ 50, %5 ], [ 10, %4 ], [ 5, %3 ], [ 1, %1 ]
ret i32 %11
}
void YUY2ToYRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToYRow_Any_AVX2() {
ret void
}
/* Variables and functions */
int inb(int);
int reademul() { return inb(0x333); }


x86 assembly (clang, -O0):
<reademul>:
push   %rbp
mov    %rsp,%rbp
mov    $0x333,%edi
call   1030 <inb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reademul>:
mov    $0x333,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define i32 @reademul() {
%1 = call i32 @inb(i32 819)
ret i32 %1
}

LLVM IR (-O2):
define i32 @reademul() {
%1 = tail call i32 @inb(i32 819)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
char *str2str(char *str) { return strcpy(malloc(strlen(str) + 1), str); }


x86 assembly (clang, -O0):
<str2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2str>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @str2str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @malloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @str2str(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world");
  return 3 * 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_name(int, char const *);
int /*<<< orphan*/ printf(char *, unsigned int);
void print_uint(int indent, const char *name, unsigned val) {
  print_name(indent, name);
  printf("%u\n", val);
}


x86 assembly (clang, -O0):
<print_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <print_name@plt>
mov    -0x14(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint>:
push   %rbx
mov    %edx,%ebx
call   1040 <print_name@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define void @print_uint(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_name(i32 %0, i8* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
immed() { ot("movl "); }


x86 assembly (clang, -O0):
<immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"movl \00"
define i32 @immed() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"movl \00"
define i32 @immed() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_MAKE_HUM_SDA_INPUT();
void HUMIDITY_MAKE_DATA_INPUT() { TOSH_MAKE_HUM_SDA_INPUT(); }


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

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

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

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