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

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *find_char_or_comment(char *, char);
int /*<<< orphan*/ free(char *);
char *lskip(char *);
scalar_t__ malloc(int);
char *rstrip(char *);
int /*<<< orphan*/ strncpy0(char *, char *, int);
int rtl_iniParseFile(FILE *file,
                     int (*handler)(void *, const char *, const char *,
                                    const char *),
                     void *user) {
  char *line;
  char section[50] = "";
  char prev_name[50] = "";
  char *start;
  char *end;
  char *name;
  char *value;
  int lineno = 0;
  int error = 0;
  line = (char *)malloc(200);
  if (!line) {
    return -2;
  }
  while (fgets(line, 200, file) != NULL) {
    lineno++;
    start = line;
    start = lskip(rstrip(start));
    if (*start == ';' || *start == '#') {
    } else if (*start == '[') {
      end = find_char_or_comment(start + 1, ']');
      if (*end == ']') {
        *end = '\0';
        strncpy0(section, start + 1, sizeof(section));
        *prev_name = '\0';
      } else if (!error) {
        error = lineno;
      }
    } else if (*start && *start != ';') {
      end = find_char_or_comment(start, '=');
      if (*end != '=') {
        end = find_char_or_comment(start, ':');
      }
      if (*end == '=' || *end == ':') {
        *end = '\0';
        name = rstrip(start);
        value = lskip(end + 1);
        end = find_char_or_comment(value, '\0');
        if (*end == ';')
          *end = '\0';
        rstrip(value);
        strncpy0(prev_name, name, sizeof(prev_name));
        if (!handler(user, section, name, value) && !error)
          error = lineno;
      } else if (!error) {
        error = lineno;
      }
    }
  }
  free(line);
  return error;
}


