xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SEGGER_SYSVIEW_X_SysView_Lock();
int /*<<< orphan*/ SEGGER_SYSVIEW_X_SysView_Unlock();
int /*<<< orphan*/ _SendPacket(unsigned char *, unsigned char *, unsigned int);
int SEGGER_SYSVIEW_SendPacket(unsigned char *pPacket,
                              unsigned char *pPayloadEnd,
                              unsigned int EventId) {
  SEGGER_SYSVIEW_X_SysView_Lock();
  _SendPacket(pPacket + 4, pPayloadEnd, EventId);
  SEGGER_SYSVIEW_X_SysView_Unlock();
  return 0;
}


x86 assembly (clang, -O0):
<SEGGER_SYSVIEW_SendPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <SEGGER_SYSVIEW_X_SysView_Lock@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <_SendPacket@plt>
mov    $0x0,%al
call   1050 <SEGGER_SYSVIEW_X_SysView_Unlock@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_SYSVIEW_SendPacket>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <SEGGER_SYSVIEW_X_SysView_Lock@plt>
add    $0x4,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <_SendPacket@plt>
xor    %eax,%eax
call   1050 <SEGGER_SYSVIEW_X_SysView_Unlock@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SEGGER_SYSVIEW_SendPacket(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (...) @SEGGER_SYSVIEW_X_SysView_Lock()
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @_SendPacket(i8* %9, i8* %10, i32 %11)
%13 = call i32 (...) @SEGGER_SYSVIEW_X_SysView_Unlock()
ret i32 0
}

