#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 */
scalar_t__ emptyCell(int **, int *, int *);
scalar_t__ isPermissible(int **, int, int, int);
int solveSuduko(int board[9][9]) {
  int row, col;
  if (emptyCell(board, &row, &col)) {
    int numb;
    for (numb = 1; numb <= 9; numb++) {
      if (isPermissible(board, numb, row, col)) {
        board[row][col] = numb;
        if (solveSuduko(board)) {
          return 1;
        }
        board[row][col] = 0;
      }
    }
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<solveSuduko>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <emptyCell@plt>
cmp    $0x0,%rax
je     11f4 <solveSuduko+0xc4>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jg     11e8 <solveSuduko+0xb8>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <isPermissible@plt>
cmp    $0x0,%rax
je     11d5 <solveSuduko+0xa5>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rdi
call   1040 <solveSuduko@plt>
cmp    $0x0,%eax
je     11bb <solveSuduko+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    11fb <solveSuduko+0xcb>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    11da <solveSuduko+0xaa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115e <solveSuduko+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    11fb <solveSuduko+0xcb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveSuduko>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <emptyCell@plt>
test   %rax,%rax
je     11a8 <solveSuduko+0x78>
mov    $0x1,%ebp
jmp    1158 <solveSuduko+0x28>
nop
add    $0x1,%ebp
cmp    $0xa,%ebp
je     11af <solveSuduko+0x7f>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <isPermissible@plt>
test   %rax,%rax
je     1150 <solveSuduko+0x20>
movslq 0x4(%rsp),%rax
movslq (%rsp),%rcx
lea    (%rax,%rax,8),%rax
lea    (%rbx,%rax,4),%rax
mov    %ebp,(%rax,%rcx,4)
mov    %rbx,%rdi
call   1040 <solveSuduko@plt>
test   %eax,%eax
jne    11a8 <solveSuduko+0x78>
movslq 0x4(%rsp),%rax
movslq (%rsp),%rcx
lea    (%rax,%rax,8),%rax
lea    (%rbx,%rax,4),%rax
movl   $0x0,(%rax,%rcx,4)
jmp    1150 <solveSuduko+0x20>
mov    $0x1,%eax
jmp    11b1 <solveSuduko+0x81>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solveSuduko([9 x i32]* %0) {
%2 = alloca i32
%3 = alloca [9 x i32]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [9 x i32]* %0, [9 x i32]** %3
%7 = load [9 x i32]*, [9 x i32]** %3
%8 = bitcast [9 x i32]* %7 to i32**
%9 = call i64 @emptyCell(i32** %8, i32* %4, i32* %5)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %49
11: ; preds = %1
store i32 1, i32* %6
br label %12
12: ; preds = %45, %11
%13 = load i32, i32* %6
%14 = icmp sle i32 %13, 9
br i1 %14, label %15, label %48
15: ; preds = %12
%16 = load [9 x i32]*, [9 x i32]** %3
%17 = bitcast [9 x i32]* %16 to i32**
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i64 @isPermissible(i32** %17, i32 %18, i32 %19, i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %44
23: ; preds = %15
%24 = load i32, i32* %6
%25 = load [9 x i32]*, [9 x i32]** %3
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %25, i64 %27
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %28, i64 0, i64 %30
store i32 %24, i32* %31
%32 = load [9 x i32]*, [9 x i32]** %3
%33 = call i32 @solveSuduko([9 x i32]* %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %23
store i32 1, i32* %2
br label %50
36: ; preds = %23
%37 = load [9 x i32]*, [9 x i32]** %3
%38 = load i32, i32* %4
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %37, i64 %39
%41 = load i32, i32* %5
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [9 x i32], [9 x i32]* %40, i64 0, i64 %42
store i32 0, i32* %43
br label %44
44: ; preds = %36, %15
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %12
48: ; preds = %12
store i32 0, i32* %2
br label %50
49: ; preds = %1
store i32 1, i32* %2
br label %50
50: ; preds = %49, %48, %35
%51 = load i32, i32* %2
ret i32 %51
}

LLVM IR (-O2):
define i32 @solveSuduko([9 x i32]* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast [9 x i32]* %0 to i32**
%7 = call i64 @emptyCell(i32** %6, i32* %2, i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %32, label %9
9: ; preds = %1, %29
%10 = phi i32 [ %30, %29 ], [ 1, %1 ]
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i64 @isPermissible(i32** %6, i32 %10, i32 %11, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %29, label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %17, i64 %19
store i32 %10, i32* %20
%21 = call i32 @solveSuduko([9 x i32]* %0)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %25, i64 %27
store i32 0, i32* %28
br label %29
29: ; preds = %9, %23
%30 = add nuw nsw i32 %10, 1
%31 = icmp eq i32 %30, 10
br i1 %31, label %32, label %9
32: ; preds = %15, %29, %1
%33 = phi i32 [ 1, %1 ], [ 0, %29 ], [ 1, %15 ]
ret i32 %33
}