#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 Cannonball(int);
int Combinations(int, int);
int DigitSum(int);
int DigitalRoot(int);
int Fib(int);
int GCD(int, int);
int RaiseIntToPower(int, int);
char *malloc(scalar_t__);
int /*<<< orphan*/ printWords();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int main(int argc, char const *argv[]) {
  printf("Cannonball(5):[%d]\n", Cannonball(5));
  printf("RaiseIntToPower(1,12345):[%d]\n", RaiseIntToPower(1, 12345));
  printf("GCD(39,13):[%d]\n", GCD(39, 13));
  printf("Fib(6):[%d]\n", Fib(6));
  printf("DigitSum(1234):[%d]\n", DigitSum(1234));
  printf("DigitalRoot(65536):[%d]\n", DigitalRoot(65536));
  printf("Combinations(6,2):[%d]\n", Combinations(6, 2));
  char *given1 = "ABC";
  char *input1 = malloc(strlen(given1) + 1 * sizeof(char));
  strcpy(input1, given1);
  printWords();
  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    $0x5,%edi
call   1050 <Cannonball@plt>
mov    %eax,%esi
lea    0xe17(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
mov    $0x3039,%esi
call   10d0 <RaiseIntToPower@plt>
mov    %eax,%esi
lea    0xe0e(%rip),%rdi
call   1070 <printf@plt>
mov    $0x27,%edi
mov    $0xd,%esi
call   10a0 <GCD@plt>
mov    %eax,%esi
lea    0xe10(%rip),%rdi
call   1070 <printf@plt>
mov    $0x6,%edi
call   10b0 <Fib@plt>
mov    %eax,%esi
lea    0xe09(%rip),%rdi
call   1070 <printf@plt>
mov    $0x4d2,%edi
call   1040 <DigitSum@plt>
mov    %eax,%esi
lea    0xdfe(%rip),%rdi
call   1070 <printf@plt>
mov    $0x10000,%edi
call   10e0 <DigitalRoot@plt>
mov    %eax,%esi
lea    0xdfb(%rip),%rdi
call   1070 <printf@plt>
mov    $0x6,%edi
mov    $0x2,%esi
call   1090 <Combinations@plt>
mov    %eax,%esi
lea    0xdf7(%rip),%rdi
call   1070 <printf@plt>
lea    0xe03(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x0,%al
call   10c0 <printWords@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <Cannonball@plt>
lea    0xe3e(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x1,%edi
mov    $0x3039,%esi
call   10c0 <RaiseIntToPower@plt>
lea    0xe35(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x27,%edi
mov    $0xd,%esi
call   1090 <GCD@plt>
lea    0xe37(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x6,%edi
call   10a0 <Fib@plt>
lea    0xe30(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x4d2,%edi
call   1040 <DigitSum@plt>
lea    0xe25(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x10000,%edi
call   10d0 <DigitalRoot@plt>
lea    0xe22(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x6,%edi
mov    $0x2,%esi
call   1080 <Combinations@plt>
lea    0xe1e(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    $0x4,%edi
call   1070 <malloc@plt>
lea    0xe1e(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
call   10b0 <printWords@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Cannonball(5):[%d]\0A\00"
@.str.1 = [31 x i8] c"RaiseIntToPower(1,12345):[%d]\0A\00"
@.str.2 = [17 x i8] c"GCD(39,13):[%d]\0A\00"
@.str.3 = [13 x i8] c"Fib(6):[%d]\0A\00"
@.str.4 = [21 x i8] c"DigitSum(1234):[%d]\0A\00"
@.str.5 = [25 x i8] c"DigitalRoot(65536):[%d]\0A\00"
@.str.6 = [24 x i8] c"Combinations(6,2):[%d]\0A\00"
@.str.7 = [4 x i8] c"ABC\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @Cannonball(i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @RaiseIntToPower(i32 1, i32 12345)
%11 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @GCD(i32 39, i32 13)
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 @Fib(i32 6)
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = call i32 @DigitSum(i32 1234)
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = call i32 @DigitalRoot(i32 65536)
%19 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = call i32 @Combinations(i32 6, i32 2)
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %20)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8** %6
%22 = load i8*, i8** %6
%23 = call i64 @strlen(i8* %22)
%24 = add i64 %23, 1
%25 = call i8* @malloc(i64 %24)
store i8* %25, i8** %7
%26 = load i8*, i8** %7
%27 = load i8*, i8** %6
%28 = call i32 @strcpy(i8* %26, i8* %27)
%29 = call i32 (...) @printWords()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Cannonball(5):[%d]\0A\00"
@.str.1 = [31 x i8] c"RaiseIntToPower(1,12345):[%d]\0A\00"
@.str.2 = [17 x i8] c"GCD(39,13):[%d]\0A\00"
@.str.3 = [13 x i8] c"Fib(6):[%d]\0A\00"
@.str.4 = [21 x i8] c"DigitSum(1234):[%d]\0A\00"
@.str.5 = [25 x i8] c"DigitalRoot(65536):[%d]\0A\00"
@.str.6 = [24 x i8] c"Combinations(6,2):[%d]\0A\00"
@.str.7 = [4 x i8] c"ABC\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Cannonball(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @RaiseIntToPower(i32 1, i32 12345)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @GCD(i32 39, i32 13)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @Fib(i32 6)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @DigitSum(i32 1234)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 @DigitalRoot(i32 65536)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = tail call i32 @Combinations(i32 6, i32 2)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%18 = tail call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%19 = tail call i32 (...) @printWords()
ret i32 0
}