xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(double);
int num_digits(int n) { return (int)floor(log10((double)n)) + 1; }


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
push   %rax
cvtsi2sd %edi,%xmm0
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @num_digits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call i32 @log10(double %4)
%6 = call i64 @floor(i32 %5)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @num_digits(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i32 @log10(double %2)
%4 = tail call i64 @floor(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
scalar_t__ ECDSA_DATA_new_method(int /*<<< orphan*/ *);
void *ecdsa_data_new(void) { return (void *)ECDSA_DATA_new_method(NULL); }


x86 assembly (clang, -O0):
<ecdsa_data_new>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ECDSA_DATA_new_method@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecdsa_data_new>:
xor    %edi,%edi
jmp    1030 <ECDSA_DATA_new_method@plt>

LLVM IR (-O0):
define i8* @ecdsa_data_new() {
%1 = call i64 @ECDSA_DATA_new_method(i32* null)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @ecdsa_data_new() {
%1 = tail call i64 @ECDSA_DATA_new_method(i32* null)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ func_one(int);
int main(void) {
  func_one(10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func_one(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x7b() {
  Assert_real((isodigit(123) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              620, ("isodigit should be 0 for {"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for {\00"
define void @t_isodigit_0x7b() {
%1 = tail call i64 @isodigit(i32 123)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 620, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void dummyvideo_FBRead(unsigned int addr) {}


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

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

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

LLVM IR (-O2):
define void @dummyvideo_FBRead(i32 %0) {
ret void
}
int test_imm_0Bint8_mem(signed char *val) {
  return ((*val) & (-0x0B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Bint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -11
%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_0Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -11
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ iplink_usage();
void usage(void) { iplink_usage(); }


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

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

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

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 (...) @iplink_usage()
ret void
}
/* Variables and functions */
int asprintf(char **, char *, char const *, char const *);
char *concat(const char *str1, const char *str2) {
  char *newstr;
  if (asprintf(&newstr, "%s%s", str1, str2) == -1)
    return NULL;
  return newstr;
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
jne    114e <concat+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1156 <concat+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
cmp    $0xffffffff,%eax
je     1131 <concat+0x21>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = icmp eq i32 %5, -1
%7 = load i8*, i8** %3
%8 = select i1 %6, i8* null, i8* %7
ret i8* %8
}
/* Variables and functions */
int virt_chdir(char const *, int);
int _chdir(const char *path) { return virt_chdir(path, 1); }


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

x86 assembly (clang, -O2):
<_chdir>:
mov    $0x1,%esi
jmp    1030 <virt_chdir@plt>

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

LLVM IR (-O2):
define i32 @_chdir(i8* %0) {
%2 = tail call i32 @virt_chdir(i8* %0, i32 1)
ret i32 %2
}
void ubi_dbg_dump_seb(const struct ubi_scan_leb *seb, int type) { return; }


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

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

LLVM IR (-O0):
%struct.ubi_scan_leb = type opaque
define void @ubi_dbg_dump_seb(%struct.ubi_scan_leb* %0, i32 %1) {
%3 = alloca %struct.ubi_scan_leb*
%4 = alloca i32
store %struct.ubi_scan_leb* %0, %struct.ubi_scan_leb** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.ubi_scan_leb = type opaque
define void @ubi_dbg_dump_seb(%struct.ubi_scan_leb* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned char condition_reduction(unsigned char *, int, int);
int main(void) {
  unsigned char a[32] = {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1,
                         2,  3,  4,  5,  6,  7,  8,  9,  10, 21, 22,
                         23, 24, 25, 26, 27, 28, 29, 30, 31, 32};
  unsigned char ret = condition_reduction(a, 16, 32);
  if (ret != 10)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x10,%esi
mov    $0x20,%edx
call   1040 <condition_reduction@plt>
mov    %al,-0x31(%rbp)
movzbl -0x31(%rbp),%eax
cmp    $0xa,%eax
je     1185 <main+0x65>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
mov    $0x20,%edx
call   1040 <condition_reduction@plt>
cmp    $0xa,%al
jne    1158 <main+0x38>
xor    %eax,%eax
add    $0x28,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.a = [32 x i8] c"\0B\0C\0D\0E\0F\10\11\12\13\14\01\02\03\04\05\06\07\08\09\0A\15\16\17\18\19\1A\1B\1C\1D\1E\1F "
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = bitcast [32 x i8]* %2 to i8*
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%6 = call zeroext i8 @condition_reduction(i8* %5, i32 16, i32 32)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [32 x i8] c"\0B\0C\0D\0E\0F\10\11\12\13\14\01\02\03\04\05\06\07\08\09\0A\15\16\17\18\19\1A\1B\1C\1D\1E\1F "
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call zeroext i8 @condition_reduction(i8* %2, i32 16, i32 32)
%4 = icmp eq i8 %3, 10
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
void rcu_nocb_gp_set(struct rcu_node *rnp, int nrq) {}


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

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

LLVM IR (-O0):
%struct.rcu_node = type opaque
define void @rcu_nocb_gp_set(%struct.rcu_node* %0, i32 %1) {
%3 = alloca %struct.rcu_node*
%4 = alloca i32
store %struct.rcu_node* %0, %struct.rcu_node** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.rcu_node = type opaque
define void @rcu_nocb_gp_set(%struct.rcu_node* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA2_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA2_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA2_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int func2(int a_def, int b_def) { return a_def - b_def; }


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

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

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

LLVM IR (-O2):
define i32 @func2(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int foo__Fi(x)
int x;
{ return csub(x / 2); }


x86 assembly (clang, -O0):
<foo__Fi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    $0x0,%al
call   1030 <csub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo__Fi>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
xor    %eax,%eax
jmp    1030 <csub@plt>

LLVM IR (-O0):
define i32 @foo__Fi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @csub to i32 (i32, ...)*)(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo__Fi(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @csub to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pioneer_read_string(unsigned char *, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ pioneer_send_command0(int);
int pioneer_sync2(void) {
  unsigned char buf[256];
  pioneer_send_command0(2);
  pioneer_read_string(buf, 5, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<pioneer_sync2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    $0x2,%edi
call   1040 <pioneer_send_command0@plt>
lea    -0x100(%rbp),%rdi
mov    $0x5,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <pioneer_read_string@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pioneer_sync2>:
sub    $0x108,%rsp
mov    $0x2,%edi
call   1040 <pioneer_send_command0@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <pioneer_read_string@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @pioneer_sync2() {
%1 = alloca [256 x i8]
%2 = call i32 @pioneer_send_command0(i32 2)
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @pioneer_read_string(i8* %3, i32 5, i32* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @pioneer_sync2() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @pioneer_send_command0(i32 2)
%4 = call i32 @pioneer_read_string(i8* %2, i32 5, i32* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main(void) {
  int i;
  for (i = 0; i < 200; i++) {
    malloc(8);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    114b <main+0x3b>
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <malloc@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @malloc(i32 8)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 200
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ state_change_fire(int, int *, int);
void state_change_fire1(int event_type, int data0) {
  int data[1];
  data[0] = data0;
  state_change_fire(event_type, data, 1);
}


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

x86 assembly (clang, -O2):
<state_change_fire1>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <state_change_fire@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @state_change_fire1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %6, i32* %7
%8 = load i32, i32* %3
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%10 = call i32 @state_change_fire(i32 %8, i32* %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @state_change_fire1(i32 %0, i32 %1) {
%3 = alloca [1 x i32]
%4 = bitcast [1 x i32]* %3 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %1, i32* %5
%6 = call i32 @state_change_fire(i32 %0, i32* %5, i32 1)
ret void
}
int do_902() { return 902; }


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

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

LLVM IR (-O0):
define i32 @do_902() {
ret i32 902
}

LLVM IR (-O2):
define i32 @do_902() {
ret i32 902
}
/* Variables and functions */
int /*<<< orphan*/ LINUX_REBOOT_MAGIC1;
int /*<<< orphan*/ LINUX_REBOOT_MAGIC2;
int /*<<< orphan*/ SYS_reboot;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            unsigned int, int /*<<< orphan*/ *);
int call_reboot(unsigned int rb_action) {
  return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
                 rb_action, NULL);
}


x86 assembly (clang, -O0):
<call_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_reboot>:
mov    %edi,%ecx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %r8d,%r8d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define i32 @call_reboot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_reboot
%4 = load i32, i32* @LINUX_REBOOT_MAGIC1
%5 = load i32, i32* @LINUX_REBOOT_MAGIC2
%6 = load i32, i32* %2
%7 = call i32 @syscall(i32 %3, i32 %4, i32 %5, i32 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
@SYS_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define i32 @call_reboot(i32 %0) {
%2 = load i32, i32* @SYS_reboot
%3 = load i32, i32* @LINUX_REBOOT_MAGIC1
%4 = load i32, i32* @LINUX_REBOOT_MAGIC2
%5 = tail call i32 @syscall(i32 %2, i32 %3, i32 %4, i32 %0, i32* null)
ret i32 %5
}
/* Variables and functions */
int savetty();
int wrap_savetty(void) { return savetty(); }


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

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

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

LLVM IR (-O2):
define i32 @wrap_savetty() {
%1 = tail call i32 (...) @savetty()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void close_file(FILE *f) {
  if (f && f != stdout && f != stderr)
    fclose(f);
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <close_file+0x48>
mov    -0x8(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <close_file+0x48>
mov    -0x8(%rbp),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <close_file+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
test   %rdi,%rdi
je     1132 <close_file+0x22>
mov    0x2ebc(%rip),%rax
cmp    %rdi,(%rax)
je     1132 <close_file+0x22>
mov    0x2eb8(%rip),%rax
cmp    %rdi,(%rax)
je     1132 <close_file+0x22>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdout = global i32* null
@stderr = global i32* null
define void @close_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = load i32*, i32** @stdout
%8 = icmp ne i32* %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32*, i32** %2
%11 = load i32*, i32** @stderr
%12 = icmp ne i32* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32*, i32** %2
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %13, %9, %5, %1
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
@stderr = global i32* null
define void @close_file(i32* %0) {
%2 = icmp eq i32* %0, null
%3 = load i32*, i32** @stdout
%4 = icmp eq i32* %3, %0
%5 = select i1 %2, i1 true, i1 %4
%6 = load i32*, i32** @stderr
%7 = icmp eq i32* %6, %0
%8 = select i1 %5, i1 true, i1 %7
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @fclose(i32* %0)
br label %11
11: ; preds = %9, %1
ret void
}
void print_slink(const char *file, struct stat *st) {}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define void @print_slink(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
ret void
}

LLVM IR (-O2):
%struct.stat = type opaque
define void @print_slink(i8* nocapture %0, %struct.stat* nocapture %1) {
ret void
}
int is_read_request(int opcode) { return opcode == 1; }


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

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

LLVM IR (-O0):
define i32 @is_read_request(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 @is_read_request(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_E2uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xE2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E2uint64_lowword_reg>:
test   $0xe2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E2uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 226
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double asinh(double x) { return log(x - sqrt((x * x) + 1.0)); }


x86 assembly (clang, -O0):
<asinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @asinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fsub double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @asinh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fsub double %0, %4
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createMulExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0C, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createMulExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xc,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createMulExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 12, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createMulExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 12, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
void quaternion_conjugate(float out[4], const float src[4]) {
  out[0] = -src[0];
  out[1] = -src[1];
  out[2] = -src[2];
  out[3] = src[3];
}


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

x86 assembly (clang, -O2):
<quaternion_conjugate>:
movss  (%rsi),%xmm0
movaps 0xef5(%rip),%xmm1
xorps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
movss  %xmm0,0xc(%rdi)
ret

LLVM IR (-O0):
define void @quaternion_conjugate(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = fneg float %7
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fneg float %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = fneg float %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 3
%25 = load float, float* %24
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
store float %25, float* %27
ret void
}

LLVM IR (-O2):
define void @quaternion_conjugate(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fneg float %3
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = fneg float %6
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = fneg float %10
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 3
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %0, i64 3
store float %14, float* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Xfree(void *n) {
  if (n)
    free(n);
}


x86 assembly (clang, -O0):
<Xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xfree>:
test   %rdi,%rdi
je     111a <Xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @Xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void glGetAttribLocation(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetAttribLocation() {
ret void
}
__attribute__((always_)) unsigned int cpuid_ebx(unsigned int op) {
  unsigned int eax, ebx;
  __asm__("cpuid" : "=a"(eax), "=b"(ebx) : "0"(op) : "cx", "dx");
  return ebx;
}


x86 assembly (clang, -O0):
<cpuid_ebx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ebx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ebx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "cpuid", "={ax},={bx},0,~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ebx(i32 %0) {
%2 = tail call { i32, i32 } asm "cpuid", "={ax},={bx},0,~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ offset(int, int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basOffset() {
  int xoff, yoff;
  yoff = popNumber();
  xoff = popNumber();
  offset(xoff, yoff);
  pushNumber(0);
}


x86 assembly (clang, -O0):
<basOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <offset@plt>
xor    %edi,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basOffset>:
push   %rbx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <offset@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basOffset() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @popNumber()
store i32 %3, i32* %2
%4 = call i32 (...) @popNumber()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @offset(i32 %5, i32 %6)
%8 = call i32 @pushNumber(i32 0)
ret void
}

LLVM IR (-O2):
define void @basOffset() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 (...) @popNumber()
%3 = tail call i32 @offset(i32 %2, i32 %1)
%4 = tail call i32 @pushNumber(i32 0)
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ ft_strlen(char const *);
scalar_t__ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int ft_putstr(char const *s) {
  if (write(STDOUT_FILENO, s, ft_strlen(s)) < 0)
    return (EXIT_FAILURE);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
jge    1172 <ft_putstr+0x52>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <ft_putstr+0x5e>
mov    0x2e57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec3(%rip),%rax
mov    (%rax),%ebp
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
test   %rax,%rax
jns    114e <ft_putstr+0x2e>
mov    0x2e8c(%rip),%rax
jmp    1155 <ft_putstr+0x35>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @ft_putstr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @STDOUT_FILENO
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_strlen(i8* %6)
%8 = call i64 @write(i32 %4, i8* %5, i32 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @ft_putstr(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i64 @write(i32 %2, i8* %0, i32 %3)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @EXIT_FAILURE
%7 = load i32, i32* @EXIT_SUCCESS
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int receive_error() {
  printf("Receiving error\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Receiving error\0A\00"
define i32 @receive_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Receiving error\00"
define i32 @receive_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char nondet_char();
int main() {
  char ch = nondet_char();
  switch (ch) {
  case 'P':
  case 'p':
    assert(ch == 80 || ch == 112);
  default:;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <nondet_char@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
or     $0x20,%eax
sub    $0x70,%eax
je     114e <main+0x2e>
jmp    117a <main+0x5a>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x50,%ecx
mov    %al,-0x6(%rbp)
je     116d <main+0x4d>
movsbl -0x5(%rbp),%eax
cmp    $0x70,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    117f <main+0x5f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <nondet_char@plt>
movsbl %al,%ecx
or     $0x20,%ecx
cmp    $0x70,%ecx
jne    1142 <main+0x22>
and    $0xdf,%al
xor    %edi,%edi
cmp    $0x50,%al
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call signext i8 (...) @nondet_char()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %18 [
i32 80, label %6
i32 112, label %6
]
6: ; preds = %0, %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 80
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 112
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
br label %18
18: ; preds = %0, %14
br label %19
19: ; preds = %18
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @nondet_char()
%2 = sext i8 %1 to i32
switch i32 %2, label %8 [
i32 80, label %3
i32 112, label %3
]
3: ; preds = %0, %0
%4 = and i8 %1, -33
%5 = icmp eq i8 %4, 80
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
br label %8
8: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
void error(void) {
ERROR:
  __VERIFIER_error();
  return;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <error+0x9>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @error() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @__VERIFIER_error()
ret void
}

LLVM IR (-O2):
define void @error() {
%1 = tail call i32 (...) @__VERIFIER_error()
ret void
}
void kill(int pid) { asm volatile("int $0x30" ::"a"(8), "b"(pid)); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
mov    $0x8,%eax
int    $0x30
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
push   %rbx
mov    %edi,%ebx
mov    $0x8,%eax
int    $0x30
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kill(i32 %0) {
tail call void asm sideeffect "int $$0x30", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 8, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ COND_HI();
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_shi_8_pi(void) {
  m68ki_write_8(EA_AY_PI_8(), COND_HI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_shi_8_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_HI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_shi_8_pi>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_HI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_shi_8_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i64 (...) @COND_HI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_shi_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i64 (...) @COND_HI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void ScaleRowDown2Linear_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Linear_Any_NEON() {
ret void
}
char *skip_space(char *c) {
  while (*c && ((*c == ' ') || (*c == '\t') || (*c == '=')))
    c++;
  return c;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115d <skip_space+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1157 <skip_space+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     1157 <skip_space+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    116d <skip_space+0x6d>
jmp    117e <skip_space+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_space+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    %rdi,%rax
movabs $0x2000000100000200,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x3d,%rdx
ja     1125 <skip_space+0x25>
bt     %rdx,%rcx
jae    1125 <skip_space+0x25>
add    $0x1,%rax
jmp    1110 <skip_space+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 61, label %5
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sorter_binary_insertion_sort_start(int /*<<< orphan*/ *, int,
                                                      size_t const);
void sorter_binary_insertion_sort(int64_t *dst, const size_t size) {
  if (size <= 1) {
    return;
  }
  sorter_binary_insertion_sort_start(dst, 1, size);
}


x86 assembly (clang, -O0):
<sorter_binary_insertion_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
ja     1130 <sorter_binary_insertion_sort+0x20>
jmp    1142 <sorter_binary_insertion_sort+0x32>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <sorter_binary_insertion_sort_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sorter_binary_insertion_sort>:
cmp    $0x2,%rsi
jae    1117 <sorter_binary_insertion_sort+0x7>
ret
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <sorter_binary_insertion_sort_start@plt>

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

LLVM IR (-O2):
define void @sorter_binary_insertion_sort(i32* %0, i64 %1) {
%3 = icmp ult i64 %1, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sorter_binary_insertion_sort_start(i32* %0, i32 1, i64 %1)
br label %6
6: ; preds = %2, %4
ret void
}