#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*/ ft_putchar(char);
scalar_t__ solve_sudoku(char **);
scalar_t__ valid_strings(char **);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  int i;
  i = 0;
  if (argc == 10 && valid_strings(argv)) {
    if (solve_sudoku(argv + 1)) {
      while (i < 9) {
        write(1, argv[i + 1], 9);
        ft_putchar('\n');
        i++;
      }
      return (0);
    }
  }
  write(1, "Error", 5);
  write(1, "\n", 1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    11e9 <main+0xa9>
mov    -0x10(%rbp),%rdi
call   1060 <valid_strings@plt>
cmp    $0x0,%rax
je     11e9 <main+0xa9>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <solve_sudoku@plt>
cmp    $0x0,%rax
je     11e4 <main+0xa4>
jmp    1196 <main+0x56>
cmpl   $0x9,-0x14(%rbp)
jge    11d8 <main+0x98>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <main+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1219 <main+0xd9>
jmp    11e9 <main+0xa9>
mov    $0x1,%edi
lea    0xe0b(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xdfb(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0xa,%edi
jne    1277 <main+0x137>
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1060 <valid_strings@plt>
test   %rax,%rax
je     1277 <main+0x137>
lea    0x8(%rbx),%rdi
call   1040 <solve_sudoku@plt>
test   %rax,%rax
je     1277 <main+0x137>
mov    0x8(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x10(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x18(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x20(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x28(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x30(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x38(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x40(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
mov    0x48(%rbx),%rsi
mov    $0x1,%edi
mov    $0x9,%edx
call   1030 <write@plt>
mov    $0xa,%edi
call   1050 <ft_putchar@plt>
jmp    12a3 <main+0x163>
lea    0xd82(%rip),%rsi
mov    $0x1,%edi
mov    $0x5,%edx
call   1030 <write@plt>
lea    0xd72(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Error\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %35
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = call i64 @valid_strings(i8** %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %35
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = call i64 @solve_sudoku(i8** %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %34
18: ; preds = %13
br label %19
19: ; preds = %22, %18
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 9
br i1 %21, label %22, label %33
22: ; preds = %19
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %23, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @write(i32 1, i8* %28, i32 9)
%30 = call i32 @ft_putchar(i8 signext 10)
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %19
33: ; preds = %19
store i32 0, i32* %3
br label %38
34: ; preds = %13
br label %35
35: ; preds = %34, %9, %2
%36 = call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%37 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i32 0, i32* %3
br label %38
38: ; preds = %35, %33
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 10
br i1 %3, label %4, label %47
4: ; preds = %2
%5 = tail call i64 @valid_strings(i8** %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %47, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = tail call i64 @solve_sudoku(i8** %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %47, label %11
11: ; preds = %7
%12 = load i8*, i8** %8
%13 = tail call i32 @write(i32 1, i8* %12, i32 9)
%14 = tail call i32 @ft_putchar(i8 signext 10)
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @write(i32 1, i8* %16, i32 9)
%18 = tail call i32 @ft_putchar(i8 signext 10)
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = tail call i32 @write(i32 1, i8* %20, i32 9)
%22 = tail call i32 @ft_putchar(i8 signext 10)
%23 = getelementptr inbounds i8*, i8** %1, i64 4
%24 = load i8*, i8** %23
%25 = tail call i32 @write(i32 1, i8* %24, i32 9)
%26 = tail call i32 @ft_putchar(i8 signext 10)
%27 = getelementptr inbounds i8*, i8** %1, i64 5
%28 = load i8*, i8** %27
%29 = tail call i32 @write(i32 1, i8* %28, i32 9)
%30 = tail call i32 @ft_putchar(i8 signext 10)
%31 = getelementptr inbounds i8*, i8** %1, i64 6
%32 = load i8*, i8** %31
%33 = tail call i32 @write(i32 1, i8* %32, i32 9)
%34 = tail call i32 @ft_putchar(i8 signext 10)
%35 = getelementptr inbounds i8*, i8** %1, i64 7
%36 = load i8*, i8** %35
%37 = tail call i32 @write(i32 1, i8* %36, i32 9)
%38 = tail call i32 @ft_putchar(i8 signext 10)
%39 = getelementptr inbounds i8*, i8** %1, i64 8
%40 = load i8*, i8** %39
%41 = tail call i32 @write(i32 1, i8* %40, i32 9)
%42 = tail call i32 @ft_putchar(i8 signext 10)
%43 = getelementptr inbounds i8*, i8** %1, i64 9
%44 = load i8*, i8** %43
%45 = tail call i32 @write(i32 1, i8* %44, i32 9)
%46 = tail call i32 @ft_putchar(i8 signext 10)
br label %50
47: ; preds = %7, %4, %2
%48 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%49 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %50
50: ; preds = %11, %47
ret i32 0
}