#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int findLineLength(int /*<<< orphan*/ *);
void Maze_findSize(FILE *fh, int *numRow, int *numCol) {
  int row = 0;
  int col = 0;
  int maxCol = 0;
  do {
    col = findLineLength(fh);
    if (col != -1) {
      if (maxCol < col) {
        maxCol = col;
      }
      row++;
    }
  } while (col != -1);
  *numRow = row;
  *numCol = maxCol;
}


x86 assembly (clang, -O0):
<Maze_findSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <findLineLength@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
je     116a <Maze_findSize+0x5a>
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1161 <Maze_findSize+0x51>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116f <Maze_findSize+0x5f>
cmpl   $0xffffffff,-0x20(%rbp)
jne    1139 <Maze_findSize+0x29>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maze_findSize>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r13d
mov    %r12,%rdi
call   1030 <findLineLength@plt>
cmp    %eax,%ebx
cmovl  %eax,%ebx
add    $0x1,%ebp
cmp    $0xffffffff,%eax
jne    1130 <Maze_findSize+0x20>
mov    %ebp,(%r15)
mov    %r13d,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @Maze_findSize(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %10
10: ; preds = %25, %3
%11 = load i32*, i32** %4
%12 = call i32 @findLineLength(i32* %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i32, i32* %9
%17 = load i32, i32* %8
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* %8
store i32 %20, i32* %9
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %24
24: ; preds = %21, %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, -1
br i1 %27, label %10, label %28
28: ; preds = %25
%29 = load i32, i32* %7
%30 = load i32*, i32** %5
store i32 %29, i32* %30
%31 = load i32, i32* %9
%32 = load i32*, i32** %6
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @Maze_findSize(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ 0, %3 ], [ %11, %4 ]
%6 = phi i32 [ 0, %3 ], [ %10, %4 ]
%7 = tail call i32 @findLineLength(i32* %0)
%8 = icmp eq i32 %7, -1
%9 = icmp slt i32 %6, %7
%10 = select i1 %9, i32 %7, i32 %6
%11 = add nuw nsw i32 %5, 1
br i1 %8, label %12, label %4
12: ; preds = %4
store i32 %5, i32* %1
store i32 %6, i32* %2
ret void
}