#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 '5':
        printf(" P ");
        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    0xf3d(%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    0xf15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <print_maze+0x5c>
mov    -0xc(%rbp),%esi
lea    0xf00(%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    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x17,-0xc(%rbp)
jge    12d9 <print_maze+0x1c9>
cmpl   $0xa,-0x14(%rbp)
jge    11cd <print_maze+0xbd>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xeaa(%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    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x1e,-0x10(%rbp)
jge    12bd <print_maze+0x1ad>
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    $0x17,%eax
ja     12aa <print_maze+0x19a>
mov    -0x20(%rbp),%rax
lea    0xdcc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12aa <print_maze+0x19a>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12aa <print_maze+0x19a>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12aa <print_maze+0x19a>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12aa <print_maze+0x19a>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12aa <print_maze+0x19a>
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12af <print_maze+0x19f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ed <print_maze+0xdd>
lea    0xda5(%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    0xf2b(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1e(%rip),%r15
lea    0xf18(%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    0xef2(%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    0xeb8(%rip),%r12
je     121c <print_maze+0xfc>
cmp    $0xa,%r15d
mov    %r12,%rdi
lea    0xeac(%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    $0x17,%eax
ja     11ea <print_maze+0xca>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
mov    %rbp,%rdi
jmp    *%rax
lea    0xe61(%rip),%rdi
jmp    11e3 <print_maze+0xc3>
lea    0xe5c(%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" P \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 = %71, %23
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 23
br i1 %27, label %28, label %74
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 = %66, %39
%41 = load i32, i32* %4
%42 = icmp slt i32 %41, 30
br i1 %42, label %43, label %69
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 %65 [
i32 48, label %53
i32 55, label %55
i32 54, label %57
i32 51, label %59
i32 53, label %61
i32 32, label %63
]
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 %65
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %65
57: ; preds = %43
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %65
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 %65
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 %65
63: ; preds = %43
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %65
65: ; preds = %43, %63, %61, %59, %57, %55, %53
br label %66
66: ; preds = %65
%67 = load i32, i32* %4
%68 = add nsw i32 %67, 1
store i32 %68, i32* %4
br label %40
69: ; preds = %40
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %71
71: ; preds = %69
%72 = load i32, i32* %3
%73 = add nsw i32 %72, 1
store i32 %73, i32* %3
br label %25
74: ; 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"
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, %34
%13 = phi i64 [ 0, %10 ], [ %35, %34 ]
%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, %31
%19 = phi i64 [ 0, %12 ], [ %32, %31 ]
%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 %31 [
i32 48, label %28
i32 55, label %23
i32 54, label %24
i32 51, label %25
i32 53, label %26
i32 32, label %27
]
23: ; preds = %18
br label %28
24: ; preds = %18
br label %28
25: ; preds = %18
br label %28
26: ; preds = %18
br label %28
27: ; preds = %18
br label %28
28: ; preds = %18, %27, %26, %25, %24, %23
%29 = 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, i64 0, i64 0), %27 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %18 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %29)
br label %31
31: ; preds = %28, %18
%32 = add nuw nsw i64 %19, 1
%33 = icmp eq i64 %32, 30
br i1 %33, label %34, label %18
34: ; preds = %31
%35 = add nuw nsw i64 %13, 1
%36 = tail call i32 @putchar(i32 10)
%37 = icmp eq i64 %35, 23
br i1 %37, label %38, label %12
38: ; preds = %34
ret void
}