#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*/ ft_putchar(int);
void ft_putnbr(int i) {
  if (i == -2147483648) {
    ft_putchar('-');
    ft_putchar('2');
    ft_putchar('1');
    ft_putchar('4');
    ft_putchar('7');
    ft_putchar('4');
    ft_putchar('8');
    ft_putchar('3');
    ft_putchar('6');
    ft_putchar('4');
    ft_putchar('8');
    return;
  }
  if (i < 0) {
    i = -i;
    ft_putchar('-');
  }
  if (i >= 10)
    ft_putnbr(i / 10);
  ft_putchar(i % 10 + '0');
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0xffffffff80000000,%rax
jne    11ae <ft_putnbr+0x8e>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
jmp    11fb <ft_putnbr+0xdb>
cmpl   $0x0,-0x4(%rbp)
jge    11ca <ft_putnbr+0xaa>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
cmpl   $0xa,-0x4(%rbp)
jl     11e6 <ft_putnbr+0xc6>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %r14
push   %rbx
push   %rax
cmp    $0x80000000,%edi
jne    1197 <ft_putnbr+0x77>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%ebx
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
jmp    11da <ft_putnbr+0xba>
mov    %edi,%ebx
test   %edi,%edi
jns    11a9 <ft_putnbr+0x89>
neg    %ebx
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     11c3 <ft_putnbr+0xa3>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <ft_putnbr@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp eq i64 %4, -2147483648
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = call i32 @ft_putchar(i32 45)
%8 = call i32 @ft_putchar(i32 50)
%9 = call i32 @ft_putchar(i32 49)
%10 = call i32 @ft_putchar(i32 52)
%11 = call i32 @ft_putchar(i32 55)
%12 = call i32 @ft_putchar(i32 52)
%13 = call i32 @ft_putchar(i32 56)
%14 = call i32 @ft_putchar(i32 51)
%15 = call i32 @ft_putchar(i32 54)
%16 = call i32 @ft_putchar(i32 52)
%17 = call i32 @ft_putchar(i32 56)
br label %36
18: ; preds = %1
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %2
%23 = sub nsw i32 0, %22
store i32 %23, i32* %2
%24 = call i32 @ft_putchar(i32 45)
br label %25
25: ; preds = %21, %18
%26 = load i32, i32* %2
%27 = icmp sge i32 %26, 10
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i32, i32* %2
%30 = sdiv i32 %29, 10
br label %31
31: ; preds = %28, %25
%32 = load i32, i32* %2
%33 = srem i32 %32, 10
%34 = add nsw i32 %33, 48
%35 = call i32 @ft_putchar(i32 %34)
br label %36
36: ; preds = %31, %6
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = tail call i32 @ft_putchar(i32 45)
%5 = tail call i32 @ft_putchar(i32 50)
%6 = tail call i32 @ft_putchar(i32 49)
%7 = tail call i32 @ft_putchar(i32 52)
%8 = tail call i32 @ft_putchar(i32 55)
%9 = tail call i32 @ft_putchar(i32 52)
%10 = tail call i32 @ft_putchar(i32 56)
%11 = tail call i32 @ft_putchar(i32 51)
%12 = tail call i32 @ft_putchar(i32 54)
%13 = tail call i32 @ft_putchar(i32 52)
br label %27
14: ; preds = %1
%15 = icmp slt i32 %0, 0
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = sub nsw i32 0, %0
%18 = tail call i32 @ft_putchar(i32 45)
br label %19
19: ; preds = %16, %14
%20 = phi i32 [ %17, %16 ], [ %0, %14 ]
%21 = icmp ugt i32 %20, 9
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = udiv i32 %20, 10
tail call void @ft_putnbr(i32 %23)
br label %24
24: ; preds = %22, %19
%25 = urem i32 %20, 10
%26 = or i32 %25, 48
br label %27
27: ; preds = %24, %3
%28 = phi i32 [ %26, %24 ], [ 56, %3 ]
%29 = tail call i32 @ft_putchar(i32 %28)
ret void
}