#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 digitToTry(int);
int getDigit(int);
scalar_t__ isInBox(int **, int, int);
scalar_t__ isInCol(int **, int, int);
scalar_t__ isInRow(int **, int, int);
int /*<<< orphan*/ printf(char *, int);
int rand();
void commitSepuku(int tab[9][9]) {
  int iter = 0;
  int i = 0;
  int tries[9][9];
  for (int j = 0; j < 9 * 9; j++)
    tries[j / 9][j % 9] = 0;
  while (i < 9 * 9) {
    iter++;
    int z = getDigit(rand());
    if (tab[i / 9][i % 9] != 0) {
      z = getDigit(tab[i / 9][i % 9] + 1);
      tab[i / 9][i % 9] = 0;
    }
    while ((tries[i / 9][i % 9] ^ 0x1ff)) {
      if (!((tries[i / 9][i % 9] & digitToTry(z)) || isInCol(tab, i % 9, z) ||
            isInRow(tab, i / 9, z) ||
            isInBox(tab, 3 * (i / 27) + ((i % 9) / 3), z))) {
        tab[i / 9][i % 9] = z;
        tries[i / 9][i % 9] |= digitToTry(z);
        break;
      }
      tries[i / 9][i % 9] |= digitToTry(z);
      z = (z + 1) % 9 + 1;
    }
    if (tab[i / 9][i % 9] != 0) {
      i++;
      continue;
    }
    tab[i / 9][i % 9] = 0;
    tries[i / 9][i % 9] = 0;
    i--;
  }
  printf("solved in %d iterations\n", iter);
}


