xunge/DecIR huggingface dataset:
int ti_mfi_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_mfi_start>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ti_mfi_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ti_mfi_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
float stdlib_strided_snanstdevpn(int /*<<< orphan*/ const, float const,
                                 float const *, int /*<<< orphan*/ const);
float stdlib_strided_snanstdev(const int64_t N, const float correction,
                               const float *X, const int64_t stride) {
  return stdlib_strided_snanstdevpn(N, correction, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_snanstdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_snanstdevpn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_snanstdev>:
jmp    1030 <stdlib_strided_snanstdevpn@plt>

LLVM IR (-O0):
define float @stdlib_strided_snanstdev(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call float @stdlib_strided_snanstdevpn(i32 %9, float %10, float* %11, i32 %12)
ret float %13
}

LLVM IR (-O2):
define float @stdlib_strided_snanstdev(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call float @stdlib_strided_snanstdevpn(i32 %0, float %1, float* %2, i32 %3)
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int sys_setfsgid(int /*<<< orphan*/);
int sys_setfsgid32(gid_t gid) { return sys_setfsgid(gid); }


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

x86 assembly (clang, -O2):
<sys_setfsgid32>:
jmp    1030 <sys_setfsgid@plt>

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

LLVM IR (-O2):
define i32 @sys_setfsgid32(i32 %0) {
%2 = tail call i32 @sys_setfsgid(i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned int __builtin_nyuzi_read_control_reg(int);
unsigned int get_cycle_count(void) {
  return __builtin_nyuzi_read_control_reg(6);
}


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

x86 assembly (clang, -O2):
<get_cycle_count>:
mov    $0x6,%edi
jmp    1030 <__builtin_nyuzi_read_control_reg@plt>

LLVM IR (-O0):
define i32 @get_cycle_count() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_cycle_count() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 6)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XMapRaised(int /*<<< orphan*/ *, int /*<<< orphan*/);
int send_client_msg(int /*<<< orphan*/ *, int /*<<< orphan*/, char *,
                    int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/);
int activate_window(Display *disp, Window *win) {
  int ret;
  ret = send_client_msg(disp, *win, "_NET_ACTIVE_WINDOW", 0, 0, 0, 0, 0);
  XMapRaised(disp, *win);
  return ret;
}


x86 assembly (clang, -O0):
<activate_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <send_client_msg@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <XMapRaised@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<activate_window>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%esi
lea    0xecd(%rip),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1040 <send_client_msg@plt>
add    $0x10,%rsp
mov    %eax,%ebp
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <XMapRaised@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"_NET_ACTIVE_WINDOW\00"
define i32 @activate_window(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @send_client_msg(i32* %6, i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %9, i32* %5
%10 = load i32*, i32** %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = call i32 @XMapRaised(i32* %10, i32 %12)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"_NET_ACTIVE_WINDOW\00"
define i32 @activate_window(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @send_client_msg(i32* %0, i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0)
%5 = load i32, i32* %1
%6 = tail call i32 @XMapRaised(i32* %0, i32 %5)
ret i32 %4
}
int sub(int x) { return (x + x); }


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

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

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

LLVM IR (-O2):
define i32 @sub(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb0() {
  Assert_real((isbdigit(176) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              885, ("isbdigit should be 0 for 0xb0"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xb0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x375,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xb0>:
push   %rax
mov    $0xb0,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x375,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb0\00"
define void @t_isbdigit_0xb0() {
%1 = call i64 @isbdigit(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb0\00"
define void @t_isbdigit_0xb0() {
%1 = tail call i64 @isbdigit(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calc_coeffs();
void init_iir() { calc_coeffs(); }


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

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

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

LLVM IR (-O2):
define void @init_iir() {
%1 = tail call i32 (...) @calc_coeffs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setresuid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void catcher(void) {
  setresuid(geteuid(), geteuid(), geteuid());
  printf("WIN!\n");
  system("/bin/sh");
  exit(0);
}


x86 assembly (clang, -O0):
<catcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    %eax,%edx
call   1030 <setresuid@plt>
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<catcher>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <geteuid@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <setresuid@plt>
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
call   1050 <system@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"WIN!\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define void @catcher() {
%1 = call i32 (...) @geteuid()
%2 = call i32 (...) @geteuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 @setresuid(i32 %1, i32 %2, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@str = [5 x i8] c"WIN!\00"
define void @catcher() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 (...) @geteuid()
%4 = tail call i32 @setresuid(i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_8Cuint8_mem(unsigned char *val) {
  return ((*val) & (0x8C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Cuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x8c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_8Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -116
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int bar();
__attribute__((no)) int foo(void) { return bar(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @bar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: ipcsem-tool OPERATIONS [OPTIONS] path\n"
         "* Operations\n"
         " -h                     : show this help\n"
         " -c nb_members          : create a semaphore\n"
         " -d                     : delete the semaphore\n"
         " -a member:delta        : add value delta to a member of the "
         "semaphore array\n"
         " -l member              : lock a member of the semaphore array\n"
         " -u member              : unlock a member of the semaphore array\n"
         " -s                     : show the values of members\n"
         "* Various options\n"
         " -i                     : use semaphore identifier instead of path\n"
         " -q                     : be quiet\n"
         " -U                     : mark operations as undoable\n"
         " -b                     : mark operations as blocking\n");
}


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

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

LLVM IR (-O0):
@.str = [678 x i8] c"Usage: ipcsem-tool OPERATIONS [OPTIONS] path\0A* Operations\0A -h : show this help\0A -c nb_members : create a semaphore\0A -d : delete the semaphore\0A -a member:delta : add value delta to a member of the semaphore array\0A -l member : lock a member of the semaphore array\0A -u member : unlock a member of the semaphore array\0A -s : show the values of members\0A* Various options\0A -i : use semaphore identifier instead of path\0A -q : be quiet\0A -U : mark operations as undoable\0A -b : mark operations as blocking\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([678 x i8], [678 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [677 x i8] c"Usage: ipcsem-tool OPERATIONS [OPTIONS] path\0A* Operations\0A -h : show this help\0A -c nb_members : create a semaphore\0A -d : delete the semaphore\0A -a member:delta : add value delta to a member of the semaphore array\0A -l member : lock a member of the semaphore array\0A -u member : unlock a member of the semaphore array\0A -s : show the values of members\0A* Various options\0A -i : use semaphore identifier instead of path\0A -q : be quiet\0A -U : mark operations as undoable\0A -b : mark operations as blocking\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([677 x i8], [677 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int Q_stricmp(const char *s1, const char *s2) { return strcasecmp(s1, s2); }


x86 assembly (clang, -O0):
<Q_stricmp>:
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 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_stricmp>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @Q_stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
getpid() { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @getpid() {
ret i32 42
}
/* Variables and functions */
int answer();
int /*<<< orphan*/ printf(char *, int, double);
double sqr(int);
int main() {
  printf("answer %d and square %f\n", answer(), sqr(4));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <answer@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1040 <sqr@plt>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"answer %d and square %f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @answer()
%2 = tail call double @sqr(i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_explosion_data();
int /*<<< orphan*/ init_explosion_dl();
int /*<<< orphan*/ init_explosion_winshield_particle_dl();
void init_explosions(void) {
  init_explosion_data();
  init_explosion_dl();
  init_explosion_winshield_particle_dl();
  return;
}


x86 assembly (clang, -O0):
<init_explosions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_explosion_data@plt>
mov    $0x0,%al
call   1050 <init_explosion_dl@plt>
mov    $0x0,%al
call   1040 <init_explosion_winshield_particle_dl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_explosions>:
push   %rax
xor    %eax,%eax
call   1030 <init_explosion_data@plt>
xor    %eax,%eax
call   1050 <init_explosion_dl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <init_explosion_winshield_particle_dl@plt>

LLVM IR (-O0):
define void @init_explosions() {
%1 = call i32 (...) @init_explosion_data()
%2 = call i32 (...) @init_explosion_dl()
%3 = call i32 (...) @init_explosion_winshield_particle_dl()
ret void
}

LLVM IR (-O2):
define void @init_explosions() {
%1 = tail call i32 (...) @init_explosion_data()
%2 = tail call i32 (...) @init_explosion_dl()
%3 = tail call i32 (...) @init_explosion_winshield_particle_dl()
ret void
}
short f0_if(short x) {
  if (x--)
    return 200;
  if (x <= 0)
    return 100;
  return 0;
}


x86 assembly (clang, -O0):
<f0_if>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x4(%rbp)
cmp    $0x0,%ax
je     112f <f0_if+0x2f>
movw   $0xc8,-0x2(%rbp)
jmp    114d <f0_if+0x4d>
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jg     1147 <f0_if+0x47>
movw   $0x64,-0x2(%rbp)
jmp    114d <f0_if+0x4d>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0_if>:
mov    %edi,%eax
sub    $0x1,%ax
xor    %ecx,%ecx
test   %ax,%ax
mov    $0x64,%edx
cmovg  %ecx,%edx
cmp    $0x1,%di
mov    $0xc8,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @f0_if(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = add i16 %4, -1
store i16 %5, i16* %3
%6 = icmp ne i16 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 200, i16* %2
br label %14
8: ; preds = %1
%9 = load i16, i16* %3
%10 = sext i16 %9 to i32
%11 = icmp sle i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i16 100, i16* %2
br label %14
13: ; preds = %8
store i16 0, i16* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @f0_if(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = add i16 %0, -1
%4 = icmp sgt i16 %3, 0
%5 = select i1 %4, i16 0, i16 100
%6 = select i1 %2, i16 %5, i16 200
ret i16 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_uint32_be(uint8_t *buf) {
  uint32_t res;
  res = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3];
  return res;
}


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

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

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

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

/* Variables and functions */
void pes_set_streamid(uint8_t *p_pes, uint8_t i_stream_id) {
  p_pes[3] = i_stream_id;
}


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

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

LLVM IR (-O0):
define void @pes_set_streamid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @pes_set_streamid(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %3
ret void
}
OP(dd, e4) {
  illegal_1();
  op_e4();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_e4@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_e4()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e4()
ret i32 undef
}
int do_409() { return 409; }


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

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

LLVM IR (-O0):
define i32 @do_409() {
ret i32 409
}

LLVM IR (-O2):
define i32 @do_409() {
ret i32 409
}
int roundup(int n) {
  int val = 1;
  while (val < n)
    val <<= 1;
  return val;
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <roundup+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <roundup+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <roundup+0x10>
ret

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

LLVM IR (-O2):
define i32 @roundup(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
void XtRemoveWorkProc() {}


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

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

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

LLVM IR (-O2):
define void @XtRemoveWorkProc() {
ret void
}
void gen_stmt(struct stmt_s *stmt) {}


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

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

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

LLVM IR (-O2):
%struct.stmt_s = type opaque
define void @gen_stmt(%struct.stmt_s* nocapture %0) {
ret void
}
int pythagorean(int a, int b, int c) { return a * a + b * b == c * c; }


x86 assembly (clang, -O0):
<pythagorean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pythagorean>:
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
imul   %edx,%edx
xor    %eax,%eax
cmp    %edx,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pythagorean(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, %0
%5 = mul nsw i32 %1, %1
%6 = add nuw nsw i32 %5, %4
%7 = mul nsw i32 %2, %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int f_eq_rc2(float a1) { return !(((a1) == (100))); }


x86 assembly (clang, -O0):
<f_eq_rc2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eq_rc2>:
cmpneqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_eq_rc2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 1.000000e+02
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_eq_rc2(float %0) {
%2 = fcmp une float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENAMETOOLONG;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
int gethostname(char *name, size_t len) {
  static const char *hostname = "naclhost";
  if (len <= strlen(hostname)) {
    errno = ENAMETOOLONG;
    return -1;
  }
  strcpy(name, hostname);
  return 0;
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ef1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
ja     1172 <gethostname+0x52>
mov    0x2e7d(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7c(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <gethostname+0x69>
mov    -0x10(%rbp),%rdi
mov    0x2eb3(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %rax
cmp    $0x8,%rsi
ja     1130 <gethostname+0x20>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    0x2eb9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@gethostname.hostname = internal global i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0)
@.str = [9 x i8] c"naclhost\00"
@ENAMETOOLONG = global i32 0
@errno = global i32 0
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i8*, i8** @gethostname.hostname
%8 = call i64 @strlen(i8* %7)
%9 = icmp ule i64 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @ENAMETOOLONG
store i32 %11, i32* @errno
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** @gethostname.hostname
%15 = call i32 @strcpy(i8* %13, i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [9 x i8] c"naclhost\00"
@ENAMETOOLONG = global i32 0
@errno = global i32 0
define i32 @gethostname(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @ENAMETOOLONG
store i32 %5, i32* @errno
br label %8
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %9
}
int gen_cvin(cvin) {
  int r = ((cvin & 2) ? (1 << 29) : 0) | ((cvin & 1) ? (1 << 28) : 0);
  r |= (1 << 31) | (1 << 30);
  return r;
}


x86 assembly (clang, -O0):
<gen_cvin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2,%edx
xor    %eax,%eax
mov    $0x20000000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    -0x4(%rbp),%esi
and    $0x1,%esi
xor    %ecx,%ecx
mov    $0x10000000,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0xc0000000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_cvin>:
mov    %edi,%eax
or     $0xfffffffc,%eax
shl    $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @gen_cvin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 536870912, i32 0
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 268435456, i32 0
%14 = or i32 %8, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = or i32 %15, -1073741824
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gen_cvin(i32 %0) {
%2 = shl i32 %0, 28
%3 = or i32 %2, -1073741824
ret i32 %3
}
int test25(int a, int b, int c, int d) {
  int x = a != b;
  int y = c == 0;
  return x - y;
}


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

x86 assembly (clang, -O2):
<test25>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
cmp    $0x1,%edx
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @test25(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ne i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp eq i32 %2, 0
%8 = sext i1 %7 to i32
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void gc_collect(int64_t **rootstack_ptr, uint64_t bytes_requested) {
  fprintf(stderr, "Garbage collection not implemented yet!\n");
}


x86 assembly (clang, -O0):
<gc_collect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gc_collect>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Garbage collection not implemented yet!\0A\00"
define void @gc_collect(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Garbage collection not implemented yet!\0A\00"
define void @gc_collect(i32** nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int main() {
  unsigned int a[] = {0x9abcdeff, 0x12345678};
  if (*((unsigned long long *)&a) != 0x123456789abcdeffLL) {
    _exit(-1);
  }
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
movabs $0x123456789abcdeff,%rax
56 34 12
cmp    %rax,-0xc(%rbp)
je     1148 <main+0x38>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 -1698898177, i32 305419896]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = bitcast [2 x i32]* %2 to i8*
%4 = bitcast [2 x i32]* %2 to i64*
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 1311768467463790335
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @_exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ LZ4HC_literalsPrice(int);
__attribute__((always_)) int LZ4HC_sequencePrice(int litlen, int mlen) {
  int price = 1 + 2;
  ((void)0);
  ((void)0);
  price += LZ4HC_literalsPrice(litlen);
  if (mlen >= (int)(((1U << 4) - 1) + 4))
    price += 1 + ((mlen - (int)(((1U << 4) - 1) + 4)) / 255);
  return price;
}


x86 assembly (clang, -O0):
<LZ4HC_sequencePrice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <LZ4HC_literalsPrice@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x13,-0x8(%rbp)
jl     115b <LZ4HC_sequencePrice+0x4b>
mov    -0x8(%rbp),%eax
sub    $0x13,%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4HC_sequencePrice>:
push   %rbx
mov    %esi,%ebx
call   1030 <LZ4HC_literalsPrice@plt>
add    $0x3,%eax
cmp    $0x13,%ebx
jl     1135 <LZ4HC_sequencePrice+0x25>
add    $0xffffffed,%ebx
mov    $0x80808081,%ecx
imul   %rbx,%rcx
shr    $0x27,%rcx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LZ4HC_sequencePrice(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 3, i32* %5
%6 = load i32, i32* %3
%7 = call i64 @LZ4HC_literalsPrice(i32 %6)
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 19
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 19
%17 = sdiv i32 %16, 255
%18 = add nsw i32 1, %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %14, %2
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @LZ4HC_sequencePrice(i32 %0, i32 %1) {
%3 = tail call i64 @LZ4HC_literalsPrice(i32 %0)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 3
%6 = icmp sgt i32 %1, 18
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = add nsw i32 %1, -19
%9 = udiv i32 %8, 255
%10 = add nuw nsw i32 %9, 1
%11 = add nsw i32 %10, %5
br label %12
12: ; preds = %7, %2
%13 = phi i32 [ %11, %7 ], [ %5, %2 ]
ret i32 %13
}
int ft_nbrlonglen(long long nb) {
  int i;
  i = 0;
  if (nb == 0)
    return (1);
  if (nb < 0) {
    nb = -nb;
    i++;
  }
  while (nb) {
    i++;
    nb /= 10;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_nbrlonglen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <ft_nbrlonglen+0x26>
movl   $0x1,-0x4(%rbp)
jmp    117a <ft_nbrlonglen+0x7a>
cmpq   $0x0,-0x10(%rbp)
jge    1144 <ft_nbrlonglen+0x44>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <ft_nbrlonglen+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1174 <ft_nbrlonglen+0x74>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
jmp    1149 <ft_nbrlonglen+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlonglen>:
test   %rdi,%rdi
je     1147 <ft_nbrlonglen+0x47>
mov    %rdi,%rcx
shr    $0x3f,%rcx
mov    %rdi,%rsi
neg    %rsi
cmovs  %rdi,%rsi
movabs $0x6666666666666667,%rdi
66 66 66
add    $0x1,%ecx
mov    %rsi,%rax
imul   %rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x9,%rsi
cmp    $0x12,%rsi
mov    %rdx,%rsi
ja     1120 <ft_nbrlonglen+0x20>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_nbrlonglen(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = lshr i64 %0, 63
%5 = trunc i64 %4 to i32
%6 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
br label %7
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %5, %3 ]
%9 = phi i64 [ %11, %7 ], [ %6, %3 ]
%10 = add nuw nsw i32 %8, 1
%11 = sdiv i64 %9, 10
%12 = add i64 %9, 9
%13 = icmp ult i64 %12, 19
br i1 %13, label %14, label %7
14: ; preds = %7, %1
%15 = phi i32 [ 1, %1 ], [ %10, %7 ]
ret i32 %15
}
/* Type definitions */
struct tm {
  int tm_hour;
};

/* Variables and functions */
unsigned Sys_Hour(void *t) { return ((struct tm *)t)->tm_hour; }


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

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

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

LLVM IR (-O2):
define i32 @Sys_Hour(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int xnarch_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xnarch_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeHexByte(int, char);
void writeHexWord(int f, unsigned int w) {
  writeHexByte(f, (char)((int)w >> 24));
  writeHexByte(f, (char)((int)w >> 16));
  writeHexByte(f, (char)((int)w >> 8));
  writeHexByte(f, (char)((int)w));
}


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

x86 assembly (clang, -O2):
<writeHexWord>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sar    $0x18,%esi
call   1030 <writeHexByte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <writeHexByte@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <writeHexByte@plt>
movsbl %bl,%esi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <writeHexByte@plt>

LLVM IR (-O0):
define void @writeHexWord(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 = ashr i32 %6, 24
%8 = trunc i32 %7 to i8
%9 = call i32 @writeHexByte(i32 %5, i8 signext %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = trunc i32 %12 to i8
%14 = call i32 @writeHexByte(i32 %10, i8 signext %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = trunc i32 %17 to i8
%19 = call i32 @writeHexByte(i32 %15, i8 signext %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = trunc i32 %21 to i8
%23 = call i32 @writeHexByte(i32 %20, i8 signext %22)
ret void
}

LLVM IR (-O2):
define void @writeHexWord(i32 %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = tail call i32 @writeHexByte(i32 %0, i8 signext %4)
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = tail call i32 @writeHexByte(i32 %0, i8 signext %7)
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @writeHexByte(i32 %0, i8 signext %10)
%12 = trunc i32 %1 to i8
%13 = tail call i32 @writeHexByte(i32 %0, i8 signext %12)
ret void
}
/* Variables and functions */
char *entitize(char const *, int /*<<< orphan*/);
char *xml_entitize(const char *str) { return entitize(str, 0); }


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

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

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

LLVM IR (-O2):
define i8* @xml_entitize(i8* %0) {
%2 = tail call i8* @entitize(i8* %0, i32 0)
ret i8* %2
}
int unpacki(int jb) {
  int m0, m1;
  m0 = 0x7fffff;
  m1 = 0x1000000;
  if (jb > m0)
    return jb - m1;
  return jb;
}


x86 assembly (clang, -O0):
<unpacki>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x7fffff,-0xc(%rbp)
movl   $0x1000000,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    112f <unpacki+0x2f>
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <unpacki+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpacki>:
lea    -0x1000000(%rdi),%eax
cmp    $0x800000,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @unpacki(i32 %0) {
%2 = icmp sgt i32 %0, 8388607
%3 = add nsw i32 %0, -16777216
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
double NucleoFunc_Trad(int i, int j) { return 1.; }


x86 assembly (clang, -O0):
<NucleoFunc_Trad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  0xeee(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<NucleoFunc_Trad>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @NucleoFunc_Trad(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @NucleoFunc_Trad(i32 %0, i32 %1) {
ret double 1.000000e+00
}