xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ creature_encounter();
int d(int);
int /*<<< orphan*/ niceprint(char *);
void aground(void) {
  niceprint("If the party is traveling by boat or raft, the vessel hits a "
            "shallow area or sandbar "
            "and runs aground. The characters can push the vessel back into "
            "the water with a successful "
            "DC 10 group Strength (Athletics) check.\n\n");
  if (d(2) == 1)
    creature_encounter();
}


x86 assembly (clang, -O0):
<aground>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <niceprint@plt>
mov    $0x2,%edi
call   1030 <d@plt>
cmp    $0x1,%eax
jne    115a <aground+0x2a>
mov    $0x0,%al
call   1050 <creature_encounter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aground>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <niceprint@plt>
mov    $0x2,%edi
call   1030 <d@plt>
cmp    $0x1,%eax
jne    1154 <aground+0x24>
xor    %eax,%eax
pop    %rcx
jmp    1050 <creature_encounter@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [218 x i8] c"If the party is traveling by boat or raft, the vessel hits a shallow area or sandbar and runs aground. The characters can push the vessel back into the water with a successful DC 10 group Strength (Athletics) check.\0A\0A\00"
define void @aground() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @d(i32 2)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @creature_encounter()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [218 x i8] c"If the party is traveling by boat or raft, the vessel hits a shallow area or sandbar and runs aground. The characters can push the vessel back into the water with a successful DC 10 group Strength (Athletics) check.\0A\0A\00"
define void @aground() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @d(i32 2)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @creature_encounter()
br label %6
6: ; preds = %4, %0
ret void
}
void gtk_curve_set_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_curve_set_range() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_int(int);
void main(void) {
  test_int(-2);
  test_int(-1);
  test_int(0);
  test_int(1);
  test_int(2);
  test_int(3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffe,%edi
call   1030 <test_int@plt>
mov    $0xffffffff,%edi
call   1030 <test_int@plt>
xor    %edi,%edi
call   1030 <test_int@plt>
mov    $0x1,%edi
call   1030 <test_int@plt>
mov    $0x2,%edi
call   1030 <test_int@plt>
mov    $0x3,%edi
call   1030 <test_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffe,%edi
call   1030 <test_int@plt>
mov    $0xffffffff,%edi
call   1030 <test_int@plt>
xor    %edi,%edi
call   1030 <test_int@plt>
mov    $0x1,%edi
call   1030 <test_int@plt>
mov    $0x2,%edi
call   1030 <test_int@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <test_int@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @test_int(i32 -2)
%2 = call i32 @test_int(i32 -1)
%3 = call i32 @test_int(i32 0)
%4 = call i32 @test_int(i32 1)
%5 = call i32 @test_int(i32 2)
%6 = call i32 @test_int(i32 3)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @test_int(i32 -2)
%2 = tail call i32 @test_int(i32 -1)
%3 = tail call i32 @test_int(i32 0)
%4 = tail call i32 @test_int(i32 1)
%5 = tail call i32 @test_int(i32 2)
%6 = tail call i32 @test_int(i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateEnableExpClk(uint32_t ui32HibClk) {
  (*((volatile unsigned long *)(0x400FC010))) |= 0x00000040;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateEnableExpClk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x400fc010,%eax
mov    (%rax),%rcx
or     $0x40,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateEnableExpClk>:
orq    $0x40,0x400fc010
40 40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateEnableExpClk(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%4 = or i64 %3, 64
store volatile i64 %4, i64* inttoptr (i64 1074774032 to i64*)
%5 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateEnableExpClk(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%3 = or i64 %2, 64
store volatile i64 %3, i64* inttoptr (i64 1074774032 to i64*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
void pmsav8_adjust_lowmem_bounds(void) {}


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

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

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

LLVM IR (-O2):
define void @pmsav8_adjust_lowmem_bounds() {
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels8_8_sse4() {
ret void
}
void genmflo() {}


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

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

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

LLVM IR (-O2):
define void @genmflo() {
ret void
}
/* Variables and functions */
int f(int);
char *g(int x) { return "hello" + f(x); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
movslq %eax,%rcx
lea    0xed3(%rip),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
call   1030 <f@plt>
movslq %eax,%rcx
lea    0xee0(%rip),%rax
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i8* @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f(i32 %3)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %5
ret i8* %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i8* @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [6 x i8], [6 x i8]* @.str, i64 0, i64 %3
ret i8* %4
}
int main() {
  if (!L'\0' != 0)
    ;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_codecversion_callback(int32_t alpha, int32_t beta,
                                  uint32_t prefer_alpha, int32_t opus,
                                  void *user_data) {
  printf("codecversion_callback\n");
}


x86 assembly (clang, -O0):
<mumble_codecversion_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [22 x i8] c"codecversion_callback\00"
define void @mumble_codecversion_callback(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
signed short signedshort_ignoring_longlong(signed short x, long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshort_ignoring_longlong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_longlong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_longlong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
void RGMgmode(void) {}


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

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

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

LLVM IR (-O2):
define void @RGMgmode() {
ret void
}
/* Variables and functions */
int ASMD(int /*<<< orphan*/);
int /*<<< orphan*/ ana_str(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", ASMD(ana_str("1+2")));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb8(%rip),%rdi
call   1030 <ana_str@plt>
mov    %eax,%edi
call   1060 <ASMD@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <ana_str@plt>
mov    %eax,%edi
call   1060 <ASMD@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"1+2\00"
define i32 @main() {
%1 = call i32 @ana_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @ASMD(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"1+2\00"
define i32 @main() {
%1 = tail call i32 @ana_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @ASMD(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int *m_add(int);
int m_create(int, int);
int slop_add_msg(int msg) {
  int *m = m_add(msg);
  *m = m_create((100 * 1024), 1);
  return *m;
}


x86 assembly (clang, -O0):
<slop_add_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <m_add@plt>
mov    %rax,-0x10(%rbp)
mov    $0x19000,%edi
mov    $0x1,%esi
call   1040 <m_create@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slop_add_msg>:
push   %rbx
call   1030 <m_add@plt>
mov    %rax,%rbx
mov    $0x19000,%edi
mov    $0x1,%esi
call   1040 <m_create@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @slop_add_msg(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32* @m_add(i32 %4)
store i32* %5, i32** %3
%6 = call i32 @m_create(i32 102400, i32 1)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @slop_add_msg(i32 %0) {
%2 = tail call i32* @m_add(i32 %0)
%3 = tail call i32 @m_create(i32 102400, i32 1)
store i32 %3, i32* %2
ret i32 %3
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RED_LED_PIN() { return 0x01 & (inp_emulate(0x38) >> 7); }


x86 assembly (clang, -O0):
<TOSH_READ_RED_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
sar    $0x7,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RED_LED_PIN>:
push   %rax
mov    $0x38,%edi
call   1030 <inp_emulate@plt>
shr    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RED_LED_PIN() {
%1 = call i32 @inp_emulate(i32 56)
%2 = ashr i32 %1, 7
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RED_LED_PIN() {
%1 = tail call i32 @inp_emulate(i32 56)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 7
ret i8 %3
}
float __ocl_convert_float_long(long src) { return (float)src; }


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

x86 assembly (clang, -O2):
<__ocl_convert_float_long>:
cvtsi2ss %rdi,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_convert_float_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @__ocl_convert_float_long(i64 %0) {
%2 = sitofp i64 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int syscall(int /*<<< orphan*/, int, void *, int);
int xwrite(int fd, void *buf, int len) {
  return syscall((SYS_write), fd, buf, len);
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_write = global i32 0
define i32 @xwrite(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @SYS_write
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_prev(int session) { return (ap_do_command_only(session, 0xcc03)); }


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

x86 assembly (clang, -O2):
<ap_prev>:
mov    $0xcc03,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_prev(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52227)
ret i32 %2
}
int inc_and_chk(unsigned long long *const val, unsigned base, unsigned inc) {
  const unsigned long long new = *val *base + inc;
  int of = new < *val || *val *base < *val;
  *val = new;
  return of;
}


x86 assembly (clang, -O0):
<inc_and_chk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
mov    -0x10(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    $0x1,%al
cmp    (%rdx),%rcx
mov    %al,-0x1d(%rbp)
jb     1157 <inc_and_chk+0x57>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
setb   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_and_chk>:
mov    (%rdi),%rax
mov    %esi,%ecx
imul   %rax,%rcx
mov    %edx,%edx
add    %rcx,%rdx
cmp    %rax,%rdx
setb   %sil
cmp    %rax,%rcx
setb   %al
or     %sil,%al
movzbl %al,%eax
mov    %rdx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @inc_and_chk(i64* nocapture %0, i32 %1, i32 %2) {
%4 = load i64, i64* %0
%5 = zext i32 %1 to i64
%6 = mul i64 %4, %5
%7 = zext i32 %2 to i64
%8 = add i64 %6, %7
%9 = icmp ult i64 %8, %4
%10 = icmp ult i64 %6, %4
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
store i64 %8, i64* %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ triple(char *);
int main() {
  triple("/testbin/huge");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"/testbin/huge\00"
define i32 @main() {
%1 = tail call i32 @triple(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void *(rawmemchr)(const void *segment, int c) {
  char *s = segment;
  for (;;)
    if (*s++ == c)
      return s - 1;
}


x86 assembly (clang, -O0):
<rawmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1138 <rawmemchr+0x38>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret
jmp    1113 <rawmemchr+0x13>

x86 assembly (clang, -O2):
<rawmemchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %esi,%ecx
jne    1110 <rawmemchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @rawmemchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %3
9: ; preds = %3
ret i8* %4
}
/* Variables and functions */
void *calloc(int, size_t);
void *myzalloc(size_t size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<myzalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @myzalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
unsigned int count_ones(unsigned int bits) {
  unsigned int v = bits;
  unsigned int c = 0;
  for (c = 0; v; ++c) {
    v &= v - 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<count_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <count_ones+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <count_ones+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @count_ones(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int function4(void) {
  static int i;
  static int state = 0;
  switch (state) {
  case 0:;
    for (i = 0; i < 10; ++i)
      do {
        state = 58;
        return i;
      case 58:;
      } while (0);
  };
  return -1;
}


x86 assembly (clang, -O0):
<function4>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function4+0x2b>
jmp    111a <function4+0x1a>
mov    -0x8(%rbp),%eax
sub    $0x3a,%eax
je     115f <function4+0x5f>
jmp    1182 <function4+0x82>
movl   $0x0,0x2eef(%rip)
cmpl   $0xa,0x2ee8(%rip)
jge    117d <function4+0x7d>
jmp    1147 <function4+0x47>
movl   $0x3a,0x2ed7(%rip)
mov    0x2ecd(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <function4+0x89>
jmp    1164 <function4+0x64>
jmp    1169 <function4+0x69>
mov    0x2eb5(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eac(%rip)
jmp    1135 <function4+0x35>
jmp    1182 <function4+0x82>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function4>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmpb   $0x0,0x2f16(%rip)
cmovne %eax,%ecx
mov    %ecx,0x2f09(%rip)
mov    $0xffffffff,%eax
cmp    $0x9,%ecx
jg     112e <function4+0x2e>
movb   $0x1,0x2efc(%rip)
mov    %ecx,%eax
ret

LLVM IR (-O0):
@function4.i = internal global i32 0
@function4.state = internal global i32 0
define i32 @function4() {
%1 = alloca i32
%2 = load i32, i32* @function4.state
switch i32 %2, label %16 [
i32 0, label %3
i32 58, label %10
]
3: ; preds = %0
store i32 0, i32* @function4.i
br label %4
4: ; preds = %12, %3
%5 = load i32, i32* @function4.i
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
br label %8
8: ; preds = %7
store i32 58, i32* @function4.state
%9 = load i32, i32* @function4.i
store i32 %9, i32* %1
br label %17
10: ; preds = %0
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = load i32, i32* @function4.i
%14 = add nsw i32 %13, 1
store i32 %14, i32* @function4.i
br label %4
15: ; preds = %4
br label %16
16: ; preds = %15, %0
store i32 -1, i32* %1
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@function4.i = internal unnamed_addr global i32 0
@function4.state = internal unnamed_addr global i1 false
define i32 @function4() {
%1 = load i1, i1* @function4.state
%2 = load i32, i32* @function4.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function4.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function4.state
br label %7
7: ; preds = %0, %6
%8 = phi i32 [ %4, %6 ], [ -1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ chew();
int /*<<< orphan*/ prout(char *);
int /*<<< orphan*/ skip(int);
void huh(void) {
  chew();
  skip(1);
  prout("Beg your pardon, Captain?");
}


x86 assembly (clang, -O0):
<huh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <chew@plt>
mov    $0x1,%edi
call   1030 <skip@plt>
lea    0xeb4(%rip),%rdi
call   1050 <prout@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<huh>:
push   %rax
xor    %eax,%eax
call   1040 <chew@plt>
mov    $0x1,%edi
call   1030 <skip@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1050 <prout@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Beg your pardon, Captain?\00"
define void @huh() {
%1 = call i32 (...) @chew()
%2 = call i32 @skip(i32 1)
%3 = call i32 @prout(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Beg your pardon, Captain?\00"
define void @huh() {
%1 = tail call i32 (...) @chew()
%2 = tail call i32 @skip(i32 1)
%3 = tail call i32 @prout(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int _conf_parse_int(char *token, const char *name, int *value) {
  if (token) {
    *value = atoi(token);
  } else {
    fprintf(stderr, "Error: Empty %s value in configuration.\n", name);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_conf_parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <_conf_parse_int+0x35>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    117a <_conf_parse_int+0x5a>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1181 <_conf_parse_int+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_conf_parse_int>:
push   %rbx
test   %rdi,%rdi
je     1134 <_conf_parse_int+0x14>
mov    %rdx,%rbx
call   1040 <atoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    %rsi,%rdx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Error: Empty %s value in configuration.\0A\00"
define i32 @_conf_parse_int(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = call i32 @atoi(i8* %11)
%13 = load i32*, i32** %7
store i32 %12, i32* %13
br label %18
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %6
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 1, i32* %4
br label %19
18: ; preds = %10
store i32 0, i32* %4
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Error: Empty %s value in configuration.\0A\00"
define i32 @_conf_parse_int(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @atoi(i8* %0)
store i32 %6, i32* %2
br label %10
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %10
10: ; preds = %5, %7
%11 = phi i32 [ 0, %5 ], [ 1, %7 ]
ret i32 %11
}
/* Type definitions */
struct TimeStampHashTable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct TimeStampHashTable *);
void timeStampHashTableDelete(struct TimeStampHashTable *timeStampHashTable) {
  free(timeStampHashTable);
}


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

x86 assembly (clang, -O2):
<timeStampHashTableDelete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.TimeStampHashTable = type { i32 }
define void @timeStampHashTableDelete(%struct.TimeStampHashTable* %0) {
%2 = alloca %struct.TimeStampHashTable*
store %struct.TimeStampHashTable* %0, %struct.TimeStampHashTable** %2
%3 = load %struct.TimeStampHashTable*, %struct.TimeStampHashTable** %2
%4 = call i32 @free(%struct.TimeStampHashTable* %3)
ret void
}

LLVM IR (-O2):
%struct.TimeStampHashTable = type { i32 }
define void @timeStampHashTableDelete(%struct.TimeStampHashTable* nocapture %0) {
%2 = tail call i32 @free(%struct.TimeStampHashTable* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_square(int);
int main(void) {
  print_square(1);
  print_square(2);
  print_square(3);
  print_square(4);
  print_square(10);
  print_square(-2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <print_square@plt>
mov    $0x2,%edi
call   1030 <print_square@plt>
mov    $0x3,%edi
call   1030 <print_square@plt>
mov    $0x4,%edi
call   1030 <print_square@plt>
mov    $0xa,%edi
call   1030 <print_square@plt>
mov    $0xfffffffe,%edi
call   1030 <print_square@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <print_square@plt>
mov    $0x2,%edi
call   1030 <print_square@plt>
mov    $0x3,%edi
call   1030 <print_square@plt>
mov    $0x4,%edi
call   1030 <print_square@plt>
mov    $0xa,%edi
call   1030 <print_square@plt>
mov    $0xfffffffe,%edi
call   1030 <print_square@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print_square(i32 1)
%3 = call i32 @print_square(i32 2)
%4 = call i32 @print_square(i32 3)
%5 = call i32 @print_square(i32 4)
%6 = call i32 @print_square(i32 10)
%7 = call i32 @print_square(i32 -2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_square(i32 1)
%2 = tail call i32 @print_square(i32 2)
%3 = tail call i32 @print_square(i32 3)
%4 = tail call i32 @print_square(i32 4)
%5 = tail call i32 @print_square(i32 10)
%6 = tail call i32 @print_square(i32 -2)
ret i32 0
}
const char *rndrm99_get_title(void) {
  return "Randomly create and remove directories and files";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Randomly create and remove directories and files\00"
define i8* @rndrm99_get_title() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Randomly create and remove directories and files\00"
define i8* @rndrm99_get_title() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct Xploit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ create_x86_elf(char *, unsigned char *, unsigned int);
int dummy_exp(struct Xploit *xp, unsigned char *rawPayload,
              unsigned int rawPayloadLen) {
  unsigned char *payload;
  unsigned int payload_len;
  void (*fptr)();
  payload = rawPayload;
  payload_len = rawPayloadLen;
  create_x86_elf("dummy-ng", payload, payload_len);
  return 0;
}


x86 assembly (clang, -O0):
<dummy_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    0xec1(%rip),%rdi
call   1030 <create_x86_elf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Xploit = type { i32 }
@.str = [9 x i8] c"dummy-ng\00"
define i32 @dummy_exp(%struct.Xploit* %0, i8* %1, i32 %2) {
%4 = alloca %struct.Xploit*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca void (...)*
store %struct.Xploit* %0, %struct.Xploit** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%10 = load i8*, i8** %5
store i8* %10, i8** %7
%11 = load i32, i32* %6
store i32 %11, i32* %8
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @create_x86_elf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
%struct.Xploit = type { i32 }
@.str = [9 x i8] c"dummy-ng\00"
define i32 @dummy_exp(%struct.Xploit* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @create_x86_elf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
scalar_t__ SQLITE_DONE;
int /*<<< orphan*/ sqlerr(char *);
scalar_t__ sqlite3_reset(int /*<<< orphan*/ *);
scalar_t__ sqlite3_step(int /*<<< orphan*/ *);
void step(char *desc, sqlite3_stmt *step) {
  if (sqlite3_step(step) != SQLITE_DONE)
    sqlerr(desc);
  if (sqlite3_reset(step))
    sqlerr(desc);
}


x86 assembly (clang, -O0):
<step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <sqlite3_step@plt>
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
je     1162 <step+0x32>
mov    -0x8(%rbp),%rdi
call   1040 <sqlerr@plt>
mov    -0x10(%rbp),%rdi
call   1030 <sqlite3_reset@plt>
cmp    $0x0,%rax
je     117e <step+0x4e>
mov    -0x8(%rbp),%rdi
call   1040 <sqlerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<step>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <sqlite3_step@plt>
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
je     1156 <step+0x26>
mov    %r14,%rdi
call   1040 <sqlerr@plt>
mov    %rbx,%rdi
call   1030 <sqlite3_reset@plt>
test   %rax,%rax
je     1172 <step+0x42>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sqlerr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SQLITE_DONE = global i64 0
define void @step(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i64 @sqlite3_step(i32* %5)
%7 = load i64, i64* @SQLITE_DONE
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @sqlerr(i8* %10)
br label %12
12: ; preds = %9, %2
%13 = load i32*, i32** %4
%14 = call i64 @sqlite3_reset(i32* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i8*, i8** %3
%18 = call i32 @sqlerr(i8* %17)
br label %19
19: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@SQLITE_DONE = global i64 0
define void @step(i8* %0, i32* %1) {
%3 = tail call i64 @sqlite3_step(i32* %1)
%4 = load i64, i64* @SQLITE_DONE
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @sqlerr(i8* %0)
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @sqlite3_reset(i32* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @sqlerr(i8* %0)
br label %13
13: ; preds = %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int ec_putch_raw(int c) {
  putchar(c);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ec_putch_raw(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void error(char *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
void fd270(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
p03A:
  goto p03A;
  goto a;
a:
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd270>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd270+0x7>

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

LLVM IR (-O0):
define void @fd270(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; No predecessors!
br label %47
47: ; preds = %47, %46
br label %47
}

LLVM IR (-O2):
define void @fd270(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++)
    puts(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int no_reuse_mov(int i) {
  int arr[1025];
  foo();
  return arr[i];
}


x86 assembly (clang, -O0):
<no_reuse_mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
movslq -0x4(%rbp),%rax
mov    -0x1010(%rbp,%rax,4),%eax
add    $0x1010,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @no_reuse_mov(i32 %0) {
%2 = alloca i32
%3 = alloca [1025 x i32]
store i32 %0, i32* %2
%4 = call i32 (...) @foo()
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [1025 x i32], [1025 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @no_reuse_mov(i32 %0) {
%2 = tail call i32 (...) @foo()
ret i32 undef
}
void oem_pm8921_bms_low_vol_detect_standby(int batt_temp) {}


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

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

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

LLVM IR (-O2):
define void @oem_pm8921_bms_low_vol_detect_standby(i32 %0) {
ret void
}
int track_bbox_left(int ch, int i) {}


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

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

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

LLVM IR (-O2):
define i32 @track_bbox_left(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int is_first_in_group_Stipulations(size_t __tag) {
  return (__tag == (233)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_first_in_group_Stipulations>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xe9,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_in_group_Stipulations>:
xor    %eax,%eax
cmp    $0xe9,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_first_in_group_Stipulations(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 233
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_first_in_group_Stipulations(i64 %0) {
%2 = icmp eq i64 %0, 233
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int larger(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int greatest = larger(10, 100);
  printf("%i is the greatest!\n", greatest);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x64,%esi
call   1040 <larger@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%i is the greatest!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @larger(i32 10, i32 100)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%i is the greatest!\0A\00"
define i32 @main() {
%1 = tail call i32 @larger(i32 10, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}