#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*/ guess(char ***);
int /*<<< orphan*/ initialize(char ***);
int /*<<< orphan*/ input(char ***, char *);
int /*<<< orphan*/ output(char ***);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ solve(char ***);
scalar_t__ solved(char ***);
int strlen(char *);
int main(int argc, char **argv) {
  if ((argc != 2) || (strlen(argv[1]) != 81)) {
    printf("[USAGE] %s [INT[81]]\n", argv[0]);
    return -1;
  }
  char grid[9][9][10];
  initialize(grid);
  input(grid, argv[1]);
  solve(grid);
  if (solved(grid))
    output(grid);
  else
    guess(grid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11b9 <main+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <strlen@plt>
cmp    $0x51,%eax
je     11d8 <main+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe39(%rip),%rdi
call   1080 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    123e <main+0xbe>
lea    -0x340(%rbp),%rdi
call   1090 <initialize@plt>
lea    -0x340(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <input@plt>
lea    -0x340(%rbp),%rdi
call   1030 <solve@plt>
lea    -0x340(%rbp),%rdi
call   1050 <solved@plt>
cmp    $0x0,%rax
je     122b <main+0xab>
lea    -0x340(%rbp),%rdi
call   1060 <output@plt>
jmp    1237 <main+0xb7>
lea    -0x340(%rbp),%rdi
call   10a0 <guess@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x338,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    11d6 <main+0x56>
mov    0x8(%rbx),%rdi
call   1070 <strlen@plt>
cmp    $0x51,%eax
jne    11d6 <main+0x56>
mov    %rsp,%r14
mov    %r14,%rdi
call   1090 <initialize@plt>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   1040 <input@plt>
mov    %r14,%rdi
call   1030 <solve@plt>
mov    %r14,%rdi
call   1050 <solved@plt>
mov    %rsp,%rdi
test   %rax,%rax
je     11ec <main+0x6c>
call   1060 <output@plt>
jmp    11f1 <main+0x71>
mov    (%rbx),%rsi
lea    0xe20(%rip),%rdi
call   1080 <printf@plt>
mov    $0xffffffff,%eax
jmp    11f3 <main+0x73>
call   10a0 <guess@plt>
xor    %eax,%eax
add    $0x338,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"[USAGE] %s [INT[81]]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x [9 x [10 x i8]]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @strlen(i8* %12)
%14 = icmp ne i32 %13, 81
br i1 %14, label %15, label %20
15: ; preds = %9, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 -1, i32* %3
br label %46
20: ; preds = %9
%21 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%22 = bitcast [9 x [10 x i8]]* %21 to i8***
%23 = call i32 @initialize(i8*** %22)
%24 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%25 = bitcast [9 x [10 x i8]]* %24 to i8***
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @input(i8*** %25, i8* %28)
%30 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%31 = bitcast [9 x [10 x i8]]* %30 to i8***
%32 = call i32 @solve(i8*** %31)
%33 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%34 = bitcast [9 x [10 x i8]]* %33 to i8***
%35 = call i64 @solved(i8*** %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %20
%38 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%39 = bitcast [9 x [10 x i8]]* %38 to i8***
%40 = call i32 @output(i8*** %39)
br label %45
41: ; preds = %20
%42 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %6, i64 0, i64 0
%43 = bitcast [9 x [10 x i8]]* %42 to i8***
%44 = call i32 @guess(i8*** %43)
br label %45
45: ; preds = %41, %37
store i32 0, i32* %3
br label %46
46: ; preds = %45, %15
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
@.str = [22 x i8] c"[USAGE] %s [INT[81]]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [9 x [9 x [10 x i8]]]
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @strlen(i8* %7)
%9 = icmp eq i32 %8, 81
br i1 %9, label %13, label %10
10: ; preds = %5, %2
%11 = load i8*, i8** %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %27
13: ; preds = %5
%14 = getelementptr inbounds [9 x [9 x [10 x i8]]], [9 x [9 x [10 x i8]]]* %3, i64 0, i64 0, i64 0, i64 0
%15 = bitcast [9 x [9 x [10 x i8]]]* %3 to i8***
%16 = call i32 @initialize(i8*** %15)
%17 = load i8*, i8** %6
%18 = call i32 @input(i8*** %15, i8* %17)
%19 = call i32 @solve(i8*** %15)
%20 = call i64 @solved(i8*** %15)
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %13
%23 = call i32 @output(i8*** %15)
br label %26
24: ; preds = %13
%25 = call i32 @guess(i8*** %15)
br label %26
26: ; preds = %24, %22
br label %27
27: ; preds = %26, %10
%28 = phi i32 [ -1, %10 ], [ 0, %26 ]
ret i32 %28
}