x86 assembly (clang, -O0):
<rtl_iniParseFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc8(%rbp)
mov    $0xc8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11f3 <rtl_iniParseFile+0x73>
movl   $0xfffffffe,-0x4(%rbp)
jmp    14a8 <rtl_iniParseFile+0x328>
jmp    11f8 <rtl_iniParseFile+0x78>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xc8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1496 <rtl_iniParseFile+0x316>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rdi
call   1030 <rstrip@plt>
mov    %rax,%rdi
call   10a0 <lskip@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
je     126f <rtl_iniParseFile+0xef>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1274 <rtl_iniParseFile+0xf4>
jmp    1491 <rtl_iniParseFile+0x311>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jne    1308 <rtl_iniParseFile+0x188>
mov    -0xa8(%rbp),%rdi
add    $0x1,%rdi
mov    $0x5d,%esi
call   1080 <find_char_or_comment@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5d,%eax
jne    12e5 <rtl_iniParseFile+0x165>
mov    -0xb0(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x60(%rbp),%rdi
mov    -0xa8(%rbp),%rsi
add    $0x1,%rsi
mov    $0x32,%edx
call   1090 <strncpy0@plt>
movb   $0x0,-0xa0(%rbp)
jmp    1303 <rtl_iniParseFile+0x183>
cmpl   $0x0,-0xc8(%rbp)
jne    12fe <rtl_iniParseFile+0x17e>
mov    -0xc4(%rbp),%eax
mov    %eax,-0xc8(%rbp)
jmp    1303 <rtl_iniParseFile+0x183>
jmp    148c <rtl_iniParseFile+0x30c>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1487 <rtl_iniParseFile+0x307>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
je     1487 <rtl_iniParseFile+0x307>
mov    -0xa8(%rbp),%rdi
mov    $0x3d,%esi
call   1080 <find_char_or_comment@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1371 <rtl_iniParseFile+0x1f1>
mov    -0xa8(%rbp),%rdi
mov    $0x3a,%esi
call   1080 <find_char_or_comment@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     1397 <rtl_iniParseFile+0x217>
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1464 <rtl_iniParseFile+0x2e4>
mov    -0xb0(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xa8(%rbp),%rdi
call   1030 <rstrip@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <lskip@plt>
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rdi
xor    %esi,%esi
call   1080 <find_char_or_comment@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    13fd <rtl_iniParseFile+0x27d>
mov    -0xb0(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc0(%rbp),%rdi
call   1030 <rstrip@plt>
lea    -0xa0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
mov    $0x32,%edx
call   1090 <strncpy0@plt>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0xb8(%rbp),%rdx
mov    -0xc0(%rbp),%rcx
call   *%rax
cmp    $0x0,%eax
jne    145f <rtl_iniParseFile+0x2df>
cmpl   $0x0,-0xc8(%rbp)
jne    145f <rtl_iniParseFile+0x2df>
mov    -0xc4(%rbp),%eax
mov    %eax,-0xc8(%rbp)
jmp    1482 <rtl_iniParseFile+0x302>
cmpl   $0x0,-0xc8(%rbp)
jne    147d <rtl_iniParseFile+0x2fd>
mov    -0xc4(%rbp),%eax
mov    %eax,-0xc8(%rbp)
jmp    1482 <rtl_iniParseFile+0x302>
jmp    1487 <rtl_iniParseFile+0x307>
jmp    148c <rtl_iniParseFile+0x30c>
jmp    1491 <rtl_iniParseFile+0x311>
jmp    11f8 <rtl_iniParseFile+0x78>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0xc8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_iniParseFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rdx,0x8(%rsp)
mov    %rsi,(%rsp)
mov    %rdi,%r12
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movw   $0x0,0x80(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
mov    $0xc8,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     133b <rtl_iniParseFile+0x1cb>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1331 <rtl_iniParseFile+0x1c1>
mov    $0x1,%r15d
jmp    124a <rtl_iniParseFile+0xda>
mov    %rbp,%rdi
call   1030 <rstrip@plt>
lea    0x10(%rsp),%rdi
mov    %r13,%rsi
mov    $0x32,%edx
call   1080 <strncpy0@plt>
mov    0x8(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
call   *(%rsp)
or     %r14d,%eax
cmove  %r15d,%r14d
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %r12,%rdx
call   1050 <fgets@plt>
add    $0x1,%r15d
test   %rax,%rax
je     1331 <rtl_iniParseFile+0x1c1>
mov    %rbx,%rdi
call   1030 <rstrip@plt>
mov    %rax,%rdi
call   1090 <lskip@plt>
mov    %rax,%r13
movzbl (%rax),%eax
cmp    $0x3a,%al
jg     1270 <rtl_iniParseFile+0x100>
test   %al,%al
je     122d <rtl_iniParseFile+0xbd>
cmp    $0x23,%al
je     122d <rtl_iniParseFile+0xbd>
jmp    12c0 <rtl_iniParseFile+0x150>
xchg   %ax,%ax
cmp    $0x3b,%al
je     122d <rtl_iniParseFile+0xbd>
cmp    $0x5b,%al
jne    12c0 <rtl_iniParseFile+0x150>
add    $0x1,%r13
mov    %r13,%rdi
mov    $0x5d,%esi
call   1070 <find_char_or_comment@plt>
cmpb   $0x5d,(%rax)
jne    1329 <rtl_iniParseFile+0x1b9>
movb   $0x0,(%rax)
lea    0x50(%rsp),%rdi
mov    %r13,%rsi
mov    $0x32,%edx
call   1080 <strncpy0@plt>
movb   $0x0,0x10(%rsp)
jmp    122d <rtl_iniParseFile+0xbd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    $0x3d,%esi
call   1070 <find_char_or_comment@plt>
mov    %rax,%rbp
cmpb   $0x3d,(%rax)
je     12f0 <rtl_iniParseFile+0x180>
mov    %r13,%rdi
mov    $0x3a,%esi
call   1070 <find_char_or_comment@plt>
mov    %rax,%rbp
movzbl (%rax),%eax
cmp    $0x3d,%al
je     12f0 <rtl_iniParseFile+0x180>
cmp    $0x3a,%al
jne    1329 <rtl_iniParseFile+0x1b9>
movb   $0x0,0x0(%rbp)
mov    %r13,%rdi
call   1030 <rstrip@plt>
mov    %rax,%r13
add    $0x1,%rbp
mov    %rbp,%rdi
call   1090 <lskip@plt>
mov    %rax,%rbp
mov    %rax,%rdi
xor    %esi,%esi
call   1070 <find_char_or_comment@plt>
cmpb   $0x3b,(%rax)
jne    11f9 <rtl_iniParseFile+0x89>
movb   $0x0,(%rax)
jmp    11f9 <rtl_iniParseFile+0x89>
test   %r14d,%r14d
jmp    1229 <rtl_iniParseFile+0xb9>
mov    %rbx,%rdi
call   1040 <free@plt>
jmp    1341 <rtl_iniParseFile+0x1d1>
mov    $0xfffffffe,%r14d
mov    %r14d,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rtl_iniParseFile(i32* nocapture %0, i32 (i8*, i8*, i8*, i8*)* nocapture %1, i8* %2) {
%4 = alloca [50 x i8]
%5 = alloca [50 x i8]
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%8 = tail call i64 @malloc(i32 200)
%9 = inttoptr i64 %8 to i8*
%10 = icmp eq i64 %8, 0
br i1 %10, label %65, label %11
11: ; preds = %3
%12 = call i32* @fgets(i8* %9, i32 200, i32* %0)
%13 = icmp eq i32* %12, null
br i1 %13, label %62, label %14
14: ; preds = %11, %58
%15 = phi i32 [ %59, %58 ], [ 0, %11 ]
%16 = phi i32 [ %17, %58 ], [ 0, %11 ]
%17 = add nuw nsw i32 %16, 1
%18 = call i8* @rstrip(i8* %9)
%19 = call i8* @lskip(i8* %18)
%20 = load i8, i8* %19
switch i8 %20, label %31 [
i8 59, label %58
i8 35, label %58
i8 91, label %21
i8 0, label %58
]
21: ; preds = %14
%22 = getelementptr inbounds i8, i8* %19, i64 1
%23 = call i8* @find_char_or_comment(i8* %22, i8 signext 93)
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 93
br i1 %25, label %26, label %28
26: ; preds = %21
store i8 0, i8* %23
%27 = call i32 @strncpy0(i8* %6, i8* %22, i32 50)
store i8 0, i8* %7
br label %58
28: ; preds = %21
%29 = icmp eq i32 %15, 0
%30 = select i1 %29, i32 %17, i32 %15
br label %58
31: ; preds = %14
%32 = call i8* @find_char_or_comment(i8* %19, i8 signext 61)
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 61
br i1 %34, label %38, label %35
35: ; preds = %31
%36 = call i8* @find_char_or_comment(i8* %19, i8 signext 58)
%37 = load i8, i8* %36
switch i8 %37, label %55 [
i8 61, label %38
i8 58, label %38
]
38: ; preds = %31, %35, %35
%39 = phi i8* [ %36, %35 ], [ %36, %35 ], [ %32, %31 ]
store i8 0, i8* %39
%40 = call i8* @rstrip(i8* %19)
%41 = getelementptr inbounds i8, i8* %39, i64 1
%42 = call i8* @lskip(i8* %41)
%43 = call i8* @find_char_or_comment(i8* %42, i8 signext 0)
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 59
br i1 %45, label %46, label %47
46: ; preds = %38
store i8 0, i8* %43
br label %47
47: ; preds = %46, %38
%48 = call i8* @rstrip(i8* %42)
%49 = call i32 @strncpy0(i8* %7, i8* %40, i32 50)
%50 = call i32 %1(i8* %2, i8* %6, i8* %40, i8* %42)
%51 = icmp ne i32 %50, 0
%52 = icmp ne i32 %15, 0
%53 = select i1 %51, i1 true, i1 %52
%54 = select i1 %53, i32 %15, i32 %17
br label %58
55: ; preds = %35
%56 = icmp eq i32 %15, 0
%57 = select i1 %56, i32 %17, i32 %15
br label %58
58: ; preds = %55, %47, %28, %14, %14, %14, %26
%59 = phi i32 [ %15, %14 ], [ %15, %26 ], [ %15, %14 ], [ %30, %28 ], [ %15, %14 ], [ %54, %47 ], [ %57, %55 ]
%60 = call i32* @fgets(i8* %9, i32 200, i32* %0)
%61 = icmp eq i32* %60, null
br i1 %61, label %62, label %14
62: ; preds = %58, %11
%63 = phi i32 [ 0, %11 ], [ %59, %58 ]
%64 = call i32 @free(i8* %9)
br label %65
65: ; preds = %3, %62
%66 = phi i32 [ %63, %62 ], [ -2, %3 ]
ret i32 %66
}