#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 scanf(char *, char *);
int readArgs(int veryLongIntegers[102][102], int integersLengths[102],
             int *maxLength) {
  int veryLongIntegerIndex, veryLongIntegerPosition, scanfResult;
  char digit;
  *maxLength = 0;
  veryLongIntegerIndex = 0;
  scanfResult = scanf("%c", &digit);
  while (scanfResult == 1) {
    veryLongIntegerPosition = 0;
    while (digit != '\n') {
      veryLongIntegers[veryLongIntegerIndex][veryLongIntegerPosition++] =
          digit - '0';
      scanfResult = scanf("%c", &digit);
    }
    integersLengths[veryLongIntegerIndex] = veryLongIntegerPosition;
    if (veryLongIntegerPosition > *maxLength)
      *maxLength = veryLongIntegerPosition;
    veryLongIntegerIndex++;
    if (veryLongIntegerPosition == 1 &&
        veryLongIntegers[veryLongIntegerIndex - 1][0] == 0)
      return veryLongIntegerIndex;
    scanfResult = scanf("%c", &digit);
  }
  return veryLongIntegerIndex;
}


x86 assembly (clang, -O0):
<readArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x24(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x2d(%rbp),%rsi
call   1030 <scanf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x1,-0x2c(%rbp)
jne    1224 <readArgs+0x114>
movl   $0x0,-0x28(%rbp)
movsbl -0x2d(%rbp),%eax
cmp    $0xa,%eax
je     11a8 <readArgs+0x98>
movsbl -0x2d(%rbp),%edx
sub    $0x30,%edx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0x198,%rcx,%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x28(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
lea    0xe69(%rip),%rdi
lea    -0x2d(%rbp),%rsi
call   1030 <scanf@plt>
mov    %eax,-0x2c(%rbp)
jmp    1159 <readArgs+0x49>
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jle    11ce <readArgs+0xbe>
mov    -0x28(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x28(%rbp)
jne    120c <readArgs+0xfc>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x198,%rcx,%rcx
add    %rcx,%rax
cmpl   $0x0,(%rax)
jne    120c <readArgs+0xfc>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    122a <readArgs+0x11a>
lea    0xded(%rip),%rdi
lea    -0x2d(%rbp),%rsi
call   1030 <scanf@plt>
mov    %eax,-0x2c(%rbp)
jmp    1148 <readArgs+0x38>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readArgs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x20(%rsp)
mov    %rdi,%r15
mov    %rdx,0x10(%rsp)
movl   $0x0,(%rdx)
lea    0xec8(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1030 <scanf@plt>
xor    %r14d,%r14d
cmp    $0x1,%eax
jne    11fd <readArgs+0xed>
xor    %ebp,%ebp
lea    0xea9(%rip),%r13
lea    0xf(%rsp),%rbx
mov    %r15,0x18(%rsp)
jmp    118a <readArgs+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x198,%r15
mov    %r14,%rbp
cmp    $0x1,%eax
jne    11fd <readArgs+0xed>
mov    0xf(%rsp),%al
mov    $0x0,%r12d
cmp    $0xa,%al
je     11c2 <readArgs+0xb2>
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
movsbl %al,%eax
add    $0xffffffd0,%eax
mov    %eax,(%r15,%r12,4)
add    $0x1,%r12
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0xa,%al
jne    11a0 <readArgs+0x90>
mov    0x20(%rsp),%rax
mov    %r12d,(%rax,%rbp,4)
mov    0x10(%rsp),%rax
cmp    (%rax),%r12d
jle    11dd <readArgs+0xcd>
mov    0x10(%rsp),%rax
mov    %r12d,(%rax)
lea    0x1(%rbp),%r14
cmp    $0x1,%r12d
jne    1170 <readArgs+0x60>
imul   $0x198,%rbp,%rax
mov    0x18(%rsp),%rcx
cmpl   $0x0,(%rcx,%rax,1)
jne    1170 <readArgs+0x60>
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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