#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 check_holding(char *);
int check_solved_legal(char pattern[9][9]) {
  int result = 1;
  for (int squarex = 0; squarex <= 6; squarex += 3) {
    for (int squarey = 0; squarey <= 6; squarey += 3) {
      char holding[9] = "         ";
      for (int x = 0; x < 3; x++) {
        for (int y = 0; y < 3; y++) {
          holding[x * 3 + y] = pattern[squarex + x][squarey + y];
        }
      }
      switch (check_holding(holding)) {
      case -1:
        return -1;
      case 0:
        result = 0;
        break;
      }
    }
  }
  for (int x = 0; x < 9; x++) {
    char holding[9] = "         ";
    for (int y = 0; y < 9; y++) {
      holding[y] = pattern[x][y];
    }
    switch (check_holding(holding)) {
    case -1:
      return -1;
    case 0:
      result = 0;
      break;
    }
  }
  for (int y = 0; y < 9; y++) {
    char holding[9] = "         ";
    for (int x = 0; x < 9; x++) {
      holding[x] = pattern[x][y];
    }
    switch (check_holding(holding)) {
    case -1:
      return -1;
    case 0:
      result = 0;
      break;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<check_solved_legal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x6,-0x18(%rbp)
jg     122e <check_solved_legal+0x11e>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jg     121b <check_solved_legal+0x10b>
mov    0xeb4(%rip),%rax
mov    %rax,-0x25(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x1d(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jge    11c9 <check_solved_legal+0xb9>
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jge    11b6 <check_solved_legal+0xa6>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
imul   $0x3,-0x2c(%rbp),%eax
add    -0x30(%rbp),%eax
cltq
mov    %cl,-0x25(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1171 <check_solved_legal+0x61>
jmp    11bb <check_solved_legal+0xab>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1160 <check_solved_legal+0x50>
lea    -0x25(%rbp),%rdi
call   1030 <check_holding@plt>
mov    %eax,%ecx
mov    %ecx,-0x5c(%rbp)
sub    $0xffffffff,%eax
je     11f5 <check_solved_legal+0xe5>
jmp    11e5 <check_solved_legal+0xd5>
mov    -0x5c(%rbp),%eax
test   %eax,%eax
je     1201 <check_solved_legal+0xf1>
jmp    1208 <check_solved_legal+0xf8>
movl   $0xffffffff,-0x4(%rbp)
jmp    139c <check_solved_legal+0x28c>
movl   $0x0,-0x14(%rbp)
jmp    120d <check_solved_legal+0xfd>
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <check_solved_legal+0x2b>
jmp    1220 <check_solved_legal+0x110>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <check_solved_legal+0x1a>
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    12e2 <check_solved_legal+0x1d2>
mov    0xdc3(%rip),%rax
mov    %rax,-0x3d(%rbp)
mov    0xdc1(%rip),%al
mov    %al,-0x35(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x9,-0x44(%rbp)
jge    1290 <check_solved_legal+0x180>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x44(%rbp),%rax
mov    %cl,-0x3d(%rbp,%rax,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    125a <check_solved_legal+0x14a>
lea    -0x3d(%rbp),%rdi
call   1030 <check_holding@plt>
mov    %eax,%ecx
mov    %ecx,-0x60(%rbp)
sub    $0xffffffff,%eax
je     12bc <check_solved_legal+0x1ac>
jmp    12ac <check_solved_legal+0x19c>
mov    -0x60(%rbp),%eax
test   %eax,%eax
je     12c8 <check_solved_legal+0x1b8>
jmp    12cf <check_solved_legal+0x1bf>
movl   $0xffffffff,-0x4(%rbp)
jmp    139c <check_solved_legal+0x28c>
movl   $0x0,-0x14(%rbp)
jmp    12d4 <check_solved_legal+0x1c4>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1235 <check_solved_legal+0x125>
movl   $0x0,-0x48(%rbp)
cmpl   $0x9,-0x48(%rbp)
jge    1396 <check_solved_legal+0x286>
mov    0xd18(%rip),%rax
mov    %rax,-0x51(%rbp)
mov    0xd16(%rip),%al
mov    %al,-0x49(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x9,-0x58(%rbp)
jge    1344 <check_solved_legal+0x234>
mov    -0x10(%rbp),%rax
movslq -0x58(%rbp),%rcx
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
movslq -0x48(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x58(%rbp),%rax
mov    %cl,-0x51(%rbp,%rax,1)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    130e <check_solved_legal+0x1fe>
lea    -0x51(%rbp),%rdi
call   1030 <check_holding@plt>
mov    %eax,%ecx
mov    %ecx,-0x64(%rbp)
sub    $0xffffffff,%eax
je     1370 <check_solved_legal+0x260>
jmp    1360 <check_solved_legal+0x250>
mov    -0x64(%rbp),%eax
test   %eax,%eax
je     137c <check_solved_legal+0x26c>
jmp    1383 <check_solved_legal+0x273>
movl   $0xffffffff,-0x4(%rbp)
jmp    139c <check_solved_legal+0x28c>
movl   $0x0,-0x14(%rbp)
jmp    1388 <check_solved_legal+0x278>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12e9 <check_solved_legal+0x1d9>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_solved_legal>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x3(%rsp),%r12
mov    $0x1,%r14d
xor    %ebp,%ebp
mov    %rsp,%r15
jmp    1151 <check_solved_legal+0x41>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r14d,%r14d
add    $0x1b,%rbp
cmp    $0x51,%rbp
je     126c <check_solved_legal+0x15c>
movzbl 0x2(%rbx,%rbp,1),%eax
mov    %al,0x2(%rsp)
movzwl (%rbx,%rbp,1),%eax
mov    %ax,(%rsp)
movzbl 0xb(%rbx,%rbp,1),%eax
mov    %al,0x2(%r12)
movzwl 0x9(%rbx,%rbp,1),%eax
mov    %ax,(%r12)
movzbl 0x14(%rbx,%rbp,1),%eax
mov    %al,0x5(%r12)
movzwl 0x12(%rbx,%rbp,1),%eax
mov    %ax,0x3(%r12)
mov    %r15,%rdi
call   1030 <check_holding@plt>
test   %eax,%eax
je     11b0 <check_solved_legal+0xa0>
cmp    $0xffffffff,%eax
jne    11b3 <check_solved_legal+0xa3>
jmp    143b <check_solved_legal+0x32b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %r14d,%r14d
movzbl 0x5(%rbx,%rbp,1),%eax
mov    %al,0x2(%rsp)
movzwl 0x3(%rbx,%rbp,1),%eax
mov    %ax,(%rsp)
movzbl 0xe(%rbx,%rbp,1),%eax
mov    %al,0x2(%r12)
movzwl 0xc(%rbx,%rbp,1),%eax
mov    %ax,(%r12)
movzbl 0x17(%rbx,%rbp,1),%eax
mov    %al,0x5(%r12)
movzwl 0x15(%rbx,%rbp,1),%eax
mov    %ax,0x3(%r12)
mov    %r15,%rdi
call   1030 <check_holding@plt>
test   %eax,%eax
je     1210 <check_solved_legal+0x100>
cmp    $0xffffffff,%eax
jne    1213 <check_solved_legal+0x103>
jmp    143b <check_solved_legal+0x32b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r14d,%r14d
movzbl 0x8(%rbx,%rbp,1),%eax
mov    %al,0x2(%rsp)
movzwl 0x6(%rbx,%rbp,1),%eax
mov    %ax,(%rsp)
movzbl 0x11(%rbx,%rbp,1),%eax
mov    %al,0x2(%r12)
movzwl 0xf(%rbx,%rbp,1),%eax
mov    %ax,(%r12)
movzbl 0x1a(%rbx,%rbp,1),%eax
mov    %al,0x5(%r12)
movzwl 0x18(%rbx,%rbp,1),%eax
mov    %ax,0x3(%r12)
mov    %r15,%rdi
call   1030 <check_holding@plt>
test   %eax,%eax
je     1140 <check_solved_legal+0x30>
cmp    $0xffffffff,%eax
jne    1143 <check_solved_legal+0x33>
jmp    143b <check_solved_legal+0x32b>
mov    0x8(%rbx),%al
mov    %al,0x8(%rsp)
mov    (%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    1292 <check_solved_legal+0x182>
xor    %r14d,%r14d
mov    0x11(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x9(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    12b9 <check_solved_legal+0x1a9>
xor    %r14d,%r14d
mov    0x1a(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x12(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    12e0 <check_solved_legal+0x1d0>
xor    %r14d,%r14d
mov    0x23(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x1b(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    1307 <check_solved_legal+0x1f7>
xor    %r14d,%r14d
mov    0x2c(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x24(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    132e <check_solved_legal+0x21e>
xor    %r14d,%r14d
mov    0x35(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x2d(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    1355 <check_solved_legal+0x245>
xor    %r14d,%r14d
mov    0x3e(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x36(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    137c <check_solved_legal+0x26c>
xor    %r14d,%r14d
mov    0x47(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x3f(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    13a3 <check_solved_legal+0x293>
xor    %r14d,%r14d
mov    0x50(%rbx),%al
mov    %al,0x8(%rsp)
mov    0x48(%rbx),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <check_holding@plt>
cmp    $0xffffffff,%eax
je     143b <check_solved_legal+0x32b>
test   %eax,%eax
jne    13c6 <check_solved_legal+0x2b6>
xor    %r14d,%r14d
mov    $0xfffffffffffffff7,%rbp
mov    %rsp,%r15
jmp    13da <check_solved_legal+0x2ca>
xor    %r14d,%r14d
inc    %rbp
je     1441 <check_solved_legal+0x331>
movzbl 0x9(%rbx,%rbp,1),%eax
mov    %al,(%rsp)
movzbl 0x12(%rbx,%rbp,1),%eax
mov    %al,0x1(%rsp)
movzbl 0x1b(%rbx,%rbp,1),%eax
mov    %al,0x2(%rsp)
movzbl 0x24(%rbx,%rbp,1),%eax
mov    %al,0x3(%rsp)
movzbl 0x2d(%rbx,%rbp,1),%eax
mov    %al,0x4(%rsp)
movzbl 0x36(%rbx,%rbp,1),%eax
mov    %al,0x5(%rsp)
movzbl 0x3f(%rbx,%rbp,1),%eax
mov    %al,0x6(%rsp)
movzbl 0x48(%rbx,%rbp,1),%eax
mov    %al,0x7(%rsp)
movzbl 0x51(%rbx,%rbp,1),%eax
mov    %al,0x8(%rsp)
mov    %r15,%rdi
call   1030 <check_holding@plt>
test   %eax,%eax
je     13d2 <check_solved_legal+0x2c2>
cmp    $0xffffffff,%eax
jne    13d5 <check_solved_legal+0x2c5>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.check_solved_legal.holding = [9 x i8] c" "
@__const.check_solved_legal.holding.1 = [9 x i8] c" "
@__const.check_solved_legal.holding.2 = [9 x i8] c" "
define i32 @check_solved_legal([9 x i8]* %0) {
%2 = alloca i32
%3 = alloca [9 x i8]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [9 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [9 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca [9 x i8]
%15 = alloca i32
store [9 x i8]* %0, [9 x i8]** %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %16
16: ; preds = %68, %1
%17 = load i32, i32* %5
%18 = icmp sle i32 %17, 6
br i1 %18, label %19, label %71
19: ; preds = %16
store i32 0, i32* %6
br label %20
20: ; preds = %64, %19
%21 = load i32, i32* %6
%22 = icmp sle i32 %21, 6
br i1 %22, label %23, label %67
23: ; preds = %20
%24 = bitcast [9 x i8]* %7 to i8*
store i32 0, i32* %8
br label %25
25: ; preds = %55, %23
%26 = load i32, i32* %8
%27 = icmp slt i32 %26, 3
br i1 %27, label %28, label %58
28: ; preds = %25
store i32 0, i32* %9
br label %29
29: ; preds = %51, %28
%30 = load i32, i32* %9
%31 = icmp slt i32 %30, 3
br i1 %31, label %32, label %54
32: ; preds = %29
%33 = load [9 x i8]*, [9 x i8]** %3
%34 = load i32, i32* %5
%35 = load i32, i32* %8
%36 = add nsw i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [9 x i8], [9 x i8]* %33, i64 %37
%39 = load i32, i32* %6
%40 = load i32, i32* %9
%41 = add nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [9 x i8], [9 x i8]* %38, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = load i32, i32* %8
%46 = mul nsw i32 %45, 3
%47 = load i32, i32* %9
%48 = add nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 %49
store i8 %44, i8* %50
br label %51
51: ; preds = %32
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
br label %29
54: ; preds = %29
br label %55
55: ; preds = %54
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %25
58: ; preds = %25
%59 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%60 = call i32 @check_holding(i8* %59)
switch i32 %60, label %63 [
i32 -1, label %61
i32 0, label %62
]
61: ; preds = %58
store i32 -1, i32* %2
br label %139
62: ; preds = %58
store i32 0, i32* %4
br label %63
63: ; preds = %58, %62
br label %64
64: ; preds = %63
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 3
store i32 %66, i32* %6
br label %20
67: ; preds = %20
br label %68
68: ; preds = %67
%69 = load i32, i32* %5
%70 = add nsw i32 %69, 3
store i32 %70, i32* %5
br label %16
71: ; preds = %16
store i32 0, i32* %10
br label %72
72: ; preds = %101, %71
%73 = load i32, i32* %10
%74 = icmp slt i32 %73, 9
br i1 %74, label %75, label %104
75: ; preds = %72
%76 = bitcast [9 x i8]* %11 to i8*
store i32 0, i32* %12
br label %77
77: ; preds = %92, %75
%78 = load i32, i32* %12
%79 = icmp slt i32 %78, 9
br i1 %79, label %80, label %95
80: ; preds = %77
%81 = load [9 x i8]*, [9 x i8]** %3
%82 = load i32, i32* %10
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [9 x i8], [9 x i8]* %81, i64 %83
%85 = load i32, i32* %12
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [9 x i8], [9 x i8]* %84, i64 0, i64 %86
%88 = load i8, i8* %87
%89 = load i32, i32* %12
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 %90
store i8 %88, i8* %91
br label %92
92: ; preds = %80
%93 = load i32, i32* %12
%94 = add nsw i32 %93, 1
store i32 %94, i32* %12
br label %77
95: ; preds = %77
%96 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%97 = call i32 @check_holding(i8* %96)
switch i32 %97, label %100 [
i32 -1, label %98
i32 0, label %99
]
98: ; preds = %95
store i32 -1, i32* %2
br label %139
99: ; preds = %95
store i32 0, i32* %4
br label %100
100: ; preds = %95, %99
br label %101
101: ; preds = %100
%102 = load i32, i32* %10
%103 = add nsw i32 %102, 1
store i32 %103, i32* %10
br label %72
104: ; preds = %72
store i32 0, i32* %13
br label %105
105: ; preds = %134, %104
%106 = load i32, i32* %13
%107 = icmp slt i32 %106, 9
br i1 %107, label %108, label %137
108: ; preds = %105
%109 = bitcast [9 x i8]* %14 to i8*
store i32 0, i32* %15
br label %110
110: ; preds = %125, %108
%111 = load i32, i32* %15
%112 = icmp slt i32 %111, 9
br i1 %112, label %113, label %128
113: ; preds = %110
%114 = load [9 x i8]*, [9 x i8]** %3
%115 = load i32, i32* %15
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [9 x i8], [9 x i8]* %114, i64 %116
%118 = load i32, i32* %13
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [9 x i8], [9 x i8]* %117, i64 0, i64 %119
%121 = load i8, i8* %120
%122 = load i32, i32* %15
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [9 x i8], [9 x i8]* %14, i64 0, i64 %123
store i8 %121, i8* %124
br label %125
125: ; preds = %113
%126 = load i32, i32* %15
%127 = add nsw i32 %126, 1
store i32 %127, i32* %15
br label %110
128: ; preds = %110
%129 = getelementptr inbounds [9 x i8], [9 x i8]* %14, i64 0, i64 0
%130 = call i32 @check_holding(i8* %129)
switch i32 %130, label %133 [
i32 -1, label %131
i32 0, label %132
]
131: ; preds = %128
store i32 -1, i32* %2
br label %139
132: ; preds = %128
store i32 0, i32* %4
br label %133
133: ; preds = %128, %132
br label %134
134: ; preds = %133
%135 = load i32, i32* %13
%136 = add nsw i32 %135, 1
store i32 %136, i32* %13
br label %105
137: ; preds = %105
%138 = load i32, i32* %4
store i32 %138, i32* %2
br label %139
139: ; preds = %137, %131, %98, %61
%140 = load i32, i32* %2
ret i32 %140
}

LLVM IR (-O2):
define i32 @check_solved_legal([9 x i8]* nocapture %0) {
%2 = alloca [9 x i8]
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = alloca [9 x i8]
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 3
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 6
br label %9
9: ; preds = %1, %38
%10 = phi i64 [ 0, %1 ], [ %40, %38 ]
%11 = phi i32 [ 1, %1 ], [ %39, %38 ]
%12 = mul nuw nsw i64 %10, 3
%13 = getelementptr [9 x i8], [9 x i8]* %0, i64 %12, i64 0
%14 = add nuw nsw i64 %12, 1
%15 = getelementptr [9 x i8], [9 x i8]* %0, i64 %14, i64 0
%16 = add nuw nsw i64 %12, 2
%17 = getelementptr [9 x i8], [9 x i8]* %0, i64 %16, i64 0
%18 = call i32 @check_holding(i8* %6)
switch i32 %18, label %24 [
i32 -1, label %124
i32 0, label %23
]
19: ; preds = %38
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%21 = getelementptr [9 x i8], [9 x i8]* %0, i64 0, i64 0
%22 = call i32 @check_holding(i8* %20)
switch i32 %22, label %45 [
i32 -1, label %43
i32 0, label %42
]
23: ; preds = %9
br label %24
24: ; preds = %23, %9
%25 = phi i32 [ %11, %9 ], [ 0, %23 ]
%26 = getelementptr [9 x i8], [9 x i8]* %0, i64 %12, i64 3
%27 = getelementptr [9 x i8], [9 x i8]* %0, i64 %14, i64 3
%28 = getelementptr [9 x i8], [9 x i8]* %0, i64 %16, i64 3
%29 = call i32 @check_holding(i8* %6)
switch i32 %29, label %31 [
i32 -1, label %124
i32 0, label %30
]
30: ; preds = %24
br label %31
31: ; preds = %30, %24
%32 = phi i32 [ %25, %24 ], [ 0, %30 ]
%33 = getelementptr [9 x i8], [9 x i8]* %0, i64 %12, i64 6
%34 = getelementptr [9 x i8], [9 x i8]* %0, i64 %14, i64 6
%35 = getelementptr [9 x i8], [9 x i8]* %0, i64 %16, i64 6
%36 = call i32 @check_holding(i8* %6)
switch i32 %36, label %38 [
i32 -1, label %124
i32 0, label %37
]
37: ; preds = %31
br label %38
38: ; preds = %31, %37
%39 = phi i32 [ %32, %31 ], [ 0, %37 ]
%40 = add nuw nsw i64 %10, 1
%41 = icmp eq i64 %40, 3
br i1 %41, label %19, label %9
42: ; preds = %19
br label %45
43: ; preds = %80, %75, %70, %65, %60, %55, %50, %45, %19
%44 = phi i32 [ %39, %19 ], [ %46, %45 ], [ %51, %50 ], [ %56, %55 ], [ %61, %60 ], [ %66, %65 ], [ %71, %70 ], [ %76, %75 ], [ %81, %80 ]
br label %125
45: ; preds = %42, %19
%46 = phi i32 [ %39, %19 ], [ 0, %42 ]
%47 = getelementptr [9 x i8], [9 x i8]* %0, i64 1, i64 0
%48 = call i32 @check_holding(i8* %20)
switch i32 %48, label %50 [
i32 -1, label %43
i32 0, label %49
]
49: ; preds = %45
br label %50
50: ; preds = %49, %45
%51 = phi i32 [ %46, %45 ], [ 0, %49 ]
%52 = getelementptr [9 x i8], [9 x i8]* %0, i64 2, i64 0
%53 = call i32 @check_holding(i8* %20)
switch i32 %53, label %55 [
i32 -1, label %43
i32 0, label %54
]
54: ; preds = %50
br label %55
55: ; preds = %54, %50
%56 = phi i32 [ %51, %50 ], [ 0, %54 ]
%57 = getelementptr [9 x i8], [9 x i8]* %0, i64 3, i64 0
%58 = call i32 @check_holding(i8* %20)
switch i32 %58, label %60 [
i32 -1, label %43
i32 0, label %59
]
59: ; preds = %55
br label %60
60: ; preds = %59, %55
%61 = phi i32 [ %56, %55 ], [ 0, %59 ]
%62 = getelementptr [9 x i8], [9 x i8]* %0, i64 4, i64 0
%63 = call i32 @check_holding(i8* %20)
switch i32 %63, label %65 [
i32 -1, label %43
i32 0, label %64
]
64: ; preds = %60
br label %65
65: ; preds = %64, %60
%66 = phi i32 [ %61, %60 ], [ 0, %64 ]
%67 = getelementptr [9 x i8], [9 x i8]* %0, i64 5, i64 0
%68 = call i32 @check_holding(i8* %20)
switch i32 %68, label %70 [
i32 -1, label %43
i32 0, label %69
]
69: ; preds = %65
br label %70
70: ; preds = %69, %65
%71 = phi i32 [ %66, %65 ], [ 0, %69 ]
%72 = getelementptr [9 x i8], [9 x i8]* %0, i64 6, i64 0
%73 = call i32 @check_holding(i8* %20)
switch i32 %73, label %75 [
i32 -1, label %43
i32 0, label %74
]
74: ; preds = %70
br label %75
75: ; preds = %74, %70
%76 = phi i32 [ %71, %70 ], [ 0, %74 ]
%77 = getelementptr [9 x i8], [9 x i8]* %0, i64 7, i64 0
%78 = call i32 @check_holding(i8* %20)
switch i32 %78, label %80 [
i32 -1, label %43
i32 0, label %79
]
79: ; preds = %75
br label %80
80: ; preds = %79, %75
%81 = phi i32 [ %76, %75 ], [ 0, %79 ]
%82 = getelementptr [9 x i8], [9 x i8]* %0, i64 8, i64 0
%83 = call i32 @check_holding(i8* %20)
switch i32 %83, label %85 [
i32 -1, label %43
i32 0, label %84
]
84: ; preds = %80
br label %85
85: ; preds = %84, %80
%86 = phi i32 [ %81, %80 ], [ 0, %84 ]
%87 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%88 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 1
%89 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 2
%90 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 3
%91 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 4
%92 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 5
%93 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 6
%94 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 7
%95 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 8
br label %96
96: ; preds = %85, %120
%97 = phi i64 [ 0, %85 ], [ %122, %120 ]
%98 = phi i32 [ %86, %85 ], [ %121, %120 ]
%99 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 0, i64 %97
%100 = load i8, i8* %99
store i8 %100, i8* %87
%101 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 1, i64 %97
%102 = load i8, i8* %101
store i8 %102, i8* %88
%103 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 2, i64 %97
%104 = load i8, i8* %103
store i8 %104, i8* %89
%105 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 3, i64 %97
%106 = load i8, i8* %105
store i8 %106, i8* %90
%107 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 4, i64 %97
%108 = load i8, i8* %107
store i8 %108, i8* %91
%109 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 5, i64 %97
%110 = load i8, i8* %109
store i8 %110, i8* %92
%111 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 6, i64 %97
%112 = load i8, i8* %111
store i8 %112, i8* %93
%113 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 7, i64 %97
%114 = load i8, i8* %113
store i8 %114, i8* %94
%115 = getelementptr inbounds [9 x i8], [9 x i8]* %0, i64 8, i64 %97
%116 = load i8, i8* %115
store i8 %116, i8* %95
%117 = call i32 @check_holding(i8* %87)
switch i32 %117, label %120 [
i32 -1, label %119
i32 0, label %118
]
118: ; preds = %96
br label %120
119: ; preds = %96
br label %125
120: ; preds = %118, %96
%121 = phi i32 [ %98, %96 ], [ 0, %118 ]
%122 = add nuw nsw i64 %97, 1
%123 = icmp eq i64 %122, 9
br i1 %123, label %125, label %96
124: ; preds = %9, %24, %31
br label %125
125: ; preds = %120, %43, %124, %119
%126 = phi i32 [ -1, %43 ], [ -1, %119 ], [ -1, %124 ], [ %121, %120 ]
ret i32 %126
}