xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sendg(char *);
void homeFn(char *p1, char *p2, char *p3) { sendg("G28"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"G28\00"
define void @homeFn(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @sendg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"G28\00"
define void @homeFn(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @sendg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void tcc_overlaymix_deinit(int olymix_fd) { close(olymix_fd); }


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

x86 assembly (clang, -O2):
<tcc_overlaymix_deinit>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @tcc_overlaymix_deinit(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int redirect_io(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stdout;
int main() {
  char *file = "var/test.log";
  int old_file_num = redirect_io(file, stdout, 0600);
  puts("doing an ls or something now");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    $0x180,%edx
call   1040 <redirect_io@plt>
mov    %eax,-0x14(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
mov    $0x180,%edx
call   1040 <redirect_io@plt>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"var/test.log\00"
@stdout = global i32 0
@.str.1 = [29 x i8] c"doing an ls or something now\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdout
%6 = call i32 @redirect_io(i8* %4, i32 %5, i32 384)
store i32 %6, i32* %3
%7 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"var/test.log\00"
@stdout = global i32 0
@.str.1 = [29 x i8] c"doing an ls or something now\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @redirect_io(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1, i32 384)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void PR21945() { int i = (({}), 0l); }


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

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

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

LLVM IR (-O2):
define void @PR21945() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int my_vfprintf(struct aFILE *fp, const char *fmt, va_list arg) {
  return vfprintf(_get_actual_fp(fp), fmt, arg);
}


x86 assembly (clang, -O0):
<my_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_vfprintf>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_vfprintf(%struct.aFILE* %0, i8* %1, i32 %2) {
%4 = alloca %struct.aFILE*
%5 = alloca i8*
%6 = alloca i32
store %struct.aFILE* %0, %struct.aFILE** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.aFILE*, %struct.aFILE** %4
%8 = call i32 @_get_actual_fp(%struct.aFILE* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vfprintf(i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_vfprintf(%struct.aFILE* %0, i8* %1, i32 %2) {
%4 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%5 = tail call i32 @vfprintf(i32 %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
scalar_t__ ft_strnequ_ci(char const *, char *, int);
int ft_checkval(const char *nptr) {
  if (ft_strnequ_ci(nptr, "nan", 3))
    return (-1);
  else if (ft_strnequ_ci(nptr, "inf", 3))
    return (1);
  return (0.0);
}


x86 assembly (clang, -O0):
<ft_checkval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <ft_strnequ_ci@plt>
cmp    $0x0,%rax
je     1147 <ft_checkval+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <ft_checkval+0x6e>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x3,%edx
call   1030 <ft_strnequ_ci@plt>
cmp    $0x0,%rax
je     1172 <ft_checkval+0x62>
movl   $0x1,-0x4(%rbp)
jmp    117e <ft_checkval+0x6e>
jmp    1177 <ft_checkval+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_checkval>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
call   1030 <ft_strnequ_ci@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1134 <ft_checkval+0x24>
pop    %rbx
ret
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <ft_strnequ_ci@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"nan\00"
@.str.1 = [4 x i8] c"inf\00"
define i32 @ft_checkval(i8* %0) {
%2 = tail call i64 @ft_strnequ_ci(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_strnequ_ci(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ decode_utimes(struct tcb *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int sys_utimes(struct tcb *tcp) {
  decode_utimes(tcp, 0, 0);
  return 0100;
}


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

x86 assembly (clang, -O2):
<sys_utimes>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1030 <decode_utimes@plt>
mov    $0x40,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_utimes(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @decode_utimes(%struct.tcb* %3, i32 0, i32 0)
ret i32 64
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_utimes(%struct.tcb* %0) {
%2 = tail call i32 @decode_utimes(%struct.tcb* %0, i32 0, i32 0)
ret i32 64
}
__attribute__((__no__)) void __softboundcets_stub(void) { return; }


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

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

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

LLVM IR (-O2):
define void @__softboundcets_stub() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_data() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_data"
         "\n");
}


x86 assembly (clang, -O0):
<pa_tagstruct_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_tagstruct_data\0A\00"
define i32 @pa_tagstruct_data() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_tagstruct_data\00"
define i32 @pa_tagstruct_data() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_2Auint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x2A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_2Auint64_midword_reg>:
test   $0x2a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Auint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2752512
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
flt(x) long long int x;
{
  if (x < 0)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<flt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    111f <flt+0x1f>
movl   $0xd,-0x4(%rbp)
jmp    1126 <flt+0x26>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt>:
test   %rdi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @flt(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i32 13, i32 140
ret i32 %3
}
int test_imm_B2uint8_mem(unsigned char *val) {
  return ((*val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -78
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;
typedef int /*<<< orphan*/ caddr_t;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ xdr_free(int /*<<< orphan*/, int /*<<< orphan*/);
rpcmathprog_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result,
                         caddr_t result) {
  xdr_free(xdr_result, result);
  return 1;
}


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

x86 assembly (clang, -O2):
<rpcmathprog_1_freeresult>:
push   %rax
mov    %esi,%edi
mov    %edx,%esi
call   1030 <xdr_free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rpcmathprog_1_freeresult(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @xdr_free(i32 %1, i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_arithm_shift_right(void) {
  gen_pop();
  gen_call("_asr");
}


x86 assembly (clang, -O0):
<gen_arithm_shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_arithm_shift_right>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_asr\00"
define void @gen_arithm_shift_right() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_asr\00"
define void @gen_arithm_shift_right() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int *);
void helper(int i) {
  int z = i + 1;
  foo(i, &z);
}


x86 assembly (clang, -O0):
<helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper>:
push   %rax
lea    0x1(%rdi),%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <foo@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @helper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @foo(i32 %6, i32* %3)
ret void
}

LLVM IR (-O2):
define void @helper(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = add nsw i32 %0, 1
store i32 %4, i32* %2
%5 = call i32 @foo(i32 %0, i32* %2)
ret void
}
int fun280() { return 280; }


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

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

LLVM IR (-O0):
define i32 @fun280() {
ret i32 280
}

LLVM IR (-O2):
define i32 @fun280() {
ret i32 280
}
/* Type definitions */
struct property {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ property_set_value(struct property *, int /*<<< orphan*/);
int /*<<< orphan*/ value_new_method(int);
void property_set_method(struct property *prop, int v) {
  property_set_value(prop, value_new_method(v));
}


x86 assembly (clang, -O0):
<property_set_method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <value_new_method@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <property_set_value@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<property_set_method>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <value_new_method@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <property_set_value@plt>

LLVM IR (-O0):
%struct.property = type { i32 }
define void @property_set_method(%struct.property* %0, i32 %1) {
%3 = alloca %struct.property*
%4 = alloca i32
store %struct.property* %0, %struct.property** %3
store i32 %1, i32* %4
%5 = load %struct.property*, %struct.property** %3
%6 = load i32, i32* %4
%7 = call i32 @value_new_method(i32 %6)
%8 = call i32 @property_set_value(%struct.property* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.property = type { i32 }
define void @property_set_method(%struct.property* %0, i32 %1) {
%3 = tail call i32 @value_new_method(i32 %1)
%4 = tail call i32 @property_set_value(%struct.property* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int __getpt(void) { return open("/dev/ptmx", O_RDWR); }


x86 assembly (clang, -O0):
<__getpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getpt>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
define i32 @__getpt() {
%1 = load i32, i32* @O_RDWR
%2 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
define i32 @__getpt() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
int calc_codon(int codon[]) {
  return ((codon[0] * 4 + codon[1]) * 4 + codon[2]);
}


x86 assembly (clang, -O0):
<calc_codon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
shl    $0x2,%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_codon>:
mov    (%rdi),%eax
shl    $0x2,%eax
add    0x4(%rdi),%eax
shl    $0x2,%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @calc_codon(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 4
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %6, %9
%11 = mul nsw i32 %10, 4
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @calc_codon(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %3, %5
%7 = shl nsw i32 %6, 2
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void HardFault_Handler(void) {
  while (1) {
  }
}


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

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

LLVM IR (-O0):
define void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
int hexnumlen(unsigned long num) {
  int i;
  for (i = 0; num != 0; i++)
    num >>= 4;
  return (((i) > (1)) ? (i) : (1));
}


x86 assembly (clang, -O0):
<hexnumlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <hexnumlen+0x34>
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hexnumlen+0xf>
cmpl   $0x1,-0xc(%rbp)
jle    1149 <hexnumlen+0x49>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <hexnumlen+0x56>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <hexnumlen+0x56>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexnumlen>:
test   %rdi,%rdi
je     1121 <hexnumlen+0x21>
xor    %eax,%eax
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
shr    $0x4,%rcx
add    $0x1,%eax
cmp    $0xf,%rdi
mov    %rcx,%rdi
ja     1110 <hexnumlen+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @hexnumlen(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i64, i64* %2
%9 = lshr i64 %8, 4
store i64 %9, i64* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32, i32* %3
br label %19
18: ; preds = %13
br label %19
19: ; preds = %18, %16
%20 = phi i32 [ %17, %16 ], [ 1, %18 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @hexnumlen(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 4
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 16
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = icmp ugt i32 %7, 1
%11 = select i1 %10, i32 %7, i32 1
br label %12
12: ; preds = %9, %1
%13 = phi i32 [ 1, %1 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_ERROR;
int getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, void *, void *);
int BIO_sock_error(int sock) {
  int j, i;
  int size;
  size = sizeof(int);
  i = getsockopt(sock, SOL_SOCKET, SO_ERROR, (void *)&j, (void *)&size);
  if (i < 0)
    return (1);
  else
    return (j);
}


x86 assembly (clang, -O0):
<BIO_sock_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <getsockopt@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    115d <BIO_sock_error+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1163 <BIO_sock_error+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_sock_error>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
js     1146 <BIO_sock_error+0x36>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @BIO_sock_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* @SOL_SOCKET
%9 = load i32, i32* @SO_ERROR
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %6 to i8*
%12 = call i32 @getsockopt(i32 %7, i32 %8, i32 %9, i8* %10, i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %18
16: ; preds = %1
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_ERROR = global i32 0
define i32 @BIO_sock_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_ERROR
%8 = call i32 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i8* %5)
%9 = icmp slt i32 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 1, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char);
int main() {
  char num = '3';
  printf("|%c|%d|%c|%d|", num - 48, num - 48, num, num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x33,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,%dl
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,%cl
mov    -0x1(%rbp),%al
lea    0xec8(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x1(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x33,%ecx
mov    $0x33,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"|%c|%d|%c|%d|\00"
define i32 @main() {
%1 = alloca i8
store i8 51, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = sub nsw i32 %3, 48
%5 = trunc i32 %4 to i8
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 48
%9 = trunc i32 %8 to i8
%10 = load i8, i8* %1
%11 = load i8, i8* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %9, i8 signext %10, i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"|%c|%d|%c|%d|\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext 3, i8 signext 3, i8 signext 51, i8 signext 51)
ret i32 0
}
/* Variables and functions */
double truncl(double);
double trunc(double x) { return truncl(x); }


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

x86 assembly (clang, -O2):
<trunc>:
jmp    1030 <truncl@plt>

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

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double @truncl(double %0)
ret double %2
}
void IntIfClkFreeRunSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x10)))) &= ~(0x00000001u);
}


x86 assembly (clang, -O0):
<IntIfClkFreeRunSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200010,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x48200010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntIfClkFreeRunSet>:
andl   $0xfffffffe,0x48200010
fe
ret

LLVM IR (-O0):
define void @IntIfClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntIfClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}
void USBSTK5515_wait(unsigned long delay) {
  volatile unsigned long i;
  for (i = 0; i < delay; i++) {
  };
}


x86 assembly (clang, -O0):
<USBSTK5515_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1134 <USBSTK5515_wait+0x34>
jmp    1123 <USBSTK5515_wait+0x23>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <USBSTK5515_wait+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBSTK5515_wait>:
movq   $0x0,-0x8(%rsp)
nopl   0x0(%rax)
mov    -0x8(%rsp),%rax
cmp    %rdi,%rax
jae    1122 <USBSTK5515_wait+0x22>
addq   $0x1,-0x8(%rsp)
jmp    1110 <USBSTK5515_wait+0x10>
ret

LLVM IR (-O0):
define void @USBSTK5515_wait(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store volatile i64 0, i64* %3
br label %4
4: ; preds = %9, %1
%5 = load volatile i64, i64* %3
%6 = load i64, i64* %2
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load volatile i64, i64* %3
%11 = add i64 %10, 1
store volatile i64 %11, i64* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @USBSTK5515_wait(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store volatile i64 0, i64* %2
%4 = load volatile i64, i64* %2
%5 = icmp ult i64 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i64, i64* %2
%8 = add i64 %7, 1
store volatile i64 %8, i64* %2
%9 = load volatile i64, i64* %2
%10 = icmp ult i64 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
void prefetch(const void __attribute__((unused)) * x) { ; }


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

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

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_pos_binary(char *);
void problem_output() { output_pos_binary("position"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"position\00"
define void @problem_output() {
%1 = call i32 @output_pos_binary(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"position\00"
define void @problem_output() {
%1 = tail call i32 @output_pos_binary(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *zsock_gai_strerror(int);
const char *gai_strerror(int errcode) { return zsock_gai_strerror(errcode); }


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

x86 assembly (clang, -O2):
<gai_strerror>:
jmp    1030 <zsock_gai_strerror@plt>

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

LLVM IR (-O2):
define i8* @gai_strerror(i32 %0) {
%2 = tail call i8* @zsock_gai_strerror(i32 %0)
ret i8* %2
}
/* Type definitions */
struct NumArray {
  int dummy;
};

/* Variables and functions */
int getSum(struct NumArray *, int);
int sumRange(struct NumArray *numArray, int i, int j) {
  return getSum(numArray, j) - getSum(numArray, i - 1);
}


x86 assembly (clang, -O0):
<sumRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <getSum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <getSum@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumRange>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %edx,%esi
call   1030 <getSum@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <getSum@plt>
sub    %eax,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.NumArray = type { i32 }
define i32 @sumRange(%struct.NumArray* %0, i32 %1, i32 %2) {
%4 = alloca %struct.NumArray*
%5 = alloca i32
%6 = alloca i32
store %struct.NumArray* %0, %struct.NumArray** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.NumArray*, %struct.NumArray** %4
%8 = load i32, i32* %6
%9 = call i32 @getSum(%struct.NumArray* %7, i32 %8)
%10 = load %struct.NumArray*, %struct.NumArray** %4
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = call i32 @getSum(%struct.NumArray* %10, i32 %12)
%14 = sub nsw i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
%struct.NumArray = type { i32 }
define i32 @sumRange(%struct.NumArray* %0, i32 %1, i32 %2) {
%4 = tail call i32 @getSum(%struct.NumArray* %0, i32 %2)
%5 = add nsw i32 %1, -1
%6 = tail call i32 @getSum(%struct.NumArray* %0, i32 %5)
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ dash_offset;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_dash_offset(void *_p) {
  return (int)((XGCValues *)_p)->dash_offset;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XGCValues_dash_offset(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long __builtin_arm_rsr64(char *);
unsigned long rsr64_3() { return __builtin_arm_rsr64("0:1:2"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0:1:2\00"
define i64 @rsr64_3() {
%1 = call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"0:1:2\00"
define i64 @rsr64_3() {
%1 = tail call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mu_list_free_item(void *item) { free(item); }


x86 assembly (clang, -O0):
<mu_list_free_item>:
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):
<mu_list_free_item>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mu_list_free_item(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int ulaw_to_s16(unsigned char u_val) {
  int t;
  u_val = ~u_val;
  t = ((u_val & 0x0f) << 3) + 0x84;
  t <<= (u_val & 0x70) >> 4;
  return ((u_val & 0x80) ? (0x84 - t) : (t - 0x84));
}


x86 assembly (clang, -O0):
<ulaw_to_s16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
shl    $0x3,%eax
add    $0x84,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x70,%ecx
sar    $0x4,%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115a <ulaw_to_s16+0x5a>
mov    $0x84,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <ulaw_to_s16+0x65>
mov    -0x8(%rbp),%eax
sub    $0x84,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulaw_to_s16>:
not    %dil
movzbl %dil,%edx
lea    0x0(,%rdx,8),%eax
or     $0x84,%eax
movzbl %al,%eax
mov    %edx,%ecx
shr    $0x4,%cl
and    $0x7,%cl
shl    %cl,%eax
mov    $0x84,%ecx
sub    %eax,%ecx
add    $0xffffff7c,%eax
test   $0x80,%dl
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ulaw_to_s16(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = xor i32 %5, -1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = shl i32 %10, 3
%12 = add nsw i32 %11, 132
store i32 %12, i32* %3
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 112
%16 = ashr i32 %15, 4
%17 = load i32, i32* %3
%18 = shl i32 %17, %16
store i32 %18, i32* %3
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = and i32 %20, 128
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %1
%24 = load i32, i32* %3
%25 = sub nsw i32 132, %24
br label %29
26: ; preds = %1
%27 = load i32, i32* %3
%28 = sub nsw i32 %27, 132
br label %29
29: ; preds = %26, %23
%30 = phi i32 [ %25, %23 ], [ %28, %26 ]
ret i32 %30
}

LLVM IR (-O2):
define i32 @ulaw_to_s16(i8 zeroext %0) {
%2 = xor i8 %0, -1
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 3
%5 = and i32 %4, 120
%6 = or i32 %5, 132
%7 = lshr i32 %3, 4
%8 = and i32 %7, 7
%9 = shl i32 %6, %8
%10 = and i32 %3, 128
%11 = icmp eq i32 %10, 0
%12 = sub nsw i32 132, %9
%13 = add nsw i32 %9, -132
%14 = select i1 %11, i32 %13, i32 %12
ret i32 %14
}
/* Variables and functions */
int f(int, int);
int f4(int d, int e) {
  if (e > 0)
    return f(d, e - 1) + f(d, e - 1);
  else
    return d;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1156 <f4+0x46>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115c <f4+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
jle    1139 <f4+0x29>
mov    %esi,%ebp
add    $0xffffffff,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <f@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <f@plt>
mov    %eax,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f4(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* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 1
%12 = call i32 @f(i32 %9, i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call i32 @f(i32 %13, i32 %15)
%17 = add nsw i32 %12, %16
store i32 %17, i32* %3
br label %20
18: ; preds = %2
%19 = load i32, i32* %4
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @f(i32 %0, i32 %5)
%7 = tail call i32 @f(i32 %0, i32 %5)
%8 = add nsw i32 %7, %6
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ %0, %2 ]
ret i32 %10
}
/* Variables and functions */
bool empty_impl(int top) { return top == (-1); }


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

x86 assembly (clang, -O2):
<empty_impl>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @empty_impl(i32 %0) {
%2 = icmp eq i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
int time_total_milliseconds(float t) { return (int)(t * 1000.0f + 0.5f); }


x86 assembly (clang, -O0):
<time_total_milliseconds>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_total_milliseconds>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @time_total_milliseconds(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 1.000000e+03, float 5.000000e-01)
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @time_total_milliseconds(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+03, float 5.000000e-01)
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Start.");
  puts("+OK: MODULE_AUTO_INIT absent.");
  puts("Done.");
  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 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Start.\00"
@.str.1 = [30 x i8] c"+OK: MODULE_AUTO_INIT absent.\00"
@.str.2 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Start.\00"
@.str.1 = [30 x i8] c"+OK: MODULE_AUTO_INIT absent.\00"
@.str.2 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ KDSETLED;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ ioctl(int /*<<< orphan*/, int /*<<< orphan*/, char);
int /*<<< orphan*/ perror(char *);
void set_LED_flags(char new_led_flags) {
  if (ioctl(0, KDSETLED, new_led_flags)) {
    perror("ioctl KDSETLED");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<set_LED_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
movsbl -0x1(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1176 <set_LED_flags+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_LED_flags>:
push   %rax
mov    %edi,%edx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <ioctl@plt>
test   %rax,%rax
jne    114a <set_LED_flags+0x1a>
pop    %rax
ret
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@KDSETLED = global i32 0
@.str = [15 x i8] c"ioctl KDSETLED\00"
@EXIT_FAILURE = global i32 0
define void @set_LED_flags(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @KDSETLED
%4 = load i8, i8* %2
%5 = call i64 @ioctl(i32 0, i32 %3, i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@KDSETLED = global i32 0
@.str = [15 x i8] c"ioctl KDSETLED\00"
@EXIT_FAILURE = global i32 0
define void @set_LED_flags(i8 signext %0) {
%2 = load i32, i32* @KDSETLED
%3 = tail call i64 @ioctl(i32 0, i32 %2, i8 signext %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
void *test_anti_range_78(unsigned n) {
  extern void *alloc_anti_range_78(unsigned) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 1)
    n = 1 - 1;
  return alloc_anti_range_78(n);
}


x86 assembly (clang, -O0):
<test_anti_range_78>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
ja     113a <test_anti_range_78+0x2a>
cmpl   $0x1,-0x4(%rbp)
ja     113a <test_anti_range_78+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_78@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_78>:
xor    %eax,%eax
cmp    $0x1,%edi
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_78@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_78(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 0, i32 %0
%4 = tail call i8* @alloc_anti_range_78(i32 %3)
ret i8* %4
}