#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__ _solve(char **, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int solve(char board[9][11]) {
  if (_solve(board, 0, 0)) {
    printf("cant be solved\n");
    return -1;
  }
  return 100 * (board[0][0] - '0') + 10 * (board[0][1] - '0') + board[0][2] -
         '0';
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <_solve@plt>
cmp    $0x0,%rax
je     115b <solve+0x3b>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <solve+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0x64,%eax,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
sub    $0x30,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <_solve@plt>
test   %rax,%rax
je     1145 <solve+0x25>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
movsbl (%rbx),%eax
imul   $0x64,%eax,%eax
movsbl 0x1(%rbx),%ecx
lea    (%rcx,%rcx,4),%ecx
movsbl 0x2(%rbx),%edx
lea    (%rax,%rcx,2),%eax
add    %edx,%eax
add    $0xffffeb30,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"cant be solved\0A\00"
define i32 @solve([11 x i8]* %0) {
%2 = alloca i32
%3 = alloca [11 x i8]*
store [11 x i8]* %0, [11 x i8]** %3
%4 = load [11 x i8]*, [11 x i8]** %3
%5 = bitcast [11 x i8]* %4 to i8**
%6 = call i64 @_solve(i8** %5, i32 0, i32 0)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %33
10: ; preds = %1
%11 = load [11 x i8]*, [11 x i8]** %3
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %11, i64 0
%13 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
%17 = mul nsw i32 100, %16
%18 = load [11 x i8]*, [11 x i8]** %3
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %18, i64 0
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 0, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 48
%24 = mul nsw i32 10, %23
%25 = add nsw i32 %17, %24
%26 = load [11 x i8]*, [11 x i8]** %3
%27 = getelementptr inbounds [11 x i8], [11 x i8]* %26, i64 0
%28 = getelementptr inbounds [11 x i8], [11 x i8]* %27, i64 0, i64 2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = add nsw i32 %25, %30
%32 = sub nsw i32 %31, 48
store i32 %32, i32* %2
br label %33
33: ; preds = %10, %8
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
@str = [15 x i8] c"cant be solved\00"
define i32 @solve([11 x i8]* %0) {
%2 = bitcast [11 x i8]* %0 to i8**
%3 = tail call i64 @_solve(i8** %2, i32 0, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %22
7: ; preds = %1
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = mul nsw i32 %10, 100
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 0, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = mul nsw i32 %14, 10
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %0, i64 0, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = add nsw i32 %11, -5328
%20 = add nsw i32 %19, %15
%21 = add nsw i32 %20, %18
br label %22
22: ; preds = %7, %5
%23 = phi i32 [ -1, %5 ], [ %21, %7 ]
ret i32 %23
}