#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 readArgs(char labyrinth[100][100], int argc, char *argv[]) {
  int n, loop, inner_loop;
  char trash;
  scanf("%d", &n);
  for (loop = 0; loop < n; loop++) {
    scanf("%c", &trash);
    for (inner_loop = 0; inner_loop < n; inner_loop++)
      scanf("%c", &labyrinth[loop][inner_loop]);
  }
  return n;
}


x86 assembly (clang, -O0):
<readArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11b2 <readArgs+0xa2>
lea    0xeb4(%rip),%rdi
lea    -0x25(%rbp),%rsi
mov    $0x0,%al
call   1030 <scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    119f <readArgs+0x8f>
mov    -0x8(%rbp),%rsi
movslq -0x20(%rbp),%rax
imul   $0x64,%rax,%rax
add    %rax,%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1161 <readArgs+0x51>
jmp    11a4 <readArgs+0x94>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113c <readArgs+0x2c>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readArgs>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r13
lea    0xed9(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    119e <readArgs+0x8e>
lea    0xec1(%rip),%r14
lea    0xf(%rsp),%r15
xor    %r12d,%r12d
jmp    1160 <readArgs+0x50>
nopl   0x0(%rax)
movslq %eax,%rcx
add    $0x1,%r12
add    $0x64,%r13
cmp    %rcx,%r12
jge    119e <readArgs+0x8e>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1150 <readArgs+0x40>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%rbx,%r13,1),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     1180 <readArgs+0x70>
jmp    1150 <readArgs+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @readArgs([100 x i8]* %0, i32 %1, i8** %2) {
%4 = alloca [100 x i8]*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store [100 x i8]* %0, [100 x i8]** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 0, i32* %8
br label %12
12: ; preds = %35, %3
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %38
16: ; preds = %12
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 0, i32* %9
br label %18
18: ; preds = %31, %16
%19 = load i32, i32* %9
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %34
22: ; preds = %18
%23 = load [100 x i8]*, [100 x i8]** %4
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 %25
%27 = load i32, i32* %9
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %26, i64 0, i64 %28
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %22
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %18
34: ; preds = %18
br label %35
35: ; preds = %34
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %12
38: ; preds = %12
%39 = load i32, i32* %7
ret i32 %39
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @readArgs([100 x i8]* %0, i32 %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = alloca i8
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %3, %23
%11 = phi i64 [ %26, %23 ], [ 0, %3 ]
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %10, %15
%16 = phi i64 [ %19, %15 ], [ 0, %10 ]
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %0, i64 %11, i64 %16
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = add nuw nsw i64 %16, 1
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %19, %21
br i1 %22, label %15, label %23
23: ; preds = %15, %10
%24 = phi i32 [ %13, %10 ], [ %20, %15 ]
%25 = sext i32 %24 to i64
%26 = add nuw nsw i64 %11, 1
%27 = icmp slt i64 %26, %25
br i1 %27, label %10, label %28
28: ; preds = %23, %3
%29 = phi i32 [ %8, %3 ], [ %24, %23 ]
ret i32 %29
}