#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 */
char charfromint(int);
int /*<<< orphan*/ ft_putchar(char);
void printer(int **grid) {
  int i;
  int j;
  i = -1;
  while (++i < 9) {
    j = -1;
    while (++j < 9) {
      ft_putchar(charfromint(grid[i][j]));
      ft_putchar(' ');
    }
    ft_putchar('\n');
  }
}


x86 assembly (clang, -O0):
<printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x9,%eax
jge    119c <printer+0x7c>
movl   $0xffffffff,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x9,%eax
jge    118d <printer+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
jmp    114c <printer+0x2c>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
jmp    1133 <printer+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rax
mov    (%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x4(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x8(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0xc(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x10(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x14(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x18(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x1c(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    (%r14,%rbx,8),%rax
mov    0x20(%rax),%edi
call   1030 <charfromint@plt>
movsbl %al,%edi
call   1040 <ft_putchar@plt>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
add    $0x1,%rbx
cmp    $0x9,%rbx
jne    1130 <printer+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @printer(i32** nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %59, %2 ]
%4 = getelementptr inbounds i32*, i32** %0, i64 %3
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = tail call signext i8 @charfromint(i32 %6)
%8 = tail call i32 @ft_putchar(i8 signext %7)
%9 = tail call i32 @ft_putchar(i8 signext 32)
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = tail call signext i8 @charfromint(i32 %12)
%14 = tail call i32 @ft_putchar(i8 signext %13)
%15 = tail call i32 @ft_putchar(i8 signext 32)
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = tail call signext i8 @charfromint(i32 %18)
%20 = tail call i32 @ft_putchar(i8 signext %19)
%21 = tail call i32 @ft_putchar(i8 signext 32)
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = tail call signext i8 @charfromint(i32 %24)
%26 = tail call i32 @ft_putchar(i8 signext %25)
%27 = tail call i32 @ft_putchar(i8 signext 32)
%28 = load i32*, i32** %4
%29 = getelementptr inbounds i32, i32* %28, i64 4
%30 = load i32, i32* %29
%31 = tail call signext i8 @charfromint(i32 %30)
%32 = tail call i32 @ft_putchar(i8 signext %31)
%33 = tail call i32 @ft_putchar(i8 signext 32)
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 5
%36 = load i32, i32* %35
%37 = tail call signext i8 @charfromint(i32 %36)
%38 = tail call i32 @ft_putchar(i8 signext %37)
%39 = tail call i32 @ft_putchar(i8 signext 32)
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 6
%42 = load i32, i32* %41
%43 = tail call signext i8 @charfromint(i32 %42)
%44 = tail call i32 @ft_putchar(i8 signext %43)
%45 = tail call i32 @ft_putchar(i8 signext 32)
%46 = load i32*, i32** %4
%47 = getelementptr inbounds i32, i32* %46, i64 7
%48 = load i32, i32* %47
%49 = tail call signext i8 @charfromint(i32 %48)
%50 = tail call i32 @ft_putchar(i8 signext %49)
%51 = tail call i32 @ft_putchar(i8 signext 32)
%52 = load i32*, i32** %4
%53 = getelementptr inbounds i32, i32* %52, i64 8
%54 = load i32, i32* %53
%55 = tail call signext i8 @charfromint(i32 %54)
%56 = tail call i32 @ft_putchar(i8 signext %55)
%57 = tail call i32 @ft_putchar(i8 signext 32)
%58 = tail call i32 @ft_putchar(i8 signext 10)
%59 = add nuw nsw i64 %3, 1
%60 = icmp eq i64 %59, 9
br i1 %60, label %61, label %2
61: ; preds = %2
ret void
}