#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*/ _move(long, long);
void _hanoi(long EV_n, long EV_from, long EV_to, long EV_other) {
  if ((EV_n == 1)) {
    _move(EV_from, EV_to);
  } else {
    _hanoi((EV_n - 1), EV_from, EV_other, EV_to);
    _move(EV_from, EV_to);
    _hanoi((EV_n - 1), EV_other, EV_to, EV_from);
  }
}


x86 assembly (clang, -O0):
<_hanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x8(%rbp)
jne    1155 <_hanoi+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_move@plt>
jmp    1194 <_hanoi+0x74>
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <_hanoi@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_move@plt>
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1040 <_hanoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hanoi>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
cmp    $0x1,%rdi
jne    1139 <_hanoi+0x19>
mov    %r15,%r12
jmp    116b <_hanoi+0x4b>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
mov    %rcx,%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rcx,%rdx
mov    %r14,%rcx
call   1040 <_hanoi@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <_move@plt>
mov    %r15,%rcx
mov    %r12,%r15
add    $0xffffffffffffffff,%rbx
jne    1140 <_hanoi+0x20>
mov    %r12,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <_move@plt>

LLVM IR (-O0):
define void @_hanoi(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i32 @_move(i64 %12, i64 %13)
br label %29
15: ; preds = %4
%16 = load i64, i64* %5
%17 = sub nsw i64 %16, 1
%18 = load i64, i64* %6
%19 = load i64, i64* %8
%20 = load i64, i64* %7
%21 = load i64, i64* %6
%22 = load i64, i64* %7
%23 = call i32 @_move(i64 %21, i64 %22)
%24 = load i64, i64* %5
%25 = sub nsw i64 %24, 1
%26 = load i64, i64* %8
%27 = load i64, i64* %7
%28 = load i64, i64* %6
br label %29
29: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
define void @_hanoi(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %0, 1
br i1 %5, label %6, label %9
6: ; preds = %9, %4
%7 = phi i64 [ %1, %4 ], [ %10, %9 ]
%8 = tail call i32 @_move(i64 %7, i64 %2)
ret void
9: ; preds = %4, %9
%10 = phi i64 [ %11, %9 ], [ %3, %4 ]
%11 = phi i64 [ %10, %9 ], [ %1, %4 ]
%12 = phi i64 [ %13, %9 ], [ %0, %4 ]
%13 = add nsw i64 %12, -1
tail call void @_hanoi(i64 %13, i64 %11, i64 %10, i64 %2)
%14 = tail call i32 @_move(i64 %11, i64 %2)
%15 = icmp eq i64 %13, 1
br i1 %15, label %6, label %9
}