xunge/DecIR huggingface dataset:
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int do_pipe(struct tcb *, int);
int sys_pipe(struct tcb *tcp) { return do_pipe(tcp, -1); }


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

x86 assembly (clang, -O2):
<sys_pipe>:
mov    $0xffffffff,%esi
jmp    1030 <do_pipe@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_pipe(%struct.tcb* %0) {
%2 = tail call i32 @do_pipe(%struct.tcb* %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int checkcmp();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ unlink(char *);
int checkssl() {
  int rc;
  unlink("tools/.chk");
  system("gcc tools/chkssl.c -I/usr/local/ssl/include -L/usr/local/ssl/lib "
         "-lssl -lcrypto -o tools/chkssl"
         " 2>tools/.chk ");
  return checkcmp();
}


x86 assembly (clang, -O0):
<checkssl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <checkcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkssl>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec7(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <checkcmp@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [110 x i8] c"gcc tools/chkssl.c -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto -o tools/chkssl 2>tools/.chk \00"
define i32 @checkssl() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @checkcmp()
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [110 x i8] c"gcc tools/chkssl.c -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto -o tools/chkssl 2>tools/.chk \00"
define i32 @checkssl() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @checkcmp()
ret i32 %3
}
int isspace(int ch) { return (((ch >= 9) && (ch <= 13)) || (ch == 32)); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jl     1120 <isspace+0x20>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <isspace+0x2a>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 9
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 13
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 32
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ t1000_configsys_load();
int /*<<< orphan*/ t1000_emsboard_load();
void t1000_nvr_load(void) {
  t1000_emsboard_load();
  t1000_configsys_load();
}


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

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

LLVM IR (-O0):
define void @t1000_nvr_load() {
%1 = call i32 (...) @t1000_emsboard_load()
%2 = call i32 (...) @t1000_configsys_load()
ret void
}

LLVM IR (-O2):
define void @t1000_nvr_load() {
%1 = tail call i32 (...) @t1000_emsboard_load()
%2 = tail call i32 (...) @t1000_configsys_load()
ret void
}
/* Variables and functions */
int enum_1();
int enum_2();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("enum_1()"
         " = %d\n",
         (enum_1()));
  printf("enum_2()"
         " = %d\n",
         (enum_2()));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <enum_1@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <enum_2@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <enum_1@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <enum_2@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"enum_1() = %d\0A\00"
@.str.1 = [15 x i8] c"enum_2() = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @enum_1()
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @enum_2()
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"enum_1() = %d\0A\00"
@.str.1 = [15 x i8] c"enum_2() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @enum_1()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @enum_2()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_high(uint32_t a, uint32_t b) { return a >> 8; }


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

x86 assembly (clang, -O2):
<op_high>:
mov    %edi,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @op_high(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 = ashr i32 %5, 8
ret i32 %6
}

LLVM IR (-O2):
define i32 @op_high(i32 %0, i32 %1) {
%3 = ashr i32 %0, 8
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printSum(int, int /*<<< orphan*/, int *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  int result[100];
  printSum(x, 0, result, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    -0x1a0(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <printSum@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x1a8,%rsp
lea    0xed2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
lea    0x10(%rsp),%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <printSum@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%7 = call i32 @printSum(i32 %5, i32 0, i32* %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast [100 x i32]* %2 to i8*
%6 = load i32, i32* %1
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%8 = call i32 @printSum(i32 %6, i32 0, i32* %7, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yuiAutoStr(char **str) { free(*str); }


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

x86 assembly (clang, -O2):
<yuiAutoStr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @yuiAutoStr(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
ret void
}
int notification_backend_supported(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notification_backend_supported() {
ret i32 0
}
/* Variables and functions */
int SIGALRM;
int raise(int);
int test(void) {
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = raise(signal_number);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@SIGALRM = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @SIGALRM
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @raise(i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define i32 @test() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @raise(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t GET_G(const uint32_t value) {
  return (((uint32_t)value & 0xff00) >> 8);
}


x86 assembly (clang, -O0):
<GET_G>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GET_G(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @GET_G(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
bool isEmpty(struct node *node) { return (node == NULL); }


x86 assembly (clang, -O0):
<isEmpty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEmpty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @isEmpty(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = icmp eq %struct.node* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @isEmpty(%struct.node* readnone %0) {
%2 = icmp eq %struct.node* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Just a test\n");
  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 <printf@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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Just a test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Just a test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printErr(char const *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void rp_fatal(char const *str) {
  char buf[1024];
  printErr(str);
  sprintf(buf, "pppoe-discovery: %.256s", str);
  exit(1);
}


x86 assembly (clang, -O0):
<rp_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printErr@plt>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea6(%rip),%rsi
call   1040 <sprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<rp_fatal>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rbx
call   1030 <printErr@plt>
lea    0xeb9(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1040 <sprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"pppoe-discovery: %.256s\00"
define void @rp_fatal(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printErr(i8* %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"pppoe-discovery: %.256s\00"
define void @rp_fatal(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printErr(i8* %0)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
long __ccaprice_syscall_args_0(long A0) {
  unsigned long R;
  __asm__ __volatile__("syscall" : "=a"(R) : "a"(A0) : "rcx", "r11", "memory");
  return R;
}


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

x86 assembly (clang, -O2):
<__ccaprice_syscall_args_0>:
mov    %rdi,%rax
syscall
ret

LLVM IR (-O0):
define i64 @__ccaprice_syscall_args_0(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @__ccaprice_syscall_args_0(i64 %0) {
%2 = tail call i64 asm sideeffect "syscall", "={ax},{ax},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ spn_die(char *, void *, unsigned long);
void *spn_realloc(void *ptr, size_t n) {
  void *ret = realloc(ptr, n);
  if (ret == NULL && n > 0) {
    unsigned long uln = n;
    spn_die("reallocation of pointer %p to size %lu failed", ptr, uln);
  }
  return ret;
}


x86 assembly (clang, -O0):
<spn_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <spn_realloc+0x53>
cmpq   $0x0,-0x10(%rbp)
jbe    1173 <spn_realloc+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe92(%rip),%rdi
call   1030 <spn_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spn_realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     114f <spn_realloc+0x2f>
test   %r15,%r15
jne    114f <spn_realloc+0x2f>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <spn_die@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"reallocation of pointer %p to size %lu failed\00"
define i8* @spn_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i64, i64* %4
%14 = icmp ugt i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i64, i64* %4
store i64 %16, i64* %6
%17 = load i8*, i8** %3
%18 = load i64, i64* %6
%19 = call i32 @spn_die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %17, i64 %18)
br label %20
20: ; preds = %15, %12, %2
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [46 x i8] c"reallocation of pointer %p to size %lu failed\00"
define noalias i8* @spn_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @spn_die(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
char *dummy(s)
char *s;
{ return (s); }


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

x86 assembly (clang, -O2):
<dummy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @dummy(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ digitalWrite(int, int);
void hangReset() {
  digitalWrite(1, 1);
  digitalWrite(2, 0);
}


x86 assembly (clang, -O0):
<hangReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <digitalWrite@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <digitalWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hangReset>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <digitalWrite@plt>
mov    $0x2,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <digitalWrite@plt>

LLVM IR (-O0):
define void @hangReset() {
%1 = call i32 @digitalWrite(i32 1, i32 1)
%2 = call i32 @digitalWrite(i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @hangReset() {
%1 = tail call i32 @digitalWrite(i32 1, i32 1)
%2 = tail call i32 @digitalWrite(i32 2, i32 0)
ret void
}
/* Variables and functions */
void *brp_get_next_region_info_internal(void *, void *, void **, int);
void *brp_get_next_region_info_1(void *storage, void *ptr, void **info) {
  return brp_get_next_region_info_internal(storage, ptr, info, 1);
}


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

x86 assembly (clang, -O2):
<brp_get_next_region_info_1>:
mov    $0x1,%ecx
jmp    1030 <brp_get_next_region_info_internal@plt>

LLVM IR (-O0):
define i8* @brp_get_next_region_info_1(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 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i8* @brp_get_next_region_info_internal(i8* %7, i8* %8, i8** %9, i32 1)
ret i8* %10
}

LLVM IR (-O2):
define i8* @brp_get_next_region_info_1(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @brp_get_next_region_info_internal(i8* %0, i8* %1, i8** %2, i32 1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sleep_short(int milliseconds) { usleep(milliseconds / 1000); }


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

x86 assembly (clang, -O2):
<sleep_short>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleep_short(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sleep_short(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int socket(int domain, int type, int protocol) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @socket(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* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int main() {
  float a;
  float b;
  a = 4.5;
  b = 11.25;
  __print_float(a + b);
  __print_float(a - b);
  __print_float(a * b);
  __print_float(a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xede(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xed5(%rip),%xmm0
call   1030 <__print_float@plt>
movss  0xecc(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 4.500000e+00, float* %2
store float 1.125000e+01, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fadd float %4, %5
%7 = call i32 @__print_float(float %6)
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fsub float %8, %9
%11 = call i32 @__print_float(float %10)
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = call i32 @__print_float(float %14)
%16 = load float, float* %2
%17 = load float, float* %3
%18 = fdiv float %16, %17
%19 = call i32 @__print_float(float %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_float(float 1.575000e+01)
%2 = tail call i32 @__print_float(float -6.750000e+00)
%3 = tail call i32 @__print_float(float 5.062500e+01)
%4 = tail call i32 @__print_float(float 0x3FD99999A0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void target(void) {
  printf("you win!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<target>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"you win!\0A\00"
define void @target() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [9 x i8] c"you win!\00"
define void @target() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *ps = "This is a good tutorial!";
  int n = 10;
  ps = ps + n;
  printf("%s\n", ps);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"This is a good tutorial!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 10, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"This is a good tutorial!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 10))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bwrite(int /*<<< orphan*/, char *);
void ext2_write_bootblock(char *bb) { bwrite(0, bb); }


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

x86 assembly (clang, -O2):
<ext2_write_bootblock>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <bwrite@plt>

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

LLVM IR (-O2):
define void @ext2_write_bootblock(i8* %0) {
%2 = tail call i32 @bwrite(i32 0, i8* %0)
ret void
}
int left(int i) { return (i << 1) + 1; }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
void *SpawnNormalThread(void *method, void *arg) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @SpawnNormalThread(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Type definitions */
struct tms {
  scalar_t__ tms_utime;
  scalar_t__ tms_stime;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
clock_t clock() {
  struct tms x;
  (void)times(&x);
  return x.tms_stime + x.tms_utime;
}


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

x86 assembly (clang, -O2):
<clock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
mov    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
define i64 @clock() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
ret i64 %8
}
void ff_hevc_put_hevc_bi_w_qpel_hv64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv64_10_sse4() {
ret void
}
float max(float x) { return 1.0; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @max(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @max(float %0) {
ret float 1.000000e+00
}
/* Variables and functions */
float sqrtf(float);
float arm_sqrt(float in) {
  float out;
  out = sqrtf(in);
  return out;
}


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

x86 assembly (clang, -O2):
<arm_sqrt>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <arm_sqrt+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @arm_sqrt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @sqrtf(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @arm_sqrt(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
void Decode_Room_Name(char *name, int id) {
  do {
    if (*name != ' ') {
      *name = (((*name - 'a') + id) % 26) + 'a';
    }
    name++;
  } while (*name != '\0');
}


x86 assembly (clang, -O0):
<Decode_Room_Name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     113b <Decode_Room_Name+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x61,%eax
add    -0xc(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110b <Decode_Room_Name+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decode_Room_Name>:
mov    (%rdi),%al
add    $0xffffff9f,%esi
add    $0x1,%rdi
jmp    111b <Decode_Room_Name+0x1b>
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     114b <Decode_Room_Name+0x4b>
cmp    $0x20,%al
je     1110 <Decode_Room_Name+0x10>
movsbl %al,%eax
add    %esi,%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
mov    %al,-0x1(%rdi)
jmp    1110 <Decode_Room_Name+0x10>
ret

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

LLVM IR (-O2):
define void @Decode_Room_Name(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = add i32 %1, -97
br label %5
5: ; preds = %15, %2
%6 = phi i8 [ %17, %15 ], [ %3, %2 ]
%7 = phi i8* [ %16, %15 ], [ %0, %2 ]
%8 = icmp eq i8 %6, 32
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = sext i8 %6 to i32
%11 = add i32 %4, %10
%12 = srem i32 %11, 26
%13 = trunc i32 %12 to i8
%14 = add nsw i8 %13, 97
store i8 %14, i8* %7
br label %15
15: ; preds = %9, %5
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %15
ret void
}
/* Variables and functions */
int get_game_counter();
int /*<<< orphan*/ set_game_counter(int);
int increment_game_counter() {
  int gameCounter;
  gameCounter = get_game_counter();
  gameCounter++;
  set_game_counter(gameCounter);
  return gameCounter;
}


x86 assembly (clang, -O0):
<increment_game_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_game_counter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_game_counter@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_game_counter>:
push   %rbx
xor    %eax,%eax
call   1040 <get_game_counter@plt>
mov    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <set_game_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @increment_game_counter() {
%1 = alloca i32
%2 = call i32 (...) @get_game_counter()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @set_game_counter(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @increment_game_counter() {
%1 = tail call i32 (...) @get_game_counter()
%2 = add nsw i32 %1, 1
%3 = tail call i32 @set_game_counter(i32 %2)
ret i32 %2
}
/* Type definitions */
struct pci_driver {
  int dummy;
};
struct pci_device_id {
  int dummy;
};
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int get_nondet_int();
int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
                   struct pci_device_id *id) {
  int error;
  error = get_nondet_int();
  return (error);
}


x86 assembly (clang, -O0):
<pci_call_probe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <get_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pci_driver = type { i32 }
%struct.pci_dev = type { i32 }
%struct.pci_device_id = type { i32 }
define i32 @pci_call_probe(%struct.pci_driver* %0, %struct.pci_dev* %1, %struct.pci_device_id* %2) {
%4 = alloca %struct.pci_driver*
%5 = alloca %struct.pci_dev*
%6 = alloca %struct.pci_device_id*
%7 = alloca i32
store %struct.pci_driver* %0, %struct.pci_driver** %4
store %struct.pci_dev* %1, %struct.pci_dev** %5
store %struct.pci_device_id* %2, %struct.pci_device_id** %6
%8 = call i32 (...) @get_nondet_int()
store i32 %8, i32* %7
%9 = load i32, i32* %7
ret i32 %9
}

LLVM IR (-O2):
%struct.pci_driver = type { i32 }
%struct.pci_dev = type { i32 }
%struct.pci_device_id = type { i32 }
define i32 @pci_call_probe(%struct.pci_driver* nocapture readnone %0, %struct.pci_dev* nocapture readnone %1, %struct.pci_device_id* nocapture readnone %2) {
%4 = tail call i32 (...) @get_nondet_int()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  x = (10 + 2) * 3 - (4 + 5 * 3);
  printf("value of x: %d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
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    $0x11,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"value of x: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"value of x: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 17)
ret i32 0
}
/* Variables and functions */
float fabs(float);
float eval(float x) { return fabs(x - 5000); }


x86 assembly (clang, -O0):
<eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <fabs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval>:
addss  0xef8(%rip),%xmm0
andps  0xf01(%rip),%xmm0
ret

LLVM IR (-O0):
define float @eval(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 5.000000e+03
%5 = call float @fabs(float %4)
ret float %5
}

LLVM IR (-O2):
define float @eval(float %0) {
%2 = fadd float %0, -5.000000e+03
%3 = tail call float @llvm.fabs.f32(float %2)
ret float %3
}
void IN_ModeChanged(void) {}


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

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

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

LLVM IR (-O2):
define void @IN_ModeChanged() {
ret void
}
void HAL_TIM_Powerup(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_TIM_Powerup() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int Close_File(FILE *configfile) { return (fclose(configfile)); }


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

x86 assembly (clang, -O2):
<Close_File>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @Close_File(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t align32_size(uint16_t size) {
  if (size % 4 != 0) {
    return (size & 0xfffc) + 0x4;
  }
  return size;
}


x86 assembly (clang, -O0):
<align32_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112e <align32_size+0x2e>
mov    -0x8(%rbp),%eax
and    $0xfffc,%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <align32_size+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align32_size>:
mov    %edi,%eax
and    $0xfffc,%eax
add    $0x4,%eax
test   $0x3,%dil
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @align32_size(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 65532
%5 = add nuw nsw i32 %4, 4
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
int get_bit(unsigned char *x, int i) { return x[i / 8] & (1 << (i % 8)); }


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%edx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = and i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = shl nuw nsw i32 1, %8
%10 = and i32 %9, %7
ret i32 %10
}
void smp_send_reschedule(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @smp_send_reschedule(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  printf("Type in your number: \n");
  scanf("%i", &number);
  if (number < 0) {
    number = -number;
  }
  printf("The absolute value is %i\n", number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    115f <main+0x3f>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jns    115c <main+0x2c>
neg    %esi
mov    %esi,0x4(%rsp)
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Type in your number: \0A\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"The absolute value is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"The absolute value is %i\0A\00"
@str = [22 x i8] c"Type in your number: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = sub nsw i32 0, %5
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %0
%10 = phi i32 [ %8, %7 ], [ %5, %0 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
bool andg(bool s, bool c) { return (s && c); }


x86 assembly (clang, -O0):
<andg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <andg+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @andg(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}