#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 */
scalar_t__ ft_isspace(char const);
const char *ft_atoi_init(const char *nptr, int *neg) {
  while (ft_isspace(*nptr))
    nptr++;
  if (*nptr == '-' || *nptr == '+') {
    *neg = ((*nptr == '-') ? 1 : 0);
    nptr++;
  }
  return (nptr);
}


x86 assembly (clang, -O0):
<ft_atoi_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_isspace@plt>
cmp    $0x0,%rax
je     1147 <ft_atoi_init+0x37>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <ft_atoi_init+0x10>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1167 <ft_atoi_init+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    118d <ft_atoi_init+0x7d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x2d,%edx
cmove  %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_atoi_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <ft_isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <ft_atoi_init+0x10>
mov    -0x1(%rbx),%al
cmp    $0x2b,%al
je     113c <ft_atoi_init+0x2c>
cmp    $0x2d,%al
jne    1148 <ft_atoi_init+0x38>
xor    %ecx,%ecx
cmp    $0x2d,%al
sete   %cl
mov    %ecx,(%r14)
jmp    114c <ft_atoi_init+0x3c>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_atoi_init(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @ft_isspace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 45
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 43
br i1 %22, label %23, label %33
23: ; preds = %18, %13
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 1, i32 0
%30 = load i32*, i32** %4
store i32 %29, i32* %30
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %33
33: ; preds = %23, %18
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
define i8* @ft_atoi_init(i8* %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = load i8, i8* %4
%6 = tail call i64 @ft_isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = load i8, i8* %4
switch i8 %10, label %14 [
i8 45, label %11
i8 43, label %11
]
11: ; preds = %9, %9
%12 = icmp eq i8 %10, 45
%13 = zext i1 %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %9, %11
%15 = phi i8* [ %8, %11 ], [ %4, %9 ]
ret i8* %15
}