xunge/DecIR huggingface dataset:
void *arinc_get_user_data(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @arinc_get_user_data() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @arinc_get_user_data() {
ret i8* null
}
void madvise_userfault_dontneed(struct vm_area_struct *vma,
                                struct vm_area_struct **prev,
                                unsigned long start, unsigned long end) {}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @madvise_userfault_dontneed(%struct.vm_area_struct* %0, %struct.vm_area_struct** %1, i64 %2, i64 %3) {
%5 = alloca %struct.vm_area_struct*
%6 = alloca %struct.vm_area_struct**
%7 = alloca i64
%8 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %5
store %struct.vm_area_struct** %1, %struct.vm_area_struct*** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @madvise_userfault_dontneed(%struct.vm_area_struct* nocapture %0, %struct.vm_area_struct** nocapture %1, i64 %2, i64 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int exampleProgram();
int main() {
  assert(sizeof(uint16_t) == 2);
  return exampleProgram();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <exampleProgram@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 (...) @exampleProgram()
ret i32 %2
}
void fooInBundle() {}


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

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

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

LLVM IR (-O2):
define void @fooInBundle() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ ungets(char *);
void main() {
  char s[] = "Hello World";
  int c;
  ungets(s);
  while ((c = getchar()) != EOF)
    putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <ungets@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
je     117b <main+0x4b>
mov    -0x10(%rbp),%edi
call   1030 <putchar@plt>
jmp    1155 <main+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rdi
call   1040 <ungets@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e87(%rip),%rbx
cmp    (%rbx),%eax
je     1182 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1170 <main+0x40>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"Hello World\00"
@EOF = global i32 0
define void @main() {
%1 = alloca [12 x i8]
%2 = alloca i32
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @ungets(i8* %4)
br label %6
6: ; preds = %10, %0
%7 = call i32 (...) @getchar()
store i32 %7, i32* %2
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @putchar(i32 %11)
br label %6
13: ; preds = %6
ret void
}

LLVM IR (-O2):
@__const.main.s = [12 x i8] c"Hello World\00"
@EOF = global i32 0
define void @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @ungets(i8* %2)
%4 = call i32 (...) @getchar()
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ %4, %0 ]
%9 = call i32 @putchar(i32 %8)
%10 = call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %7
13: ; preds = %7, %0
ret void
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int syscall(int, struct perf_event_attr *, int /*<<< orphan*/, int, int,
            unsigned long);
int sys_perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
                        int group_fd, unsigned long flags) {
  int fd;
  fd = syscall(298, attr, pid, cpu, group_fd, flags);
  return fd;
}


x86 assembly (clang, -O0):
<sys_perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0x12a,%edi
call   1030 <syscall@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x12a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
define i32 @sys_perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 298, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
define i32 @sys_perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @syscall(i32 298, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %6
}
int ssl_sock_init(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @ssl_sock_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ssl_sock_init() {
ret i32 1
}
/* Variables and functions */
double exp(float);
float sigmoid(float z) { return 1.0 / (1.0 + exp(-z)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call double @exp(float %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sigmoid(float %0) {
%2 = fneg float %0
%3 = tail call double @exp(float %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}
void update_innovation_rangefinder(float h, float h_lidar,
                                   float *out_5326467223387434636) {
  out_5326467223387434636[0] = -h + h_lidar;
}


x86 assembly (clang, -O0):
<update_innovation_rangefinder>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_innovation_rangefinder>:
subss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @update_innovation_rangefinder(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = fneg float %7
%9 = load float, float* %5
%10 = fadd float %8, %9
%11 = load float*, float** %6
%12 = getelementptr inbounds float, float* %11, i64 0
store float %10, float* %12
ret void
}

LLVM IR (-O2):
define void @update_innovation_rangefinder(float %0, float %1, float* nocapture writeonly %2) {
%4 = fsub float %1, %0
store float %4, float* %2
ret void
}
void GB_ISLT_f_FP32(float *z, const float *x, const float *y) {
  (*z) = ((*x) < (*y));
}


x86 assembly (clang, -O0):
<GB_ISLT_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISLT_f_FP32>:
movss  (%rsi),%xmm0
cmpltss (%rdx),%xmm0
movss  0xeef(%rip),%xmm1
andps  %xmm0,%xmm1
movss  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISLT_f_FP32(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = load float, float* %7
%9 = load float*, float** %6
%10 = load float, float* %9
%11 = fcmp olt float %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to float
%14 = load float*, float** %4
store float %13, float* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISLT_f_FP32(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fcmp olt float %4, %5
%7 = uitofp i1 %6 to float
store float %7, float* %0
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int EAI_SYSTEM;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getaddrinfo(const char *name, const char *service,
                const struct addrinfo *req, struct addrinfo **pai) {
  __set_errno(ENOSYS);
  return EAI_SYSTEM;
}


x86 assembly (clang, -O0):
<getaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getaddrinfo>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
@ENOSYS = global i32 0
@EAI_SYSTEM = global i32 0
define i32 @getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
%11 = load i32, i32* @EAI_SYSTEM
ret i32 %11
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
@ENOSYS = global i32 0
@EAI_SYSTEM = global i32 0
define i32 @getaddrinfo(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.addrinfo* nocapture readnone %2, %struct.addrinfo** nocapture readnone %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
%7 = load i32, i32* @EAI_SYSTEM
ret i32 %7
}
void glutInit(int *argcp, char **argv) {}


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

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

LLVM IR (-O0):
define void @glutInit(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @glutInit(i32* nocapture %0, i8** nocapture %1) {
ret void
}
int max(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_opp(uintptr_t, uintptr_t);
void fiat_p384_opp(uint64_t out1[6], const uint64_t arg1[6]) {
  internal_fiat_p384_opp((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_opp>:
jmp    1030 <internal_fiat_p384_opp@plt>

LLVM IR (-O0):
define void @fiat_p384_opp(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p384_opp(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p384_opp(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char const *, int);
void kvtest_mkdir(const char *zDir) { (void)mkdir(zDir, 0755); }


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

x86 assembly (clang, -O2):
<kvtest_mkdir>:
mov    $0x1ed,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define void @kvtest_mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 493)
ret void
}
/* Variables and functions */
int countVowels(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%i\n", countVowels("Adam"));
  printf("%i\n", countVowels("aeiou"));
  printf("%i\n", countVowels("trlp"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <countVowels@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <countVowels@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <countVowels@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1040 <countVowels@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <countVowels@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1040 <countVowels@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [5 x i8] c"Adam\00"
@.str.2 = [6 x i8] c"aeiou\00"
@.str.3 = [5 x i8] c"trlp\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @countVowels(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @countVowels(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @countVowels(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [5 x i8] c"Adam\00"
@.str.2 = [6 x i8] c"aeiou\00"
@.str.3 = [5 x i8] c"trlp\00"
define i32 @main() {
%1 = tail call i32 @countVowels(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @countVowels(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @countVowels(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ resetFlag(int);
int /*<<< orphan*/ setFlag(int);
void SCF(void) {
  setFlag(4);
  resetFlag(6);
  resetFlag(5);
}


x86 assembly (clang, -O0):
<SCF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <setFlag@plt>
mov    $0x6,%edi
call   1040 <resetFlag@plt>
mov    $0x5,%edi
call   1040 <resetFlag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCF>:
push   %rax
mov    $0x4,%edi
call   1030 <setFlag@plt>
mov    $0x6,%edi
call   1040 <resetFlag@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <resetFlag@plt>

LLVM IR (-O0):
define void @SCF() {
%1 = call i32 @setFlag(i32 4)
%2 = call i32 @resetFlag(i32 6)
%3 = call i32 @resetFlag(i32 5)
ret void
}

LLVM IR (-O2):
define void @SCF() {
%1 = tail call i32 @setFlag(i32 4)
%2 = tail call i32 @resetFlag(i32 6)
%3 = tail call i32 @resetFlag(i32 5)
ret void
}
/* Variables and functions */
double fabs(double);
__attribute__((__weak__, __always___)) double softboundcets_fabs(double x) {
  return fabs(x);
}


x86 assembly (clang, -O0):
<softboundcets_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define weak double @softboundcets_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundcets_fabs(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Variables and functions */
int avx2_fallback();
int /*<<< orphan*/ exit(int);
void __handle_sigill() {
  int ret = avx2_fallback();
  exit(ret);
}


x86 assembly (clang, -O0):
<__handle_sigill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <avx2_fallback@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<__handle_sigill>:
push   %rax
xor    %eax,%eax
call   1040 <avx2_fallback@plt>
mov    %eax,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @__handle_sigill() {
%1 = alloca i32
%2 = call i32 (...) @avx2_fallback()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @__handle_sigill() {
%1 = tail call i32 (...) @avx2_fallback()
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int lksmith_destroy(void const *);
int r_pthread_spin_destroy(int /*<<< orphan*/ *);
int pthread_spin_destroy(pthread_spinlock_t *lock) {
  int ret;
  ret = lksmith_destroy((const void *)lock);
  if (ret)
    return ret;
  return r_pthread_spin_destroy(lock);
}


x86 assembly (clang, -O0):
<pthread_spin_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lksmith_destroy@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114d <pthread_spin_destroy+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <pthread_spin_destroy+0x39>
mov    -0x10(%rbp),%rdi
call   1040 <r_pthread_spin_destroy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_spin_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <lksmith_destroy@plt>
test   %eax,%eax
je     112f <pthread_spin_destroy+0xf>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <r_pthread_spin_destroy@plt>

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

LLVM IR (-O2):
define i32 @pthread_spin_destroy(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @lksmith_destroy(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @r_pthread_spin_destroy(i32* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ %3, %1 ]
ret i32 %8
}
/* Variables and functions */
int drand48();
double log1p(double);
double exprand() {
  double x = 1 - drand48();
  return log1p(x);
}


x86 assembly (clang, -O0):
<exprand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <drand48@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log1p@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exprand>:
push   %rax
xor    %eax,%eax
call   1040 <drand48@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rax
jmp    1030 <log1p@plt>

LLVM IR (-O0):
define double @exprand() {
%1 = alloca double
%2 = call i32 (...) @drand48()
%3 = sub nsw i32 1, %2
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = load double, double* %1
%6 = call double @log1p(double %5)
ret double %6
}

LLVM IR (-O2):
define double @exprand() {
%1 = tail call i32 (...) @drand48()
%2 = sub nsw i32 1, %1
%3 = sitofp i32 %2 to double
%4 = tail call double @log1p(double %3)
ret double %4
}
/* Type definitions */
struct expr {
  int dummy;
};

/* Variables and functions */
struct expr *ModAndDupParse(void *, struct expr *, char const *, char *);
struct expr *DuplicateParse(void *theEnv, struct expr *top,
                            const char *logicalName) {
  return (ModAndDupParse(theEnv, top, logicalName, "duplicate"));
}


x86 assembly (clang, -O0):
<DuplicateParse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec9(%rip),%rcx
call   1030 <ModAndDupParse@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DuplicateParse>:
lea    0xee9(%rip),%rcx
jmp    1030 <ModAndDupParse@plt>

LLVM IR (-O0):
%struct.expr = type { i32 }
@.str = [10 x i8] c"duplicate\00"
define %struct.expr* @DuplicateParse(i8* %0, %struct.expr* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.expr*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.expr* %1, %struct.expr** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.expr*, %struct.expr** %5
%9 = load i8*, i8** %6
%10 = call %struct.expr* @ModAndDupParse(i8* %7, %struct.expr* %8, i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret %struct.expr* %10
}

LLVM IR (-O2):
%struct.expr = type { i32 }
@.str = [10 x i8] c"duplicate\00"
define %struct.expr* @DuplicateParse(i8* %0, %struct.expr* %1, i8* %2) {
%4 = tail call %struct.expr* @ModAndDupParse(i8* %0, %struct.expr* %1, i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret %struct.expr* %4
}
/* Variables and functions */
int /*<<< orphan*/ finn_mat4_identity(float *);
void finn_mat4_translate(float *mat, float *vec) {
  finn_mat4_identity(mat);
  mat[12] = vec[0];
  mat[13] = vec[1];
  mat[14] = vec[2];
}


x86 assembly (clang, -O0):
<finn_mat4_translate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <finn_mat4_identity@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x34(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x38(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_mat4_translate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <finn_mat4_identity@plt>
movss  (%r14),%xmm0
movss  %xmm0,0x30(%rbx)
movss  0x4(%r14),%xmm0
movss  %xmm0,0x34(%rbx)
movss  0x8(%r14),%xmm0
movss  %xmm0,0x38(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @finn_mat4_translate(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 = call i32 @finn_mat4_identity(float* %5)
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 12
store float %9, float* %11
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 13
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %3
%21 = getelementptr inbounds float, float* %20, i64 14
store float %19, float* %21
ret void
}

LLVM IR (-O2):
define void @finn_mat4_translate(float* %0, float* nocapture %1) {
%3 = tail call i32 @finn_mat4_identity(float* %0)
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 12
store float %4, float* %5
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 13
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = getelementptr inbounds float, float* %0, i64 14
store float %10, float* %11
ret void
}
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *__wrap_memcpy(void *destination, const void *source, size_t num) {
  return memmove(destination, source, num);
}


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

x86 assembly (clang, -O2):
<__wrap_memcpy>:
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define i8* @__wrap_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @__wrap_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int __fegetenv(fenv_t *envp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__fegetenv(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_wait(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ syserr(int, char *);
void cond_wait(pthread_cond_t *c, pthread_mutex_t *l) {
  int err;
  if ((err = pthread_cond_wait(c, l)) != 0)
    syserr(err, "cond wait failed");
}


x86 assembly (clang, -O0):
<cond_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_cond_wait@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1158 <cond_wait+0x38>
mov    -0x14(%rbp),%edi
lea    0xead(%rip),%rsi
call   1040 <syserr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_wait>:
push   %rax
call   1030 <pthread_cond_wait@plt>
test   %eax,%eax
je     1139 <cond_wait+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <syserr@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"cond wait failed\00"
define void @cond_wait(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 = call i32 @pthread_cond_wait(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @syserr(i32 %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"cond wait failed\00"
define void @cond_wait(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_cond_wait(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @syserr(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void victoire(char c) {
  putchar('V');
  putchar('i');
  putchar('c');
  putchar('t');
  putchar('o');
  putchar('i');
  putchar('r');
  putchar('e');
  putchar(' ');
  putchar(c);
  putchar(' ');
  putchar('!');
  putchar(10);
}


x86 assembly (clang, -O0):
<victoire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<victoire>:
push   %rbx
mov    %edi,%ebx
mov    $0x56,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x63,%edi
call   1030 <putchar@plt>
mov    $0x74,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x69,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x21,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @victoire(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @putchar(i32 86)
%4 = call i32 @putchar(i32 105)
%5 = call i32 @putchar(i32 99)
%6 = call i32 @putchar(i32 116)
%7 = call i32 @putchar(i32 111)
%8 = call i32 @putchar(i32 105)
%9 = call i32 @putchar(i32 114)
%10 = call i32 @putchar(i32 101)
%11 = call i32 @putchar(i32 32)
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = call i32 @putchar(i32 %13)
%15 = call i32 @putchar(i32 32)
%16 = call i32 @putchar(i32 33)
%17 = call i32 @putchar(i32 10)
ret void
}

LLVM IR (-O2):
define void @victoire(i8 signext %0) {
%2 = tail call i32 @putchar(i32 86)
%3 = tail call i32 @putchar(i32 105)
%4 = tail call i32 @putchar(i32 99)
%5 = tail call i32 @putchar(i32 116)
%6 = tail call i32 @putchar(i32 111)
%7 = tail call i32 @putchar(i32 105)
%8 = tail call i32 @putchar(i32 114)
%9 = tail call i32 @putchar(i32 101)
%10 = tail call i32 @putchar(i32 32)
%11 = sext i8 %0 to i32
%12 = tail call i32 @putchar(i32 %11)
%13 = tail call i32 @putchar(i32 32)
%14 = tail call i32 @putchar(i32 33)
%15 = tail call i32 @putchar(i32 10)
ret void
}
int imax(int v1, int v2) { return ((v1 > v2) ? v1 : v2); }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int check_words(char c, const char *delim) {
  int i;
  i = 0;
  while (delim[i] != 0) {
    if (c == delim[i])
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<check_words>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <check_words+0x5c>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <check_words+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1163 <check_words+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <check_words+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_words>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1120 <check_words+0x20>
add    $0x1,%rsi
nop
cmp    %dil,%cl
je     1121 <check_words+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <check_words+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_words(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_sendbit(int);
void i2c_sendbyte(uint8_t x) {
  uint8_t bit;
  for (bit = 0; bit < 8; bit++) {
    i2c_sendbit((x & 0x80) != 0);
    x <<= 1;
  }
}


x86 assembly (clang, -O0):
<i2c_sendbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    115b <i2c_sendbyte+0x4b>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <i2c_sendbit@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <i2c_sendbyte+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_sendbyte>:
push   %rbx
mov    %edi,%ebx
shr    $0x7,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
call   1030 <i2c_sendbit@plt>
and    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <i2c_sendbit@plt>

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

LLVM IR (-O2):
define void @i2c_sendbyte(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
%4 = tail call i32 @i2c_sendbit(i32 %3)
%5 = lshr i32 %0, 6
%6 = and i32 %5, 1
%7 = tail call i32 @i2c_sendbit(i32 %6)
%8 = lshr i32 %0, 5
%9 = and i32 %8, 1
%10 = tail call i32 @i2c_sendbit(i32 %9)
%11 = lshr i32 %0, 4
%12 = and i32 %11, 1
%13 = tail call i32 @i2c_sendbit(i32 %12)
%14 = lshr i32 %0, 3
%15 = and i32 %14, 1
%16 = tail call i32 @i2c_sendbit(i32 %15)
%17 = lshr i32 %0, 2
%18 = and i32 %17, 1
%19 = tail call i32 @i2c_sendbit(i32 %18)
%20 = lshr i32 %0, 1
%21 = and i32 %20, 1
%22 = tail call i32 @i2c_sendbit(i32 %21)
%23 = and i32 %0, 1
%24 = tail call i32 @i2c_sendbit(i32 %23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int options_chatter(int chatter) {
  if (chatter == 1) {
    printf("Chatter Disabled");
    chatter = 0;
  } else {
    printf("Chatter Enabled");
    chatter = 1;
  }
  printf("\n");
  return chatter;
}


x86 assembly (clang, -O0):
<options_chatter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113d <options_chatter+0x2d>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1150 <options_chatter+0x40>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<options_chatter>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x1,%edi
setne  %bl
lea    0xed0(%rip),%rax
lea    0xeda(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Chatter Disabled\00"
@.str.1 = [16 x i8] c"Chatter Enabled\00"
define i32 @options_chatter(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* dereferenceable(1) %3)
%7 = tail call i32 @putchar(i32 10)
ret i32 %5
}
/* Type definitions */
struct mbuf {
  int dummy;
};

/* Variables and functions */
struct mbuf *mb_pool_alloc();
struct mbuf *mb_alloc(void) {
  struct mbuf *m;
  m = mb_pool_alloc();
  return m;
}


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

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

LLVM IR (-O0):
%struct.mbuf = type { i32 }
define %struct.mbuf* @mb_alloc() {
%1 = alloca %struct.mbuf*
%2 = call %struct.mbuf* (...) @mb_pool_alloc()
store %struct.mbuf* %2, %struct.mbuf** %1
%3 = load %struct.mbuf*, %struct.mbuf** %1
ret %struct.mbuf* %3
}

LLVM IR (-O2):
%struct.mbuf = type { i32 }
define %struct.mbuf* @mb_alloc() {
%1 = tail call %struct.mbuf* (...) @mb_pool_alloc()
ret %struct.mbuf* %1
}
/* Variables and functions */
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int isAppUninstalled(char *packagePath) {
  if (access(packagePath, 0) == -1) {
    printf("app uninstalled. file:'%s' not exits.\n", packagePath);
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isAppUninstalled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <access@plt>
cmp    $0xffffffff,%eax
jne    115c <isAppUninstalled+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <isAppUninstalled+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAppUninstalled>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <access@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1139 <isAppUninstalled+0x19>
pop    %rbx
ret
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"app uninstalled. file:'%s' not exits.\0A\00"
define i32 @isAppUninstalled(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @access(i8* %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [39 x i8] c"app uninstalled. file:'%s' not exits.\0A\00"
define i32 @isAppUninstalled(i8* %0) {
%2 = tail call i32 @access(i8* %0, i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 1, %1 ]
ret i32 %7
}
int test_imm_DBint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xDB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DBint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 14352384
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_51int64_lowword_mem(long long *val) {
  return ((*val) & (0x51 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_51int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 81
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}