#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*/ printf(char *, ...);
void Print(int a[9][9]) {
  for (int i = 0; i < 9; i++) {
    for (int j = 0; j < 9; j++) {
      printf("%d ", a[i][j]);
      if ((j + 1) % 3 == 0)
        printf(" ");
      if ((j + 1) % 9 == 0)
        printf("\n");
    }
    if ((i + 1) % 3 == 0)
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11f7 <Print+0xe7>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    11bf <Print+0xaf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1187 <Print+0x77>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ac <Print+0x9c>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b1 <Print+0xa1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <Print+0x24>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e4 <Print+0xd4>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <Print+0xd9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <Print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xecb(%rip),%r14
xor    %ebx,%ebx
jmp    1167 <Print+0x47>
nopl   0x0(%rax)
mov    (%rsp),%rbx
add    $0x1,%rbx
imul   $0xaaaaaaab,%ebx,%eax
cmp    $0x55555556,%eax
jb     11f0 <Print+0xd0>
add    $0x24,%r12
cmp    $0x9,%rbx
je     11ff <Print+0xdf>
mov    %rbx,(%rsp)
mov    $0x1,%bpl
xor    %ebx,%ebx
jmp    118d <Print+0x6d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%bpl
mov    %r13,%rbx
cmp    $0x9,%r13
je     1140 <Print+0x20>
movzbl %bpl,%eax
imul   $0x39,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,8),%r13d
add    $0xff,%r13b
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%r15d
add    $0xff,%r15b
mov    (%r12,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %bl,%r15b
jne    11cd <Print+0xad>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl %r13b,%eax
lea    0x1(%rbx),%r13
cmp    %bl,%al
jne    1180 <Print+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1180 <Print+0x60>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1159 <Print+0x39>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Print([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %47, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 9
br i1 %7, label %8, label %50
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %36, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %39
12: ; preds = %9
%13 = load [9 x i32]*, [9 x i32]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [9 x i32], [9 x i32]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %16, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
%24 = srem i32 %23, 3
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %12
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %12
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
%31 = srem i32 %30, 9
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33, %28
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %9
39: ; preds = %9
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
%42 = srem i32 %41, 3
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %46
46: ; preds = %44, %39
br label %47
47: ; preds = %46
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 1
store i32 %49, i32* %3
br label %5
50: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @Print([9 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %30
%3 = phi i64 [ 0, %1 ], [ %6, %30 ]
br label %10
4: ; preds = %30
ret void
5: ; preds = %26
%6 = add nuw nsw i64 %3, 1
%7 = trunc i64 %6 to i32
%8 = urem i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %28, label %30
10: ; preds = %2, %26
%11 = phi i64 [ 0, %2 ], [ %15, %26 ]
%12 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 %11
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %11, 1
%16 = trunc i64 %15 to i8
%17 = urem i8 %16, 3
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = tail call i32 @putchar(i32 32)
br label %21
21: ; preds = %19, %10
%22 = urem i8 %16, 9
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @putchar(i32 10)
br label %26
26: ; preds = %21, %24
%27 = icmp eq i64 %15, 9
br i1 %27, label %5, label %10
28: ; preds = %5
%29 = tail call i32 @putchar(i32 10)
br label %30
30: ; preds = %5, %28
%31 = icmp eq i64 %6, 9
br i1 %31, label %4, label %2
}