#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;
  printf("   ");
  for (i = 0; i < 30; i++) {
    if (i < 10)
      printf(" 0%d", i);
    else
      printf(" %d", i);
  }
  printf("\n");
  for (i = 0; i < 23; i++) {
    if (i < 10)
      printf("0%d ", i);
    else
      printf("%d ", i);
    for (j = 0; j < 30; j++) {
      switch (maze[i][j]) {
      case '0':
        printf("[X]");
        break;
      case ' ':
        printf("   ");
        break;
      case '7':
        printf("   ");
        break;
      case '6':
        printf("   ");
        break;
      case 'T':
        printf(" T ");
        break;
      case 'G':
        printf(" G ");
        break;
      case 'R':
        printf(" R ");
        break;
      case '8':
        printf("   ");
        break;
      case '+':
        printf(" + ");
        break;
      case 'P':
        printf(" P ");
        break;
      default:
        printf(" ? ");
        break;
      }
    }
    printf("\n");
  }
  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    0xf78(%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    0xf5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x17,-0xc(%rbp)
jge    1321 <print_maze+0x211>
cmpl   $0xa,-0xc(%rbp)
jge    11be <print_maze+0xae>
mov    -0xc(%rbp),%esi
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cf <print_maze+0xbf>
mov    -0xc(%rbp),%esi
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    1305 <print_maze+0x1f5>
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,-0x18(%rbp)
sub    $0x34,%eax
ja     12e4 <print_maze+0x1d4>
mov    -0x18(%rbp),%rax
lea    0xde3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f2 <print_maze+0x1e2>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f7 <print_maze+0x1e7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11d6 <print_maze+0xc6>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1194 <print_maze+0x84>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf92(%rip),%r15
lea    0xf90(%rip),%r12
xor    %ebp,%ebp
nop
cmp    $0xa,%ebp
mov    %r12,%rdi
cmovb  %r15,%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    0xf6a(%rip),%rbp
lea    0xe7d(%rip),%r13
xor    %r15d,%r15d
jmp    11ac <print_maze+0x8c>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x1e,%rbx
cmp    $0x17,%r15
je     1240 <print_maze+0x120>
cmp    $0xa,%r15
lea    0xf2b(%rip),%rdi
lea    0xf23(%rip),%rax
cmovb  %rax,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffffffffffe2,%r12
jmp    11ef <print_maze+0xcf>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
inc    %r12
je     1190 <print_maze+0x70>
movsbl 0x1e(%rbx,%r12,1),%eax
add    $0xffffffe0,%eax
cmp    $0x34,%eax
ja     1213 <print_maze+0xf3>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
mov    %rbp,%rdi
jmp    *%rax
lea    0xee5(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xee4(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xecb(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xece(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xebd(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xeac(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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