#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(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_put_int_arr(int **arr, int length, int height) {
  int x;
  int y;
  y = 0;
  x = 0;
  while (y < height) {
    ft_putnbr(arr[y][x]);
    if (x > length - 2) {
      ft_putchar('\n');
      y++;
      x = 0;
    } else
      x++;
  }
}


x86 assembly (clang, -O0):
<ft_put_int_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a2 <ft_put_int_arr+0x82>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <ft_putnbr@plt>
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jle    1194 <ft_put_int_arr+0x74>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    119d <ft_put_int_arr+0x7d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <ft_put_int_arr+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_put_int_arr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1185 <ft_put_int_arr+0x65>
mov    %edx,%r15d
mov    %esi,%r12d
mov    %rdi,%r14
add    $0xfffffffe,%r12d
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    1159 <ft_put_int_arr+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
cmp    %r15d,%ebx
jge    1185 <ft_put_int_arr+0x65>
movslq %ebx,%rax
mov    (%r14,%rax,8),%rax
movslq %r13d,%rbp
mov    (%rax,%rbp,4),%edi
call   1040 <ft_putnbr@plt>
cmp    %r12d,%ebp
jle    1150 <ft_put_int_arr+0x30>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x1,%ebx
xor    %r13d,%r13d
cmp    %r15d,%ebx
jl     1159 <ft_put_int_arr+0x39>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_put_int_arr(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
store i32 0, i32* %7
br label %9
9: ; preds = %35, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %36
13: ; preds = %9
%14 = load i32**, i32*** %4
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32*, i32** %14, i64 %16
%18 = load i32*, i32** %17
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = call i32 @ft_putnbr(i32 %22)
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = sub nsw i32 %25, 2
%27 = icmp sgt i32 %24, %26
br i1 %27, label %28, label %32
28: ; preds = %13
%29 = call i32 @ft_putchar(i8 signext 10)
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
store i32 0, i32* %7
br label %35
32: ; preds = %13
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %35
35: ; preds = %32, %28
br label %9
36: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @ft_put_int_arr(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %27
5: ; preds = %3
%6 = add nsw i32 %1, -2
br label %7
7: ; preds = %5, %23
%8 = phi i32 [ 0, %5 ], [ %25, %23 ]
%9 = phi i32 [ 0, %5 ], [ %24, %23 ]
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i32*, i32** %0, i64 %10
%12 = load i32*, i32** %11
%13 = sext i32 %9 to i64
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = tail call i32 @ft_putnbr(i32 %15)
%17 = icmp sgt i32 %9, %6
br i1 %17, label %18, label %21
18: ; preds = %7
%19 = tail call i32 @ft_putchar(i8 signext 10)
%20 = add nsw i32 %8, 1
br label %23
21: ; preds = %7
%22 = add nsw i32 %9, 1
br label %23
23: ; preds = %21, %18
%24 = phi i32 [ 0, %18 ], [ %22, %21 ]
%25 = phi i32 [ %20, %18 ], [ %8, %21 ]
%26 = icmp slt i32 %25, %2
br i1 %26, label %7, label %27
27: ; preds = %23, %3
ret void
}