xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ get_month(char *, int, int, int);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
void print_month(int y, int m) {
  char buf[(21 * (6 + 2))] = {0};
  puts(get_month((char *)buf, (21 * (6 + 2)), y, m));
}


x86 assembly (clang, -O0):
<print_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0xa8,%edx
call   1040 <memset@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0xa8,%esi
call   1050 <get_month@plt>
mov    %eax,%edi
call   1030 <puts@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_month>:
sub    $0xa8,%rsp
mov    %esi,%ecx
mov    %edi,%edx
xorps  %xmm0,%xmm0
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xa0(%rsp)
mov    %rsp,%rdi
mov    $0xa8,%esi
call   1040 <get_month@plt>
mov    %eax,%edi
call   1030 <puts@plt>
add    $0xa8,%rsp
ret

LLVM IR (-O0):
define void @print_month(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [168 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = bitcast [168 x i8]* %5 to i8*
%7 = getelementptr inbounds [168 x i8], [168 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @get_month(i8* %7, i32 168, i32 %8, i32 %9)
%11 = call i32 @puts(i32 %10)
ret void
}

LLVM IR (-O2):
define void @print_month(i32 %0, i32 %1) {
%3 = alloca [168 x i8]
%4 = getelementptr inbounds [168 x i8], [168 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_month(i8* %4, i32 168, i32 %0, i32 %1)
%6 = call i32 @puts(i32 %5)
ret void
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int inet_pton(int /*<<< orphan*/, char const *, struct in6_addr *);
int /*<<< orphan*/ multiplex_send_addr_over_tty(struct in6_addr *);
int /*<<< orphan*/ tun_add_addr(char const *);
int border_add_addr(const char *ip_addr) {
  struct in6_addr parsed_addr;
  if (inet_pton(AF_INET6, ip_addr, &parsed_addr) != 1) {
    return -1;
  }
  tun_add_addr(ip_addr);
  multiplex_send_addr_over_tty(&parsed_addr);
  return 0;
}


x86 assembly (clang, -O0):
<border_add_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <inet_pton@plt>
cmp    $0x1,%eax
je     1167 <border_add_addr+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <border_add_addr+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <tun_add_addr@plt>
lea    -0x18(%rbp),%rdi
call   1050 <multiplex_send_addr_over_tty@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_add_addr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rdx
mov    %rbx,%rsi
call   1040 <inet_pton@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    116e <border_add_addr+0x3e>
mov    %rbx,%rdi
call   1030 <tun_add_addr@plt>
lea    0x8(%rsp),%rdi
call   1050 <multiplex_send_addr_over_tty@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
@AF_INET6 = global i32 0
define i32 @border_add_addr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in6_addr
store i8* %0, i8** %3
%5 = load i32, i32* @AF_INET6
%6 = load i8*, i8** %3
%7 = call i32 @inet_pton(i32 %5, i8* %6, %struct.in6_addr* %4)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @tun_add_addr(i8* %11)
%13 = call i32 @multiplex_send_addr_over_tty(%struct.in6_addr* %4)
store i32 0, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
@AF_INET6 = global i32 0
define i32 @border_add_addr(i8* %0) {
%2 = alloca %struct.in6_addr
%3 = bitcast %struct.in6_addr* %2 to i8*
%4 = load i32, i32* @AF_INET6
%5 = call i32 @inet_pton(i32 %4, i8* %0, %struct.in6_addr* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @tun_add_addr(i8* %0)
%9 = call i32 @multiplex_send_addr_over_tty(%struct.in6_addr* %2)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ 0, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ static_function();
int main(void) {
  int element = 10;
  while (element-- > 0)
    static_function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    1146 <main+0x36>
mov    $0x0,%al
call   1030 <static_function@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @static_function()
%2 = tail call i32 (...) @static_function()
%3 = tail call i32 (...) @static_function()
%4 = tail call i32 (...) @static_function()
%5 = tail call i32 (...) @static_function()
%6 = tail call i32 (...) @static_function()
%7 = tail call i32 (...) @static_function()
%8 = tail call i32 (...) @static_function()
%9 = tail call i32 (...) @static_function()
%10 = tail call i32 (...) @static_function()
ret i32 0
}
void **cl_pool_block_slot(void **block) { return block + 1; }


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

x86 assembly (clang, -O2):
<cl_pool_block_slot>:
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8** @cl_pool_block_slot(i8** readnone %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
ret i8** %2
}
/* Variables and functions */
int pow(double, int);
int prob_hash_sz(int len) {
  if (len < 16) {
    return (pow(2.0, (len + 1)));
  } else {
    return (262144);
  }
}


x86 assembly (clang, -O0):
<prob_hash_sz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1140 <prob_hash_sz+0x30>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
movsd  0xecd(%rip),%xmm0
call   1030 <pow@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <prob_hash_sz+0x37>
movl   $0x40000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prob_hash_sz>:
cmp    $0xf,%edi
jg     1125 <prob_hash_sz+0x15>
add    $0x1,%edi
movsd  0xee0(%rip),%xmm0
jmp    1030 <pow@plt>
mov    $0x40000,%eax
ret

LLVM IR (-O0):
define i32 @prob_hash_sz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i32 @pow(double 2.000000e+00, i32 %8)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 262144, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @prob_hash_sz(i32 %0) {
%2 = icmp slt i32 %0, 16
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nsw i32 %0, 1
%5 = tail call i32 @pow(double 2.000000e+00, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 262144, %1 ]
ret i32 %7
}
int expt(int x, int y) {}


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

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

LLVM IR (-O0):
define i32 @expt(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @expt(i32 %0, i32 %1) {
ret i32 undef
}
float calculate_circumference(float pi, float r) { return 2 * pi * r; }


x86 assembly (clang, -O0):
<calculate_circumference>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_circumference>:
addss  %xmm0,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calculate_circumference(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fmul float 2.000000e+00, %5
%7 = load float, float* %4
%8 = fmul float %6, %7
ret float %8
}

LLVM IR (-O2):
define float @calculate_circumference(float %0, float %1) {
%3 = fmul float %0, 2.000000e+00
%4 = fmul float %3, %1
ret float %4
}
int do_143() { return 143; }


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

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

LLVM IR (-O0):
define i32 @do_143() {
ret i32 143
}

LLVM IR (-O2):
define i32 @do_143() {
ret i32 143
}
/* Variables and functions */
int count_tests();
int /*<<< orphan*/ printf(char *, char *, char *, int);
void usage(char *progname) {
  printf("SYNOPSIS: \n\n"
         "%s               \trun all tests\n"
         "%s [<testnumber>]\trun a specific test by number\n"
         "\n"
         "Tests available: 1..%d\n\n"
         "",
         progname, progname, count_tests());
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <count_tests@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <count_tests@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [118 x i8] c"SYNOPSIS: \0A\0A%s \09run all tests\0A%s [<testnumber>]\09run a specific test by number\0A\0ATests available: 1..%d\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (...) @count_tests()
%6 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [118 x i8] c"SYNOPSIS: \0A\0A%s \09run all tests\0A%s [<testnumber>]\09run a specific test by number\0A\0ATests available: 1..%d\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (...) @count_tests()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i32 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgravity_x(void *_p, int _v) {
  ((XEvent *)_p)->xgravity.x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xgravity_x>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xgravity_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
float product(float a, float b) { return (a * b); }


x86 assembly (clang, -O0):
<product>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<product>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @product(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @product(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ show_scores();
void do_cmd_knowledge_scores(void *obj, const char *name) {
  (void)obj;
  (void)name;
  show_scores();
}


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

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

LLVM IR (-O0):
define void @do_cmd_knowledge_scores(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (...) @show_scores()
ret void
}

LLVM IR (-O2):
define void @do_cmd_knowledge_scores(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @show_scores()
ret void
}
int compare_float(void *ptr1, void *ptr2) {
  if (*(float *)ptr1 >= *(float *)ptr2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jb     112d <compare_float+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <compare_float+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_float>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare_float(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp oge float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ult float %4, %6
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
int loop_always(int p) {
  int i = 0;
  if (p > 0) {
    goto Loop;
  }
  while (i < 5) {
  Loop:
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<loop_always>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111d <loop_always+0x1d>
jmp    1131 <loop_always+0x31>
jmp    1122 <loop_always+0x22>
cmpl   $0x5,-0x8(%rbp)
jge    113f <loop_always+0x3f>
jmp    1131 <loop_always+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <loop_always+0x22>
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @loop_always(i32 %0) {
ret i32 1
}
void snag32(from, to) unsigned char *from;
unsigned char *to;
{
  to[0] = from[0];
  to[1] = from[1];
  to[2] = from[2];
  to[3] = from[3];
}


x86 assembly (clang, -O0):
<snag32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<snag32>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    0x2(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x3(%rdi),%al
mov    %al,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @snag32(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ivory_serialize_unpack_prim_4_be(const uint8_t *src) {
  return (((uint32_t)src[3] << 0) | ((uint32_t)src[2] << 8) |
          ((uint32_t)src[1] << 16) | ((uint32_t)src[0] << 24));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_prim_4_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_prim_4_be>:
mov    0x10(%rdi),%ecx
shl    $0x8,%ecx
or     0x18(%rdi),%ecx
mov    (%rdi),%eax
mov    0x8(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ivory_serialize_unpack_prim_4_be(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 3
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %0, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i64, i64* %0
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
uint64_t timer_default_clock() {
  return (uint64_t)(clock() / (CLOCKS_PER_SEC / 1000));
}


x86 assembly (clang, -O0):
<timer_default_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_default_clock>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mov    0x2ec9(%rip),%rcx
movslq (%rcx),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
cltd
idiv   %ecx
pop    %rcx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @timer_default_clock() {
%1 = call i32 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = sdiv i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @timer_default_clock() {
%1 = tail call i32 (...) @clock()
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = sdiv i32 %1, %3
ret i32 %4
}
/* Variables and functions */
char *strrchr(char *, char);
int getsuf(char *s) {
  register char *p;
  if ((p = strrchr(s, '.')) && p[1] != '\0' && p[2] == '\0')
    return p[1];
  return (0);
}


x86 assembly (clang, -O0):
<getsuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     116a <getsuf+0x5a>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     116a <getsuf+0x5a>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    116a <getsuf+0x5a>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <getsuf+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsuf>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1131 <getsuf+0x21>
mov    %rax,%rcx
movsbl 0x1(%rax),%eax
test   %eax,%eax
je     1131 <getsuf+0x21>
cmpb   $0x0,0x2(%rcx)
je     1133 <getsuf+0x23>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getsuf(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %2, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8, %4, %1
br label %14
14: ; preds = %8, %13
%15 = phi i32 [ 0, %13 ], [ %9, %8 ]
ret i32 %15
}
void fn_test1(void) {
  int a = 0;
  a++;
}


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

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

LLVM IR (-O0):
define void @fn_test1() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
define void @fn_test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CalcExp(char *);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char exp[80];
  scanf("%s", exp);
  printf("%s%d\n", exp, CalcExp(exp));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <CalcExp@plt>
mov    -0x58(%rbp),%rsi
mov    %eax,%edx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <CalcExp@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%s%d\0A\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @CalcExp(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _dbg_check_unlock_from_isr();
int /*<<< orphan*/ _stats_stop_measure_crit_isr();
int /*<<< orphan*/ port_unlock_from_isr();
void chSysUnlockFromISR(void) {
  _dbg_check_unlock_from_isr();
  _stats_stop_measure_crit_isr();
  port_unlock_from_isr();
}


x86 assembly (clang, -O0):
<chSysUnlockFromISR>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <_dbg_check_unlock_from_isr@plt>
mov    $0x0,%al
call   1040 <_stats_stop_measure_crit_isr@plt>
mov    $0x0,%al
call   1030 <port_unlock_from_isr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chSysUnlockFromISR>:
push   %rax
xor    %eax,%eax
call   1050 <_dbg_check_unlock_from_isr@plt>
xor    %eax,%eax
call   1040 <_stats_stop_measure_crit_isr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <port_unlock_from_isr@plt>

LLVM IR (-O0):
define void @chSysUnlockFromISR() {
%1 = call i32 (...) @_dbg_check_unlock_from_isr()
%2 = call i32 (...) @_stats_stop_measure_crit_isr()
%3 = call i32 (...) @port_unlock_from_isr()
ret void
}

LLVM IR (-O2):
define void @chSysUnlockFromISR() {
%1 = tail call i32 (...) @_dbg_check_unlock_from_isr()
%2 = tail call i32 (...) @_stats_stop_measure_crit_isr()
%3 = tail call i32 (...) @port_unlock_from_isr()
ret void
}
int main() {
  int n[3][3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  printf("%d", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.n = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 9]]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), [3 x i32]* %3)
ret i32 0
}
int BLNK_ProcessEXE(char *name) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @BLNK_ProcessEXE(i8* nocapture readnone %0) {
ret i32 0
}
void local_irq_save(unsigned flags __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @local_irq_save(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_qsort(char **, int /*<<< orphan*/, int);
void sortPointers(char **vals, int total_elems) {
  do_qsort(vals, 0, total_elems - 1);
}


x86 assembly (clang, -O0):
<sortPointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <do_qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortPointers>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <do_qsort@plt>

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

LLVM IR (-O2):
define void @sortPointers(i8** %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @do_qsort(i8** %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
struct dirent {
  scalar_t__ d_type;
};

/* Variables and functions */
scalar_t__ DT_REG;
int selector(const struct dirent *ent) {
  if (ent->d_type == DT_REG)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<selector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%rax
jne    112b <selector+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <selector+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<selector>:
mov    (%rdi),%rcx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
@DT_REG = global i64 0
define i32 @selector(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @DT_REG
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
@DT_REG = global i64 0
define i32 @selector(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DT_REG
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double floor(double);
double wavegen_sawtooth(double time) {
  return 2.0 * (time - floor(time)) - 1.0;
}


x86 assembly (clang, -O0):
<wavegen_sawtooth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xeb7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wavegen_sawtooth>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
addsd  0xed0(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @wavegen_sawtooth(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
%6 = fsub double %3, %5
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double -1.000000e+00)
ret double %7
}

LLVM IR (-O2):
define double @wavegen_sawtooth(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double -1.000000e+00)
ret double %4
}
const char *_mk_NA(const char *p) { return p ? p : "N/A"; }


x86 assembly (clang, -O0):
<_mk_NA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <_mk_NA+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <_mk_NA+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <_mk_NA+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mk_NA>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"N/A\00"
define i8* @_mk_NA(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"N/A\00"
define i8* @_mk_NA(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int efuse_read_id(void *buf, int length, int id) { return 0; }


x86 assembly (clang, -O0):
<efuse_read_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @efuse_read_id(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int numbtrop_quaddobl_dimension(int *dim) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(731, dim, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<numbtrop_quaddobl_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2db,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numbtrop_quaddobl_dimension>:
mov    %rdi,%rsi
mov    $0x2db,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @numbtrop_quaddobl_dimension(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %4
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 731, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @numbtrop_quaddobl_dimension(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 731, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned long *);
void __attribute__((__no__)) foo(int n, unsigned long *x, unsigned long *y) {
  if (n == 0)
    bar(x);
  else
    bar(y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113b <foo+0x2b>
mov    -0x10(%rbp),%rdi
call   1030 <bar@plt>
jmp    1144 <foo+0x34>
mov    -0x18(%rbp),%rdi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
cmovne %rdx,%rsi
mov    %rsi,%rdi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0, i64* %1, i64* %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i64* %1, i64* %2
%6 = tail call i32 @bar(i64* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_house_number(char *);
void invalidate_house_number() { set_house_number(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @invalidate_house_number() {
%1 = call i32 @set_house_number(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @invalidate_house_number() {
%1 = tail call i32 @set_house_number(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
const int bitlen(int n) {
  int res = 0;
  while (n) {
    n = n >> 1;
    res++;
  }
  return res;
}


x86 assembly (clang, -O0):
<bitlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <bitlen+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitlen>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitlen+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitlen+0x10>
ret

LLVM IR (-O0):
define i32 @bitlen(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 %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = ashr i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @bitlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int FirstOne(int);
int main() {
  int a = FirstOne(12345678);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @FirstOne(i32 12345678)
ret i32 0
}
/* Variables and functions */
unsigned char inb(unsigned int);
unsigned char nsp_read(unsigned int base, unsigned int index) {
  return inb(base + index);
}


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

x86 assembly (clang, -O2):
<nsp_read>:
add    %esi,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @nsp_read(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = call zeroext i8 @inb(i32 %7)
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @nsp_read(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call zeroext i8 @inb(i32 %3)
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_quad_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_u_hyper(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_u_quad_t(XDR *xdrs, u_quad_t *ullp) {
  return xdr_u_hyper(xdrs, ullp);
}


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

x86 assembly (clang, -O2):
<xdr_u_quad_t>:
jmp    1030 <xdr_u_hyper@plt>

LLVM IR (-O0):
define i32 @xdr_u_quad_t(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 @xdr_u_hyper(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xdr_u_quad_t(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_u_hyper(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
short jsV_numbertoint32(double);
short jsV_numbertoint16(double n) { return jsV_numbertoint32(n); }


x86 assembly (clang, -O0):
<jsV_numbertoint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <jsV_numbertoint32@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsV_numbertoint16>:
jmp    1030 <jsV_numbertoint32@plt>

LLVM IR (-O0):
define signext i16 @jsV_numbertoint16(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call signext i16 @jsV_numbertoint32(double %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @jsV_numbertoint16(double %0) {
%2 = tail call signext i16 @jsV_numbertoint32(double %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *realloc(int /*<<< orphan*/, int);
void reallocPtrZero3() {
  char *r = realloc(0, 12);
  free(r);
}


x86 assembly (clang, -O0):
<reallocPtrZero3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0xc,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocPtrZero3>:
push   %rax
xor    %edi,%edi
mov    $0xc,%esi
call   1040 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @reallocPtrZero3() {
%1 = tail call i8* @realloc(i32 0, i32 12)
%2 = tail call i32 @free(i8* %1)
ret void
}