xunge/DecIR huggingface dataset:
int compare_items(const void *item1, const void *item2) {
  return item1 != item2;
}


x86 assembly (clang, -O0):
<compare_items>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_items>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @compare_items(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 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @compare_items(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int sys_connect(tcp)
struct tcb *tcp;
{
  return sys_bind(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_connect(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_bind to i32 (%struct.tcb*, ...)*)(%struct.tcb* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_connect(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @sys_bind to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 %2
}
const char *get_init_rfx(void) {
  return "<define>\\n|1.7\\n</define>\\n<language_code>\\n0xF0\\n</"
         "language_code>\\n<params> \\nip1|_IP Address|string|127|3| "
         "\\nip2||string|0|3| \\nip3||string|0|3| \\nip4||string|1|3| "
         "\\nport|_Port|num0|8888|1|65535 \\n</params> \\n<param_window> "
         "\\nlayout|\\\"Enter an IP address and port to stream to LiVES output "
         "to.\\\"| \\nlayout|\\\"In the other copy of LiVES, you must select "
         "Advanced/Receive LiVES stream from...\\\"| \\nlayout|\\\"You are "
         "advised to start with a small frame size and low framerate,\\\"| "
         "\\nlayout|\\\"and increase this if your network bandwidth allows "
         "it.\\\"| "
         "\\nlayout|p0|\\\".\\\"|p1|\\\".\\\"|p2|\\\".\\\"|p3|fill|fill|fill|"
         "fill| \\nlayout|p4|fill\\n</param_window> \\n<onchange> "
         "\\n</onchange> \\n";
}


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

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

LLVM IR (-O0):
@.str = [670 x i8] c"<define>\\n|1.7\\n</define>\\n<language_code>\\n0xF0\\n</language_code>\\n<params> \\nip1|_IP Address|string|127|3| \\nip2||string|0|3| \\nip3||string|0|3| \\nip4||string|1|3| \\nport|_Port|num0|8888|1|65535 \\n</params> \\n<param_window> \\nlayout|\\\22Enter an IP address and port to stream to LiVES output to.\\\22| \\nlayout|\\\22In the other copy of LiVES, you must select Advanced/Receive LiVES stream from...\\\22| \\nlayout|\\\22You are advised to start with a small frame size and low framerate,\\\22| \\nlayout|\\\22and increase this if your network bandwidth allows it.\\\22| \\nlayout|p0|\\\22.\\\22|p1|\\\22.\\\22|p2|\\\22.\\\22|p3|fill|fill|fill|fill| \\nlayout|p4|fill\\n</param_window> \\n<onchange> \\n</onchange> \\n\00"
define i8* @get_init_rfx() {
ret i8* getelementptr inbounds ([670 x i8], [670 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [670 x i8] c"<define>\\n|1.7\\n</define>\\n<language_code>\\n0xF0\\n</language_code>\\n<params> \\nip1|_IP Address|string|127|3| \\nip2||string|0|3| \\nip3||string|0|3| \\nip4||string|1|3| \\nport|_Port|num0|8888|1|65535 \\n</params> \\n<param_window> \\nlayout|\\\22Enter an IP address and port to stream to LiVES output to.\\\22| \\nlayout|\\\22In the other copy of LiVES, you must select Advanced/Receive LiVES stream from...\\\22| \\nlayout|\\\22You are advised to start with a small frame size and low framerate,\\\22| \\nlayout|\\\22and increase this if your network bandwidth allows it.\\\22| \\nlayout|p0|\\\22.\\\22|p1|\\\22.\\\22|p2|\\\22.\\\22|p3|fill|fill|fill|fill| \\nlayout|p4|fill\\n</param_window> \\n<onchange> \\n</onchange> \\n\00"
define i8* @get_init_rfx() {
ret i8* getelementptr inbounds ([670 x i8], [670 x i8]* @.str, i64 0, i64 0)
}
unsigned int s_floor_ilog2(int value) {
  unsigned int r = 0;
  while ((value >>= 1) != 0) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<s_floor_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <s_floor_ilog2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <s_floor_ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_floor_ilog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <s_floor_ilog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <s_floor_ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @s_floor_ilog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double process_time() {
  struct timespec ts;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
  return (double)ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
}


x86 assembly (clang, -O0):
<process_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @process_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+09
%11 = fadd double %6, %10
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @process_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %11, %7
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ i2cSendByte(unsigned char);
int /*<<< orphan*/ i2cSendStart();
int /*<<< orphan*/ i2cSendStop();
int /*<<< orphan*/ i2cWaitForComplete();
void writeRegister(unsigned char address, unsigned char data) {
  i2cSendStart();
  i2cWaitForComplete();
  i2cSendByte((0x1D << 1));
  i2cWaitForComplete();
  i2cSendByte(address);
  i2cWaitForComplete();
  i2cSendByte(data);
  i2cWaitForComplete();
  i2cSendStop();
}


x86 assembly (clang, -O0):
<writeRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1060 <i2cSendStart@plt>
mov    $0x0,%al
call   1040 <i2cWaitForComplete@plt>
mov    $0x3a,%edi
call   1030 <i2cSendByte@plt>
mov    $0x0,%al
call   1040 <i2cWaitForComplete@plt>
movzbl -0x1(%rbp),%edi
call   1030 <i2cSendByte@plt>
mov    $0x0,%al
call   1040 <i2cWaitForComplete@plt>
movzbl -0x2(%rbp),%edi
call   1030 <i2cSendByte@plt>
mov    $0x0,%al
call   1040 <i2cWaitForComplete@plt>
mov    $0x0,%al
call   1050 <i2cSendStop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <i2cSendStart@plt>
xor    %eax,%eax
call   1040 <i2cWaitForComplete@plt>
mov    $0x3a,%edi
call   1030 <i2cSendByte@plt>
xor    %eax,%eax
call   1040 <i2cWaitForComplete@plt>
mov    %ebp,%edi
call   1030 <i2cSendByte@plt>
xor    %eax,%eax
call   1040 <i2cWaitForComplete@plt>
mov    %ebx,%edi
call   1030 <i2cSendByte@plt>
xor    %eax,%eax
call   1040 <i2cWaitForComplete@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <i2cSendStop@plt>

LLVM IR (-O0):
define void @writeRegister(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @i2cSendStart()
%6 = call i32 (...) @i2cWaitForComplete()
%7 = call i32 @i2cSendByte(i8 zeroext 58)
%8 = call i32 (...) @i2cWaitForComplete()
%9 = load i8, i8* %3
%10 = call i32 @i2cSendByte(i8 zeroext %9)
%11 = call i32 (...) @i2cWaitForComplete()
%12 = load i8, i8* %4
%13 = call i32 @i2cSendByte(i8 zeroext %12)
%14 = call i32 (...) @i2cWaitForComplete()
%15 = call i32 (...) @i2cSendStop()
ret void
}

LLVM IR (-O2):
define void @writeRegister(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @i2cSendStart()
%4 = tail call i32 (...) @i2cWaitForComplete()
%5 = tail call i32 @i2cSendByte(i8 zeroext 58)
%6 = tail call i32 (...) @i2cWaitForComplete()
%7 = tail call i32 @i2cSendByte(i8 zeroext %0)
%8 = tail call i32 (...) @i2cWaitForComplete()
%9 = tail call i32 @i2cSendByte(i8 zeroext %1)
%10 = tail call i32 (...) @i2cWaitForComplete()
%11 = tail call i32 (...) @i2cSendStop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ ck_bt(char const *, unsigned int, char const *);
__attribute__((__noreturn__)) void
ck_bt_abort(const char *filename, unsigned int line, const char *msg) {
  ck_bt(filename, line, msg);
  abort();
}


x86 assembly (clang, -O0):
<ck_bt_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <ck_bt@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<ck_bt_abort>:
push   %rax
call   1040 <ck_bt@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @ck_bt_abort(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @ck_bt(i8* %7, i32 %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @ck_bt_abort(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @ck_bt(i8* %0, i32 %1, i8* %2)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponse_RemoteIOClient_RemoteInput_InputKeyUp(void *);
int /*<<< orphan*/ printf(char *, int);
void UpnpRemoteIOClient_RemoteInput_InputKeyUp(void *upnptoken, int key) {
  printf("Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyUp(%d);\r\n", key);
  UpnpResponse_RemoteIOClient_RemoteInput_InputKeyUp(upnptoken);
}


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

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputKeyUp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UpnpResponse_RemoteIOClient_RemoteInput_InputKeyUp@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyUp(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyUp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyUp(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputKeyUp(%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputKeyUp(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputKeyUp(i8* %0)
ret void
}
int btrfs_test_qgroups(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @btrfs_test_qgroups() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CopyTile(int, int);
void CopyTileRow(int source, int dest, int length) {
  for (int i = 0; i < length; i++)
    CopyTile(source + i, dest + i);
}


x86 assembly (clang, -O0):
<CopyTileRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1153 <CopyTileRow+0x43>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x10(%rbp),%esi
call   1030 <CopyTile@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <CopyTileRow+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyTileRow>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1135 <CopyTileRow+0x25>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <CopyTile@plt>
add    $0x1,%ebp
add    $0x1,%ebx
add    $0xffffffff,%r14d
jne    1120 <CopyTileRow+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @CopyTileRow(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %11, %6 ], [ 0, %3 ]
%8 = add nsw i32 %7, %0
%9 = add nsw i32 %7, %1
%10 = tail call i32 @CopyTile(i32 %8, i32 %9)
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %2
br i1 %12, label %5, label %6
}
/* Variables and functions */
int write(int, float const *, int);
int write_float4_array(int f, const float *x, int n) {
  return write(f, x, 4 * n) / 4;
}


x86 assembly (clang, -O0):
<write_float4_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x2,%edx
call   1030 <write@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_float4_array>:
push   %rax
shl    $0x2,%edx
call   1030 <write@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_float4_array(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = mul nsw i32 4, %9
%11 = call i32 @write(i32 %7, float* %8, i32 %10)
%12 = sdiv i32 %11, 4
ret i32 %12
}

LLVM IR (-O2):
define i32 @write_float4_array(i32 %0, float* nocapture %1, i32 %2) {
%4 = shl nsw i32 %2, 2
%5 = tail call i32 @write(i32 %0, float* %1, i32 %4)
%6 = sdiv i32 %5, 4
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_fixstr(void *ptr, uint8_t length, size_t *sz) {
  *sz = 1;
  *((uint8_t *)ptr) = (length & 0x1F) | 0xA0;
}


x86 assembly (clang, -O0):
<minipack_pack_fixstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x1,(%rax)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
or     $0xa0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_fixstr>:
movq   $0x1,(%rdx)
and    $0x1f,%esi
or     $0xa0,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_fixstr(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 1, i64* %7
%8 = load i32, i32* %5
%9 = and i32 %8, 31
%10 = or i32 %9, 160
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @minipack_pack_fixstr(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 1, i64* %2
%4 = and i32 %1, 31
%5 = or i32 %4, 160
%6 = bitcast i8* %0 to i32*
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
void signal_handler(int signal) {
  static size_t count = 0;
  printf("SIGINT received: %zu\n", ++count);
}


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

x86 assembly (clang, -O2):
<signal_handler>:
mov    0x2f19(%rip),%rsi
add    $0x1,%rsi
mov    %rsi,0x2f0e(%rip)
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@signal_handler.count = internal global i64 0
@.str = [22 x i8] c"SIGINT received: %zu\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @signal_handler.count
%4 = add i64 %3, 1
store i64 %4, i64* @signal_handler.count
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %4)
ret void
}

LLVM IR (-O2):
@signal_handler.count = internal unnamed_addr global i64 0
@.str = [22 x i8] c"SIGINT received: %zu\0A\00"
define void @signal_handler(i32 %0) {
%2 = load i64, i64* @signal_handler.count
%3 = add i64 %2, 1
store i64 %3, i64* @signal_handler.count
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}
/* Variables and functions */
int f(int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i, a[] = {-2, -1, 0, 1, 2};
  i = f(a + 2);
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
add    $0x8,%rdi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <f@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 -2, i32 -1, i32 0, i32 1, i32 2]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%4 = call i32 @f(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int IsBigEndian();
short rotate2b(short var) {
  typedef union {
    short int i;
    char b[2];
  } int_um;
  if (IsBigEndian() == 0x01) {
    int_um *ptr;
    char hilf;
    ptr = (int_um *)&var;
    hilf = ptr->b[0];
    ptr->b[0] = ptr->b[1];
    ptr->b[1] = hilf;
  }
  return var;
}


x86 assembly (clang, -O0):
<rotate2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <IsBigEndian@plt>
cmp    $0x1,%eax
jne    1157 <rotate2b+0x47>
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movswl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate2b>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movzbl %bh,%ebp
xor    %eax,%eax
call   1030 <IsBigEndian@plt>
cmp    $0x1,%eax
mov    %ebp,%ecx
cmove  %ebx,%ecx
cmove  %ebp,%ebx
shl    $0x8,%ecx
movzbl %bl,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%union.int_um = type { i16 }
define signext i16 @rotate2b(i16 signext %0) {
%2 = alloca i16
%3 = alloca %union.int_um*
%4 = alloca i8
store i16 %0, i16* %2
%5 = call i32 (...) @IsBigEndian()
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = bitcast i16* %2 to %union.int_um*
store %union.int_um* %8, %union.int_um** %3
%9 = load %union.int_um*, %union.int_um** %3
%10 = bitcast %union.int_um* %9 to [2 x i8]*
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
%12 = load i8, i8* %11
store i8 %12, i8* %4
%13 = load %union.int_um*, %union.int_um** %3
%14 = bitcast %union.int_um* %13 to [2 x i8]*
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 1
%16 = load i8, i8* %15
%17 = load %union.int_um*, %union.int_um** %3
%18 = bitcast %union.int_um* %17 to [2 x i8]*
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %18, i64 0, i64 0
store i8 %16, i8* %19
%20 = load i8, i8* %4
%21 = load %union.int_um*, %union.int_um** %3
%22 = bitcast %union.int_um* %21 to [2 x i8]*
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %22, i64 0, i64 1
store i8 %20, i8* %23
br label %24
24: ; preds = %7, %1
%25 = load i16, i16* %2
ret i16 %25
}

LLVM IR (-O2):
define signext i16 @rotate2b(i16 signext %0) {
%2 = lshr i16 %0, 8
%3 = tail call i32 (...) @IsBigEndian()
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i16 %0, i16 %2
%6 = select i1 %4, i16 %2, i16 %0
%7 = shl i16 %5, 8
%8 = and i16 %6, 255
%9 = or i16 %7, %8
ret i16 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short descent;
};
typedef TYPE_1__ XCharStruct;

/* Variables and functions */
void set_XCharStruct_descent(void *_p, short _v) {
  ((XCharStruct *)_p)->descent = (short)_v;
}


x86 assembly (clang, -O0):
<set_XCharStruct_descent>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XCharStruct_descent>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XCharStruct_descent(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XCharStruct_descent(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
double calcSunTrueLong(double);
int /*<<< orphan*/ deg2rad(double);
double sin(int /*<<< orphan*/);
double calcSunApparentLong(double t) {
  return calcSunTrueLong(t) - 0.00569 -
         0.00478 * sin(deg2rad(125.04 - 1934.136 * t));
}


x86 assembly (clang, -O0):
<calcSunApparentLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <calcSunTrueLong@plt>
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe72(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSunApparentLong>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1050 <calcSunTrueLong@plt>
addsd  0xeb9(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  0xead(%rip),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0xea1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calcSunApparentLong(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @calcSunTrueLong(double %3)
%5 = fsub double %4, 5.690000e-03
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double 0xC09E388B43958106, double %6, double 1.250400e+02)
%8 = call i32 @deg2rad(double %7)
%9 = call double @sin(i32 %8)
%10 = call double @llvm.fmuladd.f64(double -4.780000e-03, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @calcSunApparentLong(double %0) {
%2 = tail call double @calcSunTrueLong(double %0)
%3 = fadd double %2, -5.690000e-03
%4 = tail call double @llvm.fmuladd.f64(double %0, double 0xC09E388B43958106, double 1.250400e+02)
%5 = tail call i32 @deg2rad(double %4)
%6 = tail call double @sin(i32 %5)
%7 = tail call double @llvm.fmuladd.f64(double %6, double -4.780000e-03, double %3)
ret double %7
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
char *strstr(const char *haystack, const char *needle) {
  size_t needleLength = strlen(needle);
  do {
    if (strncmp(haystack, needle, needleLength) == 0) {
      return (char *)haystack;
    }
  } while (*haystack++);
  return NULL;
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1165 <strstr+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118a <strstr+0x6a>
jmp    116a <strstr+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    113d <strstr+0x1d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncmp@plt>
test   %rax,%rax
je     115e <strstr+0x3e>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <strstr+0x20>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %6
br label %9
9: ; preds = %18, %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i64 @strncmp(i8* %10, i8* %11, i64 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = load i8*, i8** %4
store i8* %16, i8** %3
br label %24
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
%21 = load i8, i8* %19
%22 = icmp ne i8 %21, 0
br i1 %22, label %9, label %23
23: ; preds = %18
store i8* null, i8** %3
br label %24
24: ; preds = %23, %15
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
br label %4
4: ; preds = %8, %2
%5 = phi i8* [ %0, %2 ], [ %9, %8 ]
%6 = tail call i64 @strncmp(i8* %5, i8* %1, i64 %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %5
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4
%13 = phi i8* [ %5, %4 ], [ null, %8 ]
ret i8* %13
}
double get_musclel(double x_up, double x_dw) { return 0; }


x86 assembly (clang, -O0):
<get_musclel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_musclel>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @get_musclel(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @get_musclel(double %0, double %1) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(void *, int, size_t, int /*<<< orphan*/ *);
int reg_store(void *dataptr, size_t size, char *regpath) {
  FILE *file;
  file = fopen(regpath, "wb");
  if (file == NULL)
    return -1;
  fwrite(dataptr, 1, size, file);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<reg_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    116f <reg_store+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1195 <reg_store+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_store>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rsi
mov    %rdx,%rdi
call   1040 <fopen@plt>
test   %rax,%rax
je     1171 <reg_store+0x41>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1176 <reg_store+0x46>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @reg_store(i8* %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
%9 = load i8*, i8** %7
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %8
%11 = load i32*, i32** %8
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 -1, i32* %4
br label %21
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = load i32*, i32** %8
%18 = call i32 @fwrite(i8* %15, i32 1, i64 %16, i32* %17)
%19 = load i32*, i32** %8
%20 = call i32 @fclose(i32* %19)
store i32 0, i32* %4
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @reg_store(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32* @fopen(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32* %4)
%8 = tail call i32 @fclose(i32* %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %10
}
char *get_mount_point(char *path) { return path; }


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

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

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

LLVM IR (-O2):
define i8* @get_mount_point(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *__tz_convert(int /*<<< orphan*/ const *, int /*<<< orphan*/,
                        struct tm *);
struct tm *__gmtime_r(const time_t *t, struct tm *tp) {
  return __tz_convert(t, 0, tp);
}


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

x86 assembly (clang, -O2):
<__gmtime_r>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <__tz_convert@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @__gmtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @__tz_convert(i32* %0, i32 0, %struct.tm* %1)
ret %struct.tm* %3
}
/* Variables and functions */
int /*<<< orphan*/ kernelLock();
int /*<<< orphan*/ kernelUnlock();
int /*<<< orphan*/ taskSetTimeout(int, unsigned long);
void taskSleep(unsigned long ticks) {
  kernelLock();
  taskSetTimeout(4, ticks);
  kernelUnlock();
}


x86 assembly (clang, -O0):
<taskSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <kernelLock@plt>
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <taskSetTimeout@plt>
mov    $0x0,%al
call   1050 <kernelUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taskSleep>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <kernelLock@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <taskSetTimeout@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <kernelUnlock@plt>

LLVM IR (-O0):
define void @taskSleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @kernelLock()
%4 = load i64, i64* %2
%5 = call i32 @taskSetTimeout(i32 4, i64 %4)
%6 = call i32 (...) @kernelUnlock()
ret void
}

LLVM IR (-O2):
define void @taskSleep(i64 %0) {
%2 = tail call i32 (...) @kernelLock()
%3 = tail call i32 @taskSetTimeout(i32 4, i64 %0)
%4 = tail call i32 (...) @kernelUnlock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ command_decode(char *, char *);
void privmsg_decode(char *username, char *msg) {
  if (msg[0] == '!') {
    command_decode(username, msg + 1);
  }
}


x86 assembly (clang, -O0):
<privmsg_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
jne    1141 <privmsg_decode+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <command_decode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<privmsg_decode>:
cmpb   $0x21,(%rsi)
jne    111e <privmsg_decode+0xe>
add    $0x1,%rsi
jmp    1030 <command_decode@plt>
ret

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

LLVM IR (-O2):
define void @privmsg_decode(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = tail call i32 @command_decode(i8* %0, i8* %6)
br label %8
8: ; preds = %5, %2
ret void
}
int stricmp(a, b)
char *a, *b;
{ return strcasecmp(a, b); }


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

x86 assembly (clang, -O2):
<stricmp>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @stricmp(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 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @stricmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dir_iterator(char const *, int /*<<< orphan*/,
                                void (*)(char const *, void *), void *);
void foreach_file(const char *path,
                  void (*f)(const char *the_filename, void *the_userdata),
                  void *userdata) {
  dir_iterator(path, 0, f, userdata);
}


x86 assembly (clang, -O0):
<foreach_file>:
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),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <dir_iterator@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foreach_file>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <dir_iterator@plt>

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

LLVM IR (-O2):
define void @foreach_file(i8* %0, void (i8*, i8*)* %1, i8* %2) {
%4 = tail call i32 @dir_iterator(i8* %0, i32 0, void (i8*, i8*)* %1, i8* %2)
ret void
}
int getLenghtOfFloat(float var) {
  if (var >= 10)
    return 5;
  else
    return 4;
}


x86 assembly (clang, -O0):
<getLenghtOfFloat>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     112b <getLenghtOfFloat+0x2b>
movl   $0x5,-0x4(%rbp)
jmp    1132 <getLenghtOfFloat+0x32>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLenghtOfFloat>:
ucomiss 0xef9(%rip),%xmm0
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @getLenghtOfFloat(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 1.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 5, i32* %2
br label %8
7: ; preds = %1
store i32 4, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @getLenghtOfFloat(float %0) {
%2 = fcmp ult float %0, 1.000000e+01
%3 = select i1 %2, i32 4, i32 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void outputControllSymbol(void) { printf("6 digit int: %.2f\n", 0.123456789); }


x86 assembly (clang, -O0):
<outputControllSymbol>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputControllSymbol>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"6 digit int: %.2f\0A\00"
define void @outputControllSymbol() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 0x3FBF9ADD3739635F)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"6 digit int: %.2f\0A\00"
define void @outputControllSymbol() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 0x3FBF9ADD3739635F)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ rol8addr(int /*<<< orphan*/);
void rolAbsx8(void) { rol8addr(absolutex()); }


x86 assembly (clang, -O0):
<rolAbsx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutex@plt>
mov    %eax,%edi
call   1040 <rol8addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolAbsx8>:
push   %rax
xor    %eax,%eax
call   1030 <absolutex@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <rol8addr@plt>

LLVM IR (-O0):
define void @rolAbsx8() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @rol8addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rolAbsx8() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @rol8addr(i32 %1)
ret void
}
unsigned int DMTimerReloadGet(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x40)))));
}


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

x86 assembly (clang, -O2):
<DMTimerReloadGet>:
add    $0x40,%edi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @DMTimerReloadGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 64
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @DMTimerReloadGet(i32 %0) {
%2 = add i32 %0, 64
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
void gluPerspective(float a, float b, float c, float d) {}


x86 assembly (clang, -O0):
<gluPerspective>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gluPerspective(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
ret void
}

LLVM IR (-O2):
define void @gluPerspective(float %0, float %1, float %2, float %3) {
ret void
}
/* Variables and functions */
double M_PI;
double degToRad(double angleDeg) { return (M_PI * angleDeg / 180.0); }


x86 assembly (clang, -O0):
<degToRad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degToRad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @degToRad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @degToRad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Variables and functions */
int unlink(char const *);
int mq_unlink(const char *pathname) {
  if (unlink(pathname) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<mq_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    113a <mq_unlink+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <mq_unlink+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_unlink>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mq_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *__softboundcets_safe_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<__softboundcets_safe_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__softboundcets_safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void ktsan_free_page(struct page *page, unsigned int order) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @ktsan_free_page(%struct.page* nocapture %0, i32 %1) {
ret void
}