xunge/DecIR huggingface dataset:
void move_(x, y, z) float *x, *y, *z;
{ move(*x, *y, *z); }


x86 assembly (clang, -O0):
<move_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <move@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @move_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = call i32 (double, double, double, ...) bitcast (i32 (...)* @move to i32 (double, double, double, ...)*)(double %9, double %12, double %15)
ret void
}

LLVM IR (-O2):
define void @move_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @move to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int remote_send(char *);
int remote_sig_quit(void) { return remote_send("quit"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"quit\00"
define i32 @remote_sig_quit() {
%1 = call i32 @remote_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"quit\00"
define i32 @remote_sig_quit() {
%1 = tail call i32 @remote_send(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned short be_short(unsigned short s) {
  unsigned short ret = s;
  ret = s >> 8;
  ret += s << 8;
  return ret;
}


x86 assembly (clang, -O0):
<be_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
movzwl -0x4(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_short>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @be_short(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
store i16 %4, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = add nsw i32 %13, %11
%15 = trunc i32 %14 to i16
store i16 %15, i16* %3
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @be_short(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int Z_INTERRUPT_CAUSE();
int z_sys_current_irq_key_get(void) { return Z_INTERRUPT_CAUSE(); }


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

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

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

LLVM IR (-O2):
define i32 @z_sys_current_irq_key_get() {
%1 = tail call i32 (...) @Z_INTERRUPT_CAUSE()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int terminerProcess(int a) { exit(a); }


x86 assembly (clang, -O0):
<terminerProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<terminerProcess>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @terminerProcess(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
foo(a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ milli_delay(int);
void TestC() {
  int i = 0x2000;
  while (1) {
    disp_str("C.");
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2000,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0xa,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestC+0xf>

x86 assembly (clang, -O2):
<TestC>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0xa,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestC+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"C.\00"
define void @TestC() {
%1 = alloca i32
store i32 8192, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"C.\00"
define void @TestC() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 10)
br label %1
}
/* Type definitions */
struct csvdb_data {
  int dummy;
};

/* Variables and functions */
int csvdb_set_str(struct csvdb_data *, int, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int csvdb_set_num(struct csvdb_data *csv, int row, int col, int num) {
  char buf[32];
  sprintf(buf, "%d", num);
  return csvdb_set_str(csv, row, col, buf);
}


x86 assembly (clang, -O0):
<csvdb_set_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x40(%rbp),%rcx
call   1030 <csvdb_set_str@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csvdb_set_num>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %ecx,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15,%rcx
call   1030 <csvdb_set_str@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.csvdb_data = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @csvdb_set_num(%struct.csvdb_data* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.csvdb_data*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [32 x i8]
store %struct.csvdb_data* %0, %struct.csvdb_data** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %8
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load %struct.csvdb_data*, %struct.csvdb_data** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%17 = call i32 @csvdb_set_str(%struct.csvdb_data* %13, i32 %14, i32 %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.csvdb_data = type { i32 }
@.str = [3 x i8] c"%d\00"
define i32 @csvdb_set_num(%struct.csvdb_data* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%8 = call i32 @csvdb_set_str(%struct.csvdb_data* %0, i32 %1, i32 %2, i8* %6)
ret i32 %8
}
int _receive_tr(struct MIDIDevice *device) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.MIDIDevice = type opaque
define i32 @_receive_tr(%struct.MIDIDevice* nocapture readnone %0) {
ret i32 0
}
void proximity_init(void) {}


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

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

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

LLVM IR (-O2):
define void @proximity_init() {
ret void
}
int test_imm_10uint32_mem(unsigned int *val) {
  return ((*val) & (0x10 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_10uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int is_letter(char s) { return (s >= 'a' && s <= 'z' || s >= 'A' && s <= 'Z'); }


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_letter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_letter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_letter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void init_signal_handling() {}


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

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

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

LLVM IR (-O2):
define void @init_signal_handling() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void printError(const char *msg) {
  fprintf(stderr, "%s: %s\n", msg, strerror(errno));
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @printError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @printError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
void fn_SYSCALL0(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_SYSCALL0() {
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int ignore_task(void) { return syscall(295, 2, 0); }


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

x86 assembly (clang, -O2):
<ignore_task>:
mov    $0x127,%edi
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @ignore_task() {
%1 = call i32 @syscall(i32 295, i32 2, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ignore_task() {
%1 = tail call i32 @syscall(i32 295, i32 2, i32 0)
ret i32 %1
}
/* Variables and functions */
unsigned short strspn(const char *first, const char *second) { return 0; }


x86 assembly (clang, -O0):
<strspn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @strspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @strspn(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i16 0
}
int conv_temp_celsius(int fahr) { return 5 * (fahr - 32) / 9; }


x86 assembly (clang, -O0):
<conv_temp_celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_temp_celsius>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @conv_temp_celsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = mul nsw i32 5, %4
%6 = sdiv i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @conv_temp_celsius(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ drop_mems(int *, int);
int /*<<< orphan*/ drop_queues(int *, int);
int test_msgmni(int **);
int test_shmmni(int **);
int main(void) {
  int *qids;
  int no_qs;
  int *mids;
  int no_ms;
  no_ms = test_shmmni(&mids);
  no_qs = test_msgmni(&qids);
  drop_queues(qids, no_qs);
  drop_mems(mids, no_ms);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <test_shmmni@plt>
mov    %eax,-0x24(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <test_msgmni@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <drop_queues@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <drop_mems@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
call   1040 <test_shmmni@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1030 <test_msgmni@plt>
mov    0x8(%rsp),%rdi
mov    %eax,%esi
call   1060 <drop_queues@plt>
mov    (%rsp),%rdi
mov    %ebx,%esi
call   1050 <drop_mems@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @test_shmmni(i32** %4)
store i32 %6, i32* %5
%7 = call i32 @test_msgmni(i32** %2)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = call i32 @drop_queues(i32* %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = call i32 @drop_mems(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = call i32 @test_shmmni(i32** %2)
%6 = call i32 @test_msgmni(i32** %1)
%7 = load i32*, i32** %1
%8 = call i32 @drop_queues(i32* %7, i32 %6)
%9 = load i32*, i32** %2
%10 = call i32 @drop_mems(i32* %9, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handler(int sig) {
  printf("Caught SIGINT\n");
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [15 x i8] c"Caught SIGINT\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Caught SIGINT\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int glutGetModifiers(void) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ rtc_make64(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ rtc_mem_read(scalar_t__);
uint64_t rtc_mem_read64(uint32_t addr) {
  return rtc_make64(rtc_mem_read(addr + 1), rtc_mem_read(addr));
}


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

x86 assembly (clang, -O2):
<rtc_mem_read64>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <rtc_mem_read@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <rtc_mem_read@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <rtc_make64@plt>

LLVM IR (-O0):
define i32 @rtc_mem_read64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = call i32 @rtc_mem_read(i64 %4)
%6 = load i64, i64* %2
%7 = call i32 @rtc_mem_read(i64 %6)
%8 = call i32 @rtc_make64(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rtc_mem_read64(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i32 @rtc_mem_read(i64 %2)
%4 = tail call i32 @rtc_mem_read(i64 %0)
%5 = tail call i32 @rtc_make64(i32 %3, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t format_address_physical_head(uint8_t *data) { return data[3]; }


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

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

LLVM IR (-O0):
define i32 @format_address_physical_head(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @format_address_physical_head(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
int main(int argc, char **argv) {
  a(argc);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @a(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sub1(int);
int /*<<< orphan*/ sub2(int);
int /*<<< orphan*/ sub3(int);
int main() {
  sub1(2);
  sub2(15);
  sub3(20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1050 <sub1@plt>
mov    $0xf,%edi
call   1030 <sub2@plt>
mov    $0x14,%edi
call   1040 <sub3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1050 <sub1@plt>
mov    $0xf,%edi
call   1030 <sub2@plt>
mov    $0x14,%edi
call   1040 <sub3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sub1(i32 2)
%3 = call i32 @sub2(i32 15)
%4 = call i32 @sub3(i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sub1(i32 2)
%2 = tail call i32 @sub2(i32 15)
%3 = tail call i32 @sub3(i32 20)
ret i32 0
}
void m(struct cell *c) {}


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

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

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

LLVM IR (-O2):
%struct.cell = type opaque
define void @m(%struct.cell* nocapture %0) {
ret void
}
int foo(void) {
  int a, b, c, d, e, f;
  asm("# Magic instruction" : "=r"(a), "=r"(d) : : "eax");
  asm("# Magic instruction" : "=r"(b), "=r"(e) : : "edx");
  asm("# Magic instruction" : "=r"(c), "=r"(f) : : "ecx");
  return a + b + c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x10(%rbp)
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x14(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %ecx,%esi
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call { i32, i32 } asm "# Magic instruction", "=r,=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
%8 = extractvalue { i32, i32 } %7, 0
%9 = extractvalue { i32, i32 } %7, 1
store i32 %8, i32* %1
store i32 %9, i32* %4
%10 = call { i32, i32 } asm "# Magic instruction", "=r,=r,~{edx},~{dirflag},~{fpsr},~{flags}"()
%11 = extractvalue { i32, i32 } %10, 0
%12 = extractvalue { i32, i32 } %10, 1
store i32 %11, i32* %2
store i32 %12, i32* %5
%13 = call { i32, i32 } asm "# Magic instruction", "=r,=r,~{ecx},~{dirflag},~{fpsr},~{flags}"()
%14 = extractvalue { i32, i32 } %13, 0
%15 = extractvalue { i32, i32 } %13, 1
store i32 %14, i32* %3
store i32 %15, i32* %6
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,~{edx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = tail call { i32, i32 } asm "# Magic instruction", "=r,=r,~{ecx},~{dirflag},~{fpsr},~{flags}"()
%6 = extractvalue { i32, i32 } %5, 0
%7 = add nsw i32 %4, %2
%8 = add nsw i32 %7, %6
ret i32 %8
}
/* Variables and functions */
float glm_clamp_zo(int /*<<< orphan*/);
int /*<<< orphan*/ glm_percent(float, float, float);
__attribute((always_)) float glm_percentc(float from, float to, float current) {
  return glm_clamp_zo(glm_percent(from, to, current));
}


x86 assembly (clang, -O0):
<glm_percentc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <glm_percent@plt>
mov    %eax,%edi
call   1040 <glm_clamp_zo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_percentc>:
push   %rax
call   1030 <glm_percent@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <glm_clamp_zo@plt>

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

LLVM IR (-O2):
define float @glm_percentc(float %0, float %1, float %2) {
%4 = tail call i32 @glm_percent(float %0, float %1, float %2)
%5 = tail call float @glm_clamp_zo(i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getAge() {
  int yourAge;
  printf("Please enter your age --> ");
  scanf("%i", &yourAge);
  return yourAge;
}


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

x86 assembly (clang, -O2):
<getAge>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter your age --> \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @getAge() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter your age --> \00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @getAge() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ soft_restart(int /*<<< orphan*/);
void arch_reset(char mode, const char *cmd) { soft_restart(0); }


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <soft_restart@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arch_reset(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = call i32 @soft_restart(i32 0)
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0, i8* nocapture readnone %1) {
%3 = tail call i32 @soft_restart(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mp_alloc(size_t);
void *alloc_cpy(const void *org, size_t length) {
  void *cpy;
  cpy = mp_alloc(length);
  if (org) {
    memcpy(cpy, org, length);
  } else {
    memset(cpy, 0, length);
  }
  return cpy;
}


x86 assembly (clang, -O0):
<alloc_cpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mp_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <alloc_cpy+0x3e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
jmp    117d <alloc_cpy+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_cpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <mp_alloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
test   %rbx,%rbx
je     115b <alloc_cpy+0x2b>
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <alloc_cpy+0x35>
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @alloc_cpy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @mp_alloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
br label %19
15: ; preds = %2
%16 = load i8*, i8** %5
%17 = load i64, i64* %4
%18 = call i32 @memset(i8* %16, i32 0, i64 %17)
br label %19
19: ; preds = %15, %10
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @alloc_cpy(i8* %0, i64 %1) {
%3 = tail call i8* @mp_alloc(i64 %1)
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
br label %9
9: ; preds = %7, %5
ret i8* %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t pos_int16_t(uint16_t number) { return number ^ 0x8000; }


x86 assembly (clang, -O0):
<pos_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x8000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_int16_t>:
mov    %edi,%eax
xor    $0x8000,%eax
ret

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

LLVM IR (-O2):
define i32 @pos_int16_t(i32 %0) {
%2 = xor i32 %0, 32768
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int Join(int argc, char **argv) {
  printf("Calling from Join\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Calling from Join\00"
define i32 @Join(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void RETURN(int *running) { *running = 0; }


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

x86 assembly (clang, -O2):
<RETURN>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @RETURN(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
intptr_t rust_get_test_int() { return 1; }


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

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

LLVM IR (-O0):
define i64 @rust_get_test_int() {
ret i64 1
}

LLVM IR (-O2):
define i64 @rust_get_test_int() {
ret i64 1
}
void nmi_handler(void) {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @nmi_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ srand48(unsigned int);
void srandom(unsigned int __s) { srand48(__s); }


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

x86 assembly (clang, -O2):
<srandom>:
jmp    1030 <srand48@plt>

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

LLVM IR (-O2):
define void @srandom(i32 %0) {
%2 = tail call i32 @srand48(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_lock_handler(int /*<<< orphan*/);
void io_unlock(void) { io_lock_handler(0); }


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

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

LLVM IR (-O0):
define void @io_unlock() {
%1 = call i32 @io_lock_handler(i32 0)
ret void
}

LLVM IR (-O2):
define void @io_unlock() {
%1 = tail call i32 @io_lock_handler(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ SQLITE_OK;
scalar_t__ sqlite3_initialize();
int db_sqlite3_init(void) { return !(sqlite3_initialize() == SQLITE_OK); }


x86 assembly (clang, -O0):
<db_sqlite3_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sqlite3_initialize@plt>
mov    0x2ec6(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_sqlite3_init>:
push   %rax
xor    %eax,%eax
call   1030 <sqlite3_initialize@plt>
mov    0x2ec9(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SQLITE_OK = global i64 0
define i32 @db_sqlite3_init() {
%1 = call i64 (...) @sqlite3_initialize()
%2 = load i64, i64* @SQLITE_OK
%3 = icmp eq i64 %1, %2
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@SQLITE_OK = global i64 0
define i32 @db_sqlite3_init() {
%1 = tail call i64 (...) @sqlite3_initialize()
%2 = load i64, i64* @SQLITE_OK
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  i = 198;
  while (i < 200) {
    i = i + 1;
    assert(i > 0);
  }
  assert(i == 201);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc6,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    1152 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1126 <main+0x16>
cmpl   $0xc9,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 198, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 200
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 201
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
void foo24() {}


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

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

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

LLVM IR (-O2):
define void @foo24() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void boxless_wakeup_table_header(__attribute__((unused)) void *report_data) {
  printf("  IRQ   Name                Count     early      late\n");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c" IRQ Name Count early late\0A\00"
define void @boxless_wakeup_table_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c" IRQ Name Count early late\00"
define void @boxless_wakeup_table_header(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./a.out [my_addr], [my_port], [your_addr], [your_port] \n");
  exit(errno);
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"Usage: ./a.out [my_addr], [my_port], [your_addr], [your_port] \0A\00"
@errno = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@str = [63 x i8] c"Usage: ./a.out [my_addr], [my_port], [your_addr], [your_port] \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
char tty_getc(int /*<<< orphan*/);
char _getc(void) {
  char c;
  c = tty_getc(0);
  return c;
}


x86 assembly (clang, -O0):
<_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <tty_getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @_getc() {
%1 = tail call signext i8 @tty_getc(i32 0)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ __enter_new_func();
void __cyg_profile_func_enter(void *func, void *from) {
  (void)func, (void)from;
  __enter_new_func();
}


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_enter(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @__enter_new_func()
ret void
}
yyerror(char *s) {}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @yyerror(i8* nocapture readnone %0) {
ret i32 undef
}
void powuu() {}


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

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

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

LLVM IR (-O2):
define void @powuu() {
ret void
}
void b43_nphy_radio_turn_off(struct b43_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43_wldev = type opaque
define void @b43_nphy_radio_turn_off(%struct.b43_wldev* nocapture %0) {
ret void
}
/* Variables and functions */
bool nrf51_errata_54(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_54() {
ret i32 0
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int factorial, num;
  printf("Enter the value of num :");
  scanf("%d", &num);
  factorial = fact(num);
  printf("Factorial is %d", factorial);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the value of num :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Factorial is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @fact(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter the value of num :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Factorial is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}