#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*/ config_name(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ lsmod_name(char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
int main(int argc, char **argv) {
  char mod_line[500];
  char conf_line[500];
  while (fgets(mod_line, 500, stdin) != NULL) {
    char mod_name[50] = "";
    char conf_name[50] = "";
    lsmod_name(mod_line, mod_name);
    if (strcmp(mod_name, "Module") == 0)
      continue;
    config_name(mod_name, conf_name);
    if (conf_name[0] == '\0') {
      printf("\x1b[33m"
             "# Module %s is not known to lsmodconf"
             "\x1b[0m"
             "\n",
             mod_name);
      continue;
    }
    char conf_name_from_line[50];
    unsigned short matched = 0;
    FILE *conf_file = fopen(argv[1], "r");
    while (fgets(conf_line, 500, conf_file) != NULL) {
      strcpy(conf_name_from_line, conf_line);
      conf_name_from_line[strlen(conf_name)] = '\0';
      if (strcmp(conf_name_from_line, conf_name) == 0 &&
          conf_line[strlen(conf_name)] == '=') {
        printf("%s", conf_line);
        matched = 1;
      }
    }
    fclose(conf_file);
    if (matched)
      continue;
    conf_file = fopen(argv[1], "r");
    while (fgets(conf_line, 500, conf_file) != NULL) {
      strcpy(conf_name_from_line, "# ");
      strcat(conf_name_from_line, conf_name);
      strcat(conf_name_from_line, " is not set\n");
      if (strcmp(conf_name_from_line, conf_line) == 0) {
        printf("%s", conf_line);
        matched = 1;
      }
    }
    fclose(conf_file);
    if (matched)
      continue;
    printf("\x1b[31m"
           "# Config string %s for module %s could not be found. Perhaps "
           "there's a version mismatch?"
           "\x1b[0m"
           "\n",
           conf_name, mod_name);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    0x2e11(%rip),%rax
mov    (%rax),%rdx
mov    $0x1f4,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1465 <main+0x2b5>
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1070 <memset@plt>
lea    -0x490(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1070 <memset@plt>
lea    -0x210(%rbp),%rdi
lea    -0x450(%rbp),%rsi
call   10a0 <lsmod_name@plt>
lea    -0x450(%rbp),%rdi
lea    0xdcb(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1249 <main+0x99>
jmp    11c9 <main+0x19>
lea    -0x450(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   10d0 <config_name@plt>
movsbl -0x490(%rbp),%eax
cmp    $0x0,%eax
jne    1286 <main+0xd6>
lea    -0x450(%rbp),%rsi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11c9 <main+0x19>
movw   $0x0,-0x4d2(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd99(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x4e0(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4e0(%rbp),%rdx
mov    $0x1f4,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1350 <main+0x1a0>
lea    -0x4d0(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x490(%rbp),%rdi
call   1050 <strlen@plt>
movb   $0x0,-0x4d0(%rbp,%rax,1)
lea    -0x4d0(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    134b <main+0x19b>
lea    -0x490(%rbp),%rdi
call   1050 <strlen@plt>
movsbl -0x410(%rbp,%rax,1),%eax
ff
cmp    $0x3d,%eax
jne    134b <main+0x19b>
lea    -0x410(%rbp),%rsi
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movw   $0x1,-0x4d2(%rbp)
jmp    12aa <main+0xfa>
mov    -0x4e0(%rbp),%rdi
call   1040 <fclose@plt>
cmpw   $0x0,-0x4d2(%rbp)
je     136f <main+0x1bf>
jmp    11c9 <main+0x19>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcb9(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x4e0(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4e0(%rbp),%rdx
mov    $0x1f4,%esi
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     1425 <main+0x275>
lea    -0x4d0(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x4d0(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x4d0(%rbp),%rdi
lea    0xc5f(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x4d0(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1420 <main+0x270>
lea    -0x410(%rbp),%rsi
lea    0xc29(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movw   $0x1,-0x4d2(%rbp)
jmp    138a <main+0x1da>
mov    -0x4e0(%rbp),%rdi
call   1040 <fclose@plt>
cmpw   $0x0,-0x4d2(%rbp)
je     1444 <main+0x294>
jmp    11c9 <main+0x19>
lea    -0x490(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    0xbf3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11c9 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x4e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4c8,%rsp
mov    %rsi,0x8(%rsp)
mov    0x2e2b(%rip),%r15
mov    (%r15),%rdx
lea    0xd0(%rsp),%rdi
mov    $0x1f4,%esi
call   1070 <fgets@plt>
test   %rax,%rax
je     1471 <main+0x2d1>
lea    0xd0(%rsp),%r13
lea    0x10(%rsp),%rbx
lea    0x50(%rsp),%r12
lea    0x2d0(%rsp),%rbp
lea    0x90(%rsp),%r14
jmp    1242 <main+0xa2>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xe3e(%rip),%rdi
mov    %r12,%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2dc4(%rip),%r15
mov    (%r15),%rdx
mov    %r13,%rdi
mov    $0x1f4,%esi
call   1070 <fgets@plt>
test   %rax,%rax
lea    0x10(%rsp),%rbx
je     1471 <main+0x2d1>
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movw   $0x0,0x80(%rsp)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1090 <lsmod_name@plt>
mov    %rbx,%rdi
lea    0xd77(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1224 <main+0x84>
mov    %r15,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   10c0 <config_name@plt>
cmpb   $0x0,0x50(%rsp)
je     1380 <main+0x1e0>
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0xd76(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r13
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1399 <main+0x1f9>
xor    %ebx,%ebx
lea    0xd51(%rip),%r15
jmp    1305 <main+0x165>
nopl   (%rax)
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1360 <main+0x1c0>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1050 <strlen@plt>
movb   $0x0,0x90(%rsp,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    12f0 <main+0x150>
mov    %r12,%rdi
call   1050 <strlen@plt>
cmpb   $0x3d,0x2d0(%rsp,%rax,1)
3d
jne    12f0 <main+0x150>
lea    0xcf0(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%bx
jmp    12f0 <main+0x150>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1040 <fclose@plt>
test   %bx,%bx
lea    0xd0(%rsp),%r13
jne    121d <main+0x7d>
jmp    13b0 <main+0x210>
nopl   0x0(%rax,%rax,1)
lea    0xc80(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%r15
jmp    1224 <main+0x84>
mov    %r13,%rdi
call   1040 <fclose@plt>
lea    0xd0(%rsp),%r13
lea    0xc8c(%rip),%r15
mov    0x8(%rsp),%rax
mov    0x8(%rax),%rdi
lea    0xc77(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     11ff <main+0x5f>
xor    %r13d,%r13d
jmp    1405 <main+0x265>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x1f4,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1452 <main+0x2b2>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <strcat@plt>
mov    %r14,%rdi
lea    0xc1a(%rip),%rsi
call   10b0 <strcat@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    13f0 <main+0x250>
lea    0xbf8(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13w
jmp    13f0 <main+0x250>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %r13w,%r13w
lea    0xd0(%rsp),%r13
jne    121d <main+0x7d>
jmp    1207 <main+0x67>
xor    %eax,%eax
add    $0x4c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [7 x i8] c"Module\00"
@.str.1 = [48 x i8] c"\1B[33m# Module %s is not known to lsmodconf\1B[0m\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"# \00"
@.str.5 = [13 x i8] c" is not set\0A\00"
@.str.6 = [99 x i8] c"\1B[31m# Config string %s for module %s could not be found. Perhaps there's a version mismatch?\1B[0m\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [500 x i8]
%7 = alloca [500 x i8]
%8 = alloca [50 x i8]
%9 = alloca [50 x i8]
%10 = alloca [50 x i8]
%11 = alloca i16
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %13
13: ; preds = %109, %108, %76, %36, %27, %2
%14 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%15 = load i32*, i32** @stdin
%16 = call i32* @fgets(i8* %14, i32 500, i32* %15)
%17 = icmp ne i32* %16, null
br i1 %17, label %18, label %113
18: ; preds = %13
%19 = bitcast [50 x i8]* %8 to i8*
%20 = bitcast [50 x i8]* %9 to i8*
%21 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%23 = call i32 @lsmod_name(i8* %21, i8* %22)
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %18
br label %13
28: ; preds = %18
%29 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%30 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%31 = call i32 @config_name(i8* %29, i8* %30)
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %28
%37 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %37)
br label %13
39: ; preds = %28
store i16 0, i16* %11
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32* @fopen(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %43, i32** %12
br label %44
44: ; preds = %70, %39
%45 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%46 = load i32*, i32** %12
%47 = call i32* @fgets(i8* %45, i32 500, i32* %46)
%48 = icmp ne i32* %47, null
br i1 %48, label %49, label %71
49: ; preds = %44
%50 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%51 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%52 = call i32 @strcpy(i8* %50, i8* %51)
%53 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%54 = call i64 @strlen(i8* %53)
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 %54
store i8 0, i8* %55
%56 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%57 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%58 = call i64 @strcmp(i8* %56, i8* %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %70
60: ; preds = %49
%61 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%62 = call i64 @strlen(i8* %61)
%63 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 61
br i1 %66, label %67, label %70
67: ; preds = %60
%68 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%69 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %68)
store i16 1, i16* %11
br label %70
70: ; preds = %67, %60, %49
br label %44
71: ; preds = %44
%72 = load i32*, i32** %12
%73 = call i32 @fclose(i32* %72)
%74 = load i16, i16* %11
%75 = icmp ne i16 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %71
br label %13
77: ; preds = %71
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i32* @fopen(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %81, i32** %12
br label %82
82: ; preds = %102, %77
%83 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%84 = load i32*, i32** %12
%85 = call i32* @fgets(i8* %83, i32 500, i32* %84)
%86 = icmp ne i32* %85, null
br i1 %86, label %87, label %103
87: ; preds = %82
%88 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%89 = call i32 @strcpy(i8* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%90 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%91 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%92 = call i32 @strcat(i8* %90, i8* %91)
%93 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%94 = call i32 @strcat(i8* %93, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%95 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%96 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%97 = call i64 @strcmp(i8* %95, i8* %96)
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %87
%100 = getelementptr inbounds [500 x i8], [500 x i8]* %7, i64 0, i64 0
%101 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %100)
store i16 1, i16* %11
br label %102
102: ; preds = %99, %87
br label %82
103: ; preds = %82
%104 = load i32*, i32** %12
%105 = call i32 @fclose(i32* %104)
%106 = load i16, i16* %11
%107 = icmp ne i16 %106, 0
br i1 %107, label %108, label %109
108: ; preds = %103
br label %13
109: ; preds = %103
%110 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%111 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%112 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.6, i64 0, i64 0), i8* %110, i8* %111)
br label %13
113: ; preds = %13
%114 = load i32, i32* %3
ret i32 %114
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [7 x i8] c"Module\00"
@.str.1 = [48 x i8] c"\1B[33m# Module %s is not known to lsmodconf\1B[0m\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"# \00"
@.str.5 = [13 x i8] c" is not set\0A\00"
@.str.6 = [99 x i8] c"\1B[31m# Config string %s for module %s could not be found. Perhaps there's a version mismatch?\1B[0m\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [500 x i8]
%4 = alloca [500 x i8]
%5 = alloca [50 x i8]
%6 = alloca [50 x i8]
%7 = alloca [50 x i8]
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 0
%10 = load i32*, i32** @stdin
%11 = call i32* @fgets(i8* %8, i32 500, i32* %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %86, label %13
13: ; preds = %2
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds i8*, i8** %1, i64 1
br label %18
18: ; preds = %13, %82
%19 = call i32 @lsmod_name(i8* %8, i8* %14)
%20 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %82, label %22
22: ; preds = %18
%23 = call i32 @config_name(i8* %14, i8* %15)
%24 = load i8, i8* %15
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %82
28: ; preds = %22
%29 = load i8*, i8** %17
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = call i32* @fgets(i8* %9, i32 500, i32* %30)
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = call i32 @fclose(i32* %30)
br label %56
35: ; preds = %28, %49
%36 = phi i16 [ %50, %49 ], [ 0, %28 ]
%37 = call i32 @strcpy(i8* %16, i8* %9)
%38 = call i64 @strlen(i8* %15)
%39 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 %38
store i8 0, i8* %39
%40 = call i64 @strcmp(i8* %16, i8* %15)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %35
%43 = call i64 @strlen(i8* %15)
%44 = getelementptr inbounds [500 x i8], [500 x i8]* %4, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 61
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %9)
br label %49
49: ; preds = %47, %42, %35
%50 = phi i16 [ 1, %47 ], [ %36, %42 ], [ %36, %35 ]
%51 = call i32* @fgets(i8* %9, i32 500, i32* %30)
%52 = icmp eq i32* %51, null
br i1 %52, label %53, label %35
53: ; preds = %49
%54 = call i32 @fclose(i32* %30)
%55 = icmp eq i16 %50, 0
br i1 %55, label %56, label %81
56: ; preds = %33, %53
%57 = load i8*, i8** %17
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%59 = call i32* @fgets(i8* %9, i32 500, i32* %58)
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 @fclose(i32* %58)
br label %79
63: ; preds = %56, %72
%64 = phi i16 [ %73, %72 ], [ 0, %56 ]
%65 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%66 = call i32 @strcat(i8* %16, i8* %15)
%67 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%68 = call i64 @strcmp(i8* %16, i8* %9)
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %63
%71 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %9)
br label %72
72: ; preds = %70, %63
%73 = phi i16 [ 1, %70 ], [ %64, %63 ]
%74 = call i32* @fgets(i8* %9, i32 500, i32* %58)
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %63
76: ; preds = %72
%77 = call i32 @fclose(i32* %58)
%78 = icmp eq i16 %73, 0
br i1 %78, label %79, label %81
79: ; preds = %61, %76
%80 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.6, i64 0, i64 0), i8* %15, i8* %14)
br label %81
81: ; preds = %76, %53, %79
br label %82
82: ; preds = %18, %81, %26
%83 = load i32*, i32** @stdin
%84 = call i32* @fgets(i8* %8, i32 500, i32* %83)
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %18
86: ; preds = %82, %2
ret i32 0
}