#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__ isValidSudoku(char **, int, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *board[9] = {"....5..1.", ".4.3.....", ".....3..1",
                    "8......2.", "..2.7....", ".15......",
                    ".....2...", ".2.9.....", "..4......"};
  char *board2[9] = {
      ".87654321", "2........", "3........", "4........", "5........",
      "6........", "7........", "8........", "9........",
  };
  if (isValidSudoku(board, 9, 9)) {
    printf("true\n");
  } else {
    printf("false\n");
  }
  if (isValidSudoku(board2, 9, 9)) {
    printf("true\n");
  } else {
    printf("false\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2c33(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0x2c6b(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1030 <isValidSudoku@plt>
cmp    $0x0,%rax
je     119a <main+0x6a>
lea    0xf24(%rip),%rdi
call   1040 <printf@plt>
jmp    11a6 <main+0x76>
lea    0xf19(%rip),%rdi
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x9,%edx
mov    %edx,%esi
call   1030 <isValidSudoku@plt>
cmp    $0x0,%rax
je     11d4 <main+0xa4>
lea    0xeea(%rip),%rdi
call   1040 <printf@plt>
jmp    11e0 <main+0xb0>
lea    0xedf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    0x2c8f(%rip),%rax
mov    %rax,0x90(%rsp)
movaps 0x2c70(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2c51(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0x2c35(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2c19(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
mov    0x2c9d(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0x2c81(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2c65(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c49(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c2d(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x50(%rsp),%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1040 <isValidSudoku@plt>
test   %rax,%rax
lea    0xeef(%rip),%r14
lea    0xeee(%rip),%rbx
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x9,%esi
mov    $0x9,%edx
call   1040 <isValidSudoku@plt>
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"....5..1.\00"
@.str.1 = [10 x i8] c".4.3.....\00"
@.str.2 = [10 x i8] c".....3..1\00"
@.str.3 = [10 x i8] c"8......2.\00"
@.str.4 = [10 x i8] c"..2.7....\00"
@.str.5 = [10 x i8] c".15......\00"
@.str.6 = [10 x i8] c".....2...\00"
@.str.7 = [10 x i8] c".2.9.....\00"
@.str.8 = [10 x i8] c"..4......\00"
@__const.main.board = [9 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [10 x i8] c".87654321\00"
@.str.10 = [10 x i8] c"2........\00"
@.str.11 = [10 x i8] c"3........\00"
@.str.12 = [10 x i8] c"4........\00"
@.str.13 = [10 x i8] c"5........\00"
@.str.14 = [10 x i8] c"6........\00"
@.str.15 = [10 x i8] c"7........\00"
@.str.16 = [10 x i8] c"8........\00"
@.str.17 = [10 x i8] c"9........\00"
@__const.main.board2 = [9 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i32 0, i32 0)]
@.str.18 = [6 x i8] c"true\0A\00"
@.str.19 = [7 x i8] c"false\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8*]
%3 = alloca [9 x i8*]
store i32 0, i32* %1
%4 = bitcast [9 x i8*]* %2 to i8*
%5 = bitcast [9 x i8*]* %3 to i8*
%6 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 0
%7 = call i64 @isValidSudoku(i8** %6, i32 9, i32 9)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 0
%15 = call i64 @isValidSudoku(i8** %14, i32 9, i32 9)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
br label %21
19: ; preds = %13
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"....5..1.\00"
@.str.1 = [10 x i8] c".4.3.....\00"
@.str.2 = [10 x i8] c".....3..1\00"
@.str.3 = [10 x i8] c"8......2.\00"
@.str.4 = [10 x i8] c"..2.7....\00"
@.str.5 = [10 x i8] c".15......\00"
@.str.6 = [10 x i8] c".....2...\00"
@.str.7 = [10 x i8] c".2.9.....\00"
@.str.8 = [10 x i8] c"..4......\00"
@__const.main.board = [9 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [10 x i8] c".87654321\00"
@.str.10 = [10 x i8] c"2........\00"
@.str.11 = [10 x i8] c"3........\00"
@.str.12 = [10 x i8] c"4........\00"
@.str.13 = [10 x i8] c"5........\00"
@.str.14 = [10 x i8] c"6........\00"
@.str.15 = [10 x i8] c"7........\00"
@.str.16 = [10 x i8] c"8........\00"
@.str.17 = [10 x i8] c"9........\00"
@__const.main.board2 = [9 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i32 0, i32 0)]
@str.20 = [6 x i8] c"false\00"
@str.22 = [5 x i8] c"true\00"
define i32 @main() {
%1 = alloca [9 x i8*]
%2 = alloca [9 x i8*]
%3 = bitcast [9 x i8*]* %1 to i8*
%4 = bitcast [9 x i8*]* %2 to i8*
%5 = getelementptr inbounds [9 x i8*], [9 x i8*]* %1, i64 0, i64 0
%6 = call i64 @isValidSudoku(i8** %5, i32 9, i32 9)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.22, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 0
%11 = call i64 @isValidSudoku(i8** %10, i32 9, i32 9)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.22, i64 0, i64 0)
%14 = call i32 @puts(i8* dereferenceable(1) %13)
ret i32 0
}