#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 *, ...);
void printHanoi(int **state, int n) {
  int i, j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < n; j++) {
      if (state[i][j] != -1) {
        printf("%d", state[i][j]);
      } else {
        printf(".");
      }
    }
    if (i != 2)
      printf(" ");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printHanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11cf <printHanoi+0xbf>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a4 <printHanoi+0x94>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1183 <printHanoi+0x73>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1191 <printHanoi+0x81>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1196 <printHanoi+0x86>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <printHanoi+0x27>
cmpl   $0x2,-0x10(%rbp)
je     11bc <printHanoi+0xac>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c1 <printHanoi+0xb1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printHanoi+0x16>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHanoi>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    11cc <printHanoi+0xac>
mov    %esi,%r14d
mov    %rdi,%r12
mov    %esi,%ebp
lea    0xec1(%rip),%r15
xor    %ebx,%ebx
jmp    1163 <printHanoi+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     117b <printHanoi+0x5b>
mov    (%r12),%rax
mov    (%rax,%rbx,4),%esi
cmp    $0xffffffff,%esi
je     1150 <printHanoi+0x30>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <printHanoi+0x3a>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    11d6 <printHanoi+0xb6>
lea    0xe6f(%rip),%r15
xor    %ebx,%ebx
jmp    11b3 <printHanoi+0x93>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     11e2 <printHanoi+0xc2>
mov    0x8(%r12),%rax
mov    (%rax,%rbx,4),%esi
cmp    $0xffffffff,%esi
je     11a0 <printHanoi+0x80>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11aa <printHanoi+0x8a>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    122c <printHanoi+0x10c>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    122c <printHanoi+0x10c>
lea    0xe08(%rip),%r14
xor    %ebx,%ebx
jmp    1213 <printHanoi+0xf3>
nopl   0x0(%rax)
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
je     122c <printHanoi+0x10c>
mov    0x10(%r12),%rax
mov    (%rax,%rbx,4),%esi
cmp    $0xffffffff,%esi
je     1200 <printHanoi+0xe0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    120a <printHanoi+0xea>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @printHanoi(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %49, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %52
10: ; preds = %7
store i32 0, i32* %6
br label %11
11: ; preds = %40, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %11
%16 = load i32**, i32*** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32*, i32** %16, i64 %18
%20 = load i32*, i32** %19
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, -1
br i1 %25, label %26, label %37
26: ; preds = %15
%27 = load i32**, i32*** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32*, i32** %27, i64 %29
%31 = load i32*, i32** %30
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %35)
br label %39
37: ; preds = %15
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %26
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %11
43: ; preds = %11
%44 = load i32, i32* %5
%45 = icmp ne i32 %44, 2
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
br label %49
49: ; preds = %48
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %7
52: ; preds = %7
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printHanoi(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @putchar(i32 32)
br label %39
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %18
%9 = phi i64 [ 0, %6 ], [ %19, %18 ]
%10 = load i32*, i32** %0
%11 = getelementptr inbounds i32, i32* %10, i64 %9
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %18
16: ; preds = %8
%17 = tail call i32 @putchar(i32 46)
br label %18
18: ; preds = %14, %16
%19 = add nuw nsw i64 %9, 1
%20 = icmp eq i64 %19, %7
br i1 %20, label %21, label %8
21: ; preds = %18
%22 = tail call i32 @putchar(i32 32)
br i1 %3, label %23, label %39
23: ; preds = %21
%24 = getelementptr inbounds i32*, i32** %0, i64 1
%25 = zext i32 %1 to i64
br label %26
26: ; preds = %36, %23
%27 = phi i64 [ 0, %23 ], [ %37, %36 ]
%28 = load i32*, i32** %24
%29 = getelementptr inbounds i32, i32* %28, i64 %27
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, -1
br i1 %31, label %34, label %32
32: ; preds = %26
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %36
34: ; preds = %26
%35 = tail call i32 @putchar(i32 46)
br label %36
36: ; preds = %34, %32
%37 = add nuw nsw i64 %27, 1
%38 = icmp eq i64 %37, %25
br i1 %38, label %41, label %26
39: ; preds = %4, %21
%40 = tail call i32 @putchar(i32 32)
br label %59
41: ; preds = %36
%42 = tail call i32 @putchar(i32 32)
br i1 %3, label %43, label %59
43: ; preds = %41
%44 = getelementptr inbounds i32*, i32** %0, i64 2
%45 = zext i32 %1 to i64
br label %46
46: ; preds = %56, %43
%47 = phi i64 [ 0, %43 ], [ %57, %56 ]
%48 = load i32*, i32** %44
%49 = getelementptr inbounds i32, i32* %48, i64 %47
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, -1
br i1 %51, label %54, label %52
52: ; preds = %46
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
br label %56
54: ; preds = %46
%55 = tail call i32 @putchar(i32 46)
br label %56
56: ; preds = %54, %52
%57 = add nuw nsw i64 %47, 1
%58 = icmp eq i64 %57, %45
br i1 %58, label %59, label %46
59: ; preds = %56, %41, %39
%60 = tail call i32 @putchar(i32 10)
ret void
}