#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*/ Tower(int, char, char, char);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n;
  char src[3];
  printf("\nEnter the number of stacks which you want to move\n");
  scanf("%d", &n);
  printf("\nEnter source name destination name and spare name (only single "
         "character per name with no spaces in between eg.abc)\n");
  scanf("%s", src);
  printf("\n\n");
  Tower(n, src[0], src[1], src[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb(%rbp),%rsi
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xb(%rbp),%cl
mov    -0xa(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x9(%rbp),%ecx
call   1040 <Tower@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
lea    0x1(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
movsbl 0x1(%rsp),%esi
movsbl 0x2(%rsp),%edx
movsbl 0x3(%rsp),%ecx
call   1040 <Tower@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0AEnter the number of stacks which you want to move\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [118 x i8] c"\0AEnter source name destination name and spare name (only single character per name with no spaces in between eg.abc)\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%10 = load i32, i32* %2
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%12 = load i8, i8* %11
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%14 = load i8, i8* %13
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%16 = load i8, i8* %15
%17 = call i32 @Tower(i32 %10, i8 signext %12, i8 signext %14, i8 signext %16)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%s\00"
@str = [51 x i8] c"\0AEnter the number of stacks which you want to move\00"
@str.5 = [117 x i8] c"\0AEnter source name destination name and spare name (only single character per name with no spaces in between eg.abc)\00"
@str.6 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = load i8, i8* %4
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%13 = load i8, i8* %12
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%15 = load i8, i8* %14
%16 = call i32 @Tower(i32 %10, i8 signext %11, i8 signext %13, i8 signext %15)
ret i32 0
}