#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 print_maze(char maze[23][30]) {
  int i, j, k;
  printf("   ");
  for (i = 0; i < 30; i++) {
    if (i < 10) {
      printf(" %d ", i);
    } else {
      printf("%d ", i);
    }
  }
  printf("\n");
  k = 0;
  for (i = 0; i < 23; i++) {
    if (k < 10) {
      printf("%d  ", k++);
    } else {
      printf("%d ", k++);
    }
    for (j = 0; j < 30; j++) {
      switch (maze[i][j]) {
      case '0':
        printf("[X]");
        break;
      case '7':
        printf("   ");
        break;
      case '6':
        printf("   ");
        break;
      case 'G':
        printf(" G ");
        break;
      case 'P':
        printf(" P ");
        break;
      case ' ':
        printf("   ");
        break;
      case 'T':
        printf(" T ");
        break;
      case '9':
        printf(" ");
        break;
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xfb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jge    117f <print_maze+0x6f>
cmpl   $0xa,-0xc(%rbp)
jge    115b <print_maze+0x4b>
mov    -0xc(%rbp),%esi
lea    0xf89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <print_maze+0x5c>
mov    -0xc(%rbp),%esi
lea    0xf74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <print_maze+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <print_maze+0x21>
lea    0xf57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x17,-0xc(%rbp)
jge    12ff <print_maze+0x1ef>
cmpl   $0xa,-0x14(%rbp)
jge    11cd <print_maze+0xbd>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e6 <print_maze+0xd6>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    12e3 <print_maze+0x1d3>
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    %rdx,%rax
shl    $0x5,%rax
sub    %rdx,%rax
sub    %rdx,%rax
add    %rax,%rcx
movslq -0x10(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x34,%eax
ja     12d0 <print_maze+0x1c0>
mov    -0x20(%rbp),%rax
lea    0xdcc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d5 <print_maze+0x1c5>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <print_maze+0xdd>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119b <print_maze+0x8b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_maze>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xf9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf95(%rip),%r14
lea    0xf8f(%rip),%r13
xor    %ebp,%ebp
nopl   0x0(%rax)
cmp    $0xa,%ebp
mov    %r13,%rdi
cmovb  %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x1e,%ebp
jne    1150 <print_maze+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe84(%rip),%r12
lea    0xf51(%rip),%r14
xor    %r15d,%r15d
jmp    11af <print_maze+0x8f>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1e,%rbx
cmp    $0x17,%r15
mov    %rbp,%r13
je     122f <print_maze+0x10f>
cmp    $0xa,%r15d
mov    %r13,%rbp
mov    %r13,%rdi
lea    0xf1d(%rip),%rax
cmovb  %rax,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffffffffffe2,%r13
jmp    11ec <print_maze+0xcc>
lea    0xf04(%rip),%rdi
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <printf@plt>
inc    %r13
je     1190 <print_maze+0x70>
movsbl 0x1e(%rbx,%r13,1),%eax
add    $0xffffffe0,%eax
cmp    $0x34,%eax
ja     11e7 <print_maze+0xc7>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    %r14,%rdi
jmp    11e0 <print_maze+0xc0>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11e7 <print_maze+0xc7>
lea    0xecb(%rip),%rdi
jmp    11e0 <print_maze+0xc0>
lea    0xec6(%rip),%rdi
jmp    11e0 <print_maze+0xc0>
lea    0xec1(%rip),%rdi
jmp    11e0 <print_maze+0xc0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@.str.1 = [5 x i8] c" %d \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [5 x i8] c"%d \00"
@.str.5 = [4 x i8] c"[X]\00"
@.str.6 = [4 x i8] c" G \00"
@.str.7 = [4 x i8] c" P \00"
@.str.8 = [4 x i8] c" T \00"
@.str.9 = [2 x i8] c" \00"
define void @print_maze([30 x i8]* %0) {
%2 = alloca [30 x i8]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [30 x i8]* %0, [30 x i8]** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 30
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %19
16: ; preds = %10
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %7
23: ; preds = %7
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %5
store i32 0, i32* %3
br label %25
25: ; preds = %75, %23
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 23
br i1 %27, label %28, label %78
28: ; preds = %25
%29 = load i32, i32* %5
%30 = icmp slt i32 %29, 10
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %32)
br label %39
35: ; preds = %28
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %39
39: ; preds = %35, %31
store i32 0, i32* %4
br label %40
40: ; preds = %70, %39
%41 = load i32, i32* %4
%42 = icmp slt i32 %41, 30
br i1 %42, label %43, label %73
43: ; preds = %40
%44 = load [30 x i8]*, [30 x i8]** %2
%45 = load i32, i32* %3
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %44, i64 %46
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [30 x i8], [30 x i8]* %47, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
switch i32 %52, label %69 [
i32 48, label %53
i32 55, label %55
i32 54, label %57
i32 71, label %59
i32 80, label %61
i32 32, label %63
i32 84, label %65
i32 57, label %67
]
53: ; preds = %43
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %69
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %69
57: ; preds = %43
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %69
59: ; preds = %43
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %69
61: ; preds = %43
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %69
63: ; preds = %43
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %69
65: ; preds = %43
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %69
67: ; preds = %43
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %69
69: ; preds = %43, %67, %65, %63, %61, %59, %57, %55, %53
br label %70
70: ; preds = %69
%71 = load i32, i32* %4
%72 = add nsw i32 %71, 1
store i32 %72, i32* %4
br label %40
73: ; preds = %40
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %75
75: ; preds = %73
%76 = load i32, i32* %3
%77 = add nsw i32 %76, 1
store i32 %77, i32* %3
br label %25
78: ; preds = %25
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [5 x i8] c" %d \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.4 = [5 x i8] c"%d \00"
@.str.5 = [4 x i8] c"[X]\00"
@.str.6 = [4 x i8] c" G \00"
@.str.7 = [4 x i8] c" P \00"
@.str.8 = [4 x i8] c" T \00"
define void @print_maze([30 x i8]* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %8, %3 ]
%5 = icmp ult i32 %4, 10
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %6, i32 %4)
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, 30
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %10, %42
%13 = phi i64 [ 0, %10 ], [ %43, %42 ]
%14 = trunc i64 %13 to i32
%15 = icmp ult i32 %14, 10
%16 = select i1 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %16, i32 %14)
br label %18
18: ; preds = %12, %39
%19 = phi i64 [ 0, %12 ], [ %40, %39 ]
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %13, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
switch i32 %22, label %39 [
i32 48, label %23
i32 55, label %25
i32 54, label %27
i32 71, label %29
i32 80, label %31
i32 32, label %33
i32 84, label %35
i32 57, label %37
]
23: ; preds = %18
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %39
25: ; preds = %18
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %39
27: ; preds = %18
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %39
29: ; preds = %18
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %39
31: ; preds = %18
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %39
33: ; preds = %18
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %39
35: ; preds = %18
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %39
37: ; preds = %18
%38 = tail call i32 @putchar(i32 32)
br label %39
39: ; preds = %23, %25, %27, %29, %31, %33, %35, %37, %18
%40 = add nuw nsw i64 %19, 1
%41 = icmp eq i64 %40, 30
br i1 %41, label %42, label %18
42: ; preds = %39
%43 = add nuw nsw i64 %13, 1
%44 = tail call i32 @putchar(i32 10)
%45 = icmp eq i64 %43, 23
br i1 %45, label %46, label %12
46: ; preds = %42
ret void
}