#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 const *, char *);
scalar_t__ isspace(char);
int read_line(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
scalar_t__ strcmp(char *, char *);
int strlen(char const *);
scalar_t__ strncmp(char *, char const *, int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *strrchr(char *, char);
int GetPrivateProfileString(const char *section, const char *entry,
                            const char *def, char *buffer, int buffer_len,
                            const char *file_name) {
  FILE *fp;
  char buff[180];
  char *ep, *ep_end;
  char t_section[180];
  int len = strlen(entry);
  int sec_len;
  int flag;
  fp = fopen(file_name, "r");
  if (!fp)
    return 0;
  sprintf(t_section, "[%s]", section);
  sec_len = strlen(t_section);
  t_section[sec_len] = '\0';
  do {
    flag = read_line(fp, buff);
    if (!flag) {
      fclose(fp);
      if (def)
        strncpy(buffer, def, buffer_len);
      return (strlen(buffer));
    }
  } while (strcmp(buff, t_section));
  do {
    if (!read_line(fp, buff) || (buff[0] == '\n')) {
      fclose(fp);
      if (def)
        strncpy(buffer, def, buffer_len);
      return (strlen(buffer));
    }
  } while (strncmp(buff, entry, len));
  ep = strrchr(buff, '=');
  do
    ep++;
  while (isspace(*ep));
  ep_end = ep + strlen(ep);
  while (ep_end > ep) {
    if (isspace(*(ep_end - 1)))
      ep_end--;
    else
      break;
  }
  *ep_end = 0;
  if (!ep || strlen(ep) == 0) {
    fclose(fp);
    if (def)
      strncpy(buffer, def, buffer_len);
    return (strlen(buffer));
  }
  strncpy(buffer, ep, strlen(ep));
  buffer[strlen(ep)] = '\0';
  fclose(fp);
  return (strlen(buffer));
}


x86 assembly (clang, -O0):
<GetPrivateProfileString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x1d4(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11fd <GetPrivateProfileString+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    14d1 <GetPrivateProfileString+0x331>
lea    -0x1d0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdf3(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x1d0(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x1d8(%rbp)
movslq -0x1d8(%rbp),%rax
movb   $0x0,-0x1d0(%rbp,%rax,1)
mov    -0x40(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   10a0 <read_line@plt>
mov    %eax,-0x1dc(%rbp)
cmpl   $0x0,-0x1dc(%rbp)
jne    128d <GetPrivateProfileString+0xed>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     127c <GetPrivateProfileString+0xdc>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    14d1 <GetPrivateProfileString+0x331>
jmp    1292 <GetPrivateProfileString+0xf2>
lea    -0x100(%rbp),%rdi
lea    -0x1d0(%rbp),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1235 <GetPrivateProfileString+0x95>
jmp    12b4 <GetPrivateProfileString+0x114>
mov    -0x40(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   10a0 <read_line@plt>
cmp    $0x0,%eax
je     12dd <GetPrivateProfileString+0x13d>
movsbl -0x100(%rbp),%eax
cmp    $0xa,%eax
jne    1312 <GetPrivateProfileString+0x172>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     1301 <GetPrivateProfileString+0x161>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    14d1 <GetPrivateProfileString+0x331>
jmp    1317 <GetPrivateProfileString+0x177>
lea    -0x100(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1d4(%rbp),%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12b4 <GetPrivateProfileString+0x114>
lea    -0x100(%rbp),%rdi
mov    $0x3d,%esi
call   1070 <strrchr@plt>
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
jne    134f <GetPrivateProfileString+0x1af>
mov    -0x108(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
mov    -0x108(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x1e8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
cmp    -0x108(%rbp),%rax
jbe    13f9 <GetPrivateProfileString+0x259>
mov    -0x110(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
je     13ef <GetPrivateProfileString+0x24f>
mov    -0x110(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x110(%rbp)
jmp    13f4 <GetPrivateProfileString+0x254>
jmp    13f9 <GetPrivateProfileString+0x259>
jmp    13aa <GetPrivateProfileString+0x20a>
mov    -0x110(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x108(%rbp)
je     1426 <GetPrivateProfileString+0x286>
mov    -0x108(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x0,%eax
jne    145b <GetPrivateProfileString+0x2bb>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmpq   $0x0,-0x20(%rbp)
je     144a <GetPrivateProfileString+0x2aa>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4(%rbp)
jmp    14d1 <GetPrivateProfileString+0x331>
mov    -0x28(%rbp),%rax
mov    %rax,-0x200(%rbp)
mov    -0x108(%rbp),%rax
mov    %rax,-0x1f8(%rbp)
mov    -0x108(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x200(%rbp),%rdi
mov    -0x1f8(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x1f0(%rbp)
mov    -0x108(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x1f0(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPrivateProfileString>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %r9,%rbx
mov    %r8d,0x4(%rsp)
mov    %rcx,%r14
mov    %rdx,%rbp
mov    %rsi,%r15
mov    %rdi,0x18(%rsp)
mov    %rsi,%rdi
call   1060 <strlen@plt>
mov    %eax,%r13d
lea    0xe27(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1320 <GetPrivateProfileString+0x180>
mov    %rax,%r12
mov    %rbp,0x10(%rsp)
mov    %r14,0x8(%rsp)
lea    0xe04(%rip),%rsi
lea    0xe0(%rsp),%r14
mov    %r14,%rdi
mov    0x18(%rsp),%rdx
call   10c0 <sprintf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,0xe0(%rsp,%rax,1)
lea    0x20(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbp,%rsi
call   10a0 <read_line@plt>
test   %eax,%eax
je     1389 <GetPrivateProfileString+0x1e9>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1230 <GetPrivateProfileString+0x90>
lea    0x20(%rsp),%rbp
mov    0x8(%rsp),%rbx
mov    0x10(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %rbp,%rsi
call   10a0 <read_line@plt>
test   %eax,%eax
je     1327 <GetPrivateProfileString+0x187>
cmpb   $0xa,0x20(%rsp)
je     1327 <GetPrivateProfileString+0x187>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1270 <GetPrivateProfileString+0xd0>
lea    0x20(%rsp),%rdi
mov    $0x3d,%esi
call   1070 <strrchr@plt>
mov    %rax,%r15
mov    %rax,%rcx
add    $0x1,%rcx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rbp
mov    %rcx,%rbx
add    $0x1,%r15
movsbl 0x1(%rbp),%edi
call   1080 <isspace@plt>
lea    0x1(%rbx),%rcx
test   %rax,%rax
jne    12c0 <GetPrivateProfileString+0x120>
mov    %r15,%rdi
call   1060 <strlen@plt>
movslq %eax,%r13
test   %r13d,%r13d
jle    133c <GetPrivateProfileString+0x19c>
lea    (%rbx,%r13,1),%r14
add    $0x2,%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl -0x3(%rbx,%r13,1),%edi
call   1080 <isspace@plt>
test   %rax,%rax
je     1347 <GetPrivateProfileString+0x1a7>
add    $0xffffffffffffffff,%r14
add    $0xffffffffffffffff,%r13
cmp    $0x3,%r13
jge    1300 <GetPrivateProfileString+0x160>
jmp    1347 <GetPrivateProfileString+0x1a7>
xor    %eax,%eax
jmp    13b4 <GetPrivateProfileString+0x214>
mov    %r12,%rdi
call   1050 <fclose@plt>
test   %r14,%r14
je     13ac <GetPrivateProfileString+0x20c>
mov    %rbx,%rdi
mov    %r14,%rsi
jmp    13a3 <GetPrivateProfileString+0x203>
lea    0x1(,%rbp,1),%r14
add    %r13,%r14
movb   $0x0,(%r14)
mov    %r15,%rdi
call   1060 <strlen@plt>
test   %eax,%eax
je     1389 <GetPrivateProfileString+0x1e9>
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %r12,%rdi
call   1050 <fclose@plt>
jmp    13ac <GetPrivateProfileString+0x20c>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rsi
test   %rsi,%rsi
mov    0x8(%rsp),%rbx
je     13ac <GetPrivateProfileString+0x20c>
mov    %rbx,%rdi
mov    0x4(%rsp),%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [5 x i8] c"[%s]\00"
define i32 @GetPrivateProfileString(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i8* nocapture %5) {
%7 = alloca [180 x i8]
%8 = alloca [180 x i8]
%9 = getelementptr inbounds [180 x i8], [180 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds [180 x i8], [180 x i8]* %8, i64 0, i64 0
%11 = tail call i32 @strlen(i8* %1)
%12 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %87, label %14
14: ; preds = %6
%15 = call i32 @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%16 = call i32 @strlen(i8* %10)
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [180 x i8], [180 x i8]* %8, i64 0, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %27, %14
%20 = call i32 @read_line(i32* %12, i8* %9)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = call i32 @fclose(i32* %12)
%24 = icmp eq i8* %2, null
br i1 %24, label %85, label %25
25: ; preds = %22
%26 = call i32 @strncpy(i8* %3, i8* %2, i32 %4)
br label %85
27: ; preds = %19
%28 = call i64 @strcmp(i8* %9, i8* %10)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %19
30: ; preds = %27, %41
%31 = call i32 @read_line(i32* %12, i8* %9)
%32 = icmp eq i32 %31, 0
%33 = load i8, i8* %9
%34 = icmp eq i8 %33, 10
%35 = select i1 %32, i1 true, i1 %34
br i1 %35, label %36, label %41
36: ; preds = %30
%37 = call i32 @fclose(i32* %12)
%38 = icmp eq i8* %2, null
br i1 %38, label %85, label %39
39: ; preds = %36
%40 = call i32 @strncpy(i8* %3, i8* %2, i32 %4)
br label %85
41: ; preds = %30
%42 = call i64 @strncmp(i8* %9, i8* %1, i32 %11)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %30
44: ; preds = %41
%45 = call i8* @strrchr(i8* %9, i8 signext 61)
br label %46
46: ; preds = %46, %44
%47 = phi i8* [ %45, %44 ], [ %48, %46 ]
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = call i64 @isspace(i8 signext %49)
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %46
52: ; preds = %46
%53 = call i32 @strlen(i8* %48)
%54 = sext i32 %53 to i64
%55 = add nsw i64 %54, 1
%56 = getelementptr inbounds i8, i8* %47, i64 %55
%57 = icmp sgt i32 %53, 0
br i1 %57, label %61, label %69
58: ; preds = %61
%59 = getelementptr inbounds i8, i8* %47, i64 %68
%60 = icmp sgt i64 %63, 2
br i1 %60, label %61, label %69
61: ; preds = %52, %58
%62 = phi i8* [ %59, %58 ], [ %56, %52 ]
%63 = phi i64 [ %68, %58 ], [ %55, %52 ]
%64 = getelementptr inbounds i8, i8* %62, i64 -1
%65 = load i8, i8* %64
%66 = call i64 @isspace(i8 signext %65)
%67 = icmp eq i64 %66, 0
%68 = add nsw i64 %63, -1
br i1 %67, label %69, label %58
69: ; preds = %58, %61, %52
%70 = phi i8* [ %56, %52 ], [ %62, %61 ], [ %59, %58 ]
store i8 0, i8* %70
%71 = call i32 @strlen(i8* %48)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %78
73: ; preds = %69
%74 = call i32 @fclose(i32* %12)
%75 = icmp eq i8* %2, null
br i1 %75, label %85, label %76
76: ; preds = %73
%77 = call i32 @strncpy(i8* %3, i8* %2, i32 %4)
br label %85
78: ; preds = %69
%79 = call i32 @strlen(i8* %48)
%80 = call i32 @strncpy(i8* %3, i8* %48, i32 %79)
%81 = call i32 @strlen(i8* %48)
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %3, i64 %82
store i8 0, i8* %83
%84 = call i32 @fclose(i32* %12)
br label %85
85: ; preds = %73, %76, %36, %39, %22, %25, %78
%86 = call i32 @strlen(i8* %3)
br label %87
87: ; preds = %85, %6
%88 = phi i32 [ 0, %6 ], [ %86, %85 ]
ret i32 %88
}