#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*/ assert(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ isalnum(char);
scalar_t__ isdigit(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char *);
void stub1(char *, char *);
void init_config(char *filename,
                 void (*set_config_item)(char *key, char *value)) {
  assert(filename);
  FILE *fp = NULL;
  if (NULL == (fp = fopen(filename, "r"))) {
    printf("bad conf file %s\n", filename);
    exit(0);
  }
  char buffer[4096], key[50], value[255];
  int line = 1;
  while (1) {
    if (feof(fp))
      break;
    memset(buffer, 0, 4096);
    memset(key, 0, 50);
    memset(value, 0, 255);
    fgets(buffer, 4096, fp);
    char *p1 = buffer;
    while (isspace(*p1))
      p1++;
    char *p2 = p1;
    while (p2 && (isalnum(*p2) || '_' == *p2))
      p2++;
    strncpy(key, p1, p2 - p1);
    char *p3 = strstr(buffer, "=");
    if (NULL == p3) {
      line++;
      continue;
    }
    p3++;
    while (p3 && isspace(*p3))
      p3++;
    char comma[1];
    memset(comma, 0, 1);
    int have_comma = false;
    if ('"' == *p3 || '\'' == *p3) {
      comma[0] = *p3;
      have_comma = true;
      p3++;
    }
    if (have_comma) {
      bool ok = false;
      char c;
      int offset = 0;
      bool have_backslash = false;
      while ('\0' != (c = *p3++)) {
        if (c == comma[0]) {
          if (have_backslash) {
            value[offset] = c;
            have_backslash = false;
            offset++;
          } else {
            ok = true;
            break;
          }
        } else if ('\\' == c) {
          if (have_backslash) {
            value[offset] = '\\';
            have_backslash = false;
            offset++;
          } else
            have_backslash = true;
        } else {
          value[offset] = c;
          offset++;
        }
      }
      if (!ok) {
        printf("bad config in line %d\n", line);
        exit(0);
      }
    } else {
      char *p4 = p3;
      while (p4 && isdigit(*p4))
        p4++;
      strncpy(value, p3, p4 - p3);
    }
    line++;
    (*set_config_item)(key, value);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<init_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x11b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   10b0 <assert@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe01(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    122f <init_config+0x5f>
mov    -0x8(%rbp),%rsi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
movl   $0x1,-0x1164(%rbp)
mov    -0x18(%rbp),%rdi
call   10c0 <feof@plt>
cmp    $0x0,%rax
je     1251 <init_config+0x81>
jmp    16e9 <init_config+0x519>
lea    -0x1020(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1080 <memset@plt>
lea    -0x1060(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1080 <memset@plt>
lea    -0x1160(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1080 <memset@plt>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1000,%esi
call   10a0 <fgets@plt>
lea    -0x1020(%rbp),%rax
mov    %rax,-0x1170(%rbp)
mov    -0x1170(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
je     12dd <init_config+0x10d>
mov    -0x1170(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1170(%rbp)
jmp    12ad <init_config+0xdd>
mov    -0x1170(%rbp),%rax
mov    %rax,-0x1178(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x1178(%rbp)
mov    %al,-0x11a1(%rbp)
je     134b <init_config+0x17b>
mov    -0x1178(%rbp),%rax
movsbl (%rax),%edi
call   1070 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11a2(%rbp)
jne    133f <init_config+0x16f>
mov    -0x1178(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x5f,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11a2(%rbp)
mov    -0x11a2(%rbp),%al
mov    %al,-0x11a1(%rbp)
mov    -0x11a1(%rbp),%al
test   $0x1,%al
jne    135e <init_config+0x18e>
jmp    1375 <init_config+0x1a5>
mov    -0x1178(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1178(%rbp)
jmp    12eb <init_config+0x11b>
lea    -0x1060(%rbp),%rdi
mov    -0x1170(%rbp),%rsi
mov    -0x1178(%rbp),%rax
mov    -0x1170(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
lea    -0x1020(%rbp),%rdi
lea    0xc6b(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x1180(%rbp)
xor    %eax,%eax
cmp    -0x1180(%rbp),%rax
jne    13d8 <init_config+0x208>
mov    -0x1164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1164(%rbp)
jmp    1239 <init_config+0x69>
mov    -0x1180(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1180(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x1180(%rbp)
mov    %al,-0x11a3(%rbp)
je     141c <init_config+0x24c>
mov    -0x1180(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11a3(%rbp)
mov    -0x11a3(%rbp),%al
test   $0x1,%al
jne    142f <init_config+0x25f>
jmp    1446 <init_config+0x276>
mov    -0x1180(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1180(%rbp)
jmp    13ea <init_config+0x21a>
lea    -0x1181(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1080 <memset@plt>
movl   $0x0,-0x1188(%rbp)
mov    -0x1180(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
je     1491 <init_config+0x2c1>
mov    -0x1180(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x27,%eax
cmp    %ecx,%eax
jne    14bc <init_config+0x2ec>
mov    -0x1180(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1181(%rbp)
movl   $0x1,-0x1188(%rbp)
mov    -0x1180(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1180(%rbp)
cmpl   $0x0,-0x1188(%rbp)
je     1631 <init_config+0x461>
movl   $0x0,-0x118c(%rbp)
movl   $0x0,-0x1194(%rbp)
movl   $0x0,-0x1198(%rbp)
mov    -0x1180(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x1180(%rbp)
mov    (%rax),%al
mov    %al,-0x118d(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1604 <init_config+0x434>
movsbl -0x118d(%rbp),%eax
movsbl -0x1181(%rbp),%ecx
cmp    %ecx,%eax
jne    157a <init_config+0x3aa>
cmpl   $0x0,-0x1198(%rbp)
je     1566 <init_config+0x396>
mov    -0x118d(%rbp),%cl
movslq -0x1194(%rbp),%rax
mov    %cl,-0x1160(%rbp,%rax,1)
movl   $0x0,-0x1198(%rbp)
mov    -0x1194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1194(%rbp)
jmp    1575 <init_config+0x3a5>
movl   $0x1,-0x118c(%rbp)
jmp    1604 <init_config+0x434>
jmp    15ff <init_config+0x42f>
movsbl -0x118d(%rbp),%ecx
mov    $0x5c,%eax
cmp    %ecx,%eax
jne    15d7 <init_config+0x407>
cmpl   $0x0,-0x1198(%rbp)
je     15c8 <init_config+0x3f8>
movslq -0x1194(%rbp),%rax
movb   $0x5c,-0x1160(%rbp,%rax,1)
5c
movl   $0x0,-0x1198(%rbp)
mov    -0x1194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1194(%rbp)
jmp    15d2 <init_config+0x402>
movl   $0x1,-0x1198(%rbp)
jmp    15fa <init_config+0x42a>
mov    -0x118d(%rbp),%cl
movslq -0x1194(%rbp),%rax
mov    %cl,-0x1160(%rbp,%rax,1)
mov    -0x1194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1194(%rbp)
jmp    15ff <init_config+0x42f>
jmp    14e7 <init_config+0x317>
cmpl   $0x0,-0x118c(%rbp)
jne    162c <init_config+0x45c>
mov    -0x1164(%rbp),%esi
lea    0x9f8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
jmp    16c1 <init_config+0x4f1>
mov    -0x1180(%rbp),%rax
mov    %rax,-0x11a0(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x11a0(%rbp)
mov    %al,-0x11a4(%rbp)
je     1671 <init_config+0x4a1>
mov    -0x11a0(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11a4(%rbp)
mov    -0x11a4(%rbp),%al
test   $0x1,%al
jne    1684 <init_config+0x4b4>
jmp    169b <init_config+0x4cb>
mov    -0x11a0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x11a0(%rbp)
jmp    163f <init_config+0x46f>
lea    -0x1160(%rbp),%rdi
mov    -0x1180(%rbp),%rsi
mov    -0x11a0(%rbp),%rax
mov    -0x1180(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x1164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1164(%rbp)
mov    -0x10(%rbp),%rax
lea    -0x1060(%rbp),%rdi
lea    -0x1160(%rbp),%rsi
call   *%rax
jmp    1239 <init_config+0x69>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x11b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_config>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1158,%rsp
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
call   10c0 <assert@plt>
lea    0xe0b(%rip),%rsi
mov    %rbx,%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1422 <init_config+0x252>
mov    %rax,%r12
mov    %rax,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
je     1230 <init_config+0x60>
mov    %r12,%rdi
call   1050 <fclose@plt>
add    $0x1158,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r15d
lea    0x150(%rsp),%r14
jmp    1272 <init_config+0xa2>
sub    %r13d,%edx
lea    0x50(%rsp),%rdi
mov    %r14,%rsi
call   1030 <strncpy@plt>
lea    0x10(%rsp),%rdi
lea    0x50(%rsp),%rsi
call   *0x8(%rsp)
mov    %rbp,%r14
add    $0x1,%r15d
mov    %r12,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
jne    1216 <init_config+0x46>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1090 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1090 <memset@plt>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1090 <memset@plt>
mov    %r14,%rdi
mov    $0x1000,%esi
mov    %r12,%rdx
call   10b0 <fgets@plt>
lea    0x14f(%rsp),%rbx
mov    %rbx,%rbp
xchg   %ax,%ax
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   10a0 <isspace@plt>
add    $0x1,%rbp
test   %rax,%rax
jne    12c0 <init_config+0xf0>
xor    %ebp,%ebp
jmp    12e4 <init_config+0x114>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
movsbl (%rbx,%rbp,1),%edi
call   1080 <isalnum@plt>
test   %rax,%rax
jne    12e0 <init_config+0x110>
cmpb   $0x5f,(%rbx,%rbp,1)
je     12e0 <init_config+0x110>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1261 <init_config+0x91>
mov    %rax,%r13
mov    %r14,%rbp
mov    %rax,%r14
add    $0x1,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rbx
movsbl (%r14),%edi
call   10a0 <isspace@plt>
add    $0x1,%r14
add    $0x1,%r13d
test   %rax,%rax
jne    1330 <init_config+0x160>
lea    0x7(%rsp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1090 <memset@plt>
mov    -0x1(%r14),%sil
cmp    $0x22,%sil
je     136a <init_config+0x19a>
cmp    $0x27,%sil
jne    13d0 <init_config+0x200>
mov    %sil,0x7(%rsp)
mov    (%r14),%al
test   %al,%al
je     140a <init_config+0x23a>
add    $0x1,%r14
xor    %edx,%edx
xor    %ecx,%ecx
jmp    13b5 <init_config+0x1e5>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %esi,%eax
test   %edx,%edx
mov    $0x0,%edx
je     1250 <init_config+0x80>
movslq %ecx,%rcx
mov    %al,0x50(%rsp,%rcx,1)
add    $0x1,%ecx
movzbl (%r14),%eax
add    $0x1,%r14
test   %al,%al
je     140a <init_config+0x23a>
cmp    %sil,%al
je     1390 <init_config+0x1c0>
cmp    $0x5c,%al
jne    139f <init_config+0x1cf>
test   %edx,%edx
je     13c8 <init_config+0x1f8>
xor    %edx,%edx
mov    $0x5c,%al
jmp    139f <init_config+0x1cf>
mov    $0x1,%edx
jmp    13a9 <init_config+0x1d9>
nop
add    $0xffffffffffffffff,%r14
movsbl %sil,%edi
call   1040 <isdigit@plt>
mov    %r14,%rdx
test   %rax,%rax
je     1240 <init_config+0x70>
nopl   0x0(%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isdigit@plt>
mov    %rbx,%rdx
test   %rax,%rax
jne    13f0 <init_config+0x220>
jmp    1240 <init_config+0x70>
lea    0xc03(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>
lea    0xbd9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"bad conf file %s\0A\00"
@.str.2 = [2 x i8] c"=\00"
@.str.3 = [23 x i8] c"bad config in line %d\0A\00"
define void @init_config(i8* %0, void (i8*, i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i8*, i8*)*
%5 = alloca i32*
%6 = alloca [4096 x i8]
%7 = alloca [50 x i8]
%8 = alloca [255 x i8]
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [1 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
store i8* %0, i8** %3
store void (i8*, i8*)* %1, void (i8*, i8*)** %4
%20 = load i8*, i8** %3
%21 = call i32 @assert(i8* %20)
store i32* null, i32** %5
%22 = load i8*, i8** %3
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %23, i32** %5
%24 = icmp eq i32* null, %23
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i8*, i8** %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %2
store i32 1, i32* %9
br label %30
30: ; preds = %29, %90, %213
%31 = load i32*, i32** %5
%32 = call i64 @feof(i32* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %30
br label %219
35: ; preds = %30
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%37 = call i32 @memset(i8* %36, i32 0, i32 4096)
%38 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%39 = call i32 @memset(i8* %38, i32 0, i32 50)
%40 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%41 = call i32 @memset(i8* %40, i32 0, i32 255)
%42 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%43 = load i32*, i32** %5
%44 = call i32 @fgets(i8* %42, i32 4096, i32* %43)
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
store i8* %45, i8** %10
br label %46
46: ; preds = %51, %35
%47 = load i8*, i8** %10
%48 = load i8, i8* %47
%49 = call i64 @isspace(i8 signext %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %46
%52 = load i8*, i8** %10
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %10
br label %46
54: ; preds = %46
%55 = load i8*, i8** %10
store i8* %55, i8** %11
br label %56
56: ; preds = %73, %54
%57 = load i8*, i8** %11
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %71
59: ; preds = %56
%60 = load i8*, i8** %11
%61 = load i8, i8* %60
%62 = call i64 @isalnum(i8 signext %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %69, label %64
64: ; preds = %59
%65 = load i8*, i8** %11
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp eq i32 95, %67
br label %69
69: ; preds = %64, %59
%70 = phi i1 [ true, %59 ], [ %68, %64 ]
br label %71
71: ; preds = %69, %56
%72 = phi i1 [ false, %56 ], [ %70, %69 ]
br i1 %72, label %73, label %76
73: ; preds = %71
%74 = load i8*, i8** %11
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %11
br label %56
76: ; preds = %71
%77 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%78 = load i8*, i8** %10
%79 = load i8*, i8** %11
%80 = load i8*, i8** %10
%81 = ptrtoint i8* %79 to i64
%82 = ptrtoint i8* %80 to i64
%83 = sub i64 %81, %82
%84 = trunc i64 %83 to i32
%85 = call i32 @strncpy(i8* %77, i8* %78, i32 %84)
%86 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%87 = call i8* @strstr(i8* %86, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %87, i8** %12
%88 = load i8*, i8** %12
%89 = icmp eq i8* null, %88
br i1 %89, label %90, label %93
90: ; preds = %76
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %30
93: ; preds = %76
%94 = load i8*, i8** %12
%95 = getelementptr inbounds i8, i8* %94, i32 1
store i8* %95, i8** %12
br label %96
96: ; preds = %106, %93
%97 = load i8*, i8** %12
%98 = icmp ne i8* %97, null
br i1 %98, label %99, label %104
99: ; preds = %96
%100 = load i8*, i8** %12
%101 = load i8, i8* %100
%102 = call i64 @isspace(i8 signext %101)
%103 = icmp ne i64 %102, 0
br label %104
104: ; preds = %99, %96
%105 = phi i1 [ false, %96 ], [ %103, %99 ]
br i1 %105, label %106, label %109
106: ; preds = %104
%107 = load i8*, i8** %12
%108 = getelementptr inbounds i8, i8* %107, i32 1
store i8* %108, i8** %12
br label %96
109: ; preds = %104
%110 = getelementptr inbounds [1 x i8], [1 x i8]* %13, i64 0, i64 0
%111 = call i32 @memset(i8* %110, i32 0, i32 1)
store i32 0, i32* %14
%112 = load i8*, i8** %12
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 34, %114
br i1 %115, label %121, label %116
116: ; preds = %109
%117 = load i8*, i8** %12
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 39, %119
br i1 %120, label %121, label %127
121: ; preds = %116, %109
%122 = load i8*, i8** %12
%123 = load i8, i8* %122
%124 = getelementptr inbounds [1 x i8], [1 x i8]* %13, i64 0, i64 0
store i8 %123, i8* %124
store i32 1, i32* %14
%125 = load i8*, i8** %12
%126 = getelementptr inbounds i8, i8* %125, i32 1
store i8* %126, i8** %12
br label %127
127: ; preds = %121, %116
%128 = load i32, i32* %14
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %188
130: ; preds = %127
store i32 0, i32* %15
store i32 0, i32* %17
store i32 0, i32* %18
br label %131
131: ; preds = %179, %130
%132 = load i8*, i8** %12
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %12
%134 = load i8, i8* %132
store i8 %134, i8* %16
%135 = sext i8 %134 to i32
%136 = icmp ne i32 0, %135
br i1 %136, label %137, label %180
137: ; preds = %131
%138 = load i8, i8* %16
%139 = sext i8 %138 to i32
%140 = getelementptr inbounds [1 x i8], [1 x i8]* %13, i64 0, i64 0
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %139, %142
br i1 %143, label %144, label %156
144: ; preds = %137
%145 = load i32, i32* %18
%146 = icmp ne i32 %145, 0
br i1 %146, label %147, label %154
147: ; preds = %144
%148 = load i8, i8* %16
%149 = load i32, i32* %17
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 %150
store i8 %148, i8* %151
store i32 0, i32* %18
%152 = load i32, i32* %17
%153 = add nsw i32 %152, 1
store i32 %153, i32* %17
br label %155
154: ; preds = %144
store i32 1, i32* %15
br label %180
155: ; preds = %147
br label %179
156: ; preds = %137
%157 = load i8, i8* %16
%158 = sext i8 %157 to i32
%159 = icmp eq i32 92, %158
br i1 %159, label %160, label %171
160: ; preds = %156
%161 = load i32, i32* %18
%162 = icmp ne i32 %161, 0
br i1 %162, label %163, label %169
163: ; preds = %160
%164 = load i32, i32* %17
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 %165
store i8 92, i8* %166
store i32 0, i32* %18
%167 = load i32, i32* %17
%168 = add nsw i32 %167, 1
store i32 %168, i32* %17
br label %170
169: ; preds = %160
store i32 1, i32* %18
br label %170
170: ; preds = %169, %163
br label %178
171: ; preds = %156
%172 = load i8, i8* %16
%173 = load i32, i32* %17
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 %174
store i8 %172, i8* %175
%176 = load i32, i32* %17
%177 = add nsw i32 %176, 1
store i32 %177, i32* %17
br label %178
178: ; preds = %171, %170
br label %179
179: ; preds = %178, %155
br label %131
180: ; preds = %154, %131
%181 = load i32, i32* %15
%182 = icmp ne i32 %181, 0
br i1 %182, label %187, label %183
183: ; preds = %180
%184 = load i32, i32* %9
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %184)
%186 = call i32 @exit(i32 0)
unreachable
187: ; preds = %180
br label %213
188: ; preds = %127
%189 = load i8*, i8** %12
store i8* %189, i8** %19
br label %190
190: ; preds = %200, %188
%191 = load i8*, i8** %19
%192 = icmp ne i8* %191, null
br i1 %192, label %193, label %198
193: ; preds = %190
%194 = load i8*, i8** %19
%195 = load i8, i8* %194
%196 = call i64 @isdigit(i8 signext %195)
%197 = icmp ne i64 %196, 0
br label %198
198: ; preds = %193, %190
%199 = phi i1 [ false, %190 ], [ %197, %193 ]
br i1 %199, label %200, label %203
200: ; preds = %198
%201 = load i8*, i8** %19
%202 = getelementptr inbounds i8, i8* %201, i32 1
store i8* %202, i8** %19
br label %190
203: ; preds = %198
%204 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%205 = load i8*, i8** %12
%206 = load i8*, i8** %19
%207 = load i8*, i8** %12
%208 = ptrtoint i8* %206 to i64
%209 = ptrtoint i8* %207 to i64
%210 = sub i64 %208, %209
%211 = trunc i64 %210 to i32
%212 = call i32 @strncpy(i8* %204, i8* %205, i32 %211)
br label %213
213: ; preds = %203, %187
%214 = load i32, i32* %9
%215 = add nsw i32 %214, 1
store i32 %215, i32* %9
%216 = load void (i8*, i8*)*, void (i8*, i8*)** %4
%217 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%218 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
br label %30
219: ; preds = %34
%220 = load i32*, i32** %5
%221 = call i32 @fclose(i32* %220)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"bad conf file %s\0A\00"
@.str.3 = [23 x i8] c"bad config in line %d\0A\00"
define void @init_config(i8* %0, void (i8*, i8*)* nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [50 x i8]
%5 = alloca [255 x i8]
%6 = alloca [1 x i8]
%7 = tail call i32 @assert(i8* %0)
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%17 = call i64 @feof(i32* %8)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %116
19: ; preds = %13
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %6, i64 0, i64 0
br label %21
21: ; preds = %19, %112
%22 = phi i32 [ 1, %19 ], [ %113, %112 ]
%23 = call i32 @memset(i8* %14, i32 0, i32 4096)
%24 = call i32 @memset(i8* %15, i32 0, i32 50)
%25 = call i32 @memset(i8* %16, i32 0, i32 255)
%26 = call i32 @fgets(i8* %14, i32 4096, i32* %8)
br label %27
27: ; preds = %27, %21
%28 = phi i8* [ %14, %21 ], [ %32, %27 ]
%29 = load i8, i8* %28
%30 = call i64 @isspace(i8 signext %29)
%31 = icmp eq i64 %30, 0
%32 = getelementptr inbounds i8, i8* %28, i64 1
br i1 %31, label %33, label %27
33: ; preds = %27, %41
%34 = phi i8* [ %42, %41 ], [ %28, %27 ]
%35 = load i8, i8* %34
%36 = call i64 @isalnum(i8 signext %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8, i8* %34
%40 = icmp eq i8 %39, 95
br i1 %40, label %41, label %43
41: ; preds = %33, %38
%42 = getelementptr inbounds i8, i8* %34, i64 1
br label %33
43: ; preds = %38
%44 = ptrtoint i8* %34 to i64
%45 = ptrtoint i8* %28 to i64
%46 = sub i64 %44, %45
%47 = trunc i64 %46 to i32
%48 = call i32 @strncpy(i8* %15, i8* %28, i32 %47)
%49 = call i8* @strchr(i8* %14, i32 61)
%50 = icmp eq i8* %49, null
br i1 %50, label %112, label %51
51: ; preds = %43, %51
%52 = phi i8* [ %53, %51 ], [ %49, %43 ]
%53 = getelementptr inbounds i8, i8* %52, i64 1
%54 = load i8, i8* %53
%55 = call i64 @isspace(i8 signext %54)
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %51
57: ; preds = %51
%58 = call i32 @memset(i8* %20, i32 0, i32 1)
%59 = load i8, i8* %53
switch i8 %59, label %60 [
i8 34, label %65
i8 39, label %65
]
60: ; preds = %57
%61 = call i64 @isdigit(i8 signext %59)
%62 = icmp eq i64 %61, 0
br i1 %62, label %104, label %63
63: ; preds = %60
%64 = getelementptr inbounds i8, i8* %52, i64 2
br label %98
65: ; preds = %57, %57
store i8 %59, i8* %20
%66 = getelementptr inbounds i8, i8* %52, i64 2
%67 = load i8, i8* %66
%68 = icmp eq i8 %67, 0
br i1 %68, label %95, label %69
69: ; preds = %65
%70 = getelementptr inbounds i8, i8* %52, i64 3
br label %71
71: ; preds = %69, %89
%72 = phi i8 [ %67, %69 ], [ %93, %89 ]
%73 = phi i8* [ %70, %69 ], [ %92, %89 ]
%74 = phi i32 [ 0, %69 ], [ %91, %89 ]
%75 = phi i32 [ 0, %69 ], [ %90, %89 ]
%76 = icmp eq i8 %72, %59
br i1 %76, label %77, label %79
77: ; preds = %71
%78 = icmp eq i32 %74, 0
br i1 %78, label %111, label %83
79: ; preds = %71
%80 = icmp eq i8 %72, 92
br i1 %80, label %81, label %83
81: ; preds = %79
%82 = icmp eq i32 %74, 0
br i1 %82, label %89, label %83
83: ; preds = %79, %81, %77
%84 = phi i8 [ %59, %77 ], [ 92, %81 ], [ %72, %79 ]
%85 = phi i32 [ 0, %77 ], [ 0, %81 ], [ %74, %79 ]
%86 = sext i32 %75 to i64
%87 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 %86
store i8 %84, i8* %87
%88 = add nsw i32 %75, 1
br label %89
89: ; preds = %83, %81
%90 = phi i32 [ %75, %81 ], [ %88, %83 ]
%91 = phi i32 [ 1, %81 ], [ %85, %83 ]
%92 = getelementptr inbounds i8, i8* %73, i64 1
%93 = load i8, i8* %73
%94 = icmp eq i8 %93, 0
br i1 %94, label %95, label %71
95: ; preds = %65, %89
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%97 = call i32 @exit(i32 0)
unreachable
98: ; preds = %63, %98
%99 = phi i8* [ %64, %63 ], [ %103, %98 ]
%100 = load i8, i8* %99
%101 = call i64 @isdigit(i8 signext %100)
%102 = icmp eq i64 %101, 0
%103 = getelementptr inbounds i8, i8* %99, i64 1
br i1 %102, label %104, label %98
104: ; preds = %98, %60
%105 = phi i8* [ %53, %60 ], [ %99, %98 ]
%106 = ptrtoint i8* %105 to i64
%107 = ptrtoint i8* %53 to i64
%108 = sub i64 %106, %107
%109 = trunc i64 %108 to i32
%110 = call i32 @strncpy(i8* %16, i8* %53, i32 %109)
br label %111
111: ; preds = %77, %104
br label %112
112: ; preds = %43, %111
%113 = add nuw nsw i32 %22, 1
%114 = call i64 @feof(i32* %8)
%115 = icmp eq i64 %114, 0
br i1 %115, label %21, label %116
116: ; preds = %112, %13
%117 = call i32 @fclose(i32* %8)
ret void
}