xunge/DecIR huggingface dataset:
int test_imm_04uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x04 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_04uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 4
%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_04uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 262144
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long double fmind(long double x, long double y) { return (x < y ? x : y); }


x86 assembly (clang, -O0):
<fmind>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jbe    1130 <fmind+0x30>
jmp    1125 <fmind+0x25>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1136 <fmind+0x36>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmind>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fucomi %st(1),%st
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fmind(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load x86_fp80, x86_fp80* %3
br label %12
10: ; preds = %2
%11 = load x86_fp80, x86_fp80* %4
br label %12
12: ; preds = %10, %8
%13 = phi x86_fp80 [ %9, %8 ], [ %11, %10 ]
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @fmind(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = select i1 %3, x86_fp80 %0, x86_fp80 %1
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
long syscall(int /*<<< orphan*/);
long sys_gettid(void) { return syscall(__NR_gettid); }


x86 assembly (clang, -O0):
<sys_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_gettid = global i32 0
define i64 @sys_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = call i64 @syscall(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@__NR_gettid = global i32 0
define i64 @sys_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = tail call i64 @syscall(i32 %1)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLvoid;

/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ GL_TRIANGLE_STRIP;
int /*<<< orphan*/ GL_UNSIGNED_SHORT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glDrawElements(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ glutSwapBuffers();
void display() {
  int i, start;
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glDrawElements(GL_TRIANGLE_STRIP, (11 - 1) * ((2 * 11) + 1),
                 GL_UNSIGNED_SHORT, ((GLvoid *)NULL + 0));
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    $0xe6,%esi
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <glDrawElements@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e90(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    $0xe6,%esi
xor    %ecx,%ecx
call   1050 <glDrawElements@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TRIANGLE_STRIP = global i32 0
@GL_UNSIGNED_SHORT = global i32 0
define void @display() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @GL_COLOR_BUFFER_BIT
%4 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%5 = or i32 %3, %4
%6 = call i32 @glClear(i32 %5)
%7 = load i32, i32* @GL_TRIANGLE_STRIP
%8 = load i32, i32* @GL_UNSIGNED_SHORT
%9 = call i32 @glDrawElements(i32 %7, i32 230, i32 %8, i32* null)
%10 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
@GL_TRIANGLE_STRIP = global i32 0
@GL_UNSIGNED_SHORT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = load i32, i32* @GL_TRIANGLE_STRIP
%6 = load i32, i32* @GL_UNSIGNED_SHORT
%7 = tail call i32 @glDrawElements(i32 %5, i32 230, i32 %6, i32* null)
%8 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u64;

/* Variables and functions */
int __get_unaligned_le32(int /*<<< orphan*/ const *);
__u64 __get_unaligned_le64(const __u8 *p) {
  return (__u64)__get_unaligned_le32(p + 4) << 32 | __get_unaligned_le32(p);
}


x86 assembly (clang, -O0):
<__get_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <__get_unaligned_le32@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__get_unaligned_le32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_le64>:
push   %rbx
mov    %rdi,%rbx
add    $0x10,%rdi
call   1030 <__get_unaligned_le32@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__get_unaligned_le32@plt>

LLVM IR (-O0):
define i32 @__get_unaligned_le64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = call i32 @__get_unaligned_le32(i32* %4)
%6 = shl i32 %5, 32
%7 = load i32*, i32** %2
%8 = call i32 @__get_unaligned_le32(i32* %7)
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__get_unaligned_le64(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = tail call i32 @__get_unaligned_le32(i32* %2)
%4 = tail call i32 @__get_unaligned_le32(i32* %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned int);
void readfunc(unsigned long addr, unsigned int size) {
  printf("Detected memory read at <%#08llx> of bytes %u\n", addr, size);
}


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

x86 assembly (clang, -O2):
<readfunc>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Detected memory read at <%llx> of bytes %u\0A\00"
define void @readfunc(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Detected memory read at <%llx> of bytes %u\0A\00"
define void @readfunc(i64 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %1)
ret void
}
/* Type definitions */
struct pkt_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _hex(int /*<<< orphan*/, size_t);
size_t pkt_len(struct pkt_buff *);
int /*<<< orphan*/ pkt_pull(struct pkt_buff *, size_t);
int /*<<< orphan*/ tprintf(char *);
void hex(struct pkt_buff *pkt) {
  size_t len = pkt_len(pkt);
  if (!len)
    return;
  _hex(pkt_pull(pkt, len), len);
  tprintf("\n");
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <pkt_len@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <hex+0x29>
jmp    118d <hex+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <pkt_pull@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <_hex@plt>
lea    0xe78(%rip),%rdi
call   1050 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1060 <pkt_len@plt>
test   %rax,%rax
je     117c <hex+0x3c>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <pkt_pull@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <_hex@plt>
lea    0xe90(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <tprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @hex(%struct.pkt_buff* %0) {
%2 = alloca %struct.pkt_buff*
%3 = alloca i64
store %struct.pkt_buff* %0, %struct.pkt_buff** %2
%4 = load %struct.pkt_buff*, %struct.pkt_buff** %2
%5 = call i64 @pkt_len(%struct.pkt_buff* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
br label %16
9: ; preds = %1
%10 = load %struct.pkt_buff*, %struct.pkt_buff** %2
%11 = load i64, i64* %3
%12 = call i32 @pkt_pull(%struct.pkt_buff* %10, i64 %11)
%13 = load i64, i64* %3
%14 = call i32 @_hex(i32 %12, i64 %13)
%15 = call i32 @tprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [2 x i8] c"\0A\00"
define void @hex(%struct.pkt_buff* %0) {
%2 = tail call i64 @pkt_len(%struct.pkt_buff* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @pkt_pull(%struct.pkt_buff* %0, i64 %2)
%6 = tail call i32 @_hex(i32 %5, i64 %2)
%7 = tail call i32 @tprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %1, %4
ret void
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_sb_alloc();
struct clad_sb *clad_sb_init_cstr(int /*<<< orphan*/, char *);
struct clad_sb *clad_sb_make_cstr(char *cstr) {
  return clad_sb_init_cstr(clad_sb_alloc(), cstr);
}


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

x86 assembly (clang, -O2):
<clad_sb_make_cstr>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clad_sb_alloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <clad_sb_init_cstr@plt>

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_make_cstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @clad_sb_alloc()
%4 = load i8*, i8** %2
%5 = call %struct.clad_sb* @clad_sb_init_cstr(i32 %3, i8* %4)
ret %struct.clad_sb* %5
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_make_cstr(i8* %0) {
%2 = tail call i32 (...) @clad_sb_alloc()
%3 = tail call %struct.clad_sb* @clad_sb_init_cstr(i32 %2, i8* %0)
ret %struct.clad_sb* %3
}
int sys_unmount(int fd, const char *pos) {}


x86 assembly (clang, -O0):
<sys_unmount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sys_unmount(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t gettid() { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ __v16qi;
typedef scalar_t__ __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_add_epi8(__m128i a, __m128i b) {
  return (__m128i)((__v16qi)a + (__v16qi)b);
}


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

x86 assembly (clang, -O2):
<_mm_add_epi8>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_mm_add_epi8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_mm_add_epi8(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
void gtk_paint_arrow() {}


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

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

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

LLVM IR (-O2):
define void @gtk_paint_arrow() {
ret void
}
double logtwo(x)
double x;
{
  if (x <= 0)
    printf("%e\n", x);
  return ((double)(log(x) / log(2.0)));
}


x86 assembly (clang, -O0):
<logtwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     114e <logtwo+0x2e>
movsd  -0x8(%rbp),%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9b(%rip),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logtwo>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jb     1143 <logtwo+0x23>
lea    0xed6(%rip),%rdi
mov    $0x1,%al
movsd  %xmm0,(%rsp)
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <log@plt>
divsd  0xeb0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define double @logtwo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call double @log(double %9)
%11 = call double @log(double 2.000000e+00)
%12 = fdiv double %10, %11
ret double %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define double @logtwo(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
br label %5
5: ; preds = %3, %1
%6 = tail call double @log(double %0)
%7 = fdiv double %6, 0x3FE62E42FEFA39EF
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_zero(unsigned short _syslog, unsigned short _verbose,
                    const char *_function_name, const char *_file_name,
                    int _line_number, int _errno) {
  pfpanic("Unexpected zero occurred", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pfpanic_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_zero>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Unexpected zero occurred\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zero(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_SOFTWARE
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Unexpected zero occurred\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zero(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void p_range(const uint8_t *data, const size_t len) {
  for (size_t i = 0; i < len; ++i) {
    printf("%02X-", data[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<p_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <p_range+0x50>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <p_range+0x18>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_range>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1157 <p_range+0x37>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <p_range+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02X-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @p_range(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%02X-\00"
define void @p_range(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
/* Variables and functions */
double _acos(double);
double acos(double x) { return _acos(x); }


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

x86 assembly (clang, -O2):
<acos>:
jmp    1030 <_acos@plt>

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

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @_acos(double %0)
ret double %2
}
/* Variables and functions */
void *binary_search(void const *, void const *, int /*<<< orphan*/, size_t,
                    size_t, int (*)(void const *, void const *));
void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
              int (*compar)(const void *, const void *)) {
  return binary_search(key, base, 0, nmemb, size, compar);
}


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

x86 assembly (clang, -O2):
<bsearch>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <binary_search@plt>

LLVM IR (-O0):
define i8* @bsearch(i8* %0, i8* %1, i64 %2, i64 %3, i32 (i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32 (i8*, i8*)* %4, i32 (i8*, i8*)** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%16 = call i8* @binary_search(i8* %11, i8* %12, i32 0, i64 %13, i64 %14, i32 (i8*, i8*)* %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @bsearch(i8* %0, i8* %1, i64 %2, i64 %3, i32 (i8*, i8*)* %4) {
%6 = tail call i8* @binary_search(i8* %0, i8* %1, i32 0, i64 %2, i64 %3, i32 (i8*, i8*)* %4)
ret i8* %6
}
void ble_rsp_hardware_analog_comparator_read(
    const struct ble_msg_hardware_analog_comparator_read_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_analog_comparator_read_rsp_t = type opaque
define void @ble_rsp_hardware_analog_comparator_read(%struct.ble_msg_hardware_analog_comparator_read_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glLightf(unsigned int, unsigned int, float);
void Lightf(unsigned int l, unsigned int p, float v) { glLightf(l, p, v); }


x86 assembly (clang, -O0):
<Lightf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
call   1030 <glLightf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lightf>:
jmp    1030 <glLightf@plt>

LLVM IR (-O0):
define void @Lightf(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @glLightf(i32 %7, i32 %8, float %9)
ret void
}

LLVM IR (-O2):
define void @Lightf(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @glLightf(i32 %0, i32 %1, float %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("lcalc") ? "lcalc" : "lcalc"), "1.3 Dec 1, 2009");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdline_parser_print_version>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
lea    0xee8(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"lcalc\00"
@.str.2 = [16 x i8] c"1.3 Dec 1, 2009\00"
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [6 x i8] c"lcalc\00"
@.str.2 = [16 x i8] c"1.3 Dec 1, 2009\00"
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int user_free(void *mem) {
  int val;
  __asm__ __volatile__("int $0x40" : "=a"(val) : "a"(68), "b"(13), "c"(mem));
  return val;
}


x86 assembly (clang, -O0):
<user_free>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_free>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0xd,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @user_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 13, i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @user_free(i8* %0) {
%2 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 13, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *killer(void *arg) {
  int time = (int)arg;
  sleep(time);
  printf("Killer thread timing out. (Program hung?)  Die!  Die!  Die!\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<killer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <sleep@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<killer>:
push   %rax
call   1050 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Killer thread timing out. (Program hung?) Die! Die! Die!\0A\00"
define i8* @killer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @sleep(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"Killer thread timing out. (Program hung?) Die! Die! Die!\00"
define noalias i8* @killer(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @sleep(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
}
void errorFn(void) {
  {
  ERROR:
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<errorFn>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <errorFn+0x9>
jmp    1109 <errorFn+0x9>

x86 assembly (clang, -O2):
<errorFn>:
jmp    1100 <errorFn>

LLVM IR (-O0):
define void @errorFn() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @errorFn() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void underline(FILE *ofp, int count, char character) {
  int i;
  for (i = 0; i < count; i++)
    fprintf(ofp, "%c", character);
  fprintf(ofp, "\n");
}


x86 assembly (clang, -O0):
<underline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <underline+0x4b>
mov    -0x8(%rbp),%rdi
movsbl -0xd(%rbp),%edx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <underline+0x1b>
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<underline>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    112f <underline+0x1f>
mov    %esi,%ebp
movsbl %dl,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <underline+0x10>
mov    $0xa,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @underline(i32* %0, i32 %1, i8 signext %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
%21 = load i32*, i32** %4
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @underline(i32* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = sext i8 %2 to i32
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %10, %7 ]
%9 = tail call i32 @fputc(i32 %6, i32* %0)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %7
12: ; preds = %7, %3
%13 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a % b == 0) {
    printf("MULTIPLO\n");
  } else {
    printf("NAO E MULTIPLO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
test   %edx,%edx
lea    0xec6(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@str = [15 x i8] c"NAO E MULTIPLO\00"
@str.3 = [9 x i8] c"MULTIPLO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}
void use(char *p) {
  if (!p)
    return;
  p[0] = 'a';
}


x86 assembly (clang, -O0):
<use>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <use+0x18>
jmp    111f <use+0x1f>
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<use>:
test   %rdi,%rdi
je     1108 <use+0x8>
movb   $0x61,(%rdi)
ret

LLVM IR (-O0):
define void @use(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 97, i8* %8
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @use(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i8 97, i8* %0
br label %4
4: ; preds = %1, %3
ret void
}
char *strerror(int errnum) { return ""; }


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int myresponse(char *buf, int good) {
  buf[0] = 0x00;
  if (good)
    buf[1] = 0x5A;
  else
    buf[1] = 0x5B;
  return 8;
}


x86 assembly (clang, -O0):
<myresponse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1129 <myresponse+0x29>
mov    -0x8(%rbp),%rax
movb   $0x5a,0x1(%rax)
jmp    1131 <myresponse+0x31>
mov    -0x8(%rbp),%rax
movb   $0x5b,0x1(%rax)
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myresponse>:
movb   $0x0,(%rdi)
test   %esi,%esi
sete   %al
or     $0x5a,%al
mov    %al,0x1(%rdi)
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @myresponse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8 90, i8* %11
br label %15
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 91, i8* %14
br label %15
15: ; preds = %12, %9
ret i32 8
}

LLVM IR (-O2):
define i32 @myresponse(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8 91, i8 90
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
ret i32 8
}
int m_min(int arg1, int arg2) { return (arg1 < arg2) ? arg1 : arg2; }


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

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

LLVM IR (-O0):
define i32 @m_min(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 slt 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 @m_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned char testFuncStatementbool1(unsigned char bool1, unsigned char bool2) {
  return (bool1 && bool2);
}


x86 assembly (clang, -O0):
<testFuncStatementbool1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
je     112f <testFuncStatementbool1+0x2f>
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementbool1>:
test   %edi,%edi
setne  %cl
test   %esi,%esi
setne  %al
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @testFuncStatementbool1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @testFuncStatementbool1(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ne i8 %0, 0
%4 = icmp ne i8 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i8
ret i8 %6
}
int rdar8414119_bar(unsigned x) { return x >= 0; }


x86 assembly (clang, -O0):
<rdar8414119_bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rdar8414119_bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @rdar8414119_bar(i32 %0) {
ret i32 1
}
void proc_call_5(int p0, int p1, int p2, int p3, int p4) {}


x86 assembly (clang, -O0):
<proc_call_5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @proc_call_5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @proc_call_5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
double ls_costN_nm6_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_costN_nm6_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm6_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm6_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_costN_nm6_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
char *poller_name() { return "select"; }


x86 assembly (clang, -O0):
<poller_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poller_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
define i8* @poller_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @poller_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello BVB"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello BVB\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void WT_BARRIER(void) { return; }


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

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

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

LLVM IR (-O2):
define void @WT_BARRIER() {
ret void
}
void halt() { __asm__ __volatile__("hlt"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int foo(void) {
  static int x asm("x") = 3;
  return x++;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@x = internal global i32 3
define i32 @foo() {
%1 = load i32, i32* @x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @x
ret i32 %1
}

LLVM IR (-O2):
@x = internal unnamed_addr global i32 3
define i32 @foo() {
%1 = load i32, i32* @x
%2 = add nsw i32 %1, 1
store i32 %2, i32* @x
ret i32 %1
}
unsigned int test4(unsigned int g, unsigned int h) { return (g ^ h) != 0; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @test4(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ strcmp(char *, char *);
h(char *p) {
  static int called;
  if (called)
    abort();
  if (strcmp(p, "hi"))
    abort();
  called = 1;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpl   $0x0,0x2f01(%rip)
je     1140 <h+0x20>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1161 <h+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
movl   $0x1,0x2ec9(%rip)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
je     1144 <h+0x24>
lea    0xecf(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1144 <h+0x24>
movb   $0x1,0x2ef2(%rip)
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@h.called = internal global i32 0
@.str = [3 x i8] c"hi\00"
define i32 @h(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @h.called
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
store i32 1, i32* @h.called
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@h.called = internal unnamed_addr global i1 false
@.str = [3 x i8] c"hi\00"
define i32 @h(i8* %0) {
%2 = load i1, i1* @h.called
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
store i1 true, i1* @h.called
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test();
long main() {
  test();
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = call i32 (...) @test()
ret i64 0
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i32 (...) @test()
ret i64 0
}