#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*/ printf(char *, char, char);
void towersOfHanoi(int m, char start, char aux, char end) {
  if (m < 1) {
    return;
  } else {
    towersOfHanoi(m - 1, start, end, aux);
    printf("%c --> %c\n", start, end);
    towersOfHanoi(m - 1, aux, start, end);
  }
}


x86 assembly (clang, -O0):
<towersOfHanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    114a <towersOfHanoi+0x2a>
jmp    1196 <towersOfHanoi+0x76>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x5(%rbp),%cl
mov    -0x7(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x6(%rbp),%ecx
call   1030 <towersOfHanoi@plt>
mov    -0x5(%rbp),%al
lea    0xe91(%rip),%rdi
movsbl %al,%esi
movsbl -0x7(%rbp),%edx
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x6(%rbp),%cl
mov    -0x5(%rbp),%al
movsbl %cl,%esi
movsbl %al,%edx
movsbl -0x7(%rbp),%ecx
call   1030 <towersOfHanoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towersOfHanoi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1182 <towersOfHanoi+0x62>
mov    %esi,%r12d
mov    %edi,%ebx
add    $0x1,%ebx
movsbl %cl,%r14d
lea    0xebe(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edx,%r13d
lea    -0x2(%rbx),%edi
movsbl %r12b,%ebp
movsbl %dl,%ecx
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <towersOfHanoi@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <printf@plt>
add    $0xffffffff,%ebx
mov    %r12d,%edx
mov    %r13d,%r12d
cmp    $0x1,%ebx
ja     1150 <towersOfHanoi+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%c --> %c\0A\00"
define void @towersOfHanoi(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %4
br label %26
12: ; preds = %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = load i8, i8* %6
%16 = load i8, i8* %8
%17 = load i8, i8* %7
%18 = load i8, i8* %6
%19 = load i8, i8* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %18, i8 signext %19)
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, 1
%23 = load i8, i8* %7
%24 = load i8, i8* %6
%25 = load i8, i8* %8
br label %26
26: ; preds = %11, %12
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%c --> %c\0A\00"
define void @towersOfHanoi(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = icmp slt i32 %0, 1
br i1 %5, label %13, label %6
6: ; preds = %4, %6
%7 = phi i8 [ %8, %6 ], [ %2, %4 ]
%8 = phi i8 [ %7, %6 ], [ %1, %4 ]
%9 = phi i32 [ %10, %6 ], [ %0, %4 ]
%10 = add nsw i32 %9, -1
tail call void @towersOfHanoi(i32 %10, i8 signext %8, i8 signext %3, i8 signext %7)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %3)
%12 = icmp ult i32 %9, 2
br i1 %12, label %13, label %6
13: ; preds = %6, %4
ret void
}