#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 *, unsigned int, unsigned int);
void stampaMosseHanoi(unsigned int numeroDischi, unsigned int pioloIniziale,
                      unsigned int pioloFinale, unsigned int pioloTemporaneo) {
  unsigned int contatoreDischiSpostati = 0;
  while (contatoreDischiSpostati != (numeroDischi - 1)) {
    printf("%u --> %u\n", pioloIniziale, pioloFinale);
    printf("%u --> %u\n", pioloIniziale, pioloTemporaneo);
    printf("%u --> %u\n", pioloFinale, pioloTemporaneo);
    contatoreDischiSpostati++;
  }
  printf("%u --> %u\n", pioloIniziale, pioloFinale);
  stampaMosseHanoi((numeroDischi - 2), pioloTemporaneo, pioloIniziale,
                   pioloFinale);
  return;
}


x86 assembly (clang, -O0):
<stampaMosseHanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1190 <stampaMosseHanoi+0x70>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113b <stampaMosseHanoi+0x1b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1040 <stampaMosseHanoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stampaMosseHanoi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %edi,%r14d
lea    0xed5(%rip),%r15
jmp    1147 <stampaMosseHanoi+0x37>
nopl   (%rax)
mov    %r15,%rdi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0xfffffffe,%r14d
mov    %r12d,%esi
mov    %ebx,%r12d
mov    %r13d,%ebx
mov    %esi,%r13d
cmp    $0x1,%r14d
je     1130 <stampaMosseHanoi+0x20>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12d,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1160 <stampaMosseHanoi+0x50>
jmp    1130 <stampaMosseHanoi+0x20>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%u --> %u\0A\00"
define void @stampaMosseHanoi(i32 %0, i32 %1, i32 %2, i32 %3) {
br label %5
5: ; preds = %19, %4
%6 = phi i32 [ %0, %4 ], [ %21, %19 ]
%7 = phi i32 [ %1, %4 ], [ %9, %19 ]
%8 = phi i32 [ %2, %4 ], [ %7, %19 ]
%9 = phi i32 [ %3, %4 ], [ %8, %19 ]
%10 = add i32 %6, -1
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %5, %12
%13 = phi i32 [ %17, %12 ], [ 0, %5 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%17 = add nuw i32 %13, 1
%18 = icmp eq i32 %17, %10
br i1 %18, label %19, label %12
19: ; preds = %12, %5
%20 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%21 = add i32 %6, -2
br label %5
}