#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*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ Hanoi(int, int, int);
int /*<<< orphan*/ ParseCmdLine(int, char **, int *, int *, int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int StartCol, EndCol, nDisks;
  if (!ParseCmdLine(argc, argv, &StartCol, &EndCol, &nDisks))
    exit(EXIT_FAILURE);
  printf("Towers of Hanoi!\n");
  printf("================\n\n");
  printf("To move %d disks from column %d to column %d...\n\n", nDisks,
         StartCol, EndCol);
  Hanoi(StartCol, EndCol, nDisks);
  exit(EXIT_SUCCESS);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1050 <ParseCmdLine@plt>
cmp    $0x0,%eax
jne    1185 <main+0x45>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <Hanoi@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1060 <ParseCmdLine@plt>
test   %eax,%eax
jne    117a <main+0x2a>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1040 <Hanoi@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [18 x i8] c"Towers of Hanoi!\0A\00"
@.str.1 = [19 x i8] c"================\0A\0A\00"
@.str.2 = [50 x i8] c"To move %d disks from column %d to column %d...\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @ParseCmdLine(i32 %9, i8** %10, i32* %6, i32* %7, i32* %8)
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %2
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %20, i32 %21)
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = call i32 @Hanoi(i32 %23, i32 %24, i32 %25)
%27 = load i32, i32* @EXIT_SUCCESS
%28 = call i32 @exit(i32 %27)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str.2 = [50 x i8] c"To move %d disks from column %d to column %d...\0A\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"Towers of Hanoi!\00"
@str.3 = [18 x i8] c"================\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @ParseCmdLine(i32 %0, i8** %1, i32* %3, i32* %4, i32* %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = call i32 @Hanoi(i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* @EXIT_SUCCESS
%26 = call i32 @exit(i32 %25)
unreachable
}