#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 EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
scalar_t__ ft_putchar_fd(char, int);
int ft_putnbr_base_fd(unsigned long long, unsigned int, unsigned int, int);
int ft_putnbr_basel_fd(unsigned long long int n, unsigned int base,
                       unsigned int pad, int fd) {
  int ret;
  ret = ft_putnbr_base_fd(n, base, pad, fd);
  ret = ft_putchar_fd('\n', fd) == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putnbr_basel_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <ft_putnbr_base_fd@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    $0xa,%edi
call   1040 <ft_putchar_fd@plt>
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
jne    1172 <ft_putnbr_basel_fd+0x52>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    117e <ft_putnbr_basel_fd+0x5e>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_basel_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
call   1030 <ft_putnbr_base_fd@plt>
mov    %eax,%ebx
mov    $0xa,%edi
mov    %ebp,%esi
call   1040 <ft_putchar_fd@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     114d <ft_putnbr_basel_fd+0x2d>
mov    0x2e95(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbr_basel_fd(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @ft_putnbr_base_fd(i64 %10, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %8
%16 = call i64 @ft_putchar_fd(i8 signext 10, i32 %15)
%17 = load i64, i64* @EXIT_SUCCESS
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %4
%20 = load i32, i32* %9
br label %23
21: ; preds = %4
%22 = load i32, i32* @EXIT_FAILURE
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %9
%25 = load i32, i32* %9
ret i32 %25
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbr_basel_fd(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @ft_putnbr_base_fd(i64 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i64 @ft_putchar_fd(i8 signext 10, i32 %3)
%7 = load i64, i64* @EXIT_SUCCESS
%8 = icmp eq i64 %6, %7
%9 = load i32, i32* @EXIT_FAILURE
%10 = select i1 %8, i32 %5, i32 %9
ret i32 %10
}