#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 */
char *ft_extract_tetrimino(char *);
char **ft_fillit(char *);
int /*<<< orphan*/ ft_print_array(char **);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  char *tetrimino;
  char **solution;
  if (argc != 2) {
    ft_putstr("usage: fillit input_file\n");
    return (0);
  }
  tetrimino = ft_extract_tetrimino(argv[1]);
  solution = ft_fillit(tetrimino);
  ft_print_array(solution);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1060 <ft_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ft_extract_tetrimino@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ft_fillit@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <ft_print_array@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1161 <main+0x21>
mov    0x8(%rsi),%rdi
call   1030 <ft_extract_tetrimino@plt>
mov    %rax,%rdi
call   1040 <ft_fillit@plt>
mov    %rax,%rdi
call   1050 <ft_print_array@plt>
jmp    116d <main+0x2d>
lea    0xe98(%rip),%rdi
call   1060 <ft_putstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"usage: fillit input_file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @ft_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %21
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @ft_extract_tetrimino(i8* %15)
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = call i8** @ft_fillit(i8* %17)
store i8** %18, i8*** %7
%19 = load i8**, i8*** %7
%20 = call i32 @ft_print_array(i8** %19)
store i32 0, i32* %3
br label %21
21: ; preds = %12, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage: fillit input_file\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i8* @ft_extract_tetrimino(i8* %8)
%10 = tail call i8** @ft_fillit(i8* %9)
%11 = tail call i32 @ft_print_array(i8** %10)
br label %12
12: ; preds = %6, %4
ret i32 0
}