#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 scanf(char *, int *, ...);
int main(void) {
  int n, m, c, i, temp, sum, max, t = 1, nn[20][2];
  while (scanf("%d %d %d", &n, &m, &c) == 3) {
    if (n + m + c == 0)
      break;
    sum = 0;
    max = 0;
    for (i = 0; i < 20; i++)
      nn[i][1] = 0;
    for (i = 0; i < n; i++)
      scanf("%d", &nn[i][0]);
    for (i = 1; i <= m; i++) {
      scanf("%d", &temp);
      if (sum <= c) {
        if (nn[temp - 1][1] == 0) {
          if (nn[temp - 1][0] + sum > max)
            max = nn[temp - 1][0] + sum;
          sum += nn[temp - 1][0];
          nn[temp - 1][1] = 1;
        } else {
          nn[temp - 1][1] = 0;
          sum -= nn[temp - 1][0];
        }
      }
    }
    printf("Sequence %d\n", t);
    if (sum > c)
      printf("Fuse was blown.\n\n");
    else {
      printf("Fuse was not blown.\n");
      printf("Maximal power consumption was %d amperes.\n\n", max);
    }
    t++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x3,%eax
jne    1333 <main+0x213>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x0,%eax
jne    1173 <main+0x53>
jmp    1333 <main+0x213>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    11af <main+0x8f>
movslq -0x14(%rbp),%rax
movl   $0x0,-0xcc(%rbp,%rax,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1188 <main+0x68>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f0 <main+0xd0>
movslq -0x14(%rbp),%rax
lea    -0xd0(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b6 <main+0x96>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     12d6 <main+0x1b6>
lea    0xdfc(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12c3 <main+0x1a3>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x0,-0xcc(%rbp,%rax,8)
jne    1294 <main+0x174>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,8),%eax
add    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1267 <main+0x147>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,8),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,8),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x1,-0xcc(%rbp,%rax,8)
jmp    12be <main+0x19e>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x0,-0xcc(%rbp,%rax,8)
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,8),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
jmp    12c3 <main+0x1a3>
jmp    12c8 <main+0x1a8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f7 <main+0xd7>
mov    -0x24(%rbp),%esi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1306 <main+0x1e6>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1325 <main+0x205>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
lea    0xeb8(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x3,%eax
jne    135f <main+0x22f>
mov    $0x1,%ebx
lea    0xe95(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11c4 <main+0x94>
nopl   0x0(%rax,%rax,1)
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xe83(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
lea    0xe59(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x3,%eax
jne    135f <main+0x22f>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%eax
lea    (%rax,%rcx,1),%edx
add    (%rsp),%edx
je     135f <main+0x22f>
movl   $0x0,0x14(%rsp)
movl   $0x0,0x1c(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x2c(%rsp)
movl   $0x0,0x34(%rsp)
movl   $0x0,0x3c(%rsp)
movl   $0x0,0x44(%rsp)
movl   $0x0,0x4c(%rsp)
movl   $0x0,0x54(%rsp)
movl   $0x0,0x5c(%rsp)
movl   $0x0,0x64(%rsp)
movl   $0x0,0x6c(%rsp)
movl   $0x0,0x74(%rsp)
movl   $0x0,0x7c(%rsp)
movl   $0x0,0x84(%rsp)
movl   $0x0,0x8c(%rsp)
movl   $0x0,0x94(%rsp)
movl   $0x0,0x9c(%rsp)
movl   $0x0,0xa4(%rsp)
movl   $0x0,0xac(%rsp)
test   %ecx,%ecx
jle    12c6 <main+0x196>
mov    %ebx,%r14d
lea    0x10(%rsp),%rbp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x8,%rbp
cmp    %rax,%rbx
jl     12a0 <main+0x170>
mov    0x4(%rsp),%eax
mov    %r14d,%ebx
test   %eax,%eax
jle    1330 <main+0x200>
xor    %r14d,%r14d
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    12f7 <main+0x1c7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x0,0xc(%rsp,%rax,8)
sub    0x8(%rsp,%rax,8),%ebp
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
jge    1335 <main+0x205>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    (%rsp),%ebp
jg     12ec <main+0x1bc>
movslq 0xc(%rsp),%rax
cmpl   $0x0,0xc(%rsp,%rax,8)
jne    12e0 <main+0x1b0>
add    0x8(%rsp,%rax,8),%ebp
cmp    %r13d,%ebp
cmovg  %ebp,%r13d
movl   $0x1,0xc(%rsp,%rax,8)
jmp    12ec <main+0x1bc>
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
xor    %r13d,%r13d
lea    0xccd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    (%rsp),%ebp
jle    1180 <main+0x50>
lea    0xd01(%rip),%rdi
call   1030 <puts@plt>
jmp    119d <main+0x6d>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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