#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
int solve(int, int, int **, int **);
int main(void) {
  int num_tests, test = 0, first, second, round;
  int grid_first[4][4] = {{0}};
  int grid_second[4][4] = {{0}};
  int i, ret = 1;
  scanf("%d", &num_tests);
  if (num_tests < 1 || num_tests > 100) {
    printf("Illegal number of tests (1 <= T <= 100)\n");
    goto out;
  }
  while (test++ < num_tests) {
    scanf("%d", &first);
    for (i = 0; i < 4; i++) {
      scanf("%d %d %d %d", &grid_first[i][0], &grid_first[i][1],
            &grid_first[i][2], &grid_first[i][3]);
    }
    scanf("%d", &second);
    for (i = 0; i < 4; i++) {
      scanf("%d %d %d %d", &grid_second[i][0], &grid_second[i][1],
            &grid_second[i][2], &grid_second[i][3]);
    }
    round = solve(first, second, grid_first, grid_second);
    printf("Case #%d: ", test);
    switch (round) {
    case 0:
      printf("Bad magician!\n");
      break;
    case -1:
      printf("Volunteer cheated!\n");
      break;
    default:
      printf("%d\n", round);
    }
  }
  ret = 0;
out:
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1050 <memset@plt>
movl   $0x1,-0xa8(%rbp)
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     11ac <main+0x6c>
cmpl   $0x64,-0x8(%rbp)
jle    11bf <main+0x7f>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13bc <main+0x27c>
jmp    11c4 <main+0x84>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    13b2 <main+0x272>
lea    0xe53(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x4,-0xa4(%rbp)
jge    1277 <main+0x137>
movslq -0xa4(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0xa4(%rbp),%rax
lea    -0x60(%rbp),%rdx
shl    $0x4,%rax
add    %rax,%rdx
add    $0x4,%rdx
movslq -0xa4(%rbp),%rax
lea    -0x60(%rbp),%rcx
shl    $0x4,%rax
add    %rax,%rcx
add    $0x8,%rcx
movslq -0xa4(%rbp),%rax
lea    -0x60(%rbp),%r8
shl    $0x4,%rax
add    %rax,%r8
add    $0xc,%r8
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    11f4 <main+0xb4>
lea    0xdb4(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x4,-0xa4(%rbp)
jge    1322 <main+0x1e2>
movslq -0xa4(%rbp),%rax
lea    -0xa0(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
movslq -0xa4(%rbp),%rax
lea    -0xa0(%rbp),%rdx
shl    $0x4,%rax
add    %rax,%rdx
add    $0x4,%rdx
movslq -0xa4(%rbp),%rax
lea    -0xa0(%rbp),%rcx
shl    $0x4,%rax
add    %rax,%rcx
add    $0x8,%rcx
movslq -0xa4(%rbp),%rax
lea    -0xa0(%rbp),%r8
shl    $0x4,%rax
add    %rax,%r8
add    $0xc,%r8
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1293 <main+0x153>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
lea    -0x60(%rbp),%rdx
lea    -0xa0(%rbp),%rcx
call   1030 <solve@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xcf0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0xac(%rbp)
sub    $0xffffffff,%eax
je     1389 <main+0x249>
jmp    1363 <main+0x223>
mov    -0xac(%rbp),%eax
test   %eax,%eax
jne    139c <main+0x25c>
jmp    1376 <main+0x236>
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ad <main+0x26d>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ad <main+0x26d>
mov    -0x18(%rbp),%esi
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c4 <main+0x84>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xe83(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffff9b,%eax
cmp    $0xffffff9c,%eax
jae    11b4 <main+0x74>
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    1363 <main+0x223>
lea    0xe4e(%rip),%r14
lea    0xe3e(%rip),%r12
lea    0x50(%rsp),%r13
lea    0x10(%rsp),%rbp
xor    %ebx,%ebx
jmp    11eb <main+0xab>
lea    0xe40(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    0x4(%rsp),%ebx
jge    1361 <main+0x221>
add    $0x1,%ebx
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
lea    0x54(%rsp),%rdx
lea    0x58(%rsp),%rcx
lea    0x5c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x60(%rsp),%rsi
lea    0x64(%rsp),%rdx
lea    0x68(%rsp),%rcx
lea    0x6c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x70(%rsp),%rsi
lea    0x74(%rsp),%rdx
lea    0x78(%rsp),%rcx
lea    0x7c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x80(%rsp),%rsi
lea    0x84(%rsp),%rdx
lea    0x88(%rsp),%rcx
lea    0x8c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x20(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0x28(%rsp),%rcx
lea    0x2c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x30(%rsp),%rsi
lea    0x34(%rsp),%rdx
lea    0x38(%rsp),%rcx
lea    0x3c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r12,%rdi
lea    0x40(%rsp),%rsi
lea    0x44(%rsp),%rdx
lea    0x48(%rsp),%rcx
lea    0x4c(%rsp),%r8
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %r13,%rdx
mov    %rbp,%rcx
call   1030 <solve@plt>
mov    %eax,%r15d
lea    0xceb(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xffffffff,%r15d
je     1350 <main+0x210>
test   %r15d,%r15d
jne    11d0 <main+0x90>
lea    0xcee(%rip),%rdi
call   1040 <puts@plt>
jmp    11e1 <main+0xa1>
nopw   0x0(%rax,%rax,1)
lea    0xcc4(%rip),%rdi
call   1040 <puts@plt>
jmp    11e1 <main+0xa1>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [41 x i8] c"Illegal number of tests (1 <= T <= 100)\0A\00"
@.str.2 = [12 x i8] c"%d %d %d %d\00"
@.str.3 = [11 x i8] c"Case #%d: \00"
@.str.4 = [15 x i8] c"Bad magician!\0A\00"
@.str.5 = [20 x i8] c"Volunteer cheated!\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x [4 x i32]]
%8 = alloca [4 x [4 x i32]]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%11 = bitcast [4 x [4 x i32]]* %7 to i8*
%12 = bitcast [4 x [4 x i32]]* %8 to i8*
store i32 1, i32* %10
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 1
br i1 %15, label %19, label %16
16: ; preds = %0
%17 = load i32, i32* %2
%18 = icmp sgt i32 %17, 100
br i1 %18, label %19, label %21
19: ; preds = %16, %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
br label %99
21: ; preds = %16
br label %22
22: ; preds = %97, %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = load i32, i32* %2
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %98
27: ; preds = %22
%28 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %9
br label %29
29: ; preds = %50, %27
%30 = load i32, i32* %9
%31 = icmp slt i32 %30, 4
br i1 %31, label %32, label %53
32: ; preds = %29
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %7, i64 0, i64 %34
%36 = getelementptr inbounds [4 x i32], [4 x i32]* %35, i64 0, i64 0
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %7, i64 0, i64 %38
%40 = getelementptr inbounds [4 x i32], [4 x i32]* %39, i64 0, i64 1
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %7, i64 0, i64 %42
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %43, i64 0, i64 2
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %7, i64 0, i64 %46
%48 = getelementptr inbounds [4 x i32], [4 x i32]* %47, i64 0, i64 3
%49 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %36, i32* %40, i32* %44, i32* %48)
br label %50
50: ; preds = %32
%51 = load i32, i32* %9
%52 = add nsw i32 %51, 1
store i32 %52, i32* %9
br label %29
53: ; preds = %29
%54 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
store i32 0, i32* %9
br label %55
55: ; preds = %76, %53
%56 = load i32, i32* %9
%57 = icmp slt i32 %56, 4
br i1 %57, label %58, label %79
58: ; preds = %55
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 %60
%62 = getelementptr inbounds [4 x i32], [4 x i32]* %61, i64 0, i64 0
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 %64
%66 = getelementptr inbounds [4 x i32], [4 x i32]* %65, i64 0, i64 1
%67 = load i32, i32* %9
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 %68
%70 = getelementptr inbounds [4 x i32], [4 x i32]* %69, i64 0, i64 2
%71 = load i32, i32* %9
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 %72
%74 = getelementptr inbounds [4 x i32], [4 x i32]* %73, i64 0, i64 3
%75 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %62, i32* %66, i32* %70, i32* %74)
br label %76
76: ; preds = %58
%77 = load i32, i32* %9
%78 = add nsw i32 %77, 1
store i32 %78, i32* %9
br label %55
79: ; preds = %55
%80 = load i32, i32* %4
%81 = load i32, i32* %5
%82 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %7, i64 0, i64 0
%83 = bitcast [4 x i32]* %82 to i32**
%84 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 0
%85 = bitcast [4 x i32]* %84 to i32**
%86 = call i32 @solve(i32 %80, i32 %81, i32** %83, i32** %85)
store i32 %86, i32* %6
%87 = load i32, i32* %3
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%89 = load i32, i32* %6
switch i32 %89, label %94 [
i32 0, label %90
i32 -1, label %92
]
90: ; preds = %79
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %97
92: ; preds = %79
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %97
94: ; preds = %79
%95 = load i32, i32* %6
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %94, %92, %90
br label %22
98: ; preds = %22
store i32 0, i32* %10
br label %99
99: ; preds = %98, %19
%100 = load i32, i32* %10
ret i32 %100
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"%d %d %d %d\00"
@.str.3 = [11 x i8] c"Case #%d: \00"
@.str.6 = [4 x i8] c"%d\0A\00"
@str = [19 x i8] c"Volunteer cheated!\00"
@str.7 = [14 x i8] c"Bad magician!\00"
@str.8 = [40 x i8] c"Illegal number of tests (1 <= T <= 100)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x [4 x i32]]
%5 = alloca [4 x [4 x i32]]
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast [4 x [4 x i32]]* %4 to i8*
%10 = bitcast [4 x [4 x i32]]* %5 to i8*
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = add i32 %12, -101
%14 = icmp ult i32 %13, -100
br i1 %14, label %50, label %15
15: ; preds = %0
%16 = bitcast [4 x [4 x i32]]* %4 to i32**
%17 = bitcast [4 x [4 x i32]]* %5 to i32**
%18 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0, i64 0
%19 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0, i64 1
%20 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0, i64 2
%21 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 0, i64 3
%22 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 1, i64 0
%23 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 1, i64 1
%24 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 1, i64 2
%25 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 1, i64 3
%26 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 2, i64 0
%27 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 2, i64 1
%28 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 2, i64 2
%29 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 2, i64 3
%30 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 3, i64 0
%31 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 3, i64 1
%32 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 3, i64 2
%33 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %4, i64 0, i64 3, i64 3
%34 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 0, i64 0
%35 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 0, i64 1
%36 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 0, i64 2
%37 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 0, i64 3
%38 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 1, i64 0
%39 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 1, i64 1
%40 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 1, i64 2
%41 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 1, i64 3
%42 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 2, i64 0
%43 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 2, i64 1
%44 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 2, i64 2
%45 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 2, i64 3
%46 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 3, i64 0
%47 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 3, i64 1
%48 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 3, i64 2
%49 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %5, i64 0, i64 3, i64 3
br label %52
50: ; preds = %0
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.8, i64 0, i64 0))
br label %78
52: ; preds = %15, %74
%53 = phi i32 [ 1, %15 ], [ %75, %74 ]
%54 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%55 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %18, i32* %19, i32* %20, i32* %21)
%56 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %22, i32* %23, i32* %24, i32* %25)
%57 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %26, i32* %27, i32* %28, i32* %29)
%58 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %30, i32* %31, i32* %32, i32* %33)
%59 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%60 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %34, i32* %35, i32* %36, i32* %37)
%61 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %38, i32* %39, i32* %40, i32* %41)
%62 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %42, i32* %43, i32* %44, i32* %45)
%63 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %46, i32* %47, i32* %48, i32* %49)
%64 = load i32, i32* %2
%65 = load i32, i32* %3
%66 = call i32 @solve(i32 %64, i32 %65, i32** %16, i32** %17)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %53)
switch i32 %66, label %72 [
i32 0, label %68
i32 -1, label %70
]
68: ; preds = %52
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
br label %74
70: ; preds = %52
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %74
72: ; preds = %52
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %66)
br label %74
74: ; preds = %72, %70, %68
%75 = add nuw nsw i32 %53, 1
%76 = load i32, i32* %1
%77 = icmp slt i32 %53, %76
br i1 %77, label %52, label %78
78: ; preds = %74, %50
%79 = phi i32 [ 1, %50 ], [ 0, %74 ]
ret i32 %79
}