#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*/ horizontal(int, char **, char ***);
int /*<<< orphan*/ square(int, int, char **, char ***);
int /*<<< orphan*/ vertical(int, char **, char ***);
void first_pass(char pattern[9][9], char possibilities[9][9][9]) {
  for (int x = 0; x <= 6; x = x + 3) {
    for (int y = 0; y <= 6; y = y + 3) {
      square(x, y, pattern, possibilities);
    }
  }
  for (int x = 0; x < 9; x++) {
    horizontal(x, pattern, possibilities);
  }
  for (int y = 0; y < 9; y++) {
    vertical(y, pattern, possibilities);
  }
}


x86 assembly (clang, -O0):
<first_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jg     1196 <first_pass+0x66>
movl   $0x0,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jg     1183 <first_pass+0x53>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <square@plt>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    1158 <first_pass+0x28>
jmp    1188 <first_pass+0x58>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <first_pass+0x17>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jge    11c5 <first_pass+0x95>
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <horizontal@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119d <first_pass+0x6d>
movl   $0x0,-0x20(%rbp)
cmpl   $0x9,-0x20(%rbp)
jge    11f4 <first_pass+0xc4>
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <vertical@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11cc <first_pass+0x9c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_pass>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
xor    %edi,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
xor    %edi,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x3,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x6,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x6,%edi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
mov    $0x6,%edi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <square@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <horizontal@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vertical@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vertical@plt>

LLVM IR (-O0):
define void @first_pass([9 x i8]* %0, [9 x [9 x i8]]* %1) {
%3 = alloca [9 x i8]*
%4 = alloca [9 x [9 x i8]]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [9 x i8]* %0, [9 x i8]** %3
store [9 x [9 x i8]]* %1, [9 x [9 x i8]]** %4
store i32 0, i32* %5
br label %9
9: ; preds = %28, %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 6
br i1 %11, label %12, label %31
12: ; preds = %9
store i32 0, i32* %6
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 6
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load [9 x i8]*, [9 x i8]** %3
%20 = bitcast [9 x i8]* %19 to i8**
%21 = load [9 x [9 x i8]]*, [9 x [9 x i8]]** %4
%22 = bitcast [9 x [9 x i8]]* %21 to i8***
%23 = call i32 @square(i32 %17, i32 %18, i8** %20, i8*** %22)
br label %24
24: ; preds = %16
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 3
store i32 %26, i32* %6
br label %13
27: ; preds = %13
br label %28
28: ; preds = %27
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 3
store i32 %30, i32* %5
br label %9
31: ; preds = %9
store i32 0, i32* %7
br label %32
32: ; preds = %42, %31
%33 = load i32, i32* %7
%34 = icmp slt i32 %33, 9
br i1 %34, label %35, label %45
35: ; preds = %32
%36 = load i32, i32* %7
%37 = load [9 x i8]*, [9 x i8]** %3
%38 = bitcast [9 x i8]* %37 to i8**
%39 = load [9 x [9 x i8]]*, [9 x [9 x i8]]** %4
%40 = bitcast [9 x [9 x i8]]* %39 to i8***
%41 = call i32 @horizontal(i32 %36, i8** %38, i8*** %40)
br label %42
42: ; preds = %35
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %32
45: ; preds = %32
store i32 0, i32* %8
br label %46
46: ; preds = %56, %45
%47 = load i32, i32* %8
%48 = icmp slt i32 %47, 9
br i1 %48, label %49, label %59
49: ; preds = %46
%50 = load i32, i32* %8
%51 = load [9 x i8]*, [9 x i8]** %3
%52 = bitcast [9 x i8]* %51 to i8**
%53 = load [9 x [9 x i8]]*, [9 x [9 x i8]]** %4
%54 = bitcast [9 x [9 x i8]]* %53 to i8***
%55 = call i32 @vertical(i32 %50, i8** %52, i8*** %54)
br label %56
56: ; preds = %49
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %46
59: ; preds = %46
ret void
}

LLVM IR (-O2):
define void @first_pass([9 x i8]* %0, [9 x [9 x i8]]* %1) {
%3 = bitcast [9 x i8]* %0 to i8**
%4 = bitcast [9 x [9 x i8]]* %1 to i8***
%5 = tail call i32 @square(i32 0, i32 0, i8** %3, i8*** %4)
%6 = tail call i32 @square(i32 0, i32 3, i8** %3, i8*** %4)
%7 = tail call i32 @square(i32 0, i32 6, i8** %3, i8*** %4)
%8 = tail call i32 @square(i32 3, i32 0, i8** %3, i8*** %4)
%9 = tail call i32 @square(i32 3, i32 3, i8** %3, i8*** %4)
%10 = tail call i32 @square(i32 3, i32 6, i8** %3, i8*** %4)
%11 = tail call i32 @square(i32 6, i32 0, i8** %3, i8*** %4)
%12 = tail call i32 @square(i32 6, i32 3, i8** %3, i8*** %4)
%13 = tail call i32 @square(i32 6, i32 6, i8** %3, i8*** %4)
%14 = tail call i32 @horizontal(i32 0, i8** %3, i8*** %4)
%15 = tail call i32 @horizontal(i32 1, i8** %3, i8*** %4)
%16 = tail call i32 @horizontal(i32 2, i8** %3, i8*** %4)
%17 = tail call i32 @horizontal(i32 3, i8** %3, i8*** %4)
%18 = tail call i32 @horizontal(i32 4, i8** %3, i8*** %4)
%19 = tail call i32 @horizontal(i32 5, i8** %3, i8*** %4)
%20 = tail call i32 @horizontal(i32 6, i8** %3, i8*** %4)
%21 = tail call i32 @horizontal(i32 7, i8** %3, i8*** %4)
%22 = tail call i32 @horizontal(i32 8, i8** %3, i8*** %4)
%23 = tail call i32 @vertical(i32 0, i8** %3, i8*** %4)
%24 = tail call i32 @vertical(i32 1, i8** %3, i8*** %4)
%25 = tail call i32 @vertical(i32 2, i8** %3, i8*** %4)
%26 = tail call i32 @vertical(i32 3, i8** %3, i8*** %4)
%27 = tail call i32 @vertical(i32 4, i8** %3, i8*** %4)
%28 = tail call i32 @vertical(i32 5, i8** %3, i8*** %4)
%29 = tail call i32 @vertical(i32 6, i8** %3, i8*** %4)
%30 = tail call i32 @vertical(i32 7, i8** %3, i8*** %4)
%31 = tail call i32 @vertical(i32 8, i8** %3, i8*** %4)
ret void
}