#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*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ set_signature(char *);
int /*<<< orphan*/ set_sql(char *);
int /*<<< orphan*/ set_version(char *);
int /*<<< orphan*/ set_wdb(char *);
int set_wdbtypes_from_schema();
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ strncmp(char *, char *, int);
int parse_config(char *configPath) {
  unsigned long linesRead = 0;
  FILE *file = fopen(configPath, "r");
  if (!file) {
    fprintf(stderr, "Failed to open format file: %s\n", strerror(errno));
    return -1;
  }
  enum {
    STAGE_NONE,
    STAGE_SIGNATURE,
    STAGE_VERSION,
    STAGE_WDB,
    STAGE_SQL
  } stage = STAGE_NONE;
  while (!feof(file)) {
    char lineBuf[4096];
    if (fgets(lineBuf, 4096, file) == NULL) {
      fprintf(stderr, "End of file: %s (Read %lu lines)\n", strerror(errno),
              linesRead);
      goto endfile;
    }
    if (strncmp(lineBuf, "//", 2) == 0) {
    } else if (strncmp(lineBuf, "+signature", 10) == 0) {
      stage = STAGE_SIGNATURE;
    } else if (strncmp(lineBuf, "+version", 8) == 0) {
      stage = STAGE_VERSION;
    } else if (strncmp(lineBuf, "+wdb", 4) == 0) {
      stage = STAGE_WDB;
    } else if (strncmp(lineBuf, "+sql", 4) == 0) {
      stage = STAGE_SQL;
    } else {
      switch (stage) {
      case STAGE_NONE:
        fprintf(stderr, "Junk line: %s", lineBuf);
        break;
      case STAGE_SIGNATURE:
        if (set_signature(lineBuf) < 0)
          return -1;
        break;
      case STAGE_VERSION:
        if (set_version(lineBuf) < 0)
          return -1;
        break;
      case STAGE_WDB:
        if (set_wdb(lineBuf) < 0)
          return -1;
        break;
      case STAGE_SQL:
        if (set_sql(lineBuf) < 0)
          return -1;
        break;
      }
    }
    linesRead++;
  }
endfile:
  fclose(file);
  return set_wdbtypes_from_schema();
}


