// File: /workspace/github_c_makefile_star2_O0/ffoissey[P]push_swap_42/srcs_checker/ft_tool2.c
// Function: ft_atol
long	ft_atol(const char *str)
{
	long	nbr;
	size_t	i;

	nbr = 0;
	i = 0;
	while (*str == ' ' || (*str >= 9 && *str <= 13))
		str++;
	if (*str == '-' || *str == '+')
		i++;
	while (str[i] >= '0' && str[i] <= '9')
	{
		if ((str[0] == '-' && i == 19 && str[i] >= '8')
			|| (str[0] == '-' && i > 19 && ft_isdigit(*(str + i))))
			return (0);
		if (((i == 19 && str[0] == '+') || (i == 18 && str[0] != '-'))
			&& str[i] >= '7')
			return (-1);
		if (((i > 19 && str[0] == '+') || (i > 18 && str[0] != '-'))
			&& ft_isdigit(*(str + i)))
			return (-1);
		nbr = str[i++] - '0' + nbr * 10;
	}
	return (str[0] == '-' ? -nbr : nbr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x21(%rbp)
je 0x2024
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x9, %ecx
movb %al, -0x22(%rbp)
jl 0x201e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
setle %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x202d
jmp 0x203b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1fec
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x2053
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x205f
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2061
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x23(%rbp)
jl 0x208c
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
testb $0x1, %al
jne 0x2098
jmp 0x21a9
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x20bc
cmpq $0x13, -0x20(%rbp)
jne 0x20bc
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x38, %eax
jge 0x20e5
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x20f2
cmpq $0x13, -0x20(%rbp)
jbe 0x20f2
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x2ae0
cmpl $0x0, %eax
je 0x20f2
movq $0x0, -0x8(%rbp)
jmp 0x21d1
cmpq $0x13, -0x20(%rbp)
jne 0x2105
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x2118
cmpq $0x12, -0x20(%rbp)
jne 0x2136
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x2136
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x37, %eax
jl 0x2136
movq $-0x1, -0x8(%rbp)
jmp 0x21d1
cmpq $0x13, -0x20(%rbp)
jbe 0x2149
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
je 0x215c
cmpq $0x12, -0x20(%rbp)
jbe 0x217c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x217c
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x2ae0
cmpl $0x0, %eax
je 0x217c
movq $-0x1, -0x8(%rbp)
jmp 0x21d1
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
cltq
imulq $0xa, -0x18(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x2061
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x21c1
xorl %eax, %eax
subq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x21c9
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)