LLVM IR (-O2):
define i32 @SEGGER_SYSVIEW_SendPacket(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (...) @SEGGER_SYSVIEW_X_SysView_Lock()
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = tail call i32 @_SendPacket(i8* %5, i8* %1, i32 %2)
%7 = tail call i32 (...) @SEGGER_SYSVIEW_X_SysView_Unlock()
ret i32 0
}
/* Variables and functions */
bool has_avail(int *unavail, int n) {
  for (int i = 0; i < n; i++) {
    if (unavail[i] == 0)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<has_avail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <has_avail+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113c <has_avail+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <has_avail+0x56>
jmp    1141 <has_avail+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <has_avail+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_avail>:
test   %esi,%esi
jle    112b <has_avail+0x2b>
cmpl   $0x0,(%rdi)
je     112e <has_avail+0x2e>
mov    %esi,%ecx
mov    $0x1,%eax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1122 <has_avail+0x22>
lea    0x1(%rdx),%rax
cmpl   $0x0,(%rdi,%rdx,4)
jne    1110 <has_avail+0x10>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @has_avail(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
%7 = load i32, i32* %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %4, %12
%10 = phi i64 [ %16, %12 ], [ 1, %4 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %9
17: ; preds = %9, %12
%18 = icmp ult i64 %10, %5
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %17, %4, %2
%21 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %19, %17 ]
ret i32 %21
}
/* Variables and functions */
int rand();
int genrand(int a) {
  int r = rand();
  return r % a;
}


x86 assembly (clang, -O0):
<genrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @genrand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @genrand(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int __syscall4(int, unsigned long, unsigned long, unsigned long, unsigned long);
int _syscall4(int nr, unsigned long a, unsigned long b, unsigned long c,
              unsigned long d) {
  return __syscall4(nr, a, b, c, d);
}


x86 assembly (clang, -O0):
<_syscall4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <__syscall4@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall4>:
jmp    1030 <__syscall4@plt>

LLVM IR (-O0):
define i32 @_syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i32, i32* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @__syscall4(i32 %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @_syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @__syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test1(int);
int /*<<< orphan*/ test2(int);
void testTortureExecute(void) {
  test1(0x4000U);
  test2(0x4000U);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4000,%edi
call   1030 <test1@plt>
mov    $0x4000,%edi
call   1040 <test2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
push   %rax
mov    $0x4000,%edi
call   1030 <test1@plt>
mov    $0x4000,%edi
pop    %rax
jmp    1040 <test2@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @test1(i32 16384)
%2 = call i32 @test2(i32 16384)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @test1(i32 16384)
%2 = tail call i32 @test2(i32 16384)
ret void
}
void logging_free() {}


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

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

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

LLVM IR (-O2):
define void @logging_free() {
ret void
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
int pool_append_strn(struct pool *, int, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int pool_append_str(struct pool *p, int h, const char *str) {
  return pool_append_strn(p, h, str, str ? strlen(str) : 0);
}


x86 assembly (clang, -O0):
<pool_append_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1165 <pool_append_str+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x34(%rbp)
jmp    116f <pool_append_str+0x4f>
xor    %eax,%eax
mov    %eax,-0x34(%rbp)
jmp    116f <pool_append_str+0x4f>
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%esi
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%ecx
call   1040 <pool_append_strn@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_append_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
test   %rdx,%rdx
je     113e <pool_append_str+0x1e>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
jmp    1140 <pool_append_str+0x20>
xor    %ecx,%ecx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <pool_append_strn@plt>

LLVM IR (-O0):
%struct.pool = type { i32 }
define i32 @pool_append_str(%struct.pool* %0, i32 %1, i8* %2) {
%4 = alloca %struct.pool*
%5 = alloca i32
%6 = alloca i8*
store %struct.pool* %0, %struct.pool** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.pool*, %struct.pool** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = call i32 @strlen(i8* %13)
br label %16
15: ; preds = %3
br label %16
16: ; preds = %15, %12
%17 = phi i32 [ %14, %12 ], [ 0, %15 ]
%18 = call i32 @pool_append_strn(%struct.pool* %7, i32 %8, i8* %9, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i32 @pool_append_str(%struct.pool* %0, i32 %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
%9 = tail call i32 @pool_append_strn(%struct.pool* %0, i32 %1, i8* %2, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr1Operand(int, int, int, int);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ GenStartCommentLine();
int /*<<< orphan*/ printf2(char *);
void GenJumpIfNotZero(int label) {
  GenStartCommentLine();
  printf2("JumpIfNotZero\n");
  GenPrintInstr2Operands(0x0F, 0, 0x03, 0, 0x03, 0);
  GenPrintInstr1Operand(0x1D, 9, 0x0F, label);
}


x86 assembly (clang, -O0):
<GenJumpIfNotZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GenStartCommentLine@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf2@plt>
mov    $0xf,%edi
xor    %r9d,%r9d
mov    $0x3,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
call   1050 <GenPrintInstr2Operands@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1d,%edi
mov    $0x9,%esi
mov    $0xf,%edx
call   1060 <GenPrintInstr1Operand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpIfNotZero>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GenStartCommentLine@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf2@plt>
mov    $0xf,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
call   1050 <GenPrintInstr2Operands@plt>
mov    $0x1d,%edi
mov    $0x9,%esi
mov    $0xf,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1060 <GenPrintInstr1Operand@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"JumpIfNotZero\0A\00"
define void @GenJumpIfNotZero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @GenStartCommentLine()
%4 = call i32 @printf2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @GenPrintInstr2Operands(i32 15, i32 0, i32 3, i32 0, i32 3, i32 0)
%6 = load i32, i32* %2
%7 = call i32 @GenPrintInstr1Operand(i32 29, i32 9, i32 15, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"JumpIfNotZero\0A\00"
define void @GenJumpIfNotZero(i32 %0) {
%2 = tail call i32 (...) @GenStartCommentLine()
%3 = tail call i32 @printf2(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @GenPrintInstr2Operands(i32 15, i32 0, i32 3, i32 0, i32 3, i32 0)
%5 = tail call i32 @GenPrintInstr1Operand(i32 29, i32 9, i32 15, i32 %0)
ret void
}
const char *f_dollar() { return "$"; }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"$\00"
define i8* @f_dollar() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"$\00"
define i8* @f_dollar() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ version();
void print_usage(void) {
  version();
  printf("\n");
  printf("Usage: ocesql [--inc=include_dir] SOURCE [DESTFILE] [LOGFILE]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <version@plt>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
xor    %eax,%eax
call   1050 <version@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [63 x i8] c"Usage: ocesql [--inc=include_dir] SOURCE [DESTFILE] [LOGFILE]\0A\00"
define void @print_usage() {
%1 = call i32 (...) @version()
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [62 x i8] c"Usage: ocesql [--inc=include_dir] SOURCE [DESTFILE] [LOGFILE]\00"
define void @print_usage() {
%1 = tail call i32 (...) @version()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
void wifi_rsp_config_set_mac(const struct wifi_msg_config_set_mac_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_config_set_mac_rsp_t = type opaque
define void @wifi_rsp_config_set_mac(%struct.wifi_msg_config_set_mac_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int __divdi3(int, int);
int64_t __gnu_ldivmod_helper(int64_t a, int64_t b, int64_t *remainder) {
  int64_t quotient;
  quotient = __divdi3(a, b);
  *remainder = a - b * quotient;
  return quotient;
}


x86 assembly (clang, -O0):
<__gnu_ldivmod_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__divdi3@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
imul   -0x14(%rbp),%eax
sub    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gnu_ldivmod_helper>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <__divdi3@plt>
imul   %eax,%ebp
sub    %ebp,%ebx
mov    %ebx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__gnu_ldivmod_helper(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
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @__divdi3(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %11, %14
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @__gnu_ldivmod_helper(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @__divdi3(i32 %0, i32 %1)
%5 = mul nsw i32 %4, %1
%6 = sub nsw i32 %0, %5
store i32 %6, i32* %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_n(void **ptr) {
  free(*ptr);
  *ptr = NULL;
}


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

x86 assembly (clang, -O2):
<free_n>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_n(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
long long silk_max_64(long long a, long long b) {
  return (((a) > (b)) ? (a) : (b));
}


x86 assembly (clang, -O0):
<silk_max_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <silk_max_64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <silk_max_64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_max_64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @silk_max_64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @silk_max_64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void umem_err_recoverable(void) {}


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

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

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

LLVM IR (-O2):
define void @umem_err_recoverable() {
ret void
}
void caller_2_1_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_1_2_2_1() {
ret void
}
/* Variables and functions */
double genrand();
double rand0to1() {
  double x;
  x = genrand();
  return x;
}


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

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

LLVM IR (-O0):
define double @rand0to1() {
%1 = alloca double
%2 = call double (...) @genrand()
store double %2, double* %1
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @rand0to1() {
%1 = tail call double (...) @genrand()
ret double %1
}
void __DELETE_java_util_WeakHashMap(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_WeakHashMap(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void err(int retv, const char *str) {
  (void)fprintf(stderr, "%s\n", str);
  exit(retv);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @err(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ModelicaFormatError(char *, char const *);
void ModelicaNotExistError(const char *name) {
  ModelicaFormatError(
      "C-Function \"%s\" is called\n"
      "but is not implemented for the actual environment\n"
      "(e.g., because there is no file system available on the machine\n"
      "as for dSPACE or xPC systems)",
      name);
}


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

x86 assembly (clang, -O2):
<ModelicaNotExistError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <ModelicaFormatError@plt>

LLVM IR (-O0):
@.str = [170 x i8] c"C-Function \22%s\22 is called\0Abut is not implemented for the actual environment\0A(e.g., because there is no file system available on the machine\0Aas for dSPACE or xPC systems)\00"
define void @ModelicaNotExistError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ModelicaFormatError(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c"C-Function \22%s\22 is called\0Abut is not implemented for the actual environment\0A(e.g., because there is no file system available on the machine\0Aas for dSPACE or xPC systems)\00"
define void @ModelicaNotExistError(i8* %0) {
%2 = tail call i32 @ModelicaFormatError(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __link_error();
scalar_t__ malloc(int);
int *__attribute__((no, noclone)) foo(int *p) {
  int *q = (int *)malloc(sizeof(int));
  *p = 1;
  *q = 2;
  if (*p != 1)
    __link_error();
  *p = 3;
  return q;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
je     1162 <foo+0x42>
mov    $0x0,%al
call   1040 <__link_error@plt>
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%r14
movl   $0x1,(%rbx)
movl   $0x2,(%rax)
cmpl   $0x1,(%rbx)
je     114c <foo+0x2c>
xor    %eax,%eax
call   1040 <__link_error@plt>
movl   $0x3,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @foo(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %2
store i32 1, i32* %6
%7 = load i32*, i32** %3
store i32 2, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @__link_error()
br label %13
13: ; preds = %11, %1
%14 = load i32*, i32** %2
store i32 3, i32* %14
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
define i32* @foo(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 1, i32* %0
store i32 2, i32* %3
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @__link_error()
br label %8
8: ; preds = %6, %1
store i32 3, i32* %0
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f();
int main() {
  int i;
  for (i = 0; i < 1000; i++)
    f();
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1158 <main+0x38>
mov    $0x0,%al
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <f@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @f()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printUsage() {
  fprintf(stderr,
          "Usage: sgen4 -n num-of-variables [-sat | -unsat] [-s random-seed] "
          "[-m satisfying-model-file] [-min-variables] [-[no]reorder]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [126 x i8] c"Usage: sgen4 -n num-of-variables [-sat | -unsat] [-s random-seed] [-m satisfying-model-file] [-min-variables] [-[no]reorder]\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [126 x i8] c"Usage: sgen4 -n num-of-variables [-sat | -unsat] [-s random-seed] [-m satisfying-model-file] [-min-variables] [-[no]reorder]\0A\00"
define void @printUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ recv_byte();
int /*<<< orphan*/ send_byte(int);
void cpu_resume(void) {
  send_byte(0x4C);
  recv_byte();
}


x86 assembly (clang, -O0):
<cpu_resume>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c,%edi
call   1040 <send_byte@plt>
mov    $0x0,%al
call   1030 <recv_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_resume>:
push   %rax
mov    $0x4c,%edi
call   1040 <send_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <recv_byte@plt>

LLVM IR (-O0):
define void @cpu_resume() {
%1 = call i32 @send_byte(i32 76)
%2 = call i32 (...) @recv_byte()
ret void
}

LLVM IR (-O2):
define void @cpu_resume() {
%1 = tail call i32 @send_byte(i32 76)
%2 = tail call i32 (...) @recv_byte()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(uint8_t *name) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ AcpiShowRsdp();
int /*<<< orphan*/ AcpiShowTables();
int /*<<< orphan*/ uioPrintChar(char);
void AcpiShowHeaders(void) {
  AcpiShowRsdp();
  uioPrintChar('\n');
  AcpiShowTables();
}


x86 assembly (clang, -O0):
<AcpiShowHeaders>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AcpiShowRsdp@plt>
mov    $0xa,%edi
call   1040 <uioPrintChar@plt>
mov    $0x0,%al
call   1050 <AcpiShowTables@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AcpiShowHeaders>:
push   %rax
xor    %eax,%eax
call   1030 <AcpiShowRsdp@plt>
mov    $0xa,%edi
call   1040 <uioPrintChar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <AcpiShowTables@plt>

LLVM IR (-O0):
define void @AcpiShowHeaders() {
%1 = call i32 (...) @AcpiShowRsdp()
%2 = call i32 @uioPrintChar(i8 signext 10)
%3 = call i32 (...) @AcpiShowTables()
ret void
}

LLVM IR (-O2):
define void @AcpiShowHeaders() {
%1 = tail call i32 (...) @AcpiShowRsdp()
%2 = tail call i32 @uioPrintChar(i8 signext 10)
%3 = tail call i32 (...) @AcpiShowTables()
ret void
}
void *work(void *arg) { printf("thread:%s\n", arg); }


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

x86 assembly (clang, -O2):
<work>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"thread:%s\0A\00"
define i8* @work(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"thread:%s\0A\00"
define noalias i8* @work(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ HplAdc12P__HplAdc12__startConversion();
void Msp430Adc12ImplP__HplAdc12__startConversion(void) {
  HplAdc12P__HplAdc12__startConversion();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__HplAdc12__startConversion() {
%1 = tail call i32 (...) @HplAdc12P__HplAdc12__startConversion()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ osThreadYield();
void Thread(void const *argument) {
  while (1) {
    ;
    osThreadYield();
  }
}


x86 assembly (clang, -O0):
<Thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <osThreadYield@plt>
jmp    111c <Thread+0xc>

x86 assembly (clang, -O2):
<Thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <osThreadYield@plt>
jmp    1120 <Thread+0x10>

LLVM IR (-O0):
define void @Thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @osThreadYield()
br label %3
}

LLVM IR (-O2):
define void @Thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @osThreadYield()
br label %2
}
int turkeyArgsCount(int argc, char **argv, int index) {
  int i = index;
  int count = 0;
  while (i < argc) {
    count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<turkeyArgsCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113e <turkeyArgsCount+0x3e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111b <turkeyArgsCount+0x1b>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turkeyArgsCount>:
xor    %eax,%eax
sub    %edx,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @turkeyArgsCount(i32 %0, i8** nocapture readnone %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = sub i32 %0, %2
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
void abort(void) {
  for (;;)
    ;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_expander_get_use_underline() {
ret void
}
/* Type definitions */
struct token {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct token *);
int /*<<< orphan*/ free(struct token *);
void destroy_token(struct token *token) {
  assert(token);
  free(token);
}


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

x86 assembly (clang, -O2):
<destroy_token>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.token = type { i32 }
define void @destroy_token(%struct.token* %0) {
%2 = alloca %struct.token*
store %struct.token* %0, %struct.token** %2
%3 = load %struct.token*, %struct.token** %2
%4 = call i32 @assert(%struct.token* %3)
%5 = load %struct.token*, %struct.token** %2
%6 = call i32 @free(%struct.token* %5)
ret void
}

LLVM IR (-O2):
%struct.token = type { i32 }
define void @destroy_token(%struct.token* %0) {
%2 = tail call i32 @assert(%struct.token* %0)
%3 = tail call i32 @free(%struct.token* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program_name) {
  printf("USAGE: %s <test-c-source-file> <c-mock-header-file>\n", program_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"USAGE: %s <test-c-source-file> <c-mock-header-file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"USAGE: %s <test-c-source-file> <c-mock-header-file>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int main(void) {
  alarm(5);
  while (1)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <alarm@plt>
jmp    1129 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <alarm@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 5)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @alarm(i32 5)
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exact_square(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  exact_square(n);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
ret i32 0
}
void foo409() {}


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

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

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

LLVM IR (-O2):
define void @foo409() {
ret void
}
void cbr_swap(int *x, int *y) {
  int tmp = 0;
  tmp = *x;
  *x = *y;
  *y = tmp;
  return;
}


x86 assembly (clang, -O0):
<cbr_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cbr_swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @cbr_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
float pow(float, float);
float pow_r(float lhs, float rhs) { return pow(lhs, rhs); }


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

x86 assembly (clang, -O2):
<pow_r>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @pow_r(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @pow(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @pow_r(float %0, float %1) {
%3 = tail call float @pow(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
scalar_t__ BN_cmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
unsigned char *simpleUnpack(unsigned char *, int /*<<< orphan*/ *);
unsigned char *unpackAndCompare(unsigned char *buffer_in, BIGNUM *bn_old,
                                BIGNUM *bn_new) {
  unsigned char *ptr = simpleUnpack(buffer_in, bn_new);
  if (BN_cmp(bn_old, bn_new) != 0) {
    printf("unpackAndCompare: Failed\n");
    ptr = NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<unpackAndCompare>:
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    -0x18(%rbp),%rsi
call   1030 <simpleUnpack@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <BN_cmp@plt>
cmp    $0x0,%rax
je     1180 <unpackAndCompare+0x50>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackAndCompare>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdx,%rsi
call   1040 <simpleUnpack@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <BN_cmp@plt>
test   %rax,%rax
je     1165 <unpackAndCompare+0x35>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@str = [25 x i8] c"unpackAndCompare: Failed\00"
define i8* @unpackAndCompare(i8* %0, i32* %1, i32* %2) {
%4 = tail call i8* @simpleUnpack(i8* %0, i32* %2)
%5 = tail call i64 @BN_cmp(i32* %1, i32* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = phi i8* [ null, %7 ], [ %4, %3 ]
ret i8* %10
}
void port_fill(void *arg, int count) {}


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

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

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

LLVM IR (-O2):
define void @port_fill(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  FILE *f = freopen("/tmp/moo", "w", stdout);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <freopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <freopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/moo\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdout
%8 = call i32* @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i32 @fclose(i32* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/moo\00"
@.str.1 = [2 x i8] c"w\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32* @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @fclose(i32* %4)
ret i32 0
}