#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*/ HDR_GetLineByFile(int /*<<< orphan*/ *, unsigned char *,
                                     unsigned long *);
int /*<<< orphan*/ TCPIP_Mem_Copy(unsigned char *, int, char *, int);
unsigned long atoi(char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int strlen(char *);
char *strstr(char *, char *);
unsigned long HDR_GetBeginLineByType(FILE *fp, unsigned long ulSubType,
                                     unsigned long *pulSubLen,
                                     unsigned char *uszInfo) {
  char szLine[256] = {0};
  unsigned long ulLineLen = 0;
  char *pcCurStr = NULL;
  char *pcNextStr;
  unsigned long ulCfgSubType;
  unsigned char ucSubTemp[128];
  while (1) {
    while (!feof(fp)) {
      ulLineLen = 0;
      HDR_GetLineByFile(fp, (unsigned char *)szLine, &ulLineLen);
      if ((0 == strlen(szLine)) || (0 == ulLineLen)) {
        break;
      }
      pcCurStr = NULL;
      if (NULL != (pcCurStr = strstr(szLine, "BEGIN"))) {
        break;
      }
    }
    if (NULL == pcCurStr) {
      break;
    }
    if (NULL == (pcNextStr = strstr(pcCurStr, ","))) {
      break;
    }
    (void)TCPIP_Mem_Copy(ucSubTemp, 128, (pcCurStr + strlen("BEGIN:")),
                         pcNextStr - (pcCurStr + strlen("BEGIN:")));
    ucSubTemp[pcNextStr - (pcCurStr + strlen("BEGIN:"))] = 0;
    ulCfgSubType = atoi((char *)ucSubTemp);
    if (ulCfgSubType == ulSubType) {
      pcCurStr = pcNextStr + 1;
      if (NULL != (pcNextStr = strstr(pcCurStr, ","))) {
        (void)TCPIP_Mem_Copy(ucSubTemp, 128, pcCurStr, pcNextStr - pcCurStr);
        ucSubTemp[pcNextStr - pcCurStr] = 0;
        (*pulSubLen) = atoi((char *)ucSubTemp);
      }
      if (NULL != (pcCurStr = strstr(pcCurStr, "\""))) {
        if (NULL != (pcNextStr = strstr(pcCurStr + 1, "\""))) {
          (void)TCPIP_Mem_Copy(uszInfo, 256, (pcCurStr + 1),
                               pcNextStr - (pcCurStr + 1));
          uszInfo[pcNextStr - (pcCurStr + 1)] = 0;
        }
      }
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<HDR_GetBeginLineByType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
movq   $0x0,-0x138(%rbp)
movq   $0x0,-0x140(%rbp)
jmp    11b9 <HDR_GetBeginLineByType+0x49>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d7 <HDR_GetBeginLineByType+0x67>
jmp    1262 <HDR_GetBeginLineByType+0xf2>
movq   $0x0,-0x138(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x130(%rbp),%rsi
lea    -0x138(%rbp),%rdx
call   1060 <HDR_GetLineByFile@plt>
lea    -0x130(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1220 <HDR_GetBeginLineByType+0xb0>
xor    %eax,%eax
cmp    -0x138(%rbp),%rax
jne    1225 <HDR_GetBeginLineByType+0xb5>
jmp    1262 <HDR_GetBeginLineByType+0xf2>
movq   $0x0,-0x140(%rbp)
lea    -0x130(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x140(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     125d <HDR_GetBeginLineByType+0xed>
jmp    1262 <HDR_GetBeginLineByType+0xf2>
jmp    11b9 <HDR_GetBeginLineByType+0x49>
xor    %eax,%eax
cmp    -0x140(%rbp),%rax
jne    1276 <HDR_GetBeginLineByType+0x106>
jmp    14f5 <HDR_GetBeginLineByType+0x385>
mov    -0x140(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x148(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    12a3 <HDR_GetBeginLineByType+0x133>
jmp    14f5 <HDR_GetBeginLineByType+0x385>
lea    -0x1d0(%rbp),%rax
mov    %rax,-0x1f8(%rbp)
mov    -0x140(%rbp),%rax
mov    %rax,-0x208(%rbp)
lea    0xd42(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x208(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x1f0(%rbp)
mov    -0x148(%rbp),%rax
mov    %rax,-0x1e8(%rbp)
mov    -0x140(%rbp),%rax
mov    %rax,-0x200(%rbp)
lea    0xd04(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x200(%rbp),%rcx
mov    -0x1f8(%rbp),%rdi
mov    -0x1f0(%rbp),%rdx
mov    %eax,%esi
mov    -0x1e8(%rbp),%rax
movslq %esi,%rsi
add    %rsi,%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x80,%esi
call   1080 <TCPIP_Mem_Copy@plt>
mov    -0x148(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x140(%rbp),%rax
mov    %rax,-0x1e0(%rbp)
lea    0xca9(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x1e0(%rbp),%rcx
mov    %eax,%edx
mov    -0x1d8(%rbp),%rax
movslq %edx,%rdx
add    %rdx,%rcx
sub    %rcx,%rax
movb   $0x0,-0x1d0(%rbp,%rax,1)
lea    -0x1d0(%rbp),%rdi
call   1070 <atoi@plt>
mov    %rax,-0x150(%rbp)
mov    -0x150(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    14f0 <HDR_GetBeginLineByType+0x380>
mov    -0x148(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x140(%rbp)
mov    -0x140(%rbp),%rdi
lea    0xc3d(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x148(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     143d <HDR_GetBeginLineByType+0x2cd>
lea    -0x1d0(%rbp),%rdi
mov    -0x140(%rbp),%rdx
mov    -0x148(%rbp),%rax
mov    -0x140(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x80,%esi
call   1080 <TCPIP_Mem_Copy@plt>
mov    -0x148(%rbp),%rax
mov    -0x140(%rbp),%rcx
sub    %rcx,%rax
movb   $0x0,-0x1d0(%rbp,%rax,1)
lea    -0x1d0(%rbp),%rdi
call   1070 <atoi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x140(%rbp),%rdi
lea    0xbc4(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x140(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     14e3 <HDR_GetBeginLineByType+0x373>
mov    -0x140(%rbp),%rdi
add    $0x1,%rdi
lea    0xb98(%rip),%rsi
call   1090 <strstr@plt>
mov    %rax,%rcx
mov    %rcx,-0x148(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     14de <HDR_GetBeginLineByType+0x36e>
mov    -0x28(%rbp),%rdi
mov    -0x140(%rbp),%rdx
add    $0x1,%rdx
mov    -0x148(%rbp),%rax
mov    -0x140(%rbp),%rcx
add    $0x1,%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    $0x100,%esi
call   1080 <TCPIP_Mem_Copy@plt>
mov    -0x28(%rbp),%rax
mov    -0x148(%rbp),%rcx
mov    -0x140(%rbp),%rdx
add    $0x1,%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    14e3 <HDR_GetBeginLineByType+0x373>
movq   $0x0,-0x8(%rbp)
jmp    14fd <HDR_GetBeginLineByType+0x38d>
jmp    11b4 <HDR_GetBeginLineByType+0x44>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDR_GetBeginLineByType>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %rcx,0x10(%rsp)
mov    %rdx,0x18(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rdi,%r13
xorps  %xmm0,%xmm0
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x8(%rsp)
xor    %r12d,%r12d
lea    0x30(%rsp),%rbp
lea    0x8(%rsp),%r15
lea    0xddc(%rip),%rbx
mov    %rdi,0x20(%rsp)
nopl   0x0(%rax)
mov    %r13,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     12f0 <HDR_GetBeginLineByType+0x180>
test   %r12,%r12
je     1392 <HDR_GetBeginLineByType+0x222>
mov    %r12,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1392 <HDR_GetBeginLineByType+0x222>
mov    %rax,%r14
lea    0xd9d(%rip),%rdi
call   1030 <strlen@plt>
mov    %rbp,%r13
movslq %eax,%rbp
add    %r12,%rbp
lea    0xd88(%rip),%rdi
call   1030 <strlen@plt>
add    %r12d,%eax
mov    %r14d,%ecx
sub    %eax,%ecx
lea    0x130(%rsp),%rdi
mov    $0x80,%esi
mov    %rbp,%rdx
mov    %r13,%rbp
mov    0x20(%rsp),%r13
call   1080 <TCPIP_Mem_Copy@plt>
lea    0xd57(%rip),%rdi
call   1030 <strlen@plt>
cltq
add    %r12,%rax
mov    %r14,%rcx
sub    %rax,%rcx
movb   $0x0,0x130(%rsp,%rcx,1)
lea    0x130(%rsp),%rdi
call   1070 <atoi@plt>
cmp    0x28(%rsp),%rax
jne    1230 <HDR_GetBeginLineByType+0xc0>
jmp    13a9 <HDR_GetBeginLineByType+0x239>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movq   $0x0,0x8(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1060 <HDR_GetLineByFile@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     1240 <HDR_GetBeginLineByType+0xd0>
cmpq   $0x0,0x8(%rsp)
je     1240 <HDR_GetBeginLineByType+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1090 <strstr@plt>
test   %rax,%rax
jne    1382 <HDR_GetBeginLineByType+0x212>
mov    %r13,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1392 <HDR_GetBeginLineByType+0x222>
movq   $0x0,0x8(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1060 <HDR_GetLineByFile@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     138a <HDR_GetBeginLineByType+0x21a>
cmpq   $0x0,0x8(%rsp)
mov    $0x0,%r12d
jne    1330 <HDR_GetBeginLineByType+0x1c0>
jmp    1240 <HDR_GetBeginLineByType+0xd0>
mov    %rax,%r12
jmp    1249 <HDR_GetBeginLineByType+0xd9>
xor    %r12d,%r12d
jmp    1240 <HDR_GetBeginLineByType+0xd0>
mov    $0x1,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x1,%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     13f7 <HDR_GetBeginLineByType+0x287>
mov    %rax,%rbx
sub    %r14,%rbx
lea    0x130(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
call   1080 <TCPIP_Mem_Copy@plt>
movb   $0x0,0x130(%rsp,%rbx,1)
mov    %rbp,%rdi
call   1070 <atoi@plt>
mov    0x18(%rsp),%rcx
mov    %rax,(%rcx)
mov    %r14,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1444 <HDR_GetBeginLineByType+0x2d4>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1444 <HDR_GetBeginLineByType+0x2d4>
mov    %rax,%rbp
sub    %rbx,%rbp
mov    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1080 <TCPIP_Mem_Copy@plt>
movb   $0x0,(%r14,%rbp,1)
xor    %eax,%eax
jmp    1397 <HDR_GetBeginLineByType+0x227>

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

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