x86 assembly (clang, -O0):
<parse_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1040,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1236 <parse_config+0x76>
mov    0x2de3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1034(%rbp)
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x1034(%rbp),%edi
mov    %rax,%rdx
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14be <parse_config+0x2fe>
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1090 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    125b <parse_config+0x9b>
jmp    14a6 <parse_config+0x2e6>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1000,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
jne    12b7 <parse_config+0xf7>
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1038(%rbp)
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0x1038(%rbp),%edi
mov    %rax,%rdx
mov    -0x18(%rbp),%rcx
lea    0xd8b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    14ab <parse_config+0x2eb>
lea    -0x1030(%rbp),%rdi
lea    0xd93(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12de <parse_config+0x11e>
jmp    1495 <parse_config+0x2d5>
lea    -0x1030(%rbp),%rdi
lea    0xd6f(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    130c <parse_config+0x14c>
movl   $0x1,-0x24(%rbp)
jmp    1490 <parse_config+0x2d0>
lea    -0x1030(%rbp),%rdi
lea    0xd4c(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    133a <parse_config+0x17a>
movl   $0x2,-0x24(%rbp)
jmp    148b <parse_config+0x2cb>
lea    -0x1030(%rbp),%rdi
lea    0xd27(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1368 <parse_config+0x1a8>
movl   $0x3,-0x24(%rbp)
jmp    1486 <parse_config+0x2c6>
lea    -0x1030(%rbp),%rdi
lea    0xcfe(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1396 <parse_config+0x1d6>
movl   $0x4,-0x24(%rbp)
jmp    1481 <parse_config+0x2c1>
mov    -0x24(%rbp),%eax
mov    %rax,-0x1040(%rbp)
sub    $0x4,%rax
ja     147c <parse_config+0x2bc>
mov    -0x1040(%rbp),%rax
lea    0xc48(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2c18(%rip),%rax
mov    (%rax),%edi
lea    -0x1030(%rbp),%rdx
lea    0xca1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    147c <parse_config+0x2bc>
lea    -0x1030(%rbp),%rdi
call   10b0 <set_signature@plt>
cmp    $0x0,%eax
jge    1405 <parse_config+0x245>
movl   $0xffffffff,-0x4(%rbp)
jmp    14be <parse_config+0x2fe>
jmp    147c <parse_config+0x2bc>
lea    -0x1030(%rbp),%rdi
call   1060 <set_version@plt>
cmp    $0x0,%eax
jge    142b <parse_config+0x26b>
movl   $0xffffffff,-0x4(%rbp)
jmp    14be <parse_config+0x2fe>
jmp    147c <parse_config+0x2bc>
lea    -0x1030(%rbp),%rdi
call   10d0 <set_wdb@plt>
cmp    $0x0,%eax
jge    1451 <parse_config+0x291>
movl   $0xffffffff,-0x4(%rbp)
jmp    14be <parse_config+0x2fe>
jmp    147c <parse_config+0x2bc>
lea    -0x1030(%rbp),%rdi
call   1040 <set_sql@plt>
cmp    $0x0,%eax
jge    1477 <parse_config+0x2b7>
movl   $0xffffffff,-0x4(%rbp)
jmp    14be <parse_config+0x2fe>
jmp    147c <parse_config+0x2bc>
jmp    1481 <parse_config+0x2c1>
jmp    1486 <parse_config+0x2c6>
jmp    148b <parse_config+0x2cb>
jmp    1490 <parse_config+0x2d0>
jmp    1495 <parse_config+0x2d5>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    123d <parse_config+0x7d>
jmp    14ab <parse_config+0x2eb>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    $0x0,%al
call   10c0 <set_wdbtypes_from_schema@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_config>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1008,%rsp
lea    0xe3c(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1379 <parse_config+0x1b9>
mov    %rax,%r14
mov    %rax,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    13d7 <parse_config+0x217>
xor    %r13d,%r13d
mov    %rsp,%r15
lea    0xe52(%rip),%r12
xor    %ebx,%ebx
jmp    122a <parse_config+0x6a>
nopw   0x0(%rax,%rax,1)
mov    %r13d,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1090 <feof@plt>
mov    %ebp,%r13d
test   %eax,%eax
jne    13d7 <parse_config+0x217>
mov    %r15,%rdi
mov    $0x1000,%esi
mov    %r14,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     13aa <parse_config+0x1ea>
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1210 <parse_config+0x50>
mov    %r15,%rdi
lea    0xdf9(%rip),%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     1213 <parse_config+0x53>
mov    %r15,%rdi
lea    0xde6(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12ff <parse_config+0x13f>
mov    %r15,%rdi
lea    0xdd6(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1309 <parse_config+0x149>
mov    %r15,%rdi
lea    0xdc2(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1313 <parse_config+0x153>
cmp    $0x4,%r13d
ja     1210 <parse_config+0x50>
mov    %r13d,%eax
lea    0xd2b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
xor    %ebp,%ebp
lea    0xd89(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1213 <parse_config+0x53>
mov    $0x2,%ebp
jmp    1213 <parse_config+0x53>
mov    $0x3,%ebp
jmp    1213 <parse_config+0x53>
mov    $0x4,%ebp
jmp    1213 <parse_config+0x53>
mov    %r15,%rdi
call   10b0 <set_signature@plt>
test   %eax,%eax
jns    1213 <parse_config+0x53>
jmp    1372 <parse_config+0x1b2>
mov    %r15,%rdi
call   1060 <set_version@plt>
mov    $0x2,%ebp
test   %eax,%eax
jns    1213 <parse_config+0x53>
jmp    1372 <parse_config+0x1b2>
mov    %r15,%rdi
call   10d0 <set_wdb@plt>
mov    $0x3,%ebp
test   %eax,%eax
jns    1213 <parse_config+0x53>
jmp    1372 <parse_config+0x1b2>
mov    %r15,%rdi
call   1040 <set_sql@plt>
mov    $0x4,%ebp
test   %eax,%eax
jns    1213 <parse_config+0x53>
mov    $0xffffffff,%eax
jmp    13e6 <parse_config+0x226>
mov    0x2c60(%rip),%rax
mov    (%rax),%ebx
mov    0x2c4f(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc7f(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    13e6 <parse_config+0x226>
mov    0x2c2f(%rip),%rax
mov    (%rax),%ebp
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc6e(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
call   10c0 <set_wdbtypes_from_schema@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Failed to open format file: %s\0A\00"
@errno = global i32 0
@.str.2 = [34 x i8] c"End of file: %s (Read %lu lines)\0A\00"
@.str.3 = [3 x i8] c"//\00"
@.str.4 = [11 x i8] c"+signature\00"
@.str.5 = [9 x i8] c"+version\00"
@.str.6 = [5 x i8] c"+wdb\00"
@.str.7 = [5 x i8] c"+sql\00"
@.str.8 = [14 x i8] c"Junk line: %s\00"
define i32 @parse_config(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [4096 x i8]
store i8* %0, i8** %3
store i64 0, i64* %4
%8 = load i8*, i8** %3
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = icmp ne i32* %10, null
br i1 %11, label %17, label %12
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = load i32, i32* @errno
%15 = call i8* @strerror(i32 %14)
%16 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 -1, i32* %2
br label %102
17: ; preds = %1
store i32 0, i32* %6
br label %18
18: ; preds = %94, %17
%19 = load i32*, i32** %5
%20 = call i32 @feof(i32* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br i1 %22, label %23, label %97
23: ; preds = %18
%24 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%25 = load i32*, i32** %5
%26 = call i32* @fgets(i8* %24, i32 4096, i32* %25)
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %34
28: ; preds = %23
%29 = load i32, i32* @stderr
%30 = load i32, i32* @errno
%31 = call i8* @strerror(i32 %30)
%32 = load i64, i64* %4
%33 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %31, i64 %32)
br label %98
34: ; preds = %23
%35 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%36 = call i64 @strncmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
br label %94
39: ; preds = %34
%40 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%41 = call i64 @strncmp(i8* %40, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %39
store i32 1, i32* %6
br label %93
44: ; preds = %39
%45 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%46 = call i64 @strncmp(i8* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 8)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %44
store i32 2, i32* %6
br label %92
49: ; preds = %44
%50 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %49
store i32 3, i32* %6
br label %91
54: ; preds = %49
%55 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%56 = call i64 @strncmp(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %54
store i32 4, i32* %6
br label %90
59: ; preds = %54
%60 = load i32, i32* %6
switch i32 %60, label %89 [
i32 0, label %61
i32 1, label %65
i32 2, label %71
i32 3, label %77
i32 4, label %83
]
61: ; preds = %59
%62 = load i32, i32* @stderr
%63 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%64 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %63)
br label %89
65: ; preds = %59
%66 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%67 = call i32 @set_signature(i8* %66)
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %65
store i32 -1, i32* %2
br label %102
70: ; preds = %65
br label %89
71: ; preds = %59
%72 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%73 = call i32 @set_version(i8* %72)
%74 = icmp slt i32 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %71
store i32 -1, i32* %2
br label %102
76: ; preds = %71
br label %89
77: ; preds = %59
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%79 = call i32 @set_wdb(i8* %78)
%80 = icmp slt i32 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %77
store i32 -1, i32* %2
br label %102
82: ; preds = %77
br label %89
83: ; preds = %59
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%85 = call i32 @set_sql(i8* %84)
%86 = icmp slt i32 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %83
store i32 -1, i32* %2
br label %102
88: ; preds = %83
br label %89
89: ; preds = %59, %88, %82, %76, %70, %61
br label %90
90: ; preds = %89, %58
br label %91
91: ; preds = %90, %53
br label %92
92: ; preds = %91, %48
br label %93
93: ; preds = %92, %43
br label %94
94: ; preds = %93, %38
%95 = load i64, i64* %4
%96 = add i64 %95, 1
store i64 %96, i64* %4
br label %18
97: ; preds = %18
br label %98
98: ; preds = %97, %28
%99 = load i32*, i32** %5
%100 = call i32 @fclose(i32* %99)
%101 = call i32 (...) @set_wdbtypes_from_schema()
store i32 %101, i32* %2
br label %102
102: ; preds = %98, %87, %81, %75, %69, %12
%103 = load i32, i32* %2
ret i32 %103
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [32 x i8] c"Failed to open format file: %s\0A\00"
@errno = global i32 0
@.str.2 = [34 x i8] c"End of file: %s (Read %lu lines)\0A\00"
@.str.3 = [3 x i8] c"//\00"
@.str.4 = [11 x i8] c"+signature\00"
@.str.5 = [9 x i8] c"+version\00"
@.str.6 = [5 x i8] c"+wdb\00"
@.str.7 = [5 x i8] c"+sql\00"
@.str.8 = [14 x i8] c"Junk line: %s\00"
define i32 @parse_config(i8* nocapture %0) {
%2 = alloca [4096 x i8]
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 @feof(i32* %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %62
8: ; preds = %5
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
br label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = tail call i8* @strerror(i32 %12)
%14 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %65
15: ; preds = %8, %57
%16 = phi i32 [ 0, %8 ], [ %58, %57 ]
%17 = phi i64 [ 0, %8 ], [ %59, %57 ]
%18 = call i32* @fgets(i8* %9, i32 4096, i32* %3)
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = load i32, i32* @stderr
%22 = load i32, i32* @errno
%23 = call i8* @strerror(i32 %22)
%24 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %23, i64 %17)
br label %62
25: ; preds = %15
%26 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 2)
%27 = icmp eq i64 %26, 0
br i1 %27, label %57, label %28
28: ; preds = %25
%29 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10)
%30 = icmp eq i64 %29, 0
br i1 %30, label %57, label %31
31: ; preds = %28
%32 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32 8)
%33 = icmp eq i64 %32, 0
br i1 %33, label %57, label %34
34: ; preds = %31
%35 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 4)
%36 = icmp eq i64 %35, 0
br i1 %36, label %57, label %37
37: ; preds = %34
%38 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%39 = icmp eq i64 %38, 0
br i1 %39, label %57, label %40
40: ; preds = %37
switch i32 %16, label %57 [
i32 0, label %41
i32 1, label %44
i32 2, label %47
i32 3, label %50
i32 4, label %53
]
41: ; preds = %40
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %9)
br label %57
44: ; preds = %40
%45 = call i32 @set_signature(i8* %9)
%46 = icmp slt i32 %45, 0
br i1 %46, label %56, label %57
47: ; preds = %40
%48 = call i32 @set_version(i8* %9)
%49 = icmp slt i32 %48, 0
br i1 %49, label %56, label %57
50: ; preds = %40
%51 = call i32 @set_wdb(i8* %9)
%52 = icmp slt i32 %51, 0
br i1 %52, label %56, label %57
53: ; preds = %40
%54 = call i32 @set_sql(i8* %9)
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %44, %47, %50, %53
br label %65
57: ; preds = %25, %53, %50, %47, %44, %40, %41, %28, %31, %34, %37
%58 = phi i32 [ %16, %25 ], [ %16, %40 ], [ 4, %53 ], [ 3, %50 ], [ 2, %47 ], [ 1, %44 ], [ 0, %41 ], [ 1, %28 ], [ 2, %31 ], [ 3, %34 ], [ 4, %37 ]
%59 = add i64 %17, 1
%60 = call i32 @feof(i32* %3)
%61 = icmp eq i32 %60, 0
br i1 %61, label %15, label %62
62: ; preds = %57, %5, %20
%63 = call i32 @fclose(i32* %3)
%64 = call i32 (...) @set_wdbtypes_from_schema()
br label %65
65: ; preds = %56, %62, %10
%66 = phi i32 [ -1, %10 ], [ %64, %62 ], [ -1, %56 ]
ret i32 %66
}