#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*/ configs;

/* Variables and functions */
int /*<<< orphan*/ cfg_debug(char *);
char *cfg_error_msg(int);
char *cfg_get_filename(int);
char **cfg_get_hash_keys(int, char *, char *);
char *cfg_get_hash_value(int, char *, char *, char *);
char **cfg_get_keywords(int, char *);
char **cfg_get_sections(int);
int cfg_get_type(int, char *, char *);
char *cfg_get_type_str(int, char *, char *);
char *cfg_get_value(int, char *, char *);
char **cfg_get_values(int, char *, char *);
char *cfg_get_version();
int cfg_read_config_file(char *);
int /*<<< orphan*/ cfg_set_debug(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char *config_file, *error, *value;
  char **hkp, **hash_keys, **values, **keywords, **sections;
  char **sp, **kp, **vp, *hash_key, *type_s;
  char *keyword, *section, *filename;
  int cfg_index, type, i;
  char *configs[] = {"conf/test.conf", "conf/test2.conf"};
  printf("version of library is %s\n", cfg_get_version());
  cfg_set_debug(0);
  cfg_debug("This won't print since debugging is off\n");
  for (i = 0; i < sizeof(configs) / sizeof(configs[0]); i++) {
    cfg_index = cfg_read_config_file(configs[i]);
    if (cfg_error_msg(cfg_index)) {
      error = cfg_error_msg(cfg_index);
      fprintf(stderr, "Error: %s", error);
      continue;
    }
    filename = cfg_get_filename(cfg_index);
    printf("config filename for config index number %d is %s\n\n", cfg_index,
           filename);
    sections = cfg_get_sections(cfg_index);
    for (sp = sections; *sp; sp++) {
      section = *sp;
      printf("%s\n", section);
      keywords = cfg_get_keywords(cfg_index, *sp);
      for (kp = keywords; *kp; kp++) {
        keyword = *kp;
        type = cfg_get_type(cfg_index, section, keyword);
        type_s = cfg_get_type_str(cfg_index, section, keyword);
        printf("\t%s (%s)\n", keyword, type_s);
        switch (type) {
        case 1:
          value = cfg_get_value(cfg_index, section, keyword);
          printf("\t\t\'%s\'\n", value);
          break;
        case 2:
          values = cfg_get_values(cfg_index, section, keyword);
          for (vp = values; *vp; vp++) {
            printf("\t\t\'%s\'\n", *vp);
          }
          break;
        case 3:
          hash_keys = cfg_get_hash_keys(cfg_index, section, keyword);
          for (hkp = hash_keys; *hkp; hkp++) {
            hash_key = *hkp;
            value = cfg_get_hash_value(cfg_index, section, keyword, hash_key);
            printf("\t\t%s = \'%s\'\n", hash_key, value);
          }
          break;
        }
      }
    }
    printf("\n\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2be0(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0x2bda(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    $0x0,%al
call   10c0 <cfg_get_version@plt>
mov    %rax,%rsi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
xor    %edi,%edi
call   10d0 <cfg_set_debug@plt>
lea    0xdde(%rip),%rdi
call   1110 <cfg_debug@plt>
movl   $0x0,-0x9c(%rbp)
movslq -0x9c(%rbp),%rax
cmp    $0x2,%rax
jae    1570 <main+0x370>
movslq -0x9c(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
call   1100 <cfg_read_config_file@plt>
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%edi
call   1040 <cfg_error_msg@plt>
cmp    $0x0,%rax
je     12d7 <main+0xd7>
mov    -0x94(%rbp),%edi
call   1040 <cfg_error_msg@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d18(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd95(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    155c <main+0x35c>
mov    -0x94(%rbp),%edi
call   1120 <cfg_get_filename@plt>
mov    %rax,-0x90(%rbp)
mov    -0x94(%rbp),%esi
mov    -0x90(%rbp),%rdx
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x94(%rbp),%edi
call   1090 <cfg_get_sections@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax)
je     154e <main+0x34e>
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rsi
lea    0xcf0(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x94(%rbp),%edi
mov    -0x58(%rbp),%rax
mov    (%rax),%rsi
call   1060 <cfg_get_keywords@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
cmpq   $0x0,(%rax)
je     1538 <main+0x338>
mov    -0x60(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x80(%rbp)
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   10e0 <cfg_get_type@plt>
mov    %eax,-0x98(%rbp)
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   1050 <cfg_get_type_str@plt>
mov    %rax,-0x78(%rbp)
mov    -0x80(%rbp),%rsi
mov    -0x78(%rbp),%rdx
lea    0xcd7(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    -0x98(%rbp),%eax
mov    %eax,-0xb4(%rbp)
sub    $0x1,%eax
je     1411 <main+0x211>
jmp    13e9 <main+0x1e9>
mov    -0xb4(%rbp),%eax
sub    $0x2,%eax
je     1442 <main+0x242>
jmp    13fd <main+0x1fd>
mov    -0xb4(%rbp),%eax
sub    $0x3,%eax
je     149d <main+0x29d>
jmp    1522 <main+0x322>
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   1070 <cfg_get_value@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1522 <main+0x322>
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   1030 <cfg_get_values@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
cmpq   $0x0,(%rax)
je     1498 <main+0x298>
mov    -0x68(%rbp),%rax
mov    (%rax),%rsi
lea    0xc29(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x68(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x68(%rbp)
jmp    1464 <main+0x264>
jmp    1522 <main+0x322>
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   10f0 <cfg_get_hash_keys@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmpq   $0x0,(%rax)
je     151d <main+0x31d>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x94(%rbp),%edi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x70(%rbp),%rcx
call   1080 <cfg_get_hash_value@plt>
mov    %rax,-0x28(%rbp)
mov    -0x70(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xbac(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
jmp    14bf <main+0x2bf>
jmp    1522 <main+0x322>
jmp    1527 <main+0x327>
mov    -0x60(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x60(%rbp)
jmp    136a <main+0x16a>
jmp    153d <main+0x33d>
mov    -0x58(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x58(%rbp)
jmp    131b <main+0x11b>
lea    0xb47(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    126a <main+0x6a>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   10d0 <cfg_get_version@plt>
lea    0xdf3(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
xor    %edi,%edi
call   10e0 <cfg_set_debug@plt>
lea    0xdf5(%rip),%rdi
call   1120 <cfg_debug@plt>
mov    $0x1,%bl
lea    0xe6e(%rip),%rbp
xor    %eax,%eax
jmp    128a <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
lea    0xe36(%rip),%rdi
call   1090 <puts@plt>
mov    0xc(%rsp),%ebx
lea    0xe49(%rip),%rbp
mov    $0x1,%eax
test   $0x1,%bl
mov    $0x0,%ebx
je     1477 <main+0x267>
movslq 0x0(%rbp,%rax,4),%rdi
add    %rbp,%rdi
call   1110 <cfg_read_config_file@plt>
mov    %eax,%r14d
mov    %eax,%edi
call   1040 <cfg_error_msg@plt>
test   %rax,%rax
je     12d0 <main+0xc0>
mov    %r14d,%edi
call   1040 <cfg_error_msg@plt>
mov    0x2d2b(%rip),%rcx
mov    (%rcx),%edi
lea    0xda4(%rip),%rsi
mov    %rax,%rdx
call   10c0 <fprintf@plt>
jmp    1277 <main+0x67>
nopl   0x0(%rax,%rax,1)
mov    %ebx,0xc(%rsp)
mov    %r14d,%edi
call   1130 <cfg_get_filename@plt>
lea    0xd89(%rip),%rdi
mov    %r14d,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %r14d,%edi
call   10a0 <cfg_get_sections@plt>
mov    (%rax),%rbp
test   %rbp,%rbp
je     1260 <main+0x50>
mov    %rax,%rbx
jmp    1326 <main+0x116>
nopl   0x0(%rax)
mov    0x10(%rsp),%rbx
mov    0x8(%rbx),%rbp
add    $0x8,%rbx
test   %rbp,%rbp
je     1260 <main+0x50>
mov    %rbp,%rdi
call   1090 <puts@plt>
mov    %rbx,0x10(%rsp)
mov    (%rbx),%rsi
mov    %r14d,%edi
call   1060 <cfg_get_keywords@plt>
mov    (%rax),%r15
test   %r15,%r15
je     1310 <main+0x100>
mov    %rax,%r12
jmp    135e <main+0x14e>
nopl   0x0(%rax,%rax,1)
mov    0x8(%r12),%r15
add    $0x8,%r12
test   %r15,%r15
je     1310 <main+0x100>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   10f0 <cfg_get_type@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1050 <cfg_get_type_str@plt>
lea    0xd1c(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <printf@plt>
cmp    $0x3,%ebx
je     1410 <main+0x200>
cmp    $0x2,%ebx
je     13c0 <main+0x1b0>
cmp    $0x1,%ebx
jne    1350 <main+0x140>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1070 <cfg_get_value@plt>
lea    0xcf5(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
jmp    1350 <main+0x140>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1030 <cfg_get_values@plt>
mov    (%rax),%rsi
test   %rsi,%rsi
je     1350 <main+0x140>
mov    %rax,%rbx
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xcb2(%rip),%rdi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    13f0 <main+0x1e0>
jmp    1350 <main+0x140>
nop
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
call   1100 <cfg_get_hash_keys@plt>
mov    (%rax),%rbx
test   %rbx,%rbx
je     1350 <main+0x140>
mov    %rax,%r13
add    $0x8,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1080 <cfg_get_hash_value@plt>
lea    0xc59(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x0(%r13),%rbx
add    $0x8,%r13
test   %rbx,%rbx
jne    1440 <main+0x230>
jmp    1350 <main+0x140>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"conf/test.conf\00"
@.str.1 = [16 x i8] c"conf/test2.conf\00"
@__const.main.configs = [2 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [26 x i8] c"version of library is %s\0A\00"
@.str.3 = [41 x i8] c"This won't print since debugging is off\0A\00"
@stderr = global i32 0
@.str.4 = [10 x i8] c"Error: %s\00"
@.str.5 = [51 x i8] c"config filename for config index number %d is %s\0A\0A\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [10 x i8] c"\09%s (%s)\0A\00"
@.str.8 = [8 x i8] c"\09\09'%s'\0A\00"
@.str.9 = [13 x i8] c"\09\09%s = '%s'\0A\00"
@.str.10 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i8**
%14 = alloca i8**
%15 = alloca i8**
%16 = alloca i8**
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = bitcast [2 x i8*]* %25 to i8*
%27 = call i8* (...) @cfg_get_version()
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = call i32 @cfg_set_debug(i32 0)
%30 = call i32 @cfg_debug(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %24
br label %31
31: ; preds = %152, %2
%32 = load i32, i32* %24
%33 = sext i32 %32 to i64
%34 = icmp ult i64 %33, 2
br i1 %34, label %35, label %155
35: ; preds = %31
%36 = load i32, i32* %24
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [2 x i8*], [2 x i8*]* %25, i64 0, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 @cfg_read_config_file(i8* %39)
store i32 %40, i32* %22
%41 = load i32, i32* %22
%42 = call i8* @cfg_error_msg(i32 %41)
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %50
44: ; preds = %35
%45 = load i32, i32* %22
%46 = call i8* @cfg_error_msg(i32 %45)
store i8* %46, i8** %7
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %7
%49 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %48)
br label %152
50: ; preds = %35
%51 = load i32, i32* %22
%52 = call i8* @cfg_get_filename(i32 %51)
store i8* %52, i8** %21
%53 = load i32, i32* %22
%54 = load i8*, i8** %21
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %53, i8* %54)
%56 = load i32, i32* %22
%57 = call i8** @cfg_get_sections(i32 %56)
store i8** %57, i8*** %13
%58 = load i8**, i8*** %13
store i8** %58, i8*** %14
br label %59
59: ; preds = %147, %50
%60 = load i8**, i8*** %14
%61 = load i8*, i8** %60
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %150
63: ; preds = %59
%64 = load i8**, i8*** %14
%65 = load i8*, i8** %64
store i8* %65, i8** %20
%66 = load i8*, i8** %20
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %66)
%68 = load i32, i32* %22
%69 = load i8**, i8*** %14
%70 = load i8*, i8** %69
%71 = call i8** @cfg_get_keywords(i32 %68, i8* %70)
store i8** %71, i8*** %12
%72 = load i8**, i8*** %12
store i8** %72, i8*** %15
br label %73
73: ; preds = %143, %63
%74 = load i8**, i8*** %15
%75 = load i8*, i8** %74
%76 = icmp ne i8* %75, null
br i1 %76, label %77, label %146
77: ; preds = %73
%78 = load i8**, i8*** %15
%79 = load i8*, i8** %78
store i8* %79, i8** %19
%80 = load i32, i32* %22
%81 = load i8*, i8** %20
%82 = load i8*, i8** %19
%83 = call i32 @cfg_get_type(i32 %80, i8* %81, i8* %82)
store i32 %83, i32* %23
%84 = load i32, i32* %22
%85 = load i8*, i8** %20
%86 = load i8*, i8** %19
%87 = call i8* @cfg_get_type_str(i32 %84, i8* %85, i8* %86)
store i8* %87, i8** %18
%88 = load i8*, i8** %19
%89 = load i8*, i8** %18
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %88, i8* %89)
%91 = load i32, i32* %23
switch i32 %91, label %142 [
i32 1, label %92
i32 2, label %99
i32 3, label %117
]
92: ; preds = %77
%93 = load i32, i32* %22
%94 = load i8*, i8** %20
%95 = load i8*, i8** %19
%96 = call i8* @cfg_get_value(i32 %93, i8* %94, i8* %95)
store i8* %96, i8** %8
%97 = load i8*, i8** %8
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %97)
br label %142
99: ; preds = %77
%100 = load i32, i32* %22
%101 = load i8*, i8** %20
%102 = load i8*, i8** %19
%103 = call i8** @cfg_get_values(i32 %100, i8* %101, i8* %102)
store i8** %103, i8*** %11
%104 = load i8**, i8*** %11
store i8** %104, i8*** %16
br label %105
105: ; preds = %113, %99
%106 = load i8**, i8*** %16
%107 = load i8*, i8** %106
%108 = icmp ne i8* %107, null
br i1 %108, label %109, label %116
109: ; preds = %105
%110 = load i8**, i8*** %16
%111 = load i8*, i8** %110
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %111)
br label %113
113: ; preds = %109
%114 = load i8**, i8*** %16
%115 = getelementptr inbounds i8*, i8** %114, i32 1
store i8** %115, i8*** %16
br label %105
116: ; preds = %105
br label %142
117: ; preds = %77
%118 = load i32, i32* %22
%119 = load i8*, i8** %20
%120 = load i8*, i8** %19
%121 = call i8** @cfg_get_hash_keys(i32 %118, i8* %119, i8* %120)
store i8** %121, i8*** %10
%122 = load i8**, i8*** %10
store i8** %122, i8*** %9
br label %123
123: ; preds = %138, %117
%124 = load i8**, i8*** %9
%125 = load i8*, i8** %124
%126 = icmp ne i8* %125, null
br i1 %126, label %127, label %141
127: ; preds = %123
%128 = load i8**, i8*** %9
%129 = load i8*, i8** %128
store i8* %129, i8** %17
%130 = load i32, i32* %22
%131 = load i8*, i8** %20
%132 = load i8*, i8** %19
%133 = load i8*, i8** %17
%134 = call i8* @cfg_get_hash_value(i32 %130, i8* %131, i8* %132, i8* %133)
store i8* %134, i8** %8
%135 = load i8*, i8** %17
%136 = load i8*, i8** %8
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %135, i8* %136)
br label %138
138: ; preds = %127
%139 = load i8**, i8*** %9
%140 = getelementptr inbounds i8*, i8** %139, i32 1
store i8** %140, i8*** %9
br label %123
141: ; preds = %123
br label %142
142: ; preds = %77, %141, %116, %92
br label %143
143: ; preds = %142
%144 = load i8**, i8*** %15
%145 = getelementptr inbounds i8*, i8** %144, i32 1
store i8** %145, i8*** %15
br label %73
146: ; preds = %73
br label %147
147: ; preds = %146
%148 = load i8**, i8*** %14
%149 = getelementptr inbounds i8*, i8** %148, i32 1
store i8** %149, i8*** %14
br label %59
150: ; preds = %59
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %152
152: ; preds = %150, %44
%153 = load i32, i32* %24
%154 = add nsw i32 %153, 1
store i32 %154, i32* %24
br label %31
155: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"conf/test.conf\00"
@.str.1 = [16 x i8] c"conf/test2.conf\00"
@reltable.main = [2 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str to i64), i64 ptrtoint ([2 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([16 x i8]* @.str.1 to i64), i64 ptrtoint ([2 x i32]* @reltable.main to i64)) to i32)]
@.str.2 = [26 x i8] c"version of library is %s\0A\00"
@.str.3 = [41 x i8] c"This won't print since debugging is off\0A\00"
@stderr = global i32 0
@.str.4 = [10 x i8] c"Error: %s\00"
@.str.5 = [51 x i8] c"config filename for config index number %d is %s\0A\0A\00"
@.str.7 = [10 x i8] c"\09%s (%s)\0A\00"
@.str.8 = [8 x i8] c"\09\09'%s'\0A\00"
@.str.9 = [13 x i8] c"\09\09%s = '%s'\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @cfg_get_version()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%5 = tail call i32 @cfg_set_debug(i32 0)
%6 = tail call i32 @cfg_debug(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
br label %7
7: ; preds = %2, %75
%8 = phi i1 [ true, %2 ], [ false, %75 ]
%9 = phi i64 [ 0, %2 ], [ 1, %75 ]
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([2 x i32]* @reltable.main to i8*), i64 %10)
%12 = tail call i32 @cfg_read_config_file(i8* %11)
%13 = tail call i8* @cfg_error_msg(i32 %12)
%14 = icmp eq i8* %13, null
br i1 %14, label %19, label %15
15: ; preds = %7
%16 = tail call i8* @cfg_error_msg(i32 %12)
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %16)
br label %75
19: ; preds = %7
%20 = tail call i8* @cfg_get_filename(i32 %12)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i32 %12, i8* %20)
%22 = tail call i8** @cfg_get_sections(i32 %12)
%23 = load i8*, i8** %22
%24 = icmp eq i8* %23, null
br i1 %24, label %73, label %25
25: ; preds = %19, %69
%26 = phi i8* [ %71, %69 ], [ %23, %19 ]
%27 = phi i8** [ %70, %69 ], [ %22, %19 ]
%28 = tail call i32 @puts(i8* %26)
%29 = load i8*, i8** %27
%30 = tail call i8** @cfg_get_keywords(i32 %12, i8* %29)
%31 = load i8*, i8** %30
%32 = icmp eq i8* %31, null
br i1 %32, label %69, label %33
33: ; preds = %25, %65
%34 = phi i8* [ %67, %65 ], [ %31, %25 ]
%35 = phi i8** [ %66, %65 ], [ %30, %25 ]
%36 = tail call i32 @cfg_get_type(i32 %12, i8* %26, i8* %34)
%37 = tail call i8* @cfg_get_type_str(i32 %12, i8* %26, i8* %34)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %34, i8* %37)
switch i32 %36, label %65 [
i32 1, label %39
i32 2, label %42
i32 3, label %53
]
39: ; preds = %33
%40 = tail call i8* @cfg_get_value(i32 %12, i8* %26, i8* %34)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %40)
br label %65
42: ; preds = %33
%43 = tail call i8** @cfg_get_values(i32 %12, i8* %26, i8* %34)
%44 = load i8*, i8** %43
%45 = icmp eq i8* %44, null
br i1 %45, label %65, label %46
46: ; preds = %42, %46
%47 = phi i8* [ %51, %46 ], [ %44, %42 ]
%48 = phi i8** [ %50, %46 ], [ %43, %42 ]
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %47)
%50 = getelementptr inbounds i8*, i8** %48, i64 1
%51 = load i8*, i8** %50
%52 = icmp eq i8* %51, null
br i1 %52, label %65, label %46
53: ; preds = %33
%54 = tail call i8** @cfg_get_hash_keys(i32 %12, i8* %26, i8* %34)
%55 = load i8*, i8** %54
%56 = icmp eq i8* %55, null
br i1 %56, label %65, label %57
57: ; preds = %53, %57
%58 = phi i8* [ %63, %57 ], [ %55, %53 ]
%59 = phi i8** [ %62, %57 ], [ %54, %53 ]
%60 = tail call i8* @cfg_get_hash_value(i32 %12, i8* %26, i8* %34, i8* %58)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %58, i8* %60)
%62 = getelementptr inbounds i8*, i8** %59, i64 1
%63 = load i8*, i8** %62
%64 = icmp eq i8* %63, null
br i1 %64, label %65, label %57
65: ; preds = %57, %46, %53, %42, %39, %33
%66 = getelementptr inbounds i8*, i8** %35, i64 1
%67 = load i8*, i8** %66
%68 = icmp eq i8* %67, null
br i1 %68, label %69, label %33
69: ; preds = %65, %25
%70 = getelementptr inbounds i8*, i8** %27, i64 1
%71 = load i8*, i8** %70
%72 = icmp eq i8* %71, null
br i1 %72, label %73, label %25
73: ; preds = %69, %19
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %75
75: ; preds = %73, %15
br i1 %8, label %7, label %76
76: ; preds = %75
ret i32 0
}