#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 ack(int, int);
int fib(int);
double fibFP(double);
int /*<<< orphan*/ printf(char *, double, ...);
int tak(int, int, int);
double takFP(double, double, double);
int main(int argc, char **argv) {
  int n = 10;
  printf("Ack(3,%d): %d\n", n + 1, ack(3, n + 1));
  printf("Fib(%.1f): %.1f\n", 28.0 + n, fibFP(28.0 + n));
  printf("Tak(%d,%d,%d): %d\n", 3 * n, 2 * n, n, tak(3 * n, 2 * n, n));
  printf("Fib(3): %d\n", fib(3));
  printf("Tak(3.0,2.0,1.0): %.1f\n", takFP(3.0, 2.0, 1.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    $0x3,%edi
call   1030 <ack@plt>
movsd  -0x38(%rbp),%xmm0
mov    %eax,%esi
lea    0xe76(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe5a(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xe44(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1040 <fibFP@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
lea    0xe43(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
imul   $0x3,-0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x3,-0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
mov    -0x14(%rbp),%edx
call   1070 <tak@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe0b(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x3,%edi
call   1080 <fib@plt>
cvtsi2sd %eax,%xmm0
lea    0xe02(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xda0(%rip),%xmm0
movsd  0xda0(%rip),%xmm1
movsd  0xda0(%rip),%xmm2
call   1050 <takFP@plt>
lea    0xde3(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0xb,%esi
call   1030 <ack@plt>
lea    0xeb9(%rip),%rdi
movsd  0xe81(%rip),%xmm0
mov    %eax,%esi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xe78(%rip),%xmm0
call   1040 <fibFP@plt>
movaps %xmm0,%xmm1
lea    0xea0(%rip),%rdi
movsd  0xe61(%rip),%xmm0
mov    $0x2,%al
call   1060 <printf@plt>
mov    $0x1e,%edi
mov    $0x14,%esi
mov    $0xa,%edx
call   1070 <tak@plt>
lea    0xe87(%rip),%rdi
movsd  0xe3f(%rip),%xmm0
mov    $0x14,%esi
mov    $0xa,%edx
mov    %eax,%ecx
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x3,%edi
call   1080 <fib@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xe67(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  0xe0d(%rip),%xmm0
movsd  0xe0d(%rip),%xmm1
movsd  0xe0d(%rip),%xmm2
call   1050 <takFP@plt>
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Ack(3,%d): %d\0A\00"
@.str.1 = [17 x i8] c"Fib(%.1f): %.1f\0A\00"
@.str.2 = [19 x i8] c"Tak(%d,%d,%d): %d\0A\00"
@.str.3 = [12 x i8] c"Fib(3): %d\0A\00"
@.str.4 = [24 x i8] c"Tak(3.0,2.0,1.0): %.1f\0A\00"
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
store i32 10, i32* %6
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
%12 = call i32 @ack(i32 3, i32 %11)
%13 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %9, i32 %12)
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fadd double 2.800000e+01, %15
%17 = load i32, i32* %6
%18 = sitofp i32 %17 to double
%19 = fadd double 2.800000e+01, %18
%20 = call double @fibFP(double %19)
%21 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %16, double %20)
%22 = load i32, i32* %6
%23 = mul nsw i32 3, %22
%24 = sitofp i32 %23 to double
%25 = load i32, i32* %6
%26 = mul nsw i32 2, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %6
%29 = mul nsw i32 3, %28
%30 = load i32, i32* %6
%31 = mul nsw i32 2, %30
%32 = load i32, i32* %6
%33 = call i32 @tak(i32 %29, i32 %31, i32 %32)
%34 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double %24, i32 %26, i32 %27, i32 %33)
%35 = call i32 @fib(i32 3)
%36 = sitofp i32 %35 to double
%37 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %36)
%38 = call double @takFP(double 3.000000e+00, double 2.000000e+00, double 1.000000e+00)
%39 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Ack(3,%d): %d\0A\00"
@.str.1 = [17 x i8] c"Fib(%.1f): %.1f\0A\00"
@.str.2 = [19 x i8] c"Tak(%d,%d,%d): %d\0A\00"
@.str.3 = [12 x i8] c"Fib(3): %d\0A\00"
@.str.4 = [24 x i8] c"Tak(3.0,2.0,1.0): %.1f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ack(i32 3, i32 11)
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 1.100000e+01, i32 %3)
%5 = tail call double @fibFP(double 3.800000e+01)
%6 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 3.800000e+01, double %5)
%7 = tail call i32 @tak(i32 30, i32 20, i32 10)
%8 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), double 3.000000e+01, i32 20, i32 10, i32 %7)
%9 = tail call i32 @fib(i32 3)
%10 = sitofp i32 %9 to double
%11 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %10)
%12 = tail call double @takFP(double 3.000000e+00, double 2.000000e+00, double 1.000000e+00)
%13 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %12)
ret i32 0
}