#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 ft_atoi(char *);
int /*<<< orphan*/ ft_check_digit(char **);
int /*<<< orphan*/ ft_putendl_fd(char *, int);
int ft_error_map(char **av) {
  int line;
  int column;
  if (!ft_check_digit(av)) {
    ft_putendl_fd("\033[31mInvalid arguments\033[0m", 2);
    return (0);
  }
  line = ft_atoi(av[1]);
  column = ft_atoi(av[2]);
  if (line < 6 || column < 7) {
    ft_putendl_fd("\033[31mInvalid arguments\033[0m", 2);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<ft_error_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_check_digit@plt>
cmp    $0x0,%eax
jne    116b <ft_error_map+0x3b>
lea    0xeab(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c3 <ft_error_map+0x93>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <ft_atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <ft_atoi@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x6,-0x14(%rbp)
jl     119f <ft_error_map+0x6f>
cmpl   $0x7,-0x18(%rbp)
jge    11bc <ft_error_map+0x8c>
lea    0xe5a(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c3 <ft_error_map+0x93>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_error_map>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <ft_check_digit@plt>
test   %eax,%eax
je     1164 <ft_error_map+0x34>
mov    0x8(%rbx),%rdi
call   1050 <ft_atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <ft_atoi@plt>
cmp    $0x6,%ebp
jl     1164 <ft_error_map+0x34>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x6,%ecx
jg     1177 <ft_error_map+0x47>
lea    0xe95(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\1B[31mInvalid arguments\1B[0m\00"
define i32 @ft_error_map(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = call i32 @ft_check_digit(i8** %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @ft_putendl_fd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 0, i32* %2
br label %28
11: ; preds = %1
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @ft_atoi(i8* %14)
store i32 %15, i32* %4
%16 = load i8**, i8*** %3
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @ft_atoi(i8* %18)
store i32 %19, i32* %5
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 6
br i1 %21, label %25, label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 7
br i1 %24, label %25, label %27
25: ; preds = %22, %11
%26 = call i32 @ft_putendl_fd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 0, i32* %2
br label %28
27: ; preds = %22
store i32 1, i32* %2
br label %28
28: ; preds = %27, %25, %9
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@.str = [27 x i8] c"\1B[31mInvalid arguments\1B[0m\00"
define i32 @ft_error_map(i8** %0) {
%2 = tail call i32 @ft_check_digit(i8** %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_atoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %0, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @ft_atoi(i8* %9)
%11 = icmp slt i32 %7, 6
%12 = icmp slt i32 %10, 7
%13 = select i1 %11, i1 true, i1 %12
br i1 %13, label %14, label %16
14: ; preds = %4, %1
%15 = tail call i32 @ft_putendl_fd(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2)
br label %16
16: ; preds = %14, %4
%17 = phi i32 [ 1, %4 ], [ 0, %14 ]
ret i32 %17
}