#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 anoi(unsigned n, char *one, char *other, char *another) {
  if (n == 0)
    return;
  anoi(n - 1, one, another, other);
  printf("Move from %s to %s\n", one, other);
  anoi(n - 1, another, other, one);
}


x86 assembly (clang, -O0):
<anoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1146 <anoi+0x26>
jmp    1188 <anoi+0x68>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <anoi@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1040 <anoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anoi>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
je     116c <anoi+0x4c>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0xffffffff,%ebp
lea    0xec2(%rip),%r15
xchg   %ax,%ax
mov    %rcx,%r12
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rcx,%rdx
mov    %r14,%rcx
call   1040 <anoi@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rcx
mov    %r12,%rbx
add    $0xffffffff,%ebp
jb     1140 <anoi+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Move from %s to %s\0A\00"
define void @anoi(i32 %0, i8* %1, i8* %2, i8* %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 eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %26
12: ; preds = %4
%13 = load i32, i32* %5
%14 = sub 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** %7
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i32, i32* %5
%22 = sub i32 %21, 1
%23 = load i8*, i8** %8
%24 = load i8*, i8** %7
%25 = load i8*, i8** %6
br label %26
26: ; preds = %12, %11
ret void
}

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