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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ strcasecmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void read_config_string(char *filename, char *section, char *key,
                        char *returnbuffer, int buffersize, char *defvalue) {
  int found = 0, error = 0;
  FILE *hFile = fopen(filename, "rt");
  returnbuffer[0] = 0;
  if (hFile) {
    while (!error && !found && !feof(hFile)) {
      char buffer[256], szsection[256];
      if (fgets(buffer, sizeof(buffer), hFile) == NULL) {
        error = 1;
        break;
      }
      if (sscanf(buffer, "[%s]", szsection) == 1) {
        szsection[strlen(szsection) - 1] = 0;
        if (!strcasecmp(section, szsection)) {
          while (!error && !found && !feof(hFile)) {
            char szkey[256], szvalue[256];
            if (fgets(buffer, sizeof(buffer), hFile) == NULL) {
              error = 1;
              break;
            }
            if (sscanf(buffer, "[%s]", szsection) == 1) {
              break;
            }
            if (sscanf(buffer, "%[^=]=%[^\n]", szkey, szvalue) > 1) {
              if (!strcasecmp(key, szkey)) {
                strncpy(returnbuffer, szvalue, buffersize);
                returnbuffer[buffersize - 1] = 0;
                found = 1;
              }
            }
          }
        }
      }
    }
    fclose(hFile);
  }
  if (!found) {
    strncpy(returnbuffer, defvalue, buffersize);
    returnbuffer[buffersize - 1] = 0;
  }
}