x86 assembly (clang, -O0):
<commitSepuku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x164(%rbp)
cmpl   $0x51,-0x164(%rbp)
jge    11fd <commitSepuku+0x8d>
mov    -0x164(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x170(%rbp)
mov    -0x164(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x170(%rbp),%rax
movslq %edx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1197 <commitSepuku+0x27>
jmp    1202 <commitSepuku+0x92>
cmpl   $0x51,-0x10(%rbp)
jge    1675 <commitSepuku+0x505>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    %eax,%edi
call   1070 <getDigit@plt>
mov    %eax,-0x168(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x180(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x180(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x178(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x178(%rbp),%rax
movslq %edx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     131a <commitSepuku+0x1aa>
mov    -0x8(%rbp),%rax
mov    %rax,-0x1a0(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1a0(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x198(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x198(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%edi
add    $0x1,%edi
call   1070 <getDigit@plt>
mov    %eax,-0x168(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x190(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x190(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x188(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x188(%rbp),%rax
movslq %edx,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    131f <commitSepuku+0x1af>
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1a8(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
xor    $0x1ff,%eax
cmp    $0x0,%eax
je     157f <commitSepuku+0x40f>
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1b8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1b8(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1ac(%rbp)
mov    -0x168(%rbp),%edi
call   1030 <digitToTry@plt>
mov    %eax,%ecx
mov    -0x1ac(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
jne    1509 <commitSepuku+0x399>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
mov    -0x168(%rbp),%edx
call   1060 <isInCol@plt>
cmp    $0x0,%rax
jne    1509 <commitSepuku+0x399>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x168(%rbp),%edx
call   1040 <isInRow@plt>
cmp    $0x0,%rax
jne    1509 <commitSepuku+0x399>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%esi
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0x168(%rbp),%edx
call   1080 <isInBox@plt>
cmp    $0x0,%rax
jne    1509 <commitSepuku+0x399>
mov    -0x168(%rbp),%eax
mov    %eax,-0x1cc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x1e0(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1e0(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1d8(%rbp),%rax
mov    %edx,%ecx
mov    -0x1cc(%rbp),%edx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x168(%rbp),%edi
call   1030 <digitToTry@plt>
mov    %eax,-0x1bc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1c8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1c8(%rbp),%rax
mov    %edx,%ecx
mov    -0x1bc(%rbp),%edx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    157f <commitSepuku+0x40f>
mov    -0x168(%rbp),%edi
call   1030 <digitToTry@plt>
mov    %eax,-0x1e4(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1f0(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1f0(%rbp),%rax
mov    %edx,%ecx
mov    -0x1e4(%rbp),%edx
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x168(%rbp)
jmp    131f <commitSepuku+0x1af>
mov    -0x8(%rbp),%rax
mov    %rax,-0x200(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x200(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x1f8(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x1f8(%rbp),%rax
movslq %edx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     15dc <commitSepuku+0x46c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1202 <commitSepuku+0x92>
mov    -0x8(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x218(%rbp),%rax
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x210(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x210(%rbp),%rax
movslq %edx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x208(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    -0x208(%rbp),%rax
movslq %edx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1202 <commitSepuku+0x92>
mov    -0xc(%rbp),%esi
lea    0x981(%rip),%rdi
call   1050 <printf@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commitSepuku>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x178,%rsp
mov    %rdi,%r13
lea    0x30(%rsp),%rdi
mov    $0x144,%edx
xor    %esi,%esi
call   1070 <memset@plt>
xor    %ebp,%ebp
xor    %esi,%esi
mov    %r13,0x28(%rsp)
jmp    11be <commitSepuku+0x3e>
add    $0x1,%esi
add    %eax,%ebp
cmp    $0x51,%ebp
jge    1396 <commitSepuku+0x216>
mov    %esi,0xc(%rsp)
xor    %eax,%eax
call   10a0 <rand@plt>
mov    %eax,%edi
call   1080 <getDigit@plt>
mov    %eax,%ebx
mov    %r13,%rdx
movslq %ebp,%r13
imul   $0x38e38e39,%r13,%r12
mov    %r12,%rax
shr    $0x3f,%rax
sar    $0x21,%r12
add    %eax,%r12d
movslq %r12d,%rax
lea    (%rax,%rax,8),%ecx
mov    %r13d,%r15d
sub    %ecx,%r15d
movslq %r15d,%rcx
lea    (%rax,%rax,8),%r14
lea    (%rdx,%r14,4),%rax
lea    (%rax,%rcx,4),%rdx
mov    (%rax,%rcx,4),%edi
test   %edi,%edi
mov    %ebp,0x8(%rsp)
je     122f <commitSepuku+0xaf>
add    $0x1,%edi
mov    %rdx,%rbx
mov    %rcx,%rbp
call   1080 <getDigit@plt>
mov    %rbp,%rcx
mov    %rbx,%rdx
mov    %eax,%ebx
movl   $0x0,(%rdx)
lea    (%rsp,%r14,4),%rdi
add    $0x30,%rdi
mov    (%rdi,%rcx,4),%r14d
mov    $0x1ff,%eax
cmp    $0x1ff,%r14d
jne    1260 <commitSepuku+0xe0>
mov    0x28(%rsp),%r13
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ebp
jmp    136c <commitSepuku+0x1ec>
nopl   0x0(%rax,%rax,1)
mov    %rdi,0x10(%rsp)
mov    %rdx,0x20(%rsp)
imul   $0x4bda12f7,%r13,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
mov    %rcx,0x18(%rsp)
movsbl %cl,%ecx
imul   $0x56,%ecx,%ecx
movzwl %cx,%ecx
mov    %ecx,%edx
shr    $0xf,%edx
shr    $0x8,%ecx
add    %dl,%cl
movsbl %cl,%ebp
add    %eax,%ebp
mov    0x28(%rsp),%r13
jmp    12e6 <commitSepuku+0x166>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <digitToTry@plt>
or     %eax,%r14d
lea    0x1(%rbx),%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
neg    %eax
add    %eax,%ebx
add    $0x2,%ebx
cmp    $0x1ff,%r14d
je     1350 <commitSepuku+0x1d0>
mov    %ebx,%edi
call   1030 <digitToTry@plt>
test   %r14d,%eax
jne    12b0 <commitSepuku+0x130>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1060 <isInCol@plt>
test   %rax,%rax
jne    12b0 <commitSepuku+0x130>
mov    %r13,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
call   1040 <isInRow@plt>
test   %rax,%rax
jne    12b0 <commitSepuku+0x130>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1090 <isInBox@plt>
test   %rax,%rax
jne    12b0 <commitSepuku+0x130>
mov    0x20(%rsp),%rbp
mov    %ebx,0x0(%rbp)
mov    %ebx,%edi
call   1030 <digitToTry@plt>
mov    %rbp,%rdx
or     %r14d,%eax
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ebp
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rdi
jmp    136c <commitSepuku+0x1ec>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ebp
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%rdi
mov    $0x1ff,%eax
lea    (%rdi,%rcx,4),%rcx
mov    %eax,(%rcx)
mov    $0x1,%eax
cmpl   $0x0,(%rdx)
jne    11b0 <commitSepuku+0x30>
movl   $0x0,(%rdx)
movl   $0x0,(%rcx)
mov    $0xffffffff,%eax
jmp    11b0 <commitSepuku+0x30>
lea    0xc63(%rip),%rdi
add    $0x178,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"solved in %d iterations\0A\00"
define void @commitSepuku([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [9 x [9 x i32]]
%6 = alloca i32
%7 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %6
br label %8
8: ; preds = %20, %1
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 81
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 9
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %14
%16 = load i32, i32* %6
%17 = srem i32 %16, 9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %15, i64 0, i64 %18
store i32 0, i32* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %8
23: ; preds = %8
br label %24
24: ; preds = %176, %173, %23
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 81
br i1 %26, label %27, label %196
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = call i32 (...) @rand()
%31 = call i32 @getDigit(i32 %30)
store i32 %31, i32* %7
%32 = load [9 x i32]*, [9 x i32]** %2
%33 = load i32, i32* %4
%34 = sdiv i32 %33, 9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [9 x i32], [9 x i32]* %32, i64 %35
%37 = load i32, i32* %4
%38 = srem i32 %37, 9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %36, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %65
43: ; preds = %27
%44 = load [9 x i32]*, [9 x i32]** %2
%45 = load i32, i32* %4
%46 = sdiv i32 %45, 9
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [9 x i32], [9 x i32]* %44, i64 %47
%49 = load i32, i32* %4
%50 = srem i32 %49, 9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [9 x i32], [9 x i32]* %48, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = add nsw i32 %53, 1
%55 = call i32 @getDigit(i32 %54)
store i32 %55, i32* %7
%56 = load [9 x i32]*, [9 x i32]** %2
%57 = load i32, i32* %4
%58 = sdiv i32 %57, 9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [9 x i32], [9 x i32]* %56, i64 %59
%61 = load i32, i32* %4
%62 = srem i32 %61, 9
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [9 x i32], [9 x i32]* %60, i64 0, i64 %63
store i32 0, i32* %64
br label %65
65: ; preds = %43, %27
br label %66
66: ; preds = %144, %65
%67 = load i32, i32* %4
%68 = sdiv i32 %67, 9
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %69
%71 = load i32, i32* %4
%72 = srem i32 %71, 9
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [9 x i32], [9 x i32]* %70, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = xor i32 %75, 511
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %161
78: ; preds = %66
%79 = load i32, i32* %4
%80 = sdiv i32 %79, 9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %81
%83 = load i32, i32* %4
%84 = srem i32 %83, 9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [9 x i32], [9 x i32]* %82, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = load i32, i32* %7
%89 = call i32 @digitToTry(i32 %88)
%90 = and i32 %87, %89
%91 = icmp ne i32 %90, 0
br i1 %91, label %144, label %92
92: ; preds = %78
%93 = load [9 x i32]*, [9 x i32]** %2
%94 = bitcast [9 x i32]* %93 to i32**
%95 = load i32, i32* %4
%96 = srem i32 %95, 9
%97 = load i32, i32* %7
%98 = call i64 @isInCol(i32** %94, i32 %96, i32 %97)
%99 = icmp ne i64 %98, 0
br i1 %99, label %144, label %100
100: ; preds = %92
%101 = load [9 x i32]*, [9 x i32]** %2
%102 = bitcast [9 x i32]* %101 to i32**
%103 = load i32, i32* %4
%104 = sdiv i32 %103, 9
%105 = load i32, i32* %7
%106 = call i64 @isInRow(i32** %102, i32 %104, i32 %105)
%107 = icmp ne i64 %106, 0
br i1 %107, label %144, label %108
108: ; preds = %100
%109 = load [9 x i32]*, [9 x i32]** %2
%110 = bitcast [9 x i32]* %109 to i32**
%111 = load i32, i32* %4
%112 = sdiv i32 %111, 27
%113 = mul nsw i32 3, %112
%114 = load i32, i32* %4
%115 = srem i32 %114, 9
%116 = sdiv i32 %115, 3
%117 = add nsw i32 %113, %116
%118 = load i32, i32* %7
%119 = call i64 @isInBox(i32** %110, i32 %117, i32 %118)
%120 = icmp ne i64 %119, 0
br i1 %120, label %144, label %121
121: ; preds = %108
%122 = load i32, i32* %7
%123 = load [9 x i32]*, [9 x i32]** %2
%124 = load i32, i32* %4
%125 = sdiv i32 %124, 9
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [9 x i32], [9 x i32]* %123, i64 %126
%128 = load i32, i32* %4
%129 = srem i32 %128, 9
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [9 x i32], [9 x i32]* %127, i64 0, i64 %130
store i32 %122, i32* %131
%132 = load i32, i32* %7
%133 = call i32 @digitToTry(i32 %132)
%134 = load i32, i32* %4
%135 = sdiv i32 %134, 9
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %136
%138 = load i32, i32* %4
%139 = srem i32 %138, 9
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [9 x i32], [9 x i32]* %137, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = or i32 %142, %133
store i32 %143, i32* %141
br label %161
144: ; preds = %108, %100, %92, %78
%145 = load i32, i32* %7
%146 = call i32 @digitToTry(i32 %145)
%147 = load i32, i32* %4
%148 = sdiv i32 %147, 9
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %149
%151 = load i32, i32* %4
%152 = srem i32 %151, 9
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [9 x i32], [9 x i32]* %150, i64 0, i64 %153
%155 = load i32, i32* %154
%156 = or i32 %155, %146
store i32 %156, i32* %154
%157 = load i32, i32* %7
%158 = add nsw i32 %157, 1
%159 = srem i32 %158, 9
%160 = add nsw i32 %159, 1
store i32 %160, i32* %7
br label %66
161: ; preds = %121, %66
%162 = load [9 x i32]*, [9 x i32]** %2
%163 = load i32, i32* %4
%164 = sdiv i32 %163, 9
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [9 x i32], [9 x i32]* %162, i64 %165
%167 = load i32, i32* %4
%168 = srem i32 %167, 9
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [9 x i32], [9 x i32]* %166, i64 0, i64 %169
%171 = load i32, i32* %170
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %176
173: ; preds = %161
%174 = load i32, i32* %4
%175 = add nsw i32 %174, 1
store i32 %175, i32* %4
br label %24
176: ; preds = %161
%177 = load [9 x i32]*, [9 x i32]** %2
%178 = load i32, i32* %4
%179 = sdiv i32 %178, 9
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [9 x i32], [9 x i32]* %177, i64 %180
%182 = load i32, i32* %4
%183 = srem i32 %182, 9
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds [9 x i32], [9 x i32]* %181, i64 0, i64 %184
store i32 0, i32* %185
%186 = load i32, i32* %4
%187 = sdiv i32 %186, 9
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %5, i64 0, i64 %188
%190 = load i32, i32* %4
%191 = srem i32 %190, 9
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [9 x i32], [9 x i32]* %189, i64 0, i64 %192
store i32 0, i32* %193
%194 = load i32, i32* %4
%195 = add nsw i32 %194, -1
store i32 %195, i32* %4
br label %24
196: ; preds = %24
%197 = load i32, i32* %3
%198 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %197)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"solved in %d iterations\0A\00"
define void @commitSepuku([9 x i32]* %0) {
%2 = alloca [9 x [9 x i32]]
%3 = bitcast [9 x [9 x i32]]* %2 to i8*
%4 = bitcast [9 x i32]* %0 to i32**
br label %5
5: ; preds = %1, %63
%6 = phi i32 [ 0, %1 ], [ %65, %63 ]
%7 = phi i32 [ 0, %1 ], [ %8, %63 ]
%8 = add nuw nsw i32 %7, 1
%9 = tail call i32 (...) @rand()
%10 = tail call i32 @getDigit(i32 %9)
%11 = sdiv i32 %6, 9
%12 = sext i32 %11 to i64
%13 = srem i32 %6, 9
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %5
%19 = add nsw i32 %16, 1
%20 = tail call i32 @getDigit(i32 %19)
store i32 0, i32* %15
br label %21
21: ; preds = %18, %5
%22 = phi i32 [ %20, %18 ], [ %10, %5 ]
%23 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %2, i64 0, i64 %12, i64 %14
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 511
br i1 %25, label %58, label %26
26: ; preds = %21
%27 = sdiv i32 %6, 27
%28 = mul nsw i32 %27, 3
%29 = trunc i32 %13 to i8
%30 = sdiv i8 %29, 3
%31 = sext i8 %30 to i32
%32 = add nsw i32 %28, %31
br label %33
33: ; preds = %26, %51
%34 = phi i32 [ %22, %26 ], [ %56, %51 ]
%35 = phi i32 [ %24, %26 ], [ %53, %51 ]
%36 = tail call i32 @digitToTry(i32 %34)
%37 = and i32 %36, %35
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %51
39: ; preds = %33
%40 = tail call i64 @isInCol(i32** %4, i32 %13, i32 %34)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = tail call i64 @isInRow(i32** %4, i32 %11, i32 %34)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %42
%46 = tail call i64 @isInBox(i32** %4, i32 %32, i32 %34)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
store i32 %34, i32* %15
%49 = tail call i32 @digitToTry(i32 %34)
%50 = or i32 %49, %35
br label %58
51: ; preds = %45, %42, %39, %33
%52 = tail call i32 @digitToTry(i32 %34)
%53 = or i32 %52, %35
%54 = add nsw i32 %34, 1
%55 = srem i32 %54, 9
%56 = add nsw i32 %55, 1
%57 = icmp eq i32 %53, 511
br i1 %57, label %58, label %33
58: ; preds = %51, %21, %48
%59 = phi i32 [ %50, %48 ], [ 511, %21 ], [ 511, %51 ]
store i32 %59, i32* %23
%60 = load i32, i32* %15
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %58
store i32 0, i32* %15
store i32 0, i32* %23
br label %63
63: ; preds = %58, %62
%64 = phi i32 [ -1, %62 ], [ 1, %58 ]
%65 = add nsw i32 %6, %64
%66 = icmp slt i32 %65, 81
br i1 %66, label %5, label %67
67: ; preds = %63
%68 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}