#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*/ check_params(int, char const **);
int /*<<< orphan*/ empty_grid_check(int **);
int /*<<< orphan*/ enough_entries(int **);
int /*<<< orphan*/ free_grid_mem(int **);
int /*<<< orphan*/ ft_putstr(char *);
int **grid_init(char **);
char **lines_init(char const **);
int /*<<< orphan*/ printer(int **);
int /*<<< orphan*/ rec_solver(int **, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  char **lines;
  int **grid;
  if (!check_params(argc, argv)) {
    ft_putstr("Erreur\n");
    return (0);
  }
  lines = lines_init(argv);
  grid = grid_init(lines);
  if (!empty_grid_check(grid) || !enough_entries(grid)) {
    ft_putstr("Erreur\n");
    return (0);
  }
  rec_solver(grid, 0, 0, 0);
  printer(grid);
  free_grid_mem(grid);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <check_params@plt>
cmp    $0x0,%eax
jne    11d3 <main+0x43>
lea    0xe3e(%rip),%rdi
call   10a0 <ft_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    1251 <main+0xc1>
mov    -0x10(%rbp),%rdi
call   1090 <lines_init@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <grid_init@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <empty_grid_check@plt>
cmp    $0x0,%eax
je     1211 <main+0x81>
mov    -0x20(%rbp),%rdi
call   1040 <enough_entries@plt>
cmp    $0x0,%eax
jne    1229 <main+0x99>
lea    0xde8(%rip),%rdi
call   10a0 <ft_putstr@plt>
movl   $0x0,-0x4(%rbp)
jmp    1251 <main+0xc1>
mov    -0x20(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1080 <rec_solver@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <printer@plt>
mov    -0x20(%rbp),%rdi
call   1060 <free_grid_mem@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1070 <check_params@plt>
test   %eax,%eax
je     11e8 <main+0x58>
mov    %rbx,%rdi
call   1090 <lines_init@plt>
mov    %rax,%rdi
call   1030 <grid_init@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <empty_grid_check@plt>
test   %eax,%eax
je     11e8 <main+0x58>
mov    %rbx,%rdi
call   1040 <enough_entries@plt>
test   %eax,%eax
je     11e8 <main+0x58>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1080 <rec_solver@plt>
mov    %rbx,%rdi
call   10b0 <printer@plt>
mov    %rbx,%rdi
call   1060 <free_grid_mem@plt>
jmp    11f4 <main+0x64>
lea    0xe11(%rip),%rdi
call   10a0 <ft_putstr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Erreur\0A\00"
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
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @check_params(i32 %8, i8** %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %35
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = call i8** @lines_init(i8** %15)
store i8** %16, i8*** %6
%17 = load i8**, i8*** %6
%18 = call i32** @grid_init(i8** %17)
store i32** %18, i32*** %7
%19 = load i32**, i32*** %7
%20 = call i32 @empty_grid_check(i32** %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %14
%23 = load i32**, i32*** %7
%24 = call i32 @enough_entries(i32** %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22, %14
%27 = call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %35
28: ; preds = %22
%29 = load i32**, i32*** %7
%30 = call i32 @rec_solver(i32** %29, i32 0, i32 0, i32 0)
%31 = load i32**, i32*** %7
%32 = call i32 @printer(i32** %31)
%33 = load i32**, i32*** %7
%34 = call i32 @free_grid_mem(i32** %33)
store i32 0, i32* %3
br label %35
35: ; preds = %28, %26, %12
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [8 x i8] c"Erreur\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @check_params(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %21
7: ; preds = %2
%8 = tail call i8** @lines_init(i8** %1)
%9 = tail call i32** @grid_init(i8** %8)
%10 = tail call i32 @empty_grid_check(i32** %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = tail call i32 @enough_entries(i32** %9)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12, %7
%16 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %21
17: ; preds = %12
%18 = tail call i32 @rec_solver(i32** %9, i32 0, i32 0, i32 0)
%19 = tail call i32 @printer(i32** %9)
%20 = tail call i32 @free_grid_mem(i32** %9)
br label %21
21: ; preds = %17, %15, %5
ret i32 0
}