#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
char *malloc(int);
int search(char *, char **, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
main() {
  FILE *fin = fopen("gift1.in", "r");
  FILE *fout = fopen("gift1.out", "w");
  int n, i, j, tmoney, gives, indt, indg, div;
  char name1[15], name2[15];
  char *people[11];
  char *x;
  int inout[22];
  fscanf(fin, "%d", &n);
  for (i = 1; i <= (2 * n); ++i) {
    inout[i] = 0;
  }
  for (i = 1; i <= n; ++i) {
    fscanf(fin, "%s", name1);
    x = malloc(sizeof(char) * (strlen(name1)));
    strcpy(x, name1);
    people[i] = x;
  }
  for (i = 0; i < n; ++i) {
    fscanf(fin, "%s", name1);
    fscanf(fin, "%d %d", &tmoney, &gives);
    indg = search(name1, people, n);
    if (gives == 0) {
      inout[2 * indg - 1] += tmoney;
      continue;
    }
    div = tmoney / gives;
    inout[2 * indg] += ((gives * div));
    for (j = 0; j < gives; ++j) {
      fscanf(fin, "%s", name2);
      indt = search(name2, people, n);
      inout[2 * indt - 1] += div;
    }
  }
  for (i = 1; i <= n; ++i) {
    fprintf(fout, "%s %d\n", people[i], inout[2 * i - 1] - inout[2 * i]);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe5b(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe52(%rip),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     120b <main+0x8b>
movslq -0x20(%rbp),%rax
movl   $0x0,-0x110(%rbp,%rax,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11dd <main+0x5d>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1282 <main+0x102>
mov    -0x10(%rbp),%rdi
lea    -0x47(%rbp),%rdx
lea    0xdea(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
lea    -0x47(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb8(%rbp),%rdi
lea    -0x47(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xb8(%rbp),%rcx
movslq -0x20(%rbp),%rax
mov    %rcx,-0xb0(%rbp,%rax,8)
ff
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1212 <main+0x92>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13a9 <main+0x229>
mov    -0x10(%rbp),%rdi
lea    -0x47(%rbp),%rdx
lea    0xd73(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd64(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
mov    $0x0,%al
call   1060 <fscanf@plt>
lea    -0x47(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <search@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1306 <main+0x186>
mov    -0x28(%rbp),%ecx
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
cltq
add    -0x110(%rbp,%rax,4),%ecx
mov    %ecx,-0x110(%rbp,%rax,4)
jmp    139b <main+0x21b>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x2c(%rbp)
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%ecx
imul   -0x38(%rbp),%ecx
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
cltq
add    -0x110(%rbp,%rax,4),%ecx
mov    %ecx,-0x110(%rbp,%rax,4)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1396 <main+0x216>
mov    -0x10(%rbp),%rdi
lea    -0x56(%rbp),%rdx
lea    0xcc8(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
lea    -0x56(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <search@plt>
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
cltq
add    -0x110(%rbp,%rax,4),%ecx
mov    %ecx,-0x110(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1334 <main+0x1b4>
jmp    139b <main+0x21b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1289 <main+0x109>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1407 <main+0x287>
mov    -0x18(%rbp),%rdi
movslq -0x20(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdx
ff
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
cltq
mov    -0x110(%rbp,%rax,4),%ecx
mov    -0x20(%rbp),%eax
shl    $0x1,%eax
cltq
sub    -0x110(%rbp,%rax,4),%ecx
lea    0xc2c(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13b0 <main+0x230>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
lea    0xe58(%rip),%rdi
lea    0xe5a(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbp
lea    0xe4d(%rip),%rdi
lea    0xe50(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r13
lea    0xe49(%rip),%rsi
mov    %rsp,%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
jle    13a8 <main+0x218>
add    %eax,%eax
lea    0x34(%rsp),%rdi
cmp    $0x2,%eax
mov    $0x1,%edx
cmovge %eax,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe07(%rip),%r14
lea    0x21(%rsp),%r12
xor    %ebx,%ebx
mov    %rbp,0x8(%rsp)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbp,0xa8(%rsp,%rbx,8)
mov    0x8(%rsp),%rbp
movslq (%rsp),%rax
add    $0x1,%rbx
cmp    %rax,%rbx
jl     1220 <main+0x90>
test   %eax,%eax
jle    13a8 <main+0x218>
mov    %r13,0x18(%rsp)
lea    0xd9c(%rip),%rsi
lea    0xa0(%rsp),%r12
lea    0x91(%rsp),%r15
xor    %ebp,%ebp
jmp    12ae <main+0x11e>
nop
add    %ecx,%ecx
movslq %ecx,%rcx
add    %eax,0x2c(%rsp,%rcx,4)
mov    %r13,%rsi
mov    0x10(%rsp),%ebp
add    $0x1,%ebp
mov    (%rsp),%eax
cmp    %eax,%ebp
jge    1368 <main+0x1d8>
mov    0x8(%rsp),%r14
mov    %r14,%rdi
mov    %rsi,%r13
lea    0x21(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    %r14,%rdi
lea    0xd48(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x4(%rsp),%rcx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    (%rsp),%edx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <search@plt>
mov    %eax,%ecx
mov    0x4(%rsp),%esi
mov    0x14(%rsp),%eax
test   %esi,%esi
mov    %ebp,0x10(%rsp)
je     1290 <main+0x100>
cltd
idiv   %esi
mov    %eax,%r14d
imul   %esi,%eax
add    %ecx,%ecx
movslq %ecx,%rcx
add    %eax,0x30(%rsp,%rcx,4)
test   %esi,%esi
mov    %r13,%rsi
mov    0x8(%rsp),%rbp
jle    129c <main+0x10c>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    (%rsp),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <search@plt>
mov    %r13,%rsi
add    %eax,%eax
cltq
add    %r14d,0x2c(%rsp,%rax,4)
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     1330 <main+0x1a0>
jmp    129c <main+0x10c>
test   %eax,%eax
mov    0x18(%rsp),%rbx
jle    13a8 <main+0x218>
xor    %ebp,%ebp
lea    0xca6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    0xa8(%rsp,%rbp,8),%rdx
mov    0x34(%rsp,%rbp,8),%ecx
sub    0x38(%rsp,%rbp,8),%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <fprintf@plt>
movslq (%rsp),%rax
add    $0x1,%rbp
cmp    %rax,%rbp
jl     1380 <main+0x1f0>
xor    %edi,%edi
call   10b0 <exit@plt>

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 i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [15 x i8]
%13 = alloca [15 x i8]
%14 = alloca [11 x i8*]
%15 = alloca i8*
%16 = alloca [22 x i32]
store i32 0, i32* %1
%17 = 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* %17, i32** %2
%18 = 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* %18, i32** %3
%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* %4)
store i32 1, i32* %5
br label %21
21: ; preds = %30, %0
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = mul nsw i32 2, %23
%25 = icmp sle i32 %22, %24
br i1 %25, label %26, label %33
26: ; preds = %21
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %28
store i32 0, i32* %29
br label %30
30: ; preds = %26
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %21
33: ; preds = %21
store i32 1, i32* %5
br label %34
34: ; preds = %55, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %4
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %58
38: ; preds = %34
%39 = load i32*, i32** %2
%40 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%41 = call i32 (i32*, i8*, ...) @fscanf(i32* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%43 = call i32 @strlen(i8* %42)
%44 = sext i32 %43 to i64
%45 = mul i64 1, %44
%46 = trunc i64 %45 to i32
%47 = call i8* @malloc(i32 %46)
store i8* %47, i8** %15
%48 = load i8*, i8** %15
%49 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%50 = call i32 @strcpy(i8* %48, i8* %49)
%51 = load i8*, i8** %15
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [11 x i8*], [11 x i8*]* %14, i64 0, i64 %53
store i8* %51, i8** %54
br label %55
55: ; preds = %38
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %34
58: ; preds = %34
store i32 0, i32* %5
br label %59
59: ; preds = %121, %58
%60 = load i32, i32* %5
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %124
63: ; preds = %59
%64 = load i32*, i32** %2
%65 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%66 = call i32 (i32*, i8*, ...) @fscanf(i32* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %65)
%67 = load i32*, i32** %2
%68 = call i32 (i32*, i8*, ...) @fscanf(i32* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %7, i32* %8)
%69 = getelementptr inbounds [15 x i8], [15 x i8]* %12, i64 0, i64 0
%70 = getelementptr inbounds [11 x i8*], [11 x i8*]* %14, i64 0, i64 0
%71 = load i32, i32* %4
%72 = call i32 @search(i8* %69, i8** %70, i32 %71)
store i32 %72, i32* %10
%73 = load i32, i32* %8
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %84
75: ; preds = %63
%76 = load i32, i32* %7
%77 = load i32, i32* %10
%78 = mul nsw i32 2, %77
%79 = sub nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %80
%82 = load i32, i32* %81
%83 = add nsw i32 %82, %76
store i32 %83, i32* %81
br label %121
84: ; preds = %63
%85 = load i32, i32* %7
%86 = load i32, i32* %8
%87 = sdiv i32 %85, %86
store i32 %87, i32* %11
%88 = load i32, i32* %8
%89 = load i32, i32* %11
%90 = mul nsw i32 %88, %89
%91 = load i32, i32* %10
%92 = mul nsw i32 2, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %93
%95 = load i32, i32* %94
%96 = add nsw i32 %95, %90
store i32 %96, i32* %94
store i32 0, i32* %6
br label %97
97: ; preds = %117, %84
%98 = load i32, i32* %6
%99 = load i32, i32* %8
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %120
101: ; preds = %97
%102 = load i32*, i32** %2
%103 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%104 = call i32 (i32*, i8*, ...) @fscanf(i32* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %103)
%105 = getelementptr inbounds [15 x i8], [15 x i8]* %13, i64 0, i64 0
%106 = getelementptr inbounds [11 x i8*], [11 x i8*]* %14, i64 0, i64 0
%107 = load i32, i32* %4
%108 = call i32 @search(i8* %105, i8** %106, i32 %107)
store i32 %108, i32* %9
%109 = load i32, i32* %11
%110 = load i32, i32* %9
%111 = mul nsw i32 2, %110
%112 = sub nsw i32 %111, 1
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = add nsw i32 %115, %109
store i32 %116, i32* %114
br label %117
117: ; preds = %101
%118 = load i32, i32* %6
%119 = add nsw i32 %118, 1
store i32 %119, i32* %6
br label %97
120: ; preds = %97
br label %121
121: ; preds = %120, %75
%122 = load i32, i32* %5
%123 = add nsw i32 %122, 1
store i32 %123, i32* %5
br label %59
124: ; preds = %59
store i32 1, i32* %5
br label %125
125: ; preds = %148, %124
%126 = load i32, i32* %5
%127 = load i32, i32* %4
%128 = icmp sle i32 %126, %127
br i1 %128, label %129, label %151
129: ; preds = %125
%130 = load i32*, i32** %3
%131 = load i32, i32* %5
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [11 x i8*], [11 x i8*]* %14, i64 0, i64 %132
%134 = load i8*, i8** %133
%135 = load i32, i32* %5
%136 = mul nsw i32 2, %135
%137 = sub nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = load i32, i32* %5
%142 = mul nsw i32 2, %141
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [22 x i32], [22 x i32]* %16, i64 0, i64 %143
%145 = load i32, i32* %144
%146 = sub nsw i32 %140, %145
%147 = call i32 @fprintf(i32* %130, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %134, i32 %146)
br label %148
148: ; preds = %129
%149 = load i32, i32* %5
%150 = add nsw i32 %149, 1
store i32 %150, i32* %5
br label %125
151: ; preds = %125
%152 = call i32 @exit(i32 0)
unreachable
}

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 i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [15 x i8]
%5 = alloca [15 x i8]
%6 = alloca [11 x i8*]
%7 = alloca [22 x i32]
%8 = 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))
%9 = 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))
%10 = bitcast i32* %1 to i8*
%11 = bitcast i32* %2 to i8*
%12 = bitcast i32* %3 to i8*
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%15 = bitcast [11 x i8*]* %6 to i8*
%16 = bitcast [22 x i32]* %7 to i8*
%17 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%18 = load i32, i32* %1
%19 = icmp slt i32 %18, 1
br i1 %19, label %103, label %20
20: ; preds = %0
%21 = shl nuw i32 %18, 1
%22 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 1
%23 = bitcast i32* %22 to i8*
%24 = call i32 @llvm.smax.i32(i32 %21, i32 1)
%25 = zext i32 %24 to i64
%26 = shl nuw nsw i64 %25, 2
br label %31
27: ; preds = %31
%28 = icmp sgt i32 %39, 0
br i1 %28, label %29, label %103
29: ; preds = %27
%30 = getelementptr inbounds [11 x i8*], [11 x i8*]* %6, i64 0, i64 0
br label %44
31: ; preds = %20, %31
%32 = phi i64 [ 1, %20 ], [ %38, %31 ]
%33 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%34 = call i32 @strlen(i8* %13)
%35 = call i8* @malloc(i32 %34)
%36 = call i32 @strcpy(i8* %35, i8* %13)
%37 = getelementptr inbounds [11 x i8*], [11 x i8*]* %6, i64 0, i64 %32
store i8* %35, i8** %37
%38 = add nuw nsw i64 %32, 1
%39 = load i32, i32* %1
%40 = sext i32 %39 to i64
%41 = icmp slt i64 %32, %40
br i1 %41, label %31, label %27
42: ; preds = %83
%43 = icmp slt i32 %85, 1
br i1 %43, label %103, label %87
44: ; preds = %29, %83
%45 = phi i32 [ 0, %29 ], [ %84, %83 ]
%46 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%47 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32* %2, i32* %3)
%48 = load i32, i32* %1
%49 = call i32 @search(i8* %13, i8** %30, i32 %48)
%50 = load i32, i32* %3
%51 = icmp eq i32 %50, 0
%52 = load i32, i32* %2
br i1 %51, label %53, label %60
53: ; preds = %44
%54 = shl nsw i32 %49, 1
%55 = add nsw i32 %54, -1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, %52
store i32 %59, i32* %57
br label %83
60: ; preds = %44
%61 = sdiv i32 %52, %50
%62 = mul nsw i32 %61, %50
%63 = shl nsw i32 %49, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = add nsw i32 %66, %62
store i32 %67, i32* %65
%68 = icmp sgt i32 %50, 0
br i1 %68, label %69, label %83
69: ; preds = %60, %69
%70 = phi i32 [ %80, %69 ], [ 0, %60 ]
%71 = call i32 (i32*, i8*, ...) @fscanf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%72 = load i32, i32* %1
%73 = call i32 @search(i8* %14, i8** %30, i32 %72)
%74 = shl nsw i32 %73, 1
%75 = add nsw i32 %74, -1
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 %76
%78 = load i32, i32* %77
%79 = add nsw i32 %78, %61
store i32 %79, i32* %77
%80 = add nuw nsw i32 %70, 1
%81 = load i32, i32* %3
%82 = icmp slt i32 %80, %81
br i1 %82, label %69, label %83
83: ; preds = %69, %60, %53
%84 = add nuw nsw i32 %45, 1
%85 = load i32, i32* %1
%86 = icmp slt i32 %84, %85
br i1 %86, label %44, label %42
87: ; preds = %42, %87
%88 = phi i64 [ %99, %87 ], [ 1, %42 ]
%89 = getelementptr inbounds [11 x i8*], [11 x i8*]* %6, i64 0, i64 %88
%90 = load i8*, i8** %89
%91 = shl nuw nsw i64 %88, 1
%92 = add nsw i64 %91, -1
%93 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = getelementptr inbounds [22 x i32], [22 x i32]* %7, i64 0, i64 %91
%96 = load i32, i32* %95
%97 = sub nsw i32 %94, %96
%98 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %90, i32 %97)
%99 = add nuw nsw i64 %88, 1
%100 = load i32, i32* %1
%101 = sext i32 %100 to i64
%102 = icmp slt i64 %88, %101
br i1 %102, label %87, label %103
103: ; preds = %87, %0, %27, %42
%104 = call i32 @exit(i32 0)
unreachable
}