#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 clock();
int fib(int);
int hash_str(char *);
int /*<<< orphan*/ print_decimal(int);
int /*<<< orphan*/ print_float(double);
int /*<<< orphan*/ print_hex_n(int, int);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_ar2d_0();
int /*<<< orphan*/ test_ll_0();
int /*<<< orphan*/ test_old1(int, int);
int /*<<< orphan*/ test_struct0();
int main() {
  int i, j, k, t, dt;
  t = clock();
  puts("main: A\n");
  print_hex_n(0x12345678, 8);
  puts("\n");
  k = 0x12345678;
  for (i = 0; i < 10; i++) {
    j = k / 10;
    print_hex_n(j, 8);
    puts("(");
    print_hex_n(k % 10, 2);
    puts(") ");
    k = j;
  }
  puts("\n");
  print_decimal(0x12345678);
  puts("\n");
  i = fib(24);
  puts("main: B\n");
  print_decimal(i);
  puts("\n");
  dt = clock() - t;
  printf("V=%d Dt=%dms\n", i, dt);
  puts("main: C\n");
  printf("hashtst %d\n", hash_str("foobarbaz"));
  puts("main: D\n");
  print_float(3.14159);
  puts("\n");
  puts("main: E\n");
  test_struct0();
  puts("main: F\n");
  test_ar2d_0();
  puts("main: G\n");
  test_ll_0();
  test_old1(2, 3);
  printf("pp %f\n", 3.14159);
  puts("main: H\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <clock@plt>
mov    %eax,-0x14(%rbp)
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
mov    $0x12345678,%edi
mov    $0x8,%esi
call   10e0 <print_hex_n@plt>
lea    0xe14(%rip),%rdi
call   1030 <puts@plt>
movl   $0x12345678,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1276 <main+0xb6>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x8,%esi
call   10e0 <print_hex_n@plt>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    $0x2,%esi
call   10e0 <print_hex_n@plt>
lea    0xdb6(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120e <main+0x4e>
lea    0xd92(%rip),%rdi
call   1030 <puts@plt>
mov    $0x12345678,%edi
call   10a0 <print_decimal@plt>
lea    0xd7c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x18,%edi
call   10c0 <fib@plt>
mov    %eax,-0x8(%rbp)
lea    0xd6a(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
call   10a0 <print_decimal@plt>
lea    0xd4f(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1060 <clock@plt>
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%esi
lea    0xd3e(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd3e(%rip),%rdi
call   1030 <puts@plt>
lea    0xd47(%rip),%rdi
call   1050 <hash_str@plt>
cvtsi2sd %eax,%xmm0
lea    0xd2b(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd33(%rip),%rdi
call   1030 <puts@plt>
movsd  0xcda(%rip),%xmm0
call   10d0 <print_float@plt>
lea    0xcdd(%rip),%rdi
call   1030 <puts@plt>
lea    0xd17(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1090 <test_struct0@plt>
lea    0xd0d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1070 <test_ar2d_0@plt>
lea    0xd03(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <test_ll_0@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   10b0 <test_old1@plt>
lea    0xcea(%rip),%rdi
movsd  0xc72(%rip),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xcdb(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <clock@plt>
mov    %eax,%r14d
lea    0xe2c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x12345678,%ebx
mov    $0x12345678,%edi
mov    $0x8,%esi
call   10e0 <print_hex_n@plt>
lea    0xe13(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%r13d
lea    0xe03(%rip),%r15
lea    0xdfe(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movslq %ebx,%rbp
imul   $0x66666667,%rbp,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   10e0 <print_hex_n@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
mov    %ebp,%edi
mov    $0x2,%esi
call   10e0 <print_hex_n@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%r13d
jne    1220 <main+0x60>
lea    0xd9b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x12345678,%edi
call   10a0 <print_decimal@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x18,%edi
call   10c0 <fib@plt>
mov    %eax,%ebp
lea    0xd75(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
call   10a0 <print_decimal@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <clock@plt>
sub    %r14d,%eax
cvtsi2sd %ebp,%xmm0
lea    0xd55(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd53(%rip),%rdi
call   1030 <puts@plt>
lea    0xd5c(%rip),%rdi
call   1050 <hash_str@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xd3d(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd45(%rip),%rdi
call   1030 <puts@plt>
movsd  0xcec(%rip),%xmm0
call   10d0 <print_float@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xd2d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1090 <test_struct0@plt>
lea    0xd23(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <test_ar2d_0@plt>
lea    0xd19(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_ll_0@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   10b0 <test_old1@plt>
lea    0xd00(%rip),%rdi
movsd  0xc88(%rip),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xcf1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"main: A\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"(\00"
@.str.3 = [3 x i8] c") \00"
@.str.4 = [9 x i8] c"main: B\0A\00"
@.str.5 = [14 x i8] c"V=%d Dt=%dms\0A\00"
@.str.6 = [9 x i8] c"main: C\0A\00"
@.str.7 = [12 x i8] c"hashtst %d\0A\00"
@.str.8 = [10 x i8] c"foobarbaz\00"
@.str.9 = [9 x i8] c"main: D\0A\00"
@.str.10 = [9 x i8] c"main: E\0A\00"
@.str.11 = [9 x i8] c"main: F\0A\00"
@.str.12 = [9 x i8] c"main: G\0A\00"
@.str.13 = [7 x i8] c"pp %f\0A\00"
@.str.14 = [9 x i8] c"main: H\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @clock()
store i32 %7, i32* %5
%8 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @print_hex_n(i32 305419896, i32 8)
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 305419896, i32* %4
store i32 0, i32* %2
br label %11
11: ; preds = %25, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 10
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 10
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = call i32 @print_hex_n(i32 %17, i32 8)
%19 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* %4
%21 = srem i32 %20, 10
%22 = call i32 @print_hex_n(i32 %21, i32 2)
%23 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* %3
store i32 %24, i32* %4
br label %25
25: ; preds = %14
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %11
28: ; preds = %11
%29 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @print_decimal(i32 305419896)
%31 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @fib(i32 24)
store i32 %32, i32* %2
%33 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = call i32 @print_decimal(i32 %34)
%36 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = call i32 (...) @clock()
%38 = load i32, i32* %5
%39 = sub nsw i32 %37, %38
store i32 %39, i32* %6
%40 = load i32, i32* %2
%41 = sitofp i32 %40 to double
%42 = load i32, i32* %6
%43 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %41, i32 %42)
%44 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%45 = call i32 @hash_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%46 = sitofp i32 %45 to double
%47 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %46)
%48 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%49 = call i32 @print_float(double 3.141590e+00)
%50 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%52 = call i32 (...) @test_struct0()
%53 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%54 = call i32 (...) @test_ar2d_0()
%55 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%56 = call i32 (...) @test_ll_0()
%57 = call i32 @test_old1(i32 2, i32 3)
%58 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), double 3.141590e+00)
%59 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [9 x i8] c"main: A\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"(\00"
@.str.3 = [3 x i8] c") \00"
@.str.4 = [9 x i8] c"main: B\0A\00"
@.str.5 = [14 x i8] c"V=%d Dt=%dms\0A\00"
@.str.6 = [9 x i8] c"main: C\0A\00"
@.str.7 = [12 x i8] c"hashtst %d\0A\00"
@.str.8 = [10 x i8] c"foobarbaz\00"
@.str.9 = [9 x i8] c"main: D\0A\00"
@.str.10 = [9 x i8] c"main: E\0A\00"
@.str.11 = [9 x i8] c"main: F\0A\00"
@.str.12 = [9 x i8] c"main: G\0A\00"
@.str.13 = [7 x i8] c"pp %f\0A\00"
@.str.14 = [9 x i8] c"main: H\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @clock()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_hex_n(i32 305419896, i32 8)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 0, %0 ], [ %14, %5 ]
%7 = phi i32 [ 305419896, %0 ], [ %8, %5 ]
%8 = sdiv i32 %7, 10
%9 = tail call i32 @print_hex_n(i32 %8, i32 8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = srem i32 %7, 10
%12 = tail call i32 @print_hex_n(i32 %11, i32 2)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%14 = add nuw nsw i32 %6, 1
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %5
16: ; preds = %5
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = tail call i32 @print_decimal(i32 305419896)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @fib(i32 24)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call i32 @print_decimal(i32 %20)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = tail call i32 (...) @clock()
%25 = sub nsw i32 %24, %1
%26 = sitofp i32 %20 to double
%27 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %26, i32 %25)
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%29 = tail call i32 @hash_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%30 = sitofp i32 %29 to double
%31 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), double %30)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%33 = tail call i32 @print_float(double 3.141590e+00)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%36 = tail call i32 (...) @test_struct0()
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%38 = tail call i32 (...) @test_ar2d_0()
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%40 = tail call i32 (...) @test_ll_0()
%41 = tail call i32 @test_old1(i32 2, i32 3)
%42 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), double 3.141590e+00)
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0))
ret i32 0
}