#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_printf(char *, ...);
void show_grid(int sudoku[9][9]) {
  int h;
  int v;
  int column;
  int x;
  column = 2;
  x = 2;
  v = 0;
  ft_printf("\n");
  while (v < 9) {
    h = 0;
    while (h < 9) {
      ft_printf("%i ", sudoku[v][h]);
      if (!column--) {
        column = 2;
        ft_printf("  ");
      }
      h++;
    }
    ft_printf("\n");
    if (!x--) {
      x = 2;
      ft_printf("\n");
    }
    v++;
  }
  ft_printf("#####################\n");
}


x86 assembly (clang, -O0):
<show_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
cmpl   $0x9,-0x10(%rbp)
jge    11fa <show_grid+0xea>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11b5 <show_grid+0xa5>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jne    11a7 <show_grid+0x97>
movl   $0x2,-0x14(%rbp)
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <show_grid+0x40>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jne    11ec <show_grid+0xdc>
movl   $0x2,-0x18(%rbp)
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <show_grid+0x2f>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <ft_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r13
lea    0xef7(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    $0x2,%ebp
mov    $0x20,%ebx
lea    0xec0(%rip),%r15
lea    0xebd(%rip),%r12
jmp    1161 <show_grid+0x51>
nopl   0x0(%rax)
add    $0x24,%rbx
cmp    $0x164,%rbx
je     122d <show_grid+0x11d>
mov    -0x20(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x1c(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x18(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x14(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x10(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0xc(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x8(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    -0x4(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    0x0(%r13,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
sub    $0x1,%ebp
jae    1150 <show_grid+0x40>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <ft_printf@plt>
mov    $0x2,%ebp
jmp    1150 <show_grid+0x40>
lea    0xdd3(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ft_printf@plt>

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

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