void affichage(int grille[9][9]) {
  for (int i = 0; i < 9; i++) {
    for (int j = 0; j < 9; j++) {
      char someStuffToWrite[40];
      int formatedStuff;
      formatedStuff = sprintf(someStuffToWrite, ((j + 1) % 3) ? "%d " : "%d|",
                              grille[i][j]);
      writeThat(someStuffToWrite);
    }
    writeThat("\n");
    if (!((i + 1) % 3)) {
      writeThat("------------------");
      writeThat((char[]){'\n', '\0'});
    }
  }
  writeThat("\n\n");
  writeThat((char[]){'\0'});
}


x86 assembly (clang, -O0):
<affichage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1207 <affichage+0xe7>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    11ae <affichage+0x8e>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
lea    0xe9d(%rip),%rsi
lea    0xe92(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rsi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <affichage+0x24>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11f4 <affichage+0xd4>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
movb   $0xa,-0x46(%rbp)
movb   $0x0,-0x45(%rbp)
lea    -0x46(%rbp),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
jmp    11f9 <affichage+0xd9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <affichage+0x13>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
movb   $0x0,-0x47(%rbp)
lea    -0x47(%rbp),%rdi
mov    $0x0,%al
call   1030 <writeThat@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affichage>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r15
mov    $0x20,%ebp
mov    $0xffffffff,%r13d
mov    $0x1,%r12d
lea    0x10(%rsp),%rbx
jmp    1169 <affichage+0x49>
nopl   0x0(%rax)
add    $0x24,%rbp
add    $0xffffffff,%r13d
add    $0x1,%r12d
cmp    $0x164,%rbp
je     12cd <affichage+0x1ad>
mov    %r12d,%eax
mov    $0xaaaaaaab,%ecx
imul   %rcx,%rax
shr    $0x21,%rax
lea    (%rax,%rax,2),%eax
mov    %eax,0xc(%rsp)
mov    -0x20(%r15,%rbp,1),%edx
mov    %rbx,%rdi
lea    0xe71(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x1c(%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x18(%r15,%rbp,1),%edx
mov    %rbx,%rdi
lea    0xe36(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x14(%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x10(%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0xc(%r15,%rbp,1),%edx
mov    %rbx,%rdi
lea    0xdde(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x8(%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    -0x4(%r15,%rbp,1),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
mov    (%r15,%rbp,1),%edx
mov    %rbx,%rdi
lea    0xd87(%rip),%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
lea    0xd87(%rip),%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
add    %r13d,0xc(%rsp)
jne    1150 <affichage+0x30>
lea    0xd5a(%rip),%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
movw   $0xa,0xa(%rsp)
lea    0xa(%rsp),%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
jmp    1150 <affichage+0x30>
lea    0xd47(%rip),%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
movb   $0x0,0x9(%rsp)
lea    0x9(%rsp),%rdi
xor    %eax,%eax
call   1030 <writeThat@plt>
add    $0x38,%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 = [4 x i8] c"%d|\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [19 x i8] c"------------------\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define void @affichage([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [40 x i8]
%6 = alloca i32
%7 = alloca [2 x i8]
%8 = alloca [1 x i8]
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
br label %9
9: ; preds = %51, %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %54
12: ; preds = %9
store i32 0, i32* %4
br label %13
13: ; preds = %35, %12
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 9
br i1 %15, label %16, label %38
16: ; preds = %13
%17 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = srem i32 %19, 3
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%24 = load [9 x i32]*, [9 x i32]** %2
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [9 x i32], [9 x i32]* %24, i64 %26
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [9 x i32], [9 x i32]* %27, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* %23, i32 %31)
store i32 %32, i32* %6
%33 = getelementptr inbounds [40 x i8], [40 x i8]* %5, i64 0, i64 0
%34 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* %33)
br label %35
35: ; preds = %16
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %13
38: ; preds = %13
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
%42 = srem i32 %41, 3
%43 = icmp ne i32 %42, 0
br i1 %43, label %50, label %44
44: ; preds = %38
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%46 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 10, i8* %46
%47 = getelementptr inbounds i8, i8* %46, i64 1
store i8 0, i8* %47
%48 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%49 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* %48)
br label %50
50: ; preds = %44, %38
br label %51
51: ; preds = %50
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %9
54: ; preds = %9
%55 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%56 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
store i8 0, i8* %56
%57 = getelementptr inbounds [1 x i8], [1 x i8]* %8, i64 0, i64 0
%58 = call i32 (i8*, ...) bitcast (i32 (...)* @writeThat to i32 (i8*, ...)*)(i8* %57)
ret void
}

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