#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 */
scalar_t__ Getline();
int atoi(char *);
int /*<<< orphan*/ notimpl(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
char *strcpy(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  extern int maxline;
  extern char *line;
  int i;
  int bufsize;
  int next;
  int count, counton;
  char *c;
  char *buffer[5000];
  int maxbuffer = 500;
  void *calloc();
  maxline = 50000;
  if (argc >= 2)
    maxline = atoi(argv[1]) + 2;
  if (maxline <= 2)
    notimpl("line length must be greater than zero");
  if (argc >= 3)
    maxbuffer = atoi(argv[2]);
  if (maxbuffer <= 0)
    notimpl("buffer length must be greater than zero");
  for (i = 0; i < maxbuffer; i++)
    buffer[i] = calloc(maxline, sizeof(char));
  line = calloc(maxline, sizeof(char));
  next = -1;
  bufsize = -1;
  count = -1;
  counton = 0;
  while (Getline() > 0) {
    i = 0;
    if (strncmp(line, "end", 3) == 0)
      counton = 0;
    while (i <= bufsize && (strcmp(line, buffer[i])) != 0)
      i++;
    if (i > bufsize) {
      next++;
      if (next > maxbuffer - 1)
        next = 0;
      if (bufsize < maxbuffer - 1)
        bufsize++;
      c = strcpy(buffer[next], line);
      printf("%s", line);
      if (counton)
        count++;
    }
    if (strncmp(line, "begin", 5) == 0)
      counton = 1;
  }
  printf("\n*Number of output lines between begin/end = %d", count);
  if (count > maxbuffer)
    printf("\n*Buffer size of %d lines exceeded-some duplicates may remain",
           maxbuffer);
  else
    printf("\n*All duplicates removed");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1f4,-0x9c74(%rbp)
mov    0x2e3e(%rip),%rax
movl   $0xc350,(%rax)
cmpl   $0x2,-0x8(%rbp)
jl     11d5 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,%ecx
add    $0x2,%ecx
mov    0x2e15(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e0c(%rip),%rax
cmpl   $0x2,(%rax)
jg     11f1 <main+0x71>
lea    0xe14(%rip),%rdi
call   10a0 <notimpl@plt>
cmpl   $0x3,-0x8(%rbp)
jl     120e <main+0x8e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x9c74(%rbp)
cmpl   $0x0,-0x9c74(%rbp)
jg     1227 <main+0xa7>
lea    0xe04(%rip),%rdi
call   10a0 <notimpl@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x9c74(%rbp),%eax
jge    126e <main+0xee>
mov    0x2da4(%rip),%rax
movslq (%rax),%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
mov    %rcx,-0x9c70(%rbp,%rax,8)
ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122e <main+0xae>
mov    0x2d73(%rip),%rax
movslq (%rax),%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    0x2d54(%rip),%rax
mov    %rcx,(%rax)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   1070 <Getline@plt>
cmp    $0x0,%rax
jle    141e <main+0x29e>
movl   $0x0,-0x14(%rbp)
mov    0x2d16(%rip),%rax
mov    (%rax),%rdi
lea    0xd7a(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12ef <main+0x16f>
movl   $0x0,-0x24(%rbp)
jmp    12f4 <main+0x174>
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x9c75(%rbp)
jg     1330 <main+0x1b0>
mov    0x2cd1(%rip),%rax
mov    (%rax),%rdi
movslq -0x14(%rbp),%rax
mov    -0x9c70(%rbp,%rax,8),%rsi
ff
call   1080 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9c75(%rbp)
mov    -0x9c75(%rbp),%al
test   $0x1,%al
jne    1343 <main+0x1c3>
jmp    1351 <main+0x1d1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12f4 <main+0x174>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    13ed <main+0x26d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x9c74(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    1381 <main+0x201>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x9c74(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    139e <main+0x21e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x1c(%rbp),%rax
mov    -0x9c70(%rbp,%rax,8),%rdi
ff
mov    0x2c2f(%rip),%rax
mov    (%rax),%rsi
call   1040 <strcpy@plt>
mov    %rax,-0x30(%rbp)
mov    0x2c1c(%rip),%rax
mov    (%rax),%rsi
lea    0xc84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x24(%rbp)
je     13e8 <main+0x268>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    13ed <main+0x26d>
mov    0x2bec(%rip),%rax
mov    (%rax),%rdi
lea    0xc57(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1419 <main+0x299>
movl   $0x1,-0x24(%rbp)
jmp    12ab <main+0x12b>
mov    -0x20(%rbp),%esi
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
cmp    -0x9c74(%rbp),%eax
jle    1457 <main+0x2d7>
mov    -0x9c74(%rbp),%esi
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1465 <main+0x2e5>
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x9c80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c58,%rsp
mov    0x2e40(%rip),%r14
movl   $0xc350,(%r14)
mov    $0x1f4,%r15d
cmp    $0x2,%edi
jl     11fe <main+0x6e>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   10a0 <atoi@plt>
lea    0x2(%rax),%ecx
mov    %ecx,(%r14)
test   %eax,%eax
jle    11d9 <main+0x49>
cmp    $0x3,%ebp
jae    11ea <main+0x5a>
jmp    11fe <main+0x6e>
lea    0xe20(%rip),%rdi
call   10b0 <notimpl@plt>
cmp    $0x3,%ebp
jb     11fe <main+0x6e>
mov    0x10(%rbx),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r15d
test   %eax,%eax
jle    13af <main+0x21f>
movslq (%r14),%r14
mov    %r15d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%esi
mov    %r14,%rdi
call   1070 <calloc@plt>
mov    %rax,0x10(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1210 <main+0x80>
mov    $0x1,%esi
mov    %r14,%rdi
call   1070 <calloc@plt>
mov    0x2da1(%rip),%r14
mov    %rax,(%r14)
xor    %eax,%eax
call   1080 <Getline@plt>
test   %rax,%rax
mov    %r15,0x8(%rsp)
jle    1350 <main+0x1c0>
lea    -0x1(%r15),%eax
mov    %eax,0x4(%rsp)
movl   $0xffffffff,(%rsp)
xor    %r13d,%r13d
mov    $0xffffffff,%r15d
mov    $0xffffffff,%r12d
jmp    12f6 <main+0x166>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rax
add    $0x1,%r15d
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
mov    $0x0,%eax
cmovge %eax,%r15d
xor    %eax,%eax
cmp    %ecx,%r12d
setl   %al
add    %eax,%r12d
movslq %r15d,%rax
mov    0x10(%rsp,%rax,8),%rdi
mov    (%r14),%rsi
call   1050 <strcpy@plt>
mov    (%r14),%rsi
lea    0xd97(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%r13d
sbbl   $0xffffffff,(%rsp)
mov    (%r14),%rdi
lea    0xd81(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
mov    $0x1,%eax
cmove  %eax,%r13d
xor    %eax,%eax
call   1080 <Getline@plt>
test   %rax,%rax
jle    1357 <main+0x1c7>
mov    (%r14),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
mov    $0x0,%eax
cmove  %eax,%r13d
test   %r12d,%r12d
js     1280 <main+0xf0>
lea    0x1(%r12),%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r14),%rdi
mov    0x10(%rsp,%rbx,8),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     12ca <main+0x13a>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1330 <main+0x1a0>
jmp    1280 <main+0xf0>
movl   $0xffffffff,(%rsp)
lea    0xcfd(%rip),%rdi
mov    (%rsp),%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rsi
cmp    %esi,%ebx
jle    1383 <main+0x1f3>
lea    0xd11(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1391 <main+0x201>
lea    0xd3f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc70(%rip),%rdi
call   10b0 <notimpl@plt>
movslq (%r14),%r14
jmp    122b <main+0x9b>

LLVM IR (-O0):
@maxline = external global i32
@.str = [38 x i8] c"line length must be greater than zero\00"
@.str.1 = [40 x i8] c"buffer length must be greater than zero\00"
@line = external global i8*
@.str.2 = [4 x i8] c"end\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [6 x i8] c"begin\00"
@.str.5 = [48 x i8] c"\0A*Number of output lines between begin/end = %d\00"
@.str.6 = [62 x i8] c"\0A*Buffer size of %d lines exceeded-some duplicates may remain\00"
@.str.7 = [25 x i8] c"\0A*All duplicates removed\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca [5000 x i8*]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 500, i32* %13
store i32 50000, i32* @maxline
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = add nsw i32 %20, 2
store i32 %21, i32* @maxline
br label %22
22: ; preds = %16, %2
%23 = load i32, i32* @maxline
%24 = icmp sle i32 %23, 2
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @notimpl(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* %4
%29 = icmp sge i32 %28, 3
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %13
br label %35
35: ; preds = %30, %27
%36 = load i32, i32* %13
%37 = icmp sle i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @notimpl(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %38, %35
store i32 0, i32* %6
br label %41
41: ; preds = %52, %40
%42 = load i32, i32* %6
%43 = load i32, i32* %13
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %55
45: ; preds = %41
%46 = load i32, i32* @maxline
%47 = sext i32 %46 to i64
%48 = call i8* @calloc(i64 %47, i64 1)
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %12, i64 0, i64 %50
store i8* %48, i8** %51
br label %52
52: ; preds = %45
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %41
55: ; preds = %41
%56 = load i32, i32* @maxline
%57 = sext i32 %56 to i64
%58 = call i8* @calloc(i64 %57, i64 1)
store i8* %58, i8** @line
store i32 -1, i32* %8
store i32 -1, i32* %7
store i32 -1, i32* %9
store i32 0, i32* %10
br label %59
59: ; preds = %125, %55
%60 = call i64 (...) @Getline()
%61 = icmp sgt i64 %60, 0
br i1 %61, label %62, label %126
62: ; preds = %59
store i32 0, i32* %6
%63 = load i8*, i8** @line
%64 = call i64 @strncmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62
store i32 0, i32* %10
br label %67
67: ; preds = %66, %62
br label %68
68: ; preds = %82, %67
%69 = load i32, i32* %6
%70 = load i32, i32* %7
%71 = icmp sle i32 %69, %70
br i1 %71, label %72, label %80
72: ; preds = %68
%73 = load i8*, i8** @line
%74 = load i32, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %12, i64 0, i64 %75
%77 = load i8*, i8** %76
%78 = call i64 @strcmp(i8* %73, i8* %77)
%79 = icmp ne i64 %78, 0
br label %80
80: ; preds = %72, %68
%81 = phi i1 [ false, %68 ], [ %79, %72 ]
br i1 %81, label %82, label %85
82: ; preds = %80
%83 = load i32, i32* %6
%84 = add nsw i32 %83, 1
store i32 %84, i32* %6
br label %68
85: ; preds = %80
%86 = load i32, i32* %6
%87 = load i32, i32* %7
%88 = icmp sgt i32 %86, %87
br i1 %88, label %89, label %120
89: ; preds = %85
%90 = load i32, i32* %8
%91 = add nsw i32 %90, 1
store i32 %91, i32* %8
%92 = load i32, i32* %8
%93 = load i32, i32* %13
%94 = sub nsw i32 %93, 1
%95 = icmp sgt i32 %92, %94
br i1 %95, label %96, label %97
96: ; preds = %89
store i32 0, i32* %8
br label %97
97: ; preds = %96, %89
%98 = load i32, i32* %7
%99 = load i32, i32* %13
%100 = sub nsw i32 %99, 1
%101 = icmp slt i32 %98, %100
br i1 %101, label %102, label %105
102: ; preds = %97
%103 = load i32, i32* %7
%104 = add nsw i32 %103, 1
store i32 %104, i32* %7
br label %105
105: ; preds = %102, %97
%106 = load i32, i32* %8
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %12, i64 0, i64 %107
%109 = load i8*, i8** %108
%110 = load i8*, i8** @line
%111 = call i8* @strcpy(i8* %109, i8* %110)
store i8* %111, i8** %11
%112 = load i8*, i8** @line
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %112)
%114 = load i32, i32* %10
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %105
%117 = load i32, i32* %9
%118 = add nsw i32 %117, 1
store i32 %118, i32* %9
br label %119
119: ; preds = %116, %105
br label %120
120: ; preds = %119, %85
%121 = load i8*, i8** @line
%122 = call i64 @strncmp(i8* %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %125
124: ; preds = %120
store i32 1, i32* %10
br label %125
125: ; preds = %124, %120
br label %59
126: ; preds = %59
%127 = load i32, i32* %9
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i32 %127)
%129 = load i32, i32* %9
%130 = load i32, i32* %13
%131 = icmp sgt i32 %129, %130
br i1 %131, label %132, label %135
132: ; preds = %126
%133 = load i32, i32* %13
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), i32 %133)
br label %137
135: ; preds = %126
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %137
137: ; preds = %135, %132
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@maxline = external global i32
@.str = [38 x i8] c"line length must be greater than zero\00"
@.str.1 = [40 x i8] c"buffer length must be greater than zero\00"
@line = external global i8*
@.str.2 = [4 x i8] c"end\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [6 x i8] c"begin\00"
@.str.5 = [48 x i8] c"\0A*Number of output lines between begin/end = %d\00"
@.str.6 = [62 x i8] c"\0A*Buffer size of %d lines exceeded-some duplicates may remain\00"
@.str.7 = [25 x i8] c"\0A*All duplicates removed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5000 x i8*]
%4 = bitcast [5000 x i8*]* %3 to i8*
store i32 50000, i32* @maxline
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %25
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = add nsw i32 %9, 2
store i32 %10, i32* @maxline
%11 = icmp slt i32 %9, 1
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @notimpl(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
%15 = icmp ugt i32 %0, 2
br i1 %15, label %16, label %25
16: ; preds = %14
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i32 @atoi(i8* %18)
%20 = icmp slt i32 %19, 1
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = tail call i32 @notimpl(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* @maxline
%24 = sext i32 %23 to i64
br label %36
25: ; preds = %16, %14, %2
%26 = phi i32 [ 500, %2 ], [ 500, %14 ], [ %19, %16 ]
%27 = load i32, i32* @maxline
%28 = sext i32 %27 to i64
%29 = zext i32 %26 to i64
br label %30
30: ; preds = %25, %30
%31 = phi i64 [ 0, %25 ], [ %34, %30 ]
%32 = tail call i8* @calloc(i64 %28, i64 1)
%33 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %3, i64 0, i64 %31
store i8* %32, i8** %33
%34 = add nuw nsw i64 %31, 1
%35 = icmp eq i64 %34, %29
br i1 %35, label %36, label %30
36: ; preds = %30, %21
%37 = phi i32 [ %19, %21 ], [ %26, %30 ]
%38 = phi i64 [ %24, %21 ], [ %28, %30 ]
%39 = tail call i8* @calloc(i64 %38, i64 1)
store i8* %39, i8** @line
%40 = tail call i64 (...) @Getline()
%41 = icmp sgt i64 %40, 0
br i1 %41, label %42, label %94
42: ; preds = %36
%43 = add nsw i32 %37, -1
br label %44
44: ; preds = %42, %84
%45 = phi i32 [ 0, %42 ], [ %91, %84 ]
%46 = phi i32 [ -1, %42 ], [ %87, %84 ]
%47 = phi i32 [ -1, %42 ], [ %86, %84 ]
%48 = phi i32 [ -1, %42 ], [ %85, %84 ]
%49 = load i8*, i8** @line
%50 = tail call i64 @strncmp(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%51 = icmp eq i64 %50, 0
%52 = select i1 %51, i32 0, i32 %45
%53 = icmp slt i32 %48, 0
br i1 %53, label %67, label %54
54: ; preds = %44
%55 = add nuw i32 %48, 1
%56 = zext i32 %55 to i64
br label %60
57: ; preds = %60
%58 = add nuw nsw i64 %61, 1
%59 = icmp eq i64 %58, %56
br i1 %59, label %67, label %60
60: ; preds = %54, %57
%61 = phi i64 [ 0, %54 ], [ %58, %57 ]
%62 = load i8*, i8** @line
%63 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %3, i64 0, i64 %61
%64 = load i8*, i8** %63
%65 = tail call i64 @strcmp(i8* %62, i8* %64)
%66 = icmp eq i64 %65, 0
br i1 %66, label %84, label %57
67: ; preds = %57, %44
%68 = add nsw i32 %47, 1
%69 = icmp slt i32 %47, %43
%70 = select i1 %69, i32 %68, i32 0
%71 = icmp slt i32 %48, %43
%72 = zext i1 %71 to i32
%73 = add nsw i32 %48, %72
%74 = sext i32 %70 to i64
%75 = getelementptr inbounds [5000 x i8*], [5000 x i8*]* %3, i64 0, i64 %74
%76 = load i8*, i8** %75
%77 = load i8*, i8** @line
%78 = tail call i8* @strcpy(i8* dereferenceable(1) %76, i8* dereferenceable(1) %77)
%79 = load i8*, i8** @line
%80 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %79)
%81 = icmp ne i32 %52, 0
%82 = zext i1 %81 to i32
%83 = add nsw i32 %46, %82
br label %84
84: ; preds = %60, %67
%85 = phi i32 [ %73, %67 ], [ %48, %60 ]
%86 = phi i32 [ %70, %67 ], [ %47, %60 ]
%87 = phi i32 [ %83, %67 ], [ %46, %60 ]
%88 = load i8*, i8** @line
%89 = tail call i64 @strncmp(i8* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 5)
%90 = icmp eq i64 %89, 0
%91 = select i1 %90, i32 1, i32 %52
%92 = tail call i64 (...) @Getline()
%93 = icmp sgt i64 %92, 0
br i1 %93, label %44, label %94
94: ; preds = %84, %36
%95 = phi i32 [ -1, %36 ], [ %87, %84 ]
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i32 %95)
%97 = icmp sgt i32 %95, %37
br i1 %97, label %98, label %100
98: ; preds = %94
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.6, i64 0, i64 0), i32 %37)
br label %102
100: ; preds = %94
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %102
102: ; preds = %100, %98
%103 = tail call i32 @putchar(i32 10)
ret i32 0
}