x86 assembly (clang, -O0):
<read_config_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x40(%rbp)
je     13e6 <read_config_string+0x266>
jmp    11dc <read_config_string+0x5c>
xor    %eax,%eax
cmpl   $0x0,-0x38(%rbp)
mov    %al,-0x441(%rbp)
jne    1217 <read_config_string+0x97>
xor    %eax,%eax
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0x441(%rbp)
jne    1217 <read_config_string+0x97>
mov    -0x40(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x441(%rbp)
mov    -0x441(%rbp),%al
test   $0x1,%al
jne    122a <read_config_string+0xaa>
jmp    13dd <read_config_string+0x25d>
lea    -0x140(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    1255 <read_config_string+0xd5>
movl   $0x1,-0x38(%rbp)
jmp    13dd <read_config_string+0x25d>
lea    -0x140(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    13d8 <read_config_string+0x258>
lea    -0x240(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x240(%rbp,%rax,1)
mov    -0x10(%rbp),%rdi
lea    -0x240(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13d3 <read_config_string+0x253>
jmp    12b1 <read_config_string+0x131>
xor    %eax,%eax
cmpl   $0x0,-0x38(%rbp)
mov    %al,-0x442(%rbp)
jne    12ec <read_config_string+0x16c>
xor    %eax,%eax
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0x442(%rbp)
jne    12ec <read_config_string+0x16c>
mov    -0x40(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x442(%rbp)
mov    -0x442(%rbp),%al
test   $0x1,%al
jne    12ff <read_config_string+0x17f>
jmp    13ce <read_config_string+0x24e>
lea    -0x140(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0x100,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    132a <read_config_string+0x1aa>
movl   $0x1,-0x38(%rbp)
jmp    13ce <read_config_string+0x24e>
lea    -0x140(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jne    1354 <read_config_string+0x1d4>
jmp    13ce <read_config_string+0x24e>
lea    -0x140(%rbp),%rdi
lea    -0x340(%rbp),%rdx
lea    -0x440(%rbp),%rcx
lea    0xc98(%rip),%rsi
mov    $0x0,%al
call   1090 <sscanf@plt>
cmp    $0x1,%eax
jle    13c9 <read_config_string+0x249>
mov    -0x18(%rbp),%rdi
lea    -0x340(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13c4 <read_config_string+0x244>
mov    -0x20(%rbp),%rdi
lea    -0x440(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x34(%rbp)
jmp    13c9 <read_config_string+0x249>
jmp    12b1 <read_config_string+0x131>
jmp    13d3 <read_config_string+0x253>
jmp    13d8 <read_config_string+0x258>
jmp    11dc <read_config_string+0x5c>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1411 <read_config_string+0x291>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_config_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x438,%rsp
mov    %r9,%r14
mov    %r8d,%r15d
mov    %rcx,%rbx
mov    %rdx,0x20(%rsp)
mov    %rsi,0x28(%rsp)
lea    0xe55(%rip),%rsi
call   10a0 <fopen@plt>
movb   $0x0,(%rbx)
test   %rax,%rax
je     1374 <read_config_string+0x1f4>
mov    %rax,%rbp
mov    %r14,0x18(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r15,0x8(%rsp)
movslq %r15d,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,(%rsp)
lea    0x330(%rsp),%r14
lea    0x230(%rsp),%r12
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1357 <read_config_string+0x1d7>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1357 <read_config_string+0x1d7>
xor    %r13d,%r13d
mov    %r14,%rdi
lea    0xddd(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
mov    $0x1,%bl
cmp    $0x1,%eax
jne    1270 <read_config_string+0xf0>
mov    %r12,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r12,1)
mov    0x28(%rsp),%rdi
mov    %r12,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1270 <read_config_string+0xf0>
mov    %rbp,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     12a3 <read_config_string+0x123>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r15d,%r15d
or     %r13d,%r15d
je     11f0 <read_config_string+0x70>
jmp    137d <read_config_string+0x1fd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1080 <feof@plt>
xor    %r15d,%r15d
test   %eax,%eax
jne    134f <read_config_string+0x1cf>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1344 <read_config_string+0x1c4>
xor    %r15d,%r15d
mov    %r14,%rdi
lea    0xd3a(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x1,%eax
je     1273 <read_config_string+0xf3>
mov    %r14,%rdi
lea    0xd26(%rip),%rsi
lea    0x130(%rsp),%rdx
lea    0x30(%rsp),%rcx
xor    %eax,%eax
call   1090 <sscanf@plt>
cmp    $0x2,%eax
jl     1290 <read_config_string+0x110>
mov    0x20(%rsp),%rdi
lea    0x130(%rsp),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
jne    1290 <read_config_string+0x110>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
lea    0x30(%rsp),%rsi
mov    0x8(%rsp),%rdx
call   1040 <strncpy@plt>
mov    (%rsp),%rax
movb   $0x0,(%rbx,%rax,1)
mov    $0x1,%r13d
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    1273 <read_config_string+0xf3>
mov    $0x1,%r15d
jmp    1273 <read_config_string+0xf3>
xor    %r13d,%r13d
jmp    1273 <read_config_string+0xf3>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rbx
mov    0x18(%rsp),%r14
mov    0x8(%rsp),%r15
mov    (%rsp),%rbp
jmp    139c <read_config_string+0x21c>
lea    -0x1(%r15),%eax
movslq %eax,%rbp
jmp    139c <read_config_string+0x21c>
mov    %rbp,%rdi
call   1050 <fclose@plt>
test   %bl,%bl
mov    0x10(%rsp),%rbx
mov    0x18(%rsp),%r14
mov    0x8(%rsp),%r15
mov    (%rsp),%rbp
je     13ae <read_config_string+0x22e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <strncpy@plt>
movb   $0x0,(%rbx,%rbp,1)
add    $0x438,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@.str.1 = [5 x i8] c"[%s]\00"
@.str.2 = [12 x i8] c"%[^=]=%[^\0A]\00"
define void @read_config_string(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca [256 x i8]
%17 = alloca [256 x i8]
%18 = alloca [256 x i8]
%19 = alloca [256 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
store i32 0, i32* %13
store i32 0, i32* %14
%20 = load i8*, i8** %7
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %21, i32** %15
%22 = load i8*, i8** %10
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 0, i8* %23
%24 = load i32*, i32** %15
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %116
26: ; preds = %6
br label %27
27: ; preds = %112, %26
%28 = load i32, i32* %14
%29 = icmp ne i32 %28, 0
br i1 %29, label %38, label %30
30: ; preds = %27
%31 = load i32, i32* %13
%32 = icmp ne i32 %31, 0
br i1 %32, label %38, label %33
33: ; preds = %30
%34 = load i32*, i32** %15
%35 = call i32 @feof(i32* %34)
%36 = icmp ne i32 %35, 0
%37 = xor i1 %36, true
br label %38
38: ; preds = %33, %30, %27
%39 = phi i1 [ false, %30 ], [ false, %27 ], [ %37, %33 ]
br i1 %39, label %40, label %113
40: ; preds = %38
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%42 = load i32*, i32** %15
%43 = call i32* @fgets(i8* %41, i32 256, i32* %42)
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %46
45: ; preds = %40
store i32 1, i32* %14
br label %113
46: ; preds = %40
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%49 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %48)
%50 = icmp eq i32 %49, 1
br i1 %50, label %51, label %112
51: ; preds = %46
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%53 = call i32 @strlen(i8* %52)
%54 = sub nsw i32 %53, 1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 %55
store i8 0, i8* %56
%57 = load i8*, i8** %8
%58 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%59 = call i32 @strcasecmp(i8* %57, i8* %58)
%60 = icmp ne i32 %59, 0
br i1 %60, label %111, label %61
61: ; preds = %51
br label %62
62: ; preds = %109, %61
%63 = load i32, i32* %14
%64 = icmp ne i32 %63, 0
br i1 %64, label %73, label %65
65: ; preds = %62
%66 = load i32, i32* %13
%67 = icmp ne i32 %66, 0
br i1 %67, label %73, label %68
68: ; preds = %65
%69 = load i32*, i32** %15
%70 = call i32 @feof(i32* %69)
%71 = icmp ne i32 %70, 0
%72 = xor i1 %71, true
br label %73
73: ; preds = %68, %65, %62
%74 = phi i1 [ false, %65 ], [ false, %62 ], [ %72, %68 ]
br i1 %74, label %75, label %110
75: ; preds = %73
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%77 = load i32*, i32** %15
%78 = call i32* @fgets(i8* %76, i32 256, i32* %77)
%79 = icmp eq i32* %78, null
br i1 %79, label %80, label %81
80: ; preds = %75
store i32 1, i32* %14
br label %110
81: ; preds = %75
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %17, i64 0, i64 0
%84 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %82, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %83)
%85 = icmp eq i32 %84, 1
br i1 %85, label %86, label %87
86: ; preds = %81
br label %110
87: ; preds = %81
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %16, i64 0, i64 0
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%90 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%91 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %88, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %89, i8* %90)
%92 = icmp sgt i32 %91, 1
br i1 %92, label %93, label %109
93: ; preds = %87
%94 = load i8*, i8** %9
%95 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%96 = call i32 @strcasecmp(i8* %94, i8* %95)
%97 = icmp ne i32 %96, 0
br i1 %97, label %108, label %98
98: ; preds = %93
%99 = load i8*, i8** %10
%100 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%101 = load i32, i32* %11
%102 = call i32 @strncpy(i8* %99, i8* %100, i32 %101)
%103 = load i8*, i8** %10
%104 = load i32, i32* %11
%105 = sub nsw i32 %104, 1
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %103, i64 %106
store i8 0, i8* %107
store i32 1, i32* %13
br label %108
108: ; preds = %98, %93
br label %109
109: ; preds = %108, %87
br label %62
110: ; preds = %86, %80, %73
br label %111
111: ; preds = %110, %51
br label %112
112: ; preds = %111, %46
br label %27
113: ; preds = %45, %38
%114 = load i32*, i32** %15
%115 = call i32 @fclose(i32* %114)
br label %116
116: ; preds = %113, %6
%117 = load i32, i32* %13
%118 = icmp ne i32 %117, 0
br i1 %118, label %129, label %119
119: ; preds = %116
%120 = load i8*, i8** %10
%121 = load i8*, i8** %12
%122 = load i32, i32* %11
%123 = call i32 @strncpy(i8* %120, i8* %121, i32 %122)
%124 = load i8*, i8** %10
%125 = load i32, i32* %11
%126 = sub nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %124, i64 %127
store i8 0, i8* %128
br label %129
129: ; preds = %119, %116
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@.str.1 = [5 x i8] c"[%s]\00"
@.str.2 = [12 x i8] c"%[^=]=%[^\0A]\00"
define void @read_config_string(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
%11 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %3
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = add nsw i32 %4, -1
%15 = sext i32 %14 to i64
br label %73
16: ; preds = %6
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%21 = add nsw i32 %4, -1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %3, i64 %22
br label %24
24: ; preds = %16, %63
%25 = call i32 @feof(i32* %11)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %69
27: ; preds = %24
%28 = call i32* @fgets(i8* %17, i32 256, i32* %11)
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %31
30: ; preds = %27
br label %69
31: ; preds = %27
%32 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %63
34: ; preds = %31
%35 = call i32 @strlen(i8* %18)
%36 = add nsw i32 %35, -1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 %37
store i8 0, i8* %38
%39 = call i32 @strcasecmp(i8* %1, i8* %18)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %63
41: ; preds = %34
%42 = call i32 @feof(i32* %11)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %63
44: ; preds = %41, %60
%45 = call i32* @fgets(i8* %17, i32 256, i32* %11)
%46 = icmp eq i32* %45, null
br i1 %46, label %58, label %47
47: ; preds = %44
%48 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%49 = icmp eq i32 %48, 1
br i1 %49, label %58, label %50
50: ; preds = %47
%51 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %19, i8* %20)
%52 = icmp sgt i32 %51, 1
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = call i32 @strcasecmp(i8* %2, i8* %19)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = call i32 @strncpy(i8* %3, i8* %20, i32 %4)
store i8 0, i8* %23
br label %63
58: ; preds = %44, %47
%59 = phi i32 [ 0, %47 ], [ 1, %44 ]
br label %63
60: ; preds = %50, %53
%61 = call i32 @feof(i32* %11)
%62 = icmp eq i32 %61, 0
br i1 %62, label %44, label %63
63: ; preds = %60, %41, %56, %58, %31, %34
%64 = phi i32 [ 0, %34 ], [ 0, %31 ], [ %59, %58 ], [ 0, %56 ], [ 0, %41 ], [ 0, %60 ]
%65 = phi i1 [ true, %34 ], [ true, %31 ], [ true, %58 ], [ false, %56 ], [ true, %41 ], [ true, %60 ]
%66 = phi i32 [ 0, %34 ], [ 0, %31 ], [ 0, %58 ], [ 1, %56 ], [ 0, %41 ], [ 0, %60 ]
%67 = or i32 %66, %64
%68 = icmp eq i32 %67, 0
br i1 %68, label %24, label %71
69: ; preds = %24, %30
%70 = call i32 @fclose(i32* %11)
br label %73
71: ; preds = %63
%72 = call i32 @fclose(i32* %11)
br i1 %65, label %73, label %77
73: ; preds = %13, %69, %71
%74 = phi i64 [ %15, %13 ], [ %22, %69 ], [ %22, %71 ]
%75 = call i32 @strncpy(i8* %3, i8* %5, i32 %4)
%76 = getelementptr inbounds i8, i8* %3, i64 %74
store i8 0, i8* %76
br label %77
77: ; preds = %73, %71
ret void
}