#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ mhook_print_unfree();
int /*<<< orphan*/ printf(char *, ...);
double prox_calc_score(int);
int test1();
int test2();
int test3();
int main() {
  printf("score(minDist=%u) = %f.\n", 1, prox_calc_score(1));
  printf("score(minDist=%u) = %f.\n", 10, prox_calc_score(10));
  printf("score(minDist=%u) = %f.\n", 100, prox_calc_score(100));
  printf("=== test1 ===\n");
  printf("res = %u.\n\n", test1());
  printf("=== test2 ===\n");
  printf("res = %u.\n\n", test2());
  printf("=== test3 ===\n");
  printf("res = %u.\n\n", test3());
  mhook_print_unfree();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <prox_calc_score@plt>
lea    0xe80(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0xa,%edi
call   1050 <prox_calc_score@plt>
lea    0xe63(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x64,%edi
call   1050 <prox_calc_score@plt>
lea    0xe46(%rip),%rdi
mov    $0x64,%esi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <test1@plt>
mov    %eax,%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1080 <test2@plt>
mov    %eax,%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    %eax,%esi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1070 <mhook_print_unfree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1060 <prox_calc_score@plt>
lea    0xe7e(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1060 <prox_calc_score@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0x64,%edi
call   1060 <prox_calc_score@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test1@plt>
lea    0xe3c(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <test2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test3@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1080 <mhook_print_unfree@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"score(minDist=%u) = %f.\0A\00"
@.str.1 = [15 x i8] c"=== test1 ===\0A\00"
@.str.2 = [12 x i8] c"res = %u.\0A\0A\00"
@.str.3 = [15 x i8] c"=== test2 ===\0A\00"
@.str.4 = [15 x i8] c"=== test3 ===\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @prox_calc_score(i32 1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1, double %2)
%4 = call double @prox_calc_score(i32 10)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 10, double %4)
%6 = call double @prox_calc_score(i32 100)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100, double %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @test1()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (...) @test2()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (...) @test3()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 (...) @mhook_print_unfree()
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"score(minDist=%u) = %f.\0A\00"
@.str.2 = [12 x i8] c"res = %u.\0A\0A\00"
@str = [14 x i8] c"=== test1 ===\00"
@str.5 = [14 x i8] c"=== test2 ===\00"
@str.6 = [14 x i8] c"=== test3 ===\00"
define i32 @main() {
%1 = tail call double @prox_calc_score(i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 1, double %1)
%3 = tail call double @prox_calc_score(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 10, double %3)
%5 = tail call double @prox_calc_score(i32 100)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100, double %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (...) @test1()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%11 = tail call i32 (...) @test2()
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
%14 = tail call i32 (...) @test3()
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = tail call i32 (...) @mhook_print_unfree()
ret i32 0
}