xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Com_Error(int, char *);
void CL_Disconnect_f(void) { Com_Error(1, "Disconnected from server"); }


x86 assembly (clang, -O0):
<CL_Disconnect_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <Com_Error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_Disconnect_f>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <Com_Error@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Disconnected from server\00"
define void @CL_Disconnect_f() {
%1 = call i32 @Com_Error(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Disconnected from server\00"
define void @CL_Disconnect_f() {
%1 = tail call i32 @Com_Error(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *send_data(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @send_data() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @send_data() {
ret i8* null
}
int sign_extend(int value, int bits) {
  if (((value) & (1 << (bits - 1))))
    value |= (0xffffffff << bits);
  return value;
}


x86 assembly (clang, -O0):
<sign_extend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1137 <sign_extend+0x37>
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend>:
mov    %esi,%ecx
lea    -0x1(%rcx),%eax
movzbl %al,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
xor    %eax,%eax
bt     %edx,%edi
cmovb  %esi,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_extend(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = shl nsw i32 -1, %1
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %8, %0
ret i32 %9
}
int getbit(int n, int index) { return (n & (1 << index)) ? 1 : 0; }


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @getbit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct listAssoc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DisplayListAssoc_Aux(struct listAssoc *, int /*<<< orphan*/);
void DisplayListAssoc(struct listAssoc *l) { DisplayListAssoc_Aux(l, 0); }


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

x86 assembly (clang, -O2):
<DisplayListAssoc>:
xor    %esi,%esi
jmp    1030 <DisplayListAssoc_Aux@plt>

LLVM IR (-O0):
%struct.listAssoc = type { i32 }
define void @DisplayListAssoc(%struct.listAssoc* %0) {
%2 = alloca %struct.listAssoc*
store %struct.listAssoc* %0, %struct.listAssoc** %2
%3 = load %struct.listAssoc*, %struct.listAssoc** %2
%4 = call i32 @DisplayListAssoc_Aux(%struct.listAssoc* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.listAssoc = type { i32 }
define void @DisplayListAssoc(%struct.listAssoc* %0) {
%2 = tail call i32 @DisplayListAssoc_Aux(%struct.listAssoc* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0;
  int *p = &a;
  int i;
  for (i = 0; i < 10; i++) {
  }
  assert(i <= 10);
  *p = 10;
  assert(a == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <main+0x25>
cmpl   $0xa,-0x14(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0xa,(%rax)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int test_010(int a, int c, int b, int d) { return a + (b & 1) + b; }


x86 assembly (clang, -O0):
<test_010>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_010>:
mov    %edx,%eax
and    $0x1,%eax
add    %edi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_010(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = and i32 %10, 1
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_010(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 1
%6 = add i32 %2, %0
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int setnonblocking(int fd) {
  if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFD, 0) | O_NONBLOCK) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<setnonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    116b <setnonblocking+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <setnonblocking+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFD = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @F_SETFL
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFD
%8 = call i32 @fcntl(i32 %6, i32 %7, i32 0)
%9 = load i32, i32* @O_NONBLOCK
%10 = or i32 %8, %9
%11 = call i32 @fcntl(i32 %4, i32 %5, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFD = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFD
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %6)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_dobldobl_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(254, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xfe,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_container_to_start_system>:
mov    $0xfe,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 254, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 254, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __u16;

/* Variables and functions */
int /*<<< orphan*/ output_char(int /*<<< orphan*/);
void put_loyakey(__u16 leftOyaKeyCode) { output_char(leftOyaKeyCode); }


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

x86 assembly (clang, -O2):
<put_loyakey>:
jmp    1030 <output_char@plt>

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

LLVM IR (-O2):
define void @put_loyakey(i32 %0) {
%2 = tail call i32 @output_char(i32 %0)
ret void
}
int _divide_round_up(const int n, const int d) { return (n + (d - 1)) / d; }


x86 assembly (clang, -O0):
<_divide_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_divide_round_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @_divide_round_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
void rk29_sdmmc_set_iomux(int device_id, unsigned int bus_width) {
  switch (device_id) {
  case 0:
    break;
  case 1:
    break;
  case 2:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<rk29_sdmmc_set_iomux>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113f <rk29_sdmmc_set_iomux+0x3f>
jmp    111d <rk29_sdmmc_set_iomux+0x1d>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1144 <rk29_sdmmc_set_iomux+0x44>
jmp    112e <rk29_sdmmc_set_iomux+0x2e>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1149 <rk29_sdmmc_set_iomux+0x49>
jmp    114e <rk29_sdmmc_set_iomux+0x4e>
jmp    1153 <rk29_sdmmc_set_iomux+0x53>
jmp    1153 <rk29_sdmmc_set_iomux+0x53>
jmp    1153 <rk29_sdmmc_set_iomux+0x53>
jmp    1153 <rk29_sdmmc_set_iomux+0x53>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rk29_sdmmc_set_iomux(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %9 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
]
6: ; preds = %2
br label %10
7: ; preds = %2
br label %10
8: ; preds = %2
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %8, %7, %6
ret void
}

LLVM IR (-O2):
define void @rk29_sdmmc_set_iomux(i32 %0, i32 %1) {
ret void
}
void aide(void) {}


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

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

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

LLVM IR (-O2):
define void @aide() {
ret void
}
void r_uart1_callback_receiveend(void) {}


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

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

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

LLVM IR (-O2):
define void @r_uart1_callback_receiveend() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int rand_uninitialize() {
  srand((unsigned int)time(NULL));
  return 0;
}


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

x86 assembly (clang, -O2):
<rand_uninitialize>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_uninitialize() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @rand_uninitialize() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret i32 0
}
char *hl() {
  return "---------------------------------------------------------------------"
         "-----------";
}


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

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

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

LLVM IR (-O2):
@.str = [81 x i8] c"--------------------------------------------------------------------------------\00"
define i8* @hl() {
ret i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ magic();
int /*<<< orphan*/ maxdes();
int /*<<< orphan*/ meswp();
int /*<<< orphan*/ openfile(char *);
void leader() {
  init();
  openfile((char *)0);
  magic();
  meswp();
  maxdes();
}


x86 assembly (clang, -O0):
<leader>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <init@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <openfile@plt>
mov    $0x0,%al
call   1040 <magic@plt>
mov    $0x0,%al
call   1070 <meswp@plt>
mov    $0x0,%al
call   1050 <maxdes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<leader>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
xor    %edi,%edi
call   1030 <openfile@plt>
xor    %eax,%eax
call   1040 <magic@plt>
xor    %eax,%eax
call   1070 <meswp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <maxdes@plt>

LLVM IR (-O0):
define void @leader() {
%1 = call i32 (...) @init()
%2 = call i32 @openfile(i8* null)
%3 = call i32 (...) @magic()
%4 = call i32 (...) @meswp()
%5 = call i32 (...) @maxdes()
ret void
}

LLVM IR (-O2):
define void @leader() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @openfile(i8* null)
%3 = tail call i32 (...) @magic()
%4 = tail call i32 (...) @meswp()
%5 = tail call i32 (...) @maxdes()
ret void
}
void map_post_func_1(void *data) {}


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

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

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

LLVM IR (-O2):
define void @map_post_func_1(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR90_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMR90_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_index_event(int, char const *);
void mintaka_index_event_(int *event, const char *description) {
  mintaka_index_event(*event, description);
}


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

x86 assembly (clang, -O2):
<mintaka_index_event_>:
mov    (%rdi),%edi
jmp    1030 <mintaka_index_event@plt>

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

LLVM IR (-O2):
define void @mintaka_index_event_(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @mintaka_index_event(i32 %3, i8* %1)
ret void
}
int is_prime(int n) {
  int j;
  for (j = 2; (j * j) < n; ++j) {
    if ((n % j) == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114d <is_prime+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113a <is_prime+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <is_prime+0x54>
jmp    113f <is_prime+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x5,%edi
jl     1125 <is_prime+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <is_prime+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jl     1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %6, label %11
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
int str_cmp(const char *s1, const char *s2) {
  for (; *s1 && *s1 == *s2; s1++, s2++)
    ;
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<str_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <str_cmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <str_cmp+0x47>
jmp    1169 <str_cmp+0x69>
jmp    114c <str_cmp+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <str_cmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <str_cmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <str_cmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <str_cmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @str_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t offset2val(uint64_t a) {
  a = (a ^ 61) ^ (a >> 16);
  a = a + (a << 3);
  a = a ^ (a >> 4);
  a = a * 0x27d4eb2d;
  a = a ^ (a >> 15);
  return a % 256;
}


x86 assembly (clang, -O0):
<offset2val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
imul   $0x27d4eb2d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset2val>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @offset2val(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 61
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = xor i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 3
%11 = add nsw i32 %8, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = xor i32 %12, %14
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, 668265261
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 15
%21 = xor i32 %18, %20
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = srem i32 %22, 256
ret i32 %23
}

LLVM IR (-O2):
define i32 @offset2val(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul i32 %4, 9
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 668265261
%9 = ashr i32 %8, 15
%10 = xor i32 %9, %8
%11 = srem i32 %10, 256
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void putshort(FILE *outf, unsigned short val) {
  unsigned char buf[2];
  buf[0] = (val >> 8);
  buf[1] = (val >> 0);
  fwrite(buf, 2, 1, outf);
}


x86 assembly (clang, -O0):
<putshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
mov    %al,-0xb(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putshort>:
push   %rax
mov    %rdi,%rcx
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putshort(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
%5 = alloca [2 x i8]
store i32* %0, i32** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 0
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %14, i8* %15
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%17 = load i32*, i32** %3
%18 = call i32 @fwrite(i8* %16, i32 2, i32 1, i32* %17)
ret void
}

LLVM IR (-O2):
define void @putshort(i32* nocapture %0, i16 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 2, i32 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned func_5(int p_6) {
  step_hash(408);
  return p_6;
}


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

x86 assembly (clang, -O2):
<func_5>:
push   %rbx
mov    %edi,%ebx
mov    $0x198,%edi
call   1030 <step_hash@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @func_5(i32 returned %0) {
%2 = tail call i32 @step_hash(i32 408)
ret i32 %0
}
const char *pathconN_nm4_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm4_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <pathconN_nm4_name_in+0x27>
jmp    1117 <pathconN_nm4_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <pathconN_nm4_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm4_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm4_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm4_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
float calc_current_success_rate(used_blocks_before_gc, used_blocks_after_gc)
unsigned int used_blocks_before_gc;
unsigned int used_blocks_after_gc;
{
  if (0 == used_blocks_before_gc) {
    return (0);
  } else {
    return ((float)(1 - (((float)used_blocks_after_gc) /
                         ((float)used_blocks_before_gc))));
  }
}


x86 assembly (clang, -O0):
<calc_current_success_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1122 <calc_current_success_rate+0x22>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1147 <calc_current_success_rate+0x47>
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm1
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm0,%xmm1
movss  0xec2(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_current_success_rate>:
test   %edi,%edi
je     1123 <calc_current_success_rate+0x23>
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
divss  %xmm0,%xmm1
movss  0xee2(%rip),%xmm0
subss  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @calc_current_success_rate(i32 %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 0, %6
br i1 %7, label %8, label %9
8: ; preds = %2
store float 0.000000e+00, float* %3
br label %16
9: ; preds = %2
%10 = load i32, i32* %5
%11 = uitofp i32 %10 to float
%12 = load i32, i32* %4
%13 = uitofp i32 %12 to float
%14 = fdiv float %11, %13
%15 = fsub float 1.000000e+00, %14
store float %15, float* %3
br label %16
16: ; preds = %9, %8
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @calc_current_success_rate(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = uitofp i32 %1 to float
%6 = uitofp i32 %0 to float
%7 = fdiv float %5, %6
%8 = fsub float 1.000000e+00, %7
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ 0.000000e+00, %2 ]
ret float %10
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t w8nat(uint64_t const x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @w8nat(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main(int argc, char *argv[]) {
  printf("Call test1\n");
  test1();
  printf("----------\nCall test2\n");
  test2();
  printf("----------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test1@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test2@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test1@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test2@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Call test1\0A\00"
@.str.1 = [23 x i8] c"----------\0ACall test2\0A\00"
@.str.2 = [12 x i8] c"----------\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test1()
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @test2()
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Call test1\00"
@str.3 = [22 x i8] c"----------\0ACall test2\00"
@str.4 = [11 x i8] c"----------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test1()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 (...) @test2()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int add(int a, int b, int c, int d) { return a + b + c + d; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @add(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
void foo744() {}


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

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

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

LLVM IR (-O2):
define void @foo744() {
ret void
}
int main() { return 123; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x7b,%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ Fatal_Error(char *);
int getc(int /*<<< orphan*/ *);
int Read_Char(FILE *stream) {
  int c;
  c = getc(stream);
  if (c == EOF)
    Fatal_Error("Bad format file: Unexpected EOF.");
  return c;
}


x86 assembly (clang, -O0):
<Read_Char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jne    1156 <Read_Char+0x36>
lea    0xeaf(%rip),%rdi
call   1030 <Fatal_Error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_Char>:
push   %rbx
call   1040 <getc@plt>
mov    %eax,%ebx
mov    0x2eb9(%rip),%rax
cmp    (%rax),%ebx
jne    113f <Read_Char+0x1f>
lea    0xec6(%rip),%rdi
call   1030 <Fatal_Error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [33 x i8] c"Bad format file: Unexpected EOF.\00"
define i32 @Read_Char(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @Fatal_Error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [33 x i8] c"Bad format file: Unexpected EOF.\00"
define i32 @Read_Char(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @Fatal_Error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void fexec(char *buf) { system(buf); }


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

x86 assembly (clang, -O2):
<fexec>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define void @fexec(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret void
}
/* Variables and functions */
int npw();
bool nextPassword() { return npw(); }


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

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

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

LLVM IR (-O2):
define i32 @nextPassword() {
%1 = tail call i32 (...) @npw()
ret i32 %1
}
int main() {
  static const char HELLO[] = "hello";
  char *pc;
  float *px;
  float x;
  x = 6.5;
  px = &x;
  pc = (char *)px;
  printf("\nThis is int x: %f", x);
  printf("\nThis is pointer px that points to address int x: %f", px);
  printf("\nThis uses a type cast to set px to a char. pc: %s", pc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x40d00000,0xc(%rsp)
40
lea    0xee4(%rip),%rdi
movsd  0xed4(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@main.HELLO = internal constant [6 x i8] c"hello\00"
@.str = [19 x i8] c"\0AThis is int x: %f\00"
@.str.1 = [53 x i8] c"\0AThis is pointer px that points to address int x: %f\00"
@.str.2 = [51 x i8] c"\0AThis uses a type cast to set px to a char. pc: %s\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca float*
%3 = alloca float
store float 6.500000e+00, float* %3
store float* %3, float** %2
%4 = load float*, float** %2
%5 = bitcast float* %4 to i8*
store i8* %5, i8** %1
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load float*, float** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), float* %9)
%11 = load i8*, i8** %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AThis is int x: %f\00"
@.str.1 = [53 x i8] c"\0AThis is pointer px that points to address int x: %f\00"
@.str.2 = [51 x i8] c"\0AThis uses a type cast to set px to a char. pc: %s\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 6.500000e+00, float* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 6.500000e+00)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0), float* %1)
ret i32 0
}
void SCH_Report_Status(void) {}


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

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

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

LLVM IR (-O2):
define void @SCH_Report_Status() {
ret void
}
void gdk_atom_intern() {}


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

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

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

LLVM IR (-O2):
define void @gdk_atom_intern() {
ret void
}
int c093(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c093() {
ret i32 0
}
void ble_rsp_hardware_set_rxgain(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_hardware_set_rxgain(i8* nocapture %0) {
ret void
}
unsigned int __ecm_ceil_log2(unsigned long n) {
  unsigned int k = 0;
  do {
  } while (0);
  n--;
  while (n) {
    k++;
    n >>= 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<__ecm_ceil_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    1114 <__ecm_ceil_log2+0x14>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <__ecm_ceil_log2+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <__ecm_ceil_log2+0x20>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ecm_ceil_log2>:
xor    %eax,%eax
add    $0xffffffffffffffff,%rdi
je     111f <__ecm_ceil_log2+0x1f>
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <__ecm_ceil_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @__ecm_ceil_log2(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i64 [ %8, %4 ], [ %2, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = lshr i64 %6, 1
%9 = icmp ult i64 %6, 2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("* Usage: cmd2mot [options] <filename>\n"
         "* Available options are:\n"
         "*  -out    - output file [stdout]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"* Usage: cmd2mot [options] <filename>\0A* Available options are:\0A* -out - output file [stdout]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [97 x i8] c"* Usage: cmd2mot [options] <filename>\0A* Available options are:\0A* -out - output file [stdout]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}