#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*/ print_cell(unsigned int, unsigned int);
int /*<<< orphan*/ puts(char *);
void print(void) {
  unsigned row, col;
  for (row = 0; row < 9; ++row) {
    for (col = 0; col < 9; ++col) {
      print_cell(row, col);
    }
    puts("\033[0m");
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jae    117d <print+0x5d>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jae    1163 <print+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <print_cell@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <print+0x20>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <print+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
xor    %esi,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x3,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x4,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x5,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x6,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x7,%esi
call   1040 <print_cell@plt>
mov    %ebx,%edi
mov    $0x8,%esi
call   1040 <print_cell@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
cmp    $0x9,%ebx
jne    1130 <print+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
define void @print() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 9
br i1 %5, label %6, label %22
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp ult i32 %8, 9
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @print_cell(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
%18 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %1
%21 = add i32 %20, 1
store i32 %21, i32* %1
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @print() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %13, %1 ]
%3 = tail call i32 @print_cell(i32 %2, i32 0)
%4 = tail call i32 @print_cell(i32 %2, i32 1)
%5 = tail call i32 @print_cell(i32 %2, i32 2)
%6 = tail call i32 @print_cell(i32 %2, i32 3)
%7 = tail call i32 @print_cell(i32 %2, i32 4)
%8 = tail call i32 @print_cell(i32 %2, i32 5)
%9 = tail call i32 @print_cell(i32 %2, i32 6)
%10 = tail call i32 @print_cell(i32 %2, i32 7)
%11 = tail call i32 @print_cell(i32 %2, i32 8)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = add nuw nsw i32 %2, 1
%14 = icmp eq i32 %13, 9
br i1 %14, label %15, label %1
15: ; preds = %1
ret void
}