#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ strcmp(char *, char *);
int main(void) {
  FILE *fin = fopen("gift1.in", "r");
  FILE *fout = fopen("gift1.out", "w");
  char person_name[11][15] = {0};
  char temp_name[15] = {0};
  int i;
  int j;
  int k;
  int NP;
  int average_money;
  int money_give;
  int number_give;
  int total_money[11] = {0};
  fscanf(fin, "%d", &NP);
  for (i = 0; i < NP; ++i) {
    fscanf(fin, "%s", person_name[i]);
  }
  for (i = 0; i < NP; ++i) {
    j = 0;
    fscanf(fin, "%s", temp_name);
    while (strcmp(person_name[j], temp_name)) {
      ++j;
    }
    fscanf(fin, "%d %d", &money_give, &number_give);
    if (0 == number_give) {
      average_money = 0;
    } else {
      average_money = money_give / number_give;
    }
    total_money[j] -= average_money * number_give;
    for (k = 0; k < number_give; ++k) {
      j = 0;
      fscanf(fin, "%s", temp_name);
      while (strcmp(person_name[j], temp_name)) {
        ++j;
      }
      total_money[j] += average_money;
    }
  }
  for (i = 0; i < NP; ++i) {
    fprintf(fout, "%s %d\n", person_name[i], total_money[i]);
  }
  fclose(fin);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7b(%rip),%rdi
lea    0xe7e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0xa5,%edx
call   1040 <memset@plt>
lea    -0xcf(%rbp),%rdi
xor    %esi,%esi
mov    $0xf,%edx
call   1040 <memset@plt>
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xe39(%rip),%rsi
lea    -0xe0(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jge    1249 <main+0xe9>
mov    -0x10(%rbp),%rdi
movslq -0xd4(%rbp),%rax
lea    -0xc0(%rbp),%rdx
imul   $0xf,%rax,%rax
add    %rax,%rdx
lea    0xde9(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    11fc <main+0x9c>
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jge    1401 <main+0x2a1>
movl   $0x0,-0xd8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xcf(%rbp),%rdx
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
movslq -0xd8(%rbp),%rax
lea    -0xc0(%rbp),%rdi
imul   $0xf,%rax,%rax
add    %rax,%rdi
lea    -0xcf(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     12c7 <main+0x167>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    1288 <main+0x128>
mov    -0x10(%rbp),%rdi
lea    0xd48(%rip),%rsi
lea    -0xe8(%rbp),%rdx
lea    -0xec(%rbp),%rcx
mov    $0x0,%al
call   1050 <fscanf@plt>
xor    %eax,%eax
cmp    -0xec(%rbp),%eax
jne    1304 <main+0x1a4>
movl   $0x0,-0xe4(%rbp)
jmp    1317 <main+0x1b7>
mov    -0xe8(%rbp),%eax
cltd
idivl  -0xec(%rbp)
mov    %eax,-0xe4(%rbp)
mov    -0xe4(%rbp),%edx
imul   -0xec(%rbp),%edx
movslq -0xd8(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%ecx
sub    %edx,%ecx
mov    %ecx,-0x120(%rbp,%rax,4)
movl   $0x0,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0xec(%rbp),%eax
jge    13e8 <main+0x288>
movl   $0x0,-0xd8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xcf(%rbp),%rdx
lea    0xca4(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
movslq -0xd8(%rbp),%rax
lea    -0xc0(%rbp),%rdi
imul   $0xf,%rax,%rax
add    %rax,%rdi
lea    -0xcf(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     13b9 <main+0x259>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    137a <main+0x21a>
mov    -0xe4(%rbp),%ecx
movslq -0xd8(%rbp),%rax
add    -0x120(%rbp,%rax,4),%ecx
mov    %ecx,-0x120(%rbp,%rax,4)
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    1345 <main+0x1e5>
jmp    13ed <main+0x28d>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1253 <main+0xf3>
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jge    1464 <main+0x304>
mov    -0x18(%rbp),%rdi
movslq -0xd4(%rbp),%rax
lea    -0xc0(%rbp),%rdx
imul   $0xf,%rax,%rax
add    %rax,%rdx
movslq -0xd4(%rbp),%rax
mov    -0x120(%rbp,%rax,4),%ecx
lea    0xbd5(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    140b <main+0x2ab>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
lea    0xe98(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r12
lea    0xe8d(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r15
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movq   $0x0,0xfd(%rsp)
movq   $0x0,0x27(%rsp)
movq   $0x0,0x20(%rsp)
movups %xmm0,0x4c(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
lea    0xe0f(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <fscanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    13b4 <main+0x264>
lea    0x60(%rsp),%rbx
lea    0xde3(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0xf,%rbx
cmp    %rax,%rbp
jl     1240 <main+0xf0>
test   %eax,%eax
jle    13b4 <main+0x264>
mov    %r15,0x18(%rsp)
lea    0x20(%rsp),%r15
xor    %ecx,%ecx
jmp    1293 <main+0x143>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%ecx
add    $0x1,%ecx
mov    0x8(%rsp),%eax
cmp    %eax,%ecx
jge    136f <main+0x21f>
mov    %ecx,0x10(%rsp)
mov    %r12,%rdi
lea    0xd76(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    $0xffffffffffffffff,%rbx
lea    0x60(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
add    $0x1,%rbx
add    $0xf,%rbp
test   %rax,%rax
jne    12c0 <main+0x170>
mov    %r12,%rdi
lea    0xd38(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     1280 <main+0x130>
mov    %ebx,%esi
mov    0x14(%rsp),%eax
cltd
idiv   %ecx
mov    %eax,%r13d
imul   %ecx,%eax
sub    %eax,0x30(%rsp,%rsi,4)
test   %ecx,%ecx
jle    1280 <main+0x130>
xor    %r14d,%r14d
nopl   0x0(%rax)
mov    %r12,%rdi
lea    0xced(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    $0xffffffffffffffff,%rbx
lea    0x60(%rsp),%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
add    $0x1,%rbx
add    $0xf,%rbp
test   %rax,%rax
jne    1340 <main+0x1f0>
mov    %ebx,%eax
add    %r13d,0x30(%rsp,%rax,4)
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
jl     1320 <main+0x1d0>
jmp    1280 <main+0x130>
test   %eax,%eax
mov    0x18(%rsp),%r15
jle    13b4 <main+0x264>
lea    0x60(%rsp),%rbx
xor    %ebp,%ebp
lea    0xc9a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    0x30(%rsp,%rbp,4),%ecx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <fprintf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0xf,%rbx
cmp    %rax,%rbp
jl     1390 <main+0x240>
mov    %r12,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"gift1.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [10 x i8] c"gift1.out\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [6 x i8] c"%d %d\00"
@.str.7 = [7 x i8] c"%s %d\0A\00"
define i32 @main() {
%1 = alloca [11 x [15 x i8]]
%2 = alloca [15 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [11 x i32]
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = getelementptr inbounds [11 x [15 x i8]], [11 x [15 x i8]]* %1, i64 0, i64 0, i64 0
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast [11 x i32]* %6 to i8*
%15 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 0
br i1 %17, label %20, label %83
18: ; preds = %20
%19 = icmp sgt i32 %25, 0
br i1 %19, label %30, label %83
20: ; preds = %0, %20
%21 = phi i64 [ %24, %20 ], [ 0, %0 ]
%22 = getelementptr inbounds [11 x [15 x i8]], [11 x [15 x i8]]* %1, i64 0, i64 %21, i64 0
%23 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = add nuw nsw i64 %21, 1
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %24, %26
br i1 %27, label %20, label %18
28: ; preds = %69
%29 = icmp sgt i32 %71, 0
br i1 %29, label %73, label %83
30: ; preds = %18, %69
%31 = phi i32 [ %70, %69 ], [ 0, %18 ]
%32 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %10)
br label %33
33: ; preds = %33, %30
%34 = phi i64 [ %38, %33 ], [ 0, %30 ]
%35 = getelementptr inbounds [11 x [15 x i8]], [11 x [15 x i8]]* %1, i64 0, i64 %34, i64 0
%36 = call i64 @strcmp(i8* %35, i8* %10)
%37 = icmp eq i64 %36, 0
%38 = add nuw i64 %34, 1
br i1 %37, label %39, label %33
39: ; preds = %33
%40 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %4, i32* %5)
%41 = load i32, i32* %5
%42 = icmp eq i32 %41, 0
br i1 %42, label %69, label %43
43: ; preds = %39
%44 = and i64 %34, 4294967295
%45 = load i32, i32* %4
%46 = sdiv i32 %45, %41
%47 = mul nsw i32 %46, %41
%48 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %44
%49 = load i32, i32* %48
%50 = sub nsw i32 %49, %47
store i32 %50, i32* %48
%51 = icmp sgt i32 %41, 0
br i1 %51, label %52, label %69
52: ; preds = %43, %61
%53 = phi i32 [ %66, %61 ], [ 0, %43 ]
%54 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %10)
br label %55
55: ; preds = %55, %52
%56 = phi i64 [ %60, %55 ], [ 0, %52 ]
%57 = getelementptr inbounds [11 x [15 x i8]], [11 x [15 x i8]]* %1, i64 0, i64 %56, i64 0
%58 = call i64 @strcmp(i8* %57, i8* %10)
%59 = icmp eq i64 %58, 0
%60 = add nuw i64 %56, 1
br i1 %59, label %61, label %55
61: ; preds = %55
%62 = and i64 %56, 4294967295
%63 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %62
%64 = load i32, i32* %63
%65 = add nsw i32 %64, %46
store i32 %65, i32* %63
%66 = add nuw nsw i32 %53, 1
%67 = load i32, i32* %5
%68 = icmp slt i32 %66, %67
br i1 %68, label %52, label %69
69: ; preds = %61, %39, %43
%70 = add nuw nsw i32 %31, 1
%71 = load i32, i32* %3
%72 = icmp slt i32 %70, %71
br i1 %72, label %30, label %28
73: ; preds = %28, %73
%74 = phi i64 [ %79, %73 ], [ 0, %28 ]
%75 = getelementptr inbounds [11 x [15 x i8]], [11 x [15 x i8]]* %1, i64 0, i64 %74, i64 0
%76 = getelementptr inbounds [11 x i32], [11 x i32]* %6, i64 0, i64 %74
%77 = load i32, i32* %76
%78 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %75, i32 %77)
%79 = add nuw nsw i64 %74, 1
%80 = load i32, i32* %3
%81 = sext i32 %80 to i64
%82 = icmp slt i64 %79, %81
br i1 %82, label %73, label %83
83: ; preds = %73, %0, %18, %28
%84 = call i32 @fclose(i32* %7)
%85 = call i32 @fclose(i32* %8)
ret i32 0
}