#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 scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ free(char *);
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
char *malloc(scalar_t__);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char *, scalar_t__);
int strlen(char *);
char *strstr(char *, char *);
int wfc_util_fget_string(char *pFileName,
                         char *pEndOfCfg __attribute__((unused)),
                         char *pSTagString, char *pETagString,
                         char *pValueStringBuff, int stringBuffLength) {
  int result = 0;
  int fd;
  off_t sz_file;
  char *pReadBuff = NULL;
  char *pSPointer = NULL, *pETagPointer = NULL, *pSValuePointer = NULL;
  fd = open(pFileName, O_RDONLY);
  if (fd >= 0) {
    sz_file = lseek(fd, 0, SEEK_END);
    if (sz_file > 0)
      pReadBuff = malloc(sz_file + 1);
    if (NULL != pReadBuff) {
      memset(pReadBuff, 0, sz_file + 1);
      if (lseek(fd, 0, SEEK_SET) != 0) {
        printf("lseek failure");
        printf("\n");
      }
      read(fd, pReadBuff, sz_file);
      pReadBuff[sz_file] = '\0';
      pSPointer = strstr(pReadBuff, pSTagString);
      if (NULL != pSPointer) {
        pETagPointer = strstr(pSPointer, pETagString);
        if (NULL != pETagPointer) {
          pSValuePointer = pSPointer + strlen(pSTagString);
          if (stringBuffLength >= (int)(pETagPointer - pSValuePointer)) {
            memset(pValueStringBuff, 0, stringBuffLength);
            memcpy(pValueStringBuff, pSValuePointer,
                   (int)(pETagPointer - pSValuePointer));
            result = (int)(pETagPointer - pSValuePointer);
          } else {
            printf("wfc_util_fget_string : not enough string value buffer(%d)",
                   (int)(pETagPointer - pSValuePointer));
            printf("\n");
          }
        } else {
          printf("wfc_util_fget_string : can not find End TAG");
          printf("\n");
        }
      } else {
        printf("wfc_util_fget_string : can not find Start TAG");
        printf("\n");
      }
      free(pReadBuff);
    } else {
      printf("wfc_util_fget_string : can not malloc(%d)", (int)sz_file);
      printf("\n");
    }
    close(fd);
  } else {
    printf("wfc_util_fget_string : can not open file");
    printf("\n");
  }
  return result;
}


