#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;
int EXIT_SUCCESS;
int ft_putnbrl(int const);
int ft_putnbr2(const int *nbr2, const size_t size) {
  size_t i;
  int ret;
  i = 0;
  ret = EXIT_SUCCESS;
  while (i < size)
    ret = ft_putnbrl(nbr2[i++]) == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putnbr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    118e <ft_putnbr2+0x7e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    (%rax,%rcx,4),%edi
call   1030 <ft_putnbrl@plt>
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%eax
jne    1177 <ft_putnbr2+0x67>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1183 <ft_putnbr2+0x73>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1134 <ft_putnbr2+0x24>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2eb6(%rip),%r15
mov    (%r15),%r14d
test   %rsi,%rsi
je     115d <ft_putnbr2+0x4d>
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %ebp,%ebp
mov    0x2ea7(%rip),%r13
jmp    1145 <ft_putnbr2+0x35>
nopl   0x0(%rax,%rax,1)
cmp    %rbp,%rbx
je     115d <ft_putnbr2+0x4d>
mov    (%r12,%rbp,4),%edi
add    $0x1,%rbp
call   1030 <ft_putnbrl@plt>
cmp    (%r15),%eax
je     1140 <ft_putnbr2+0x30>
mov    0x0(%r13),%r14d
jmp    1140 <ft_putnbr2+0x30>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putnbr2(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i64 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %15, %5 ], [ %3, %2 ]
%7 = phi i64 [ %8, %5 ], [ 0, %2 ]
%8 = add nuw i64 %7, 1
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = tail call i32 @ft_putnbrl(i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
%13 = icmp eq i32 %11, %12
%14 = load i32, i32* @EXIT_FAILURE
%15 = select i1 %13, i32 %6, i32 %14
%16 = icmp eq i64 %8, %1
br i1 %16, label %17, label %5
17: ; preds = %5, %2
%18 = phi i32 [ %3, %2 ], [ %15, %5 ]
ret i32 %18
}