#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 '3':
        printf(" G ");
        break;
      case '4':
        printf(" R ");
        break;
      case '5':
        printf(" P ");
        break;
      case '8':
        printf(" T ");
        break;
      case ' ':
        printf("   ");
        break;
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xf41(%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    0xf19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <print_maze+0x5c>
mov    -0xc(%rbp),%esi
lea    0xf04(%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    0xee7(%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    0xeae(%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    0xe8a(%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    $0x18,%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    0xe30(%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    12d0 <print_maze+0x1c0>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <print_maze+0x1c0>
lea    0xd9b(%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    0xd83(%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    0xf2f(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf22(%rip),%r15
lea    0xf1c(%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    0xef6(%rip),%rbp
lea    0xe7d(%rip),%r13
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
lea    0xebc(%rip),%r12
je     122e <print_maze+0x10e>
cmp    $0xa,%r15d
mov    %r12,%rdi
lea    0xeb0(%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)
xchg   %ax,%ax
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    $0x18,%eax
ja     11ea <print_maze+0xca>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
mov    %rbp,%rdi
jmp    *%rax
lea    0xe65(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xe60(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xe5b(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xe56(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
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" R \00"
@.str.8 = [4 x i8] c" P \00"
@.str.9 = [4 x i8] c" T \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 51, label %59
i32 52, label %61
i32 53, label %63
i32 56, label %65
i32 32, 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.8, 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.9, i64 0, i64 0))
br label %69
67: ; preds = %43
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, 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" R \00"
@.str.8 = [4 x i8] c" P \00"
@.str.9 = [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, %36
%13 = phi i64 [ 0, %10 ], [ %37, %36 ]
%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, %33
%19 = phi i64 [ 0, %12 ], [ %34, %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 %33 [
i32 48, label %30
i32 55, label %23
i32 54, label %24
i32 51, label %25
i32 52, label %26
i32 53, label %27
i32 56, label %28
i32 32, label %29
]
23: ; preds = %18
br label %30
24: ; preds = %18
br label %30
25: ; preds = %18
br label %30
26: ; preds = %18
br label %30
27: ; preds = %18
br label %30
28: ; preds = %18
br label %30
29: ; preds = %18
br label %30
30: ; preds = %18, %29, %28, %27, %26, %25, %24, %23
%31 = 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.6, 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.5, i64 0, i64 0), %18 ]
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %31)
br label %33
33: ; preds = %30, %18
%34 = add nuw nsw i64 %19, 1
%35 = icmp eq i64 %34, 30
br i1 %35, label %36, label %18
36: ; preds = %33
%37 = add nuw nsw i64 %13, 1
%38 = tail call i32 @putchar(i32 10)
%39 = icmp eq i64 %37, 23
br i1 %39, label %40, label %12
40: ; preds = %36
ret void
}