#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 printSudoku(int S[][9]) {
  int i, j;
  for (i = 0; i < 9; ++i) {
    if (i == 3 || i == 6)
      printf("- - - + - - - + - - -\n");
    for (j = 0; j < 9; ++j) {
      if (j == 3 || j == 6)
        printf("| ");
      if (S[i][j] == 0)
        printf("  ");
      else
        printf("%d ", S[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printSudoku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1205 <printSudoku+0xf5>
cmpl   $0x3,-0xc(%rbp)
je     1141 <printSudoku+0x31>
cmpl   $0x6,-0xc(%rbp)
jne    114f <printSudoku+0x3f>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    11e9 <printSudoku+0xd9>
cmpl   $0x3,-0x10(%rbp)
je     1174 <printSudoku+0x64>
cmpl   $0x6,-0x10(%rbp)
jne    1182 <printSudoku+0x72>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11b2 <printSudoku+0xa2>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <printSudoku+0xc6>
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    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <printSudoku+0xcb>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <printSudoku+0x46>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printSudoku+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSudoku>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x20,%rbx
lea    0xec1(%rip),%r14
lea    0xeb3(%rip),%r15
lea    0xea9(%rip),%r12
lea    0xea8(%rip),%r13
xor    %ebp,%ebp
jmp    1196 <printSudoku+0x66>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0x24,%rbx
cmp    $0x9,%rbp
je     12e3 <printSudoku+0x1b3>
cmp    $0x6,%ebp
je     11a0 <printSudoku+0x70>
cmp    $0x3,%ebp
jne    11a8 <printSudoku+0x78>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    -0x20(%rbx),%esi
test   %esi,%esi
je     11c0 <printSudoku+0x90>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11ca <printSudoku+0x9a>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x1c(%rbx),%esi
test   %esi,%esi
je     11e0 <printSudoku+0xb0>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11ea <printSudoku+0xba>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x18(%rbx),%esi
test   %esi,%esi
je     1200 <printSudoku+0xd0>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    120a <printSudoku+0xda>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x14(%rbx),%esi
test   %esi,%esi
je     1230 <printSudoku+0x100>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    123a <printSudoku+0x10a>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x10(%rbx),%esi
test   %esi,%esi
je     1250 <printSudoku+0x120>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    125a <printSudoku+0x12a>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0xc(%rbx),%esi
test   %esi,%esi
je     1270 <printSudoku+0x140>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    127a <printSudoku+0x14a>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x8(%rbx),%esi
test   %esi,%esi
je     12a0 <printSudoku+0x170>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12aa <printSudoku+0x17a>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x4(%rbx),%esi
test   %esi,%esi
je     12c0 <printSudoku+0x190>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12ca <printSudoku+0x19a>
nopl   (%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
test   %esi,%esi
je     1170 <printSudoku+0x40>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    117a <printSudoku+0x4a>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"| \00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [4 x i8] c"%d \00"
@str = [22 x i8] c"- - - + - - - + - - -\00"
define void @printSudoku([9 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %81
%3 = phi i64 [ 0, %1 ], [ %83, %81 ]
%4 = trunc i64 %3 to i32
switch i32 %4, label %7 [
i32 6, label %5
i32 3, label %5
]
5: ; preds = %2, %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %15
15: ; preds = %13, %11
%16 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 1
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %17)
br label %23
21: ; preds = %15
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %19, %21
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 2
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %31
29: ; preds = %23
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%33 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 3
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %31
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %40
38: ; preds = %31
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %36, %38
%41 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 4
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %40
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %42)
br label %48
46: ; preds = %40
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %44, %46
%49 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 5
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 0
br i1 %51, label %54, label %52
52: ; preds = %48
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %50)
br label %56
54: ; preds = %48
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %56
56: ; preds = %54, %52
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%58 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 6
%59 = load i32, i32* %58
%60 = icmp eq i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %56
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %59)
br label %65
63: ; preds = %56
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %61, %63
%66 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 7
%67 = load i32, i32* %66
%68 = icmp eq i32 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %65
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %67)
br label %73
71: ; preds = %65
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %69, %71
%74 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 8
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %73
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %75)
br label %81
79: ; preds = %73
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %81
81: ; preds = %79, %77
%82 = tail call i32 @putchar(i32 10)
%83 = add nuw nsw i64 %3, 1
%84 = icmp eq i64 %83, 9
br i1 %84, label %85, label %2
85: ; preds = %81
ret void
}