#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*/ fill_grid(char *);
int /*<<< orphan*/ ft_error();
char *parse_file(char *);
int main(int argc, char **argv) {
  char *file;
  int i;
  i = 1;
  if (argc == 1)
    ft_error();
  while (i < argc) {
    file = parse_file(argv[i]);
    fill_grid(file);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    115e <main+0x2e>
mov    $0x0,%al
call   1050 <ft_error@plt>
jmp    1163 <main+0x33>
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119b <main+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <parse_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fill_grid@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1163 <main+0x33>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
jne    1143 <main+0x13>
xor    %eax,%eax
call   1050 <ft_error@plt>
jmp    116a <main+0x3a>
jle    116a <main+0x3a>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
mov    (%r14,%rbx,8),%rdi
call   1040 <parse_file@plt>
mov    %rax,%rdi
call   1030 <fill_grid@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @ft_error()
br label %12
12: ; preds = %10, %2
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i8* @parse_file(i8* %22)
store i8* %23, i8** %6
%24 = load i8*, i8** %6
%25 = call i32 @fill_grid(i8* %24)
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %13
28: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @ft_error()
br label %18
6: ; preds = %2
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %18
8: ; preds = %6
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 1, %8 ], [ %16, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i8* @parse_file(i8* %13)
%15 = tail call i32 @fill_grid(i8* %14)
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, %9
br i1 %17, label %18, label %10
18: ; preds = %10, %4, %6
ret i32 0
}