x86 assembly (clang, -O0):
<wfc_util_fget_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2dde(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     1413 <wfc_util_fget_string+0x263>
mov    -0x34(%rbp),%edi
mov    0x2dc8(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jle    1249 <wfc_util_fget_string+0x99>
mov    -0x40(%rbp),%rdi
add    $0x1,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
cmp    -0x48(%rbp),%rax
je     13e4 <wfc_util_fget_string+0x234>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x34(%rbp),%edi
mov    0x2d5c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1060 <lseek@plt>
cmp    $0x0,%rax
je     12a3 <wfc_util_fget_string+0xf3>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
call   1090 <read@plt>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
cmp    -0x50(%rbp),%rax
je     13ba <wfc_util_fget_string+0x20a>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10d0 <strstr@plt>
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
cmp    -0x58(%rbp),%rax
je     1399 <wfc_util_fget_string+0x1e9>
mov    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%rdx
sub    %rdx,%rcx
cmp    %ecx,%eax
jl     136b <wfc_util_fget_string+0x1bb>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x28(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   10a0 <memcpy@plt>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x30(%rbp)
jmp    1394 <wfc_util_fget_string+0x1e4>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13b5 <wfc_util_fget_string+0x205>
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13d6 <wfc_util_fget_string+0x226>
lea    0xcb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
jmp    1406 <wfc_util_fget_string+0x256>
mov    -0x40(%rbp),%rax
mov    %eax,%esi
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%edi
call   1080 <close@plt>
jmp    142f <wfc_util_fget_string+0x27f>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfc_util_fget_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9d,%r14d
mov    %r8,%rbx
mov    %rcx,%rbp
mov    %rdx,%r13
mov    0x2dff(%rip),%rax
mov    (%rax),%esi
call   10d0 <open@plt>
test   %eax,%eax
js     1306 <wfc_util_fget_string+0x146>
mov    %eax,%r15d
mov    %rbp,0x10(%rsp)
mov    %r14d,%ebp
mov    %rbx,0x8(%rsp)
mov    0x2de1(%rip),%rax
mov    (%rax),%edx
xor    %ebx,%ebx
mov    %r15d,%edi
xor    %esi,%esi
call   1070 <lseek@plt>
mov    %rax,%r12
test   %rax,%rax
jle    12e9 <wfc_util_fget_string+0x129>
mov    %r12,%rdi
add    $0x1,%rdi
call   10c0 <malloc@plt>
test   %rax,%rax
je     12e9 <wfc_util_fget_string+0x129>
mov    %rax,%r14
lea    0x1(%r12),%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edx
mov    %r15d,%edi
xor    %esi,%esi
call   1070 <lseek@plt>
test   %rax,%rax
je     1278 <wfc_util_fget_string+0xb8>
lea    0xd99(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r15d,%edi
mov    %r14,%rsi
mov    %r12,%rdx
call   10a0 <read@plt>
movb   $0x0,(%r14,%r12,1)
mov    %r14,%rdi
mov    %r13,%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     1322 <wfc_util_fget_string+0x162>
mov    %rax,%r12
mov    %rax,%rdi
mov    0x10(%rsp),%rsi
call   10e0 <strstr@plt>
test   %rax,%rax
je     132b <wfc_util_fget_string+0x16b>
mov    %rax,%rbx
mov    %r13,%rdi
call   1050 <strlen@plt>
cltq
add    %rax,%r12
sub    %r12d,%ebx
cmp    %ebp,%ebx
jle    1347 <wfc_util_fget_string+0x187>
lea    0xd3c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %ebx,%ebx
jmp    1365 <wfc_util_fget_string+0x1a5>
lea    0xdb2(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    136d <wfc_util_fget_string+0x1ad>
lea    0xdbf(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1375 <wfc_util_fget_string+0x1b5>
lea    0xd4b(%rip),%rdi
jmp    1332 <wfc_util_fget_string+0x172>
lea    0xd16(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1365 <wfc_util_fget_string+0x1a5>
mov    %ebp,%edx
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1080 <memset@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   10b0 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15d,%edi
call   1090 <close@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str = [14 x i8] c"lseek failure\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [58 x i8] c"wfc_util_fget_string : not enough string value buffer(%d)\00"
@.str.3 = [44 x i8] c"wfc_util_fget_string : can not find End TAG\00"
@.str.4 = [46 x i8] c"wfc_util_fget_string : can not find Start TAG\00"
@.str.5 = [42 x i8] c"wfc_util_fget_string : can not malloc(%d)\00"
@.str.6 = [41 x i8] c"wfc_util_fget_string : can not open file\00"
define i32 @wfc_util_fget_string(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
store i32 0, i32* %13
store i8* null, i8** %16
store i8* null, i8** %17
store i8* null, i8** %18
store i8* null, i8** %19
%20 = load i8*, i8** %7
%21 = load i32, i32* @O_RDONLY
%22 = call i32 @open(i8* %20, i32 %21)
store i32 %22, i32* %14
%23 = load i32, i32* %14
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %131
25: ; preds = %6
%26 = load i32, i32* %14
%27 = load i32, i32* @SEEK_END
%28 = call i64 @lseek(i32 %26, i32 0, i32 %27)
store i64 %28, i64* %15
%29 = load i64, i64* %15
%30 = icmp sgt i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %25
%32 = load i64, i64* %15
%33 = add nsw i64 %32, 1
%34 = call i8* @malloc(i64 %33)
store i8* %34, i8** %16
br label %35
35: ; preds = %31, %25
%36 = load i8*, i8** %16
%37 = icmp ne i8* null, %36
br i1 %37, label %38, label %123
38: ; preds = %35
%39 = load i8*, i8** %16
%40 = load i64, i64* %15
%41 = add nsw i64 %40, 1
%42 = trunc i64 %41 to i32
%43 = call i32 @memset(i8* %39, i32 0, i32 %42)
%44 = load i32, i32* %14
%45 = load i32, i32* @SEEK_SET
%46 = call i64 @lseek(i32 %44, i32 0, i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %38
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %48, %38
%52 = load i32, i32* %14
%53 = load i8*, i8** %16
%54 = load i64, i64* %15
%55 = call i32 @read(i32 %52, i8* %53, i64 %54)
%56 = load i8*, i8** %16
%57 = load i64, i64* %15
%58 = getelementptr inbounds i8, i8* %56, i64 %57
store i8 0, i8* %58
%59 = load i8*, i8** %16
%60 = load i8*, i8** %9
%61 = call i8* @strstr(i8* %59, i8* %60)
store i8* %61, i8** %17
%62 = load i8*, i8** %17
%63 = icmp ne i8* null, %62
br i1 %63, label %64, label %117
64: ; preds = %51
%65 = load i8*, i8** %17
%66 = load i8*, i8** %10
%67 = call i8* @strstr(i8* %65, i8* %66)
store i8* %67, i8** %18
%68 = load i8*, i8** %18
%69 = icmp ne i8* null, %68
br i1 %69, label %70, label %113
70: ; preds = %64
%71 = load i8*, i8** %17
%72 = load i8*, i8** %9
%73 = call i32 @strlen(i8* %72)
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %71, i64 %74
store i8* %75, i8** %19
%76 = load i32, i32* %12
%77 = load i8*, i8** %18
%78 = load i8*, i8** %19
%79 = ptrtoint i8* %77 to i64
%80 = ptrtoint i8* %78 to i64
%81 = sub i64 %79, %80
%82 = trunc i64 %81 to i32
%83 = icmp sge i32 %76, %82
br i1 %83, label %84, label %103
84: ; preds = %70
%85 = load i8*, i8** %11
%86 = load i32, i32* %12
%87 = call i32 @memset(i8* %85, i32 0, i32 %86)
%88 = load i8*, i8** %11
%89 = load i8*, i8** %19
%90 = load i8*, i8** %18
%91 = load i8*, i8** %19
%92 = ptrtoint i8* %90 to i64
%93 = ptrtoint i8* %91 to i64
%94 = sub i64 %92, %93
%95 = trunc i64 %94 to i32
%96 = call i32 @memcpy(i8* %88, i8* %89, i32 %95)
%97 = load i8*, i8** %18
%98 = load i8*, i8** %19
%99 = ptrtoint i8* %97 to i64
%100 = ptrtoint i8* %98 to i64
%101 = sub i64 %99, %100
%102 = trunc i64 %101 to i32
store i32 %102, i32* %13
br label %112
103: ; preds = %70
%104 = load i8*, i8** %18
%105 = load i8*, i8** %19
%106 = ptrtoint i8* %104 to i64
%107 = ptrtoint i8* %105 to i64
%108 = sub i64 %106, %107
%109 = trunc i64 %108 to i32
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i32 %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %112
112: ; preds = %103, %84
br label %116
113: ; preds = %64
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %116
116: ; preds = %113, %112
br label %120
117: ; preds = %51
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %120
120: ; preds = %117, %116
%121 = load i8*, i8** %16
%122 = call i32 @free(i8* %121)
br label %128
123: ; preds = %35
%124 = load i64, i64* %15
%125 = trunc i64 %124 to i32
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %125)
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %128
128: ; preds = %123, %120
%129 = load i32, i32* %14
%130 = call i32 @close(i32 %129)
br label %134
131: ; preds = %6
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %134
134: ; preds = %131, %128
%135 = load i32, i32* %13
ret i32 %135
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str = [14 x i8] c"lseek failure\00"
@.str.2 = [58 x i8] c"wfc_util_fget_string : not enough string value buffer(%d)\00"
@.str.3 = [44 x i8] c"wfc_util_fget_string : can not find End TAG\00"
@.str.4 = [46 x i8] c"wfc_util_fget_string : can not find Start TAG\00"
@.str.5 = [42 x i8] c"wfc_util_fget_string : can not malloc(%d)\00"
@.str.6 = [41 x i8] c"wfc_util_fget_string : can not open file\00"
define i32 @wfc_util_fget_string(i8* nocapture %0, i8* nocapture readnone %1, i8* %2, i8* nocapture %3, i8* %4, i32 %5) {
%7 = load i32, i32* @O_RDONLY
%8 = tail call i32 @open(i8* %0, i32 %7)
%9 = icmp sgt i32 %8, -1
br i1 %9, label %10, label %67
10: ; preds = %6
%11 = load i32, i32* @SEEK_END
%12 = tail call i64 @lseek(i32 %8, i32 0, i32 %11)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %14, label %60
14: ; preds = %10
%15 = add nuw nsw i64 %12, 1
%16 = tail call i8* @malloc(i64 %15)
%17 = icmp eq i8* %16, null
br i1 %17, label %60, label %18
18: ; preds = %14
%19 = trunc i64 %12 to i32
%20 = add i32 %19, 1
%21 = tail call i32 @memset(i8* %16, i32 0, i32 %20)
%22 = load i32, i32* @SEEK_SET
%23 = tail call i64 @lseek(i32 %8, i32 0, i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %18
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @putchar(i32 10)
br label %28
28: ; preds = %25, %18
%29 = tail call i32 @read(i32 %8, i8* %16, i64 %12)
%30 = getelementptr inbounds i8, i8* %16, i64 %12
store i8 0, i8* %30
%31 = tail call i8* @strstr(i8* %16, i8* dereferenceable(1) %2)
%32 = icmp eq i8* %31, null
br i1 %32, label %54, label %33
33: ; preds = %28
%34 = tail call i8* @strstr(i8* %31, i8* dereferenceable(1) %3)
%35 = icmp eq i8* %34, null
br i1 %35, label %51, label %36
36: ; preds = %33
%37 = tail call i32 @strlen(i8* %2)
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %31, i64 %38
%40 = ptrtoint i8* %34 to i64
%41 = ptrtoint i8* %39 to i64
%42 = sub i64 %40, %41
%43 = trunc i64 %42 to i32
%44 = icmp sgt i32 %43, %5
br i1 %44, label %48, label %45
45: ; preds = %36
%46 = tail call i32 @memset(i8* %4, i32 0, i32 %5)
%47 = tail call i32 @memcpy(i8* %4, i8* %39, i32 %43)
br label %57
48: ; preds = %36
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i32 %43)
%50 = tail call i32 @putchar(i32 10)
br label %57
51: ; preds = %33
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%53 = tail call i32 @putchar(i32 10)
br label %57
54: ; preds = %28
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%56 = tail call i32 @putchar(i32 10)
br label %57
57: ; preds = %51, %48, %45, %54
%58 = phi i32 [ %43, %45 ], [ 0, %48 ], [ 0, %51 ], [ 0, %54 ]
%59 = tail call i32 @free(i8* %16)
br label %64
60: ; preds = %10, %14
%61 = trunc i64 %12 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %61)
%63 = tail call i32 @putchar(i32 10)
br label %64
64: ; preds = %60, %57
%65 = phi i32 [ %58, %57 ], [ 0, %60 ]
%66 = tail call i32 @close(i32 %8)
br label %70
67: ; preds = %6
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
%69 = tail call i32 @putchar(i32 10)
br label %70
70: ; preds = %67, %64
%71 = phi i32 [ %65, %64 ], [ 0, %67 ]
ret i32 %71
}