#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*/ putchar(char);
void output(char grid[9][9][10]) {
  char i, j;
  for (i = 0; i < 9; ++i) {
    for (j = 0; j < 9; ++j)
      putchar('0' + grid[i][j][0]);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
jge    118c <output+0x7c>
movb   $0x0,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x9,%eax
jge    1175 <output+0x65>
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rcx
imul   $0x5a,%rcx,%rcx
add    %rcx,%rax
movsbq -0xa(%rbp),%rcx
imul   $0xa,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1131 <output+0x21>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1120 <output+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0xa(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x14(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1e(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x28(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x32(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x3c(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x46(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x50(%r14,%rbx,1),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x5a,%rbx
cmp    $0x32a,%rbx
jne    1120 <output+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @output([9 x [10 x i8]]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %41, %2 ]
%4 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = add i8 %5, 48
%7 = tail call i32 @putchar(i8 signext %6)
%8 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 1, i64 0
%9 = load i8, i8* %8
%10 = add i8 %9, 48
%11 = tail call i32 @putchar(i8 signext %10)
%12 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 2, i64 0
%13 = load i8, i8* %12
%14 = add i8 %13, 48
%15 = tail call i32 @putchar(i8 signext %14)
%16 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 3, i64 0
%17 = load i8, i8* %16
%18 = add i8 %17, 48
%19 = tail call i32 @putchar(i8 signext %18)
%20 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 4, i64 0
%21 = load i8, i8* %20
%22 = add i8 %21, 48
%23 = tail call i32 @putchar(i8 signext %22)
%24 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 5, i64 0
%25 = load i8, i8* %24
%26 = add i8 %25, 48
%27 = tail call i32 @putchar(i8 signext %26)
%28 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 6, i64 0
%29 = load i8, i8* %28
%30 = add i8 %29, 48
%31 = tail call i32 @putchar(i8 signext %30)
%32 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 7, i64 0
%33 = load i8, i8* %32
%34 = add i8 %33, 48
%35 = tail call i32 @putchar(i8 signext %34)
%36 = getelementptr inbounds [9 x [10 x i8]], [9 x [10 x i8]]* %0, i64 %3, i64 8, i64 0
%37 = load i8, i8* %36
%38 = add i8 %37, 48
%39 = tail call i32 @putchar(i8 signext %38)
%40 = tail call i32 @putchar(i8 signext 10)
%41 = add nuw nsw i64 %3, 1
%42 = icmp eq i64 %41, 9
br i1 %42, label %43, label %2
43: ; preds = %2
ret void
}