#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*/ scanf(char *, int *);
void read_maze(char maze[23][30]) {
  int aux, i, j;
  for (i = 0; i < 23; i++) {
    for (j = 0; j < 30; j++) {
      scanf("%d", &aux);
      if (aux == 1) {
        maze[i][j] = ' ';
      }
      if (aux == 0) {
        maze[i][j] = '0';
      }
      if (aux == 7) {
        maze[i][j] = '7';
      }
      if (aux == 6) {
        maze[i][j] = '6';
      }
    }
  }
}


x86 assembly (clang, -O0):
<read_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x17,-0x10(%rbp)
jge    11f8 <read_maze+0xe8>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    11e5 <read_maze+0xd5>
lea    0xebb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    116f <read_maze+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
cmpl   $0x0,-0xc(%rbp)
jne    1190 <read_maze+0x80>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
cmpl   $0x7,-0xc(%rbp)
jne    11b1 <read_maze+0xa1>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movb   $0x37,(%rax,%rcx,1)
cmpl   $0x6,-0xc(%rbp)
jne    11d2 <read_maze+0xc2>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x1e,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movb   $0x36,(%rax,%rcx,1)
jmp    11d7 <read_maze+0xc7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <read_maze+0x24>
jmp    11ea <read_maze+0xda>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <read_maze+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_maze>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %r12d,%r12d
lea    0xed8(%rip),%r15
lea    0x4(%rsp),%rbx
mov    $0xc3,%ebp
jmp    114e <read_maze+0x3e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r12
add    $0x1e,%r14
cmp    $0x17,%r12
je     1196 <read_maze+0x86>
mov    $0xffffffffffffffe2,%r13
jmp    1165 <read_maze+0x55>
nopw   0x0(%rax,%rax,1)
inc    %r13
je     1140 <read_maze+0x30>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x7,%rcx
ja     1160 <read_maze+0x50>
bt     %ecx,%ebp
jae    1160 <read_maze+0x50>
shl    $0x3,%ecx
movabs $0x3736202020202030,%rax
20 36 37
shr    %cl,%rax
mov    %al,0x1e(%r14,%r13,1)
jmp    1160 <read_maze+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @read_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
store i32 0, i32* %4
br label %6
6: ; preds = %63, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 23
br i1 %8, label %9, label %66
9: ; preds = %6
store i32 0, i32* %5
br label %10
10: ; preds = %59, %9
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 30
br i1 %12, label %13, label %62
13: ; preds = %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load [30 x i8]*, [30 x i8]** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [30 x i8], [30 x i8]* %18, i64 %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [30 x i8], [30 x i8]* %21, i64 0, i64 %23
store i8 32, i8* %24
br label %25
25: ; preds = %17, %13
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load [30 x i8]*, [30 x i8]** %2
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [30 x i8], [30 x i8]* %29, i64 %31
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [30 x i8], [30 x i8]* %32, i64 0, i64 %34
store i8 48, i8* %35
br label %36
36: ; preds = %28, %25
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 7
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load [30 x i8]*, [30 x i8]** %2
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [30 x i8], [30 x i8]* %40, i64 %42
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [30 x i8], [30 x i8]* %43, i64 0, i64 %45
store i8 55, i8* %46
br label %47
47: ; preds = %39, %36
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 6
br i1 %49, label %50, label %58
50: ; preds = %47
%51 = load [30 x i8]*, [30 x i8]** %2
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [30 x i8], [30 x i8]* %51, i64 %53
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [30 x i8], [30 x i8]* %54, i64 0, i64 %56
store i8 54, i8* %57
br label %58
58: ; preds = %50, %47
br label %59
59: ; preds = %58
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %10
62: ; preds = %10
br label %63
63: ; preds = %62
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
store i32 %65, i32* %4
br label %6
66: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read_maze([30 x i8]* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %1, %25
%5 = phi i64 [ 0, %1 ], [ %26, %25 ]
br label %6
6: ; preds = %4, %22
%7 = phi i64 [ 0, %4 ], [ %23, %22 ]
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp ult i32 %9, 8
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = trunc i32 %9 to i8
%13 = lshr i8 -61, %12
%14 = and i8 %13, 1
%15 = icmp eq i8 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %11
%17 = zext i32 %9 to i64
%18 = shl nuw nsw i64 %17, 3
%19 = lshr i64 3978402643178430512, %18
%20 = trunc i64 %19 to i8
%21 = getelementptr inbounds [30 x i8], [30 x i8]* %0, i64 %5, i64 %7
store i8 %20, i8* %21
br label %22
22: ; preds = %11, %6, %16
%23 = add nuw nsw i64 %7, 1
%24 = icmp eq i64 %23, 30
br i1 %24, label %25, label %6
25: ; preds = %22
%26 = add nuw nsw i64 %5, 1
%27 = icmp eq i64 %26, 23
br i1 %27, label %28, label %4
28: ; preds = %25
ret void
}