#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
char *get_config_filename();
int /*<<< orphan*/ install(char *, char *);
scalar_t__ isspace(char);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
char *strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
scalar_t__ strtok_r(char *, char *, char **);
int read_config_file(void) {
  FILE *cfg_file = NULL;
  char *m, *m2;
  char *line, *comment;
  char *ptr;
  unsigned int length;
  char *filename;
  filename = (char *)malloc(256);
  filename = get_config_filename();
  m = (char *)malloc(255);
  m2 = (char *)malloc(255);
  line = m;
  if ((cfg_file = fopen((char *)filename, "r")) == NULL)
    goto cleanup;
  while (fgets(line, 255 - 1, cfg_file)) {
    char *var = (char *)malloc(255);
    char *val = (char *)malloc(255);
  dirty_label:
    if (strlen(line) < 2)
      continue;
    if (line[strlen(line) - 1] == '\n')
      line[strlen(line) - 1] = '\0';
    while (*line && isspace(*line))
      line++;
    if (!line[0] || line[0] == '#' || !strchr(line, '='))
      continue;
    comment = strchr(line, '#');
    if (comment) {
      *comment-- = '\0';
    }
    length = strlen(line);
    while (length > 0 && isspace(line[length - 1])) {
      line[--length] = '\0';
    }
    if (line[length - 1] == '\\') {
      if (!fgets(m2, 255, cfg_file)) {
        fprintf(stderr,
                "nothing more to read, awaiting at least one more line\n");
        exit(1);
      }
      ptr = m2;
      while (*ptr && isspace(*ptr))
        ptr++;
      strncpy(line + length - 1, ptr, 255 - length - (line - m));
      goto dirty_label;
    }
    var = (char *)strtok_r(line, "=", &val);
    var[strlen(var) - 1] = '\0';
    ptr = var + strlen(var) - 1;
    while (ptr > var && isspace(*ptr))
      ptr--;
    while (*val && isspace(*val))
      val++;
    (void)install(var, val);
  }
  fclose(cfg_file);
cleanup:
  free(filename);
  free(m2);
  free(m);
  return 0;
}


x86 assembly (clang, -O0):
<read_config_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x100,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   10e0 <get_config_filename@plt>
mov    %rax,-0x40(%rbp)
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1253 <read_config_file+0x73>
jmp    1600 <read_config_file+0x420>
jmp    1258 <read_config_file+0x78>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xfe,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     15f7 <read_config_file+0x417>
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jge    12a7 <read_config_file+0xc7>
jmp    1258 <read_config_file+0x78>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    12f2 <read_config_file+0x112>
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    12f7 <read_config_file+0x117>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x61(%rbp)
je     1322 <read_config_file+0x142>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x61(%rbp)
mov    -0x61(%rbp),%al
test   $0x1,%al
jne    1332 <read_config_file+0x152>
jmp    1343 <read_config_file+0x163>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    12f7 <read_config_file+0x117>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1378 <read_config_file+0x198>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
je     1378 <read_config_file+0x198>
mov    -0x20(%rbp),%rdi
mov    $0x3d,%esi
call   1070 <strchr@plt>
cmp    $0x0,%rax
jne    137d <read_config_file+0x19d>
jmp    1258 <read_config_file+0x78>
mov    -0x20(%rbp),%rdi
mov    $0x23,%esi
call   1070 <strchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     13ac <read_config_file+0x1cc>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x34(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0x62(%rbp)
jbe    13e6 <read_config_file+0x206>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x62(%rbp)
mov    -0x62(%rbp),%al
test   $0x1,%al
jne    13f6 <read_config_file+0x216>
jmp    140e <read_config_file+0x22e>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x34(%rbp)
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
jmp    13b8 <read_config_file+0x1d8>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    14ec <read_config_file+0x30c>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xff,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
jne    1462 <read_config_file+0x282>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
lea    0xbaf(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x63(%rbp)
je     1495 <read_config_file+0x2b5>
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x63(%rbp)
mov    -0x63(%rbp),%al
test   $0x1,%al
jne    14a5 <read_config_file+0x2c5>
jmp    14b6 <read_config_file+0x2d6>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    146a <read_config_file+0x28a>
mov    -0x20(%rbp),%rdi
mov    -0x34(%rbp),%eax
add    %rax,%rdi
add    $0xffffffffffffffff,%rdi
mov    -0x30(%rbp),%rsi
mov    $0xff,%eax
sub    -0x34(%rbp),%eax
mov    %eax,%eax
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rdx
sub    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1040 <strncpy@plt>
jmp    1290 <read_config_file+0xb0>
mov    -0x20(%rbp),%rdi
lea    0xb42(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   10a0 <strtok_r@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x48(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x48(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
xor    %eax,%eax
cmp    -0x48(%rbp),%rcx
mov    %al,-0x79(%rbp)
jbe    1573 <read_config_file+0x393>
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    1583 <read_config_file+0x3a3>
jmp    1594 <read_config_file+0x3b4>
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    154a <read_config_file+0x36a>
jmp    1599 <read_config_file+0x3b9>
mov    -0x50(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x7a(%rbp)
je     15c4 <read_config_file+0x3e4>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x7a(%rbp)
mov    -0x7a(%rbp),%al
test   $0x1,%al
jne    15d4 <read_config_file+0x3f4>
jmp    15e5 <read_config_file+0x405>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
jmp    1599 <read_config_file+0x3b9>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1080 <install@plt>
jmp    1258 <read_config_file+0x78>
mov    -0x8(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_config_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    $0x100,%edi
call   10d0 <malloc@plt>
xor    %eax,%eax
call   10e0 <get_config_filename@plt>
mov    %rax,%rbp
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,%r13
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
lea    0xddd(%rip),%rsi
mov    %rbp,%rdi
call   10f0 <fopen@plt>
test   %rax,%rax
je     14a7 <read_config_file+0x2c7>
mov    %rax,%r12
mov    %rbp,0x10(%rsp)
mov    %r13,%rdi
mov    $0xfe,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     149a <read_config_file+0x2ba>
mov    %r13,%r15
mov    %r12,0x8(%rsp)
jmp    1289 <read_config_file+0xa9>
mov    %rcx,%rsi
mov    %r14,%rdi
call   1080 <install@plt>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0xfe,%esi
mov    %r12,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     149a <read_config_file+0x2ba>
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,(%rsp)
mov    %r15,%rdi
call   1060 <strlen@plt>
cmp    $0x2,%eax
jl     1270 <read_config_file+0x90>
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%r15,1)
jne    12d0 <read_config_file+0xf0>
mov    %r15,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r15,1)
mov    (%r15),%al
test   %al,%al
je     1270 <read_config_file+0x90>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     1300 <read_config_file+0x120>
movzbl 0x1(%r15),%eax
add    $0x1,%r15
test   %al,%al
jne    12e0 <read_config_file+0x100>
jmp    1270 <read_config_file+0x90>
nop
mov    (%r15),%al
test   %al,%al
je     1270 <read_config_file+0x90>
cmp    $0x23,%al
je     1270 <read_config_file+0x90>
mov    %r15,%rdi
mov    $0x3d,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     1270 <read_config_file+0x90>
mov    %r15,%rdi
mov    $0x23,%esi
call   1070 <strchr@plt>
test   %rax,%rax
je     133e <read_config_file+0x15e>
movb   $0x0,(%rax)
mov    %r15,%rdi
call   1060 <strlen@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     138a <read_config_file+0x1aa>
mov    %eax,%ebp
mov    %r13,%r12
mov    %eax,%r13d
add    $0xffffffff,%r13d
add    %r15,%r13
nopl   0x0(%rax)
movsbl 0x0(%r13),%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     137f <read_config_file+0x19f>
movb   $0x0,0x0(%r13)
add    $0xffffffffffffffff,%r13
add    $0xffffffff,%ebp
jne    1360 <read_config_file+0x180>
jmp    1382 <read_config_file+0x1a2>
mov    %ebp,%r14d
mov    %r12,%r13
mov    0x8(%rsp),%r12
lea    -0x1(%r14),%eax
cmpb   $0x5c,(%r15,%rax,1)
jne    1400 <read_config_file+0x220>
mov    %rbx,%rdi
mov    $0xff,%esi
mov    %r12,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     14d0 <read_config_file+0x2f0>
mov    (%rbx),%al
mov    %rbx,%rbp
test   %al,%al
je     13d9 <read_config_file+0x1f9>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1090 <isspace@plt>
test   %rax,%rax
je     13d9 <read_config_file+0x1f9>
movzbl 0x1(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    13c0 <read_config_file+0x1e0>
mov    %r14d,%eax
lea    (%r15,%rax,1),%rdi
add    $0xffffffffffffffff,%rdi
mov    %r13d,%edx
sub    %r15d,%edx
sub    %r14d,%edx
add    $0xff,%edx
mov    %rbp,%rsi
call   1040 <strncpy@plt>
jmp    12a1 <read_config_file+0xc1>
mov    %r15,%rdi
lea    0xc2f(%rip),%rsi
mov    %rsp,%rdx
call   10a0 <strtok_r@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rbp
add    $0xffffffffffffffff,%rbp
nopw   0x0(%rax,%rax,1)
cmp    %r14,%rbp
jbe    1457 <read_config_file+0x277>
movsbl 0x0(%rbp),%edi
call   1090 <isspace@plt>
add    $0xffffffffffffffff,%rbp
test   %rax,%rax
jne    1440 <read_config_file+0x260>
mov    (%rsp),%rsi
mov    (%rsi),%al
test   %al,%al
je     1262 <read_config_file+0x82>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1090 <isspace@plt>
mov    (%rsp),%rcx
test   %rax,%rax
je     125f <read_config_file+0x7f>
lea    0x1(%rcx),%rsi
mov    %rsi,(%rsp)
movzbl 0x1(%rcx),%eax
test   %al,%al
jne    1470 <read_config_file+0x290>
jmp    1262 <read_config_file+0x82>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b09(%rip),%rax
mov    (%rax),%edi
lea    0xb22(%rip),%rsi
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [55 x i8] c"nothing more to read, awaiting at least one more line\0A\00"
@.str.2 = [2 x i8] c"=\00"
define i32 @read_config_file() {
%1 = alloca i8*
%2 = tail call i64 @malloc(i32 256)
%3 = tail call i8* (...) @get_config_filename()
%4 = tail call i64 @malloc(i32 255)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @malloc(i32 255)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %155, label %10
10: ; preds = %0
%11 = call i64 @fgets(i8* %5, i32 254, i32* %8)
%12 = icmp eq i64 %11, 0
br i1 %12, label %153, label %13
13: ; preds = %10
%14 = bitcast i8** %1 to i8*
br label %15
15: ; preds = %13, %149
%16 = phi i8* [ %5, %13 ], [ %150, %149 ]
%17 = call i64 @malloc(i32 255)
%18 = call i64 @malloc(i32 255)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %1
%20 = call i32 @strlen(i8* %16)
%21 = icmp slt i32 %20, 2
br i1 %21, label %149, label %22
22: ; preds = %15, %100
%23 = phi i8* [ %40, %100 ], [ %16, %15 ]
%24 = call i32 @strlen(i8* %23)
%25 = add nsw i32 %24, -1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %23, i64 %26
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 10
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = call i32 @strlen(i8* %23)
%32 = add nsw i32 %31, -1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %23, i64 %33
store i8 0, i8* %34
br label %35
35: ; preds = %30, %22
%36 = load i8, i8* %23
%37 = icmp eq i8 %36, 0
br i1 %37, label %149, label %38
38: ; preds = %35, %43
%39 = phi i8 [ %45, %43 ], [ %36, %35 ]
%40 = phi i8* [ %44, %43 ], [ %23, %35 ]
%41 = call i64 @isspace(i8 signext %39)
%42 = icmp eq i64 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %38
%44 = getelementptr inbounds i8, i8* %40, i64 1
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 0
br i1 %46, label %149, label %38
47: ; preds = %38
%48 = load i8, i8* %40
switch i8 %48, label %49 [
i8 0, label %149
i8 35, label %149
]
49: ; preds = %47
%50 = call i8* @strchr(i8* %40, i8 signext 61)
%51 = icmp eq i8* %50, null
br i1 %51, label %149, label %52
52: ; preds = %49
%53 = call i8* @strchr(i8* %40, i8 signext 35)
%54 = icmp eq i8* %53, null
br i1 %54, label %56, label %55
55: ; preds = %52
store i8 0, i8* %53
br label %56
56: ; preds = %55, %52
%57 = call i32 @strlen(i8* %40)
%58 = icmp eq i32 %57, 0
br i1 %58, label %74, label %59
59: ; preds = %56
%60 = zext i32 %57 to i64
br label %61
61: ; preds = %59, %69
%62 = phi i64 [ %60, %59 ], [ %63, %69 ]
%63 = add nsw i64 %62, -1
%64 = and i64 %63, 4294967295
%65 = getelementptr inbounds i8, i8* %40, i64 %64
%66 = load i8, i8* %65
%67 = call i64 @isspace(i8 signext %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %72, label %69
69: ; preds = %61
%70 = trunc i64 %63 to i32
store i8 0, i8* %65
%71 = icmp eq i32 %70, 0
br i1 %71, label %74, label %61
72: ; preds = %61
%73 = trunc i64 %62 to i32
br label %74
74: ; preds = %69, %72, %56
%75 = phi i32 [ 0, %56 ], [ %73, %72 ], [ 0, %69 ]
%76 = add i32 %75, -1
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %40, i64 %77
%79 = load i8, i8* %78
%80 = icmp eq i8 %79, 92
br i1 %80, label %81, label %113
81: ; preds = %74
%82 = call i64 @fgets(i8* %7, i32 255, i32* %8)
%83 = icmp eq i64 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %81
%85 = load i8, i8* %7
%86 = icmp eq i8 %85, 0
br i1 %86, label %100, label %91
87: ; preds = %81
%88 = load i32, i32* @stderr
%89 = call i32 @fprintf(i32 %88, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%90 = call i32 @exit(i32 1)
unreachable
91: ; preds = %84, %96
%92 = phi i8 [ %98, %96 ], [ %85, %84 ]
%93 = phi i8* [ %97, %96 ], [ %7, %84 ]
%94 = call i64 @isspace(i8 signext %92)
%95 = icmp eq i64 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %91
%97 = getelementptr inbounds i8, i8* %93, i64 1
%98 = load i8, i8* %97
%99 = icmp eq i8 %98, 0
br i1 %99, label %100, label %91
100: ; preds = %91, %96, %84
%101 = phi i8* [ %7, %84 ], [ %97, %96 ], [ %93, %91 ]
%102 = zext i32 %75 to i64
%103 = getelementptr inbounds i8, i8* %40, i64 -1
%104 = getelementptr inbounds i8, i8* %103, i64 %102
%105 = ptrtoint i8* %40 to i64
%106 = sub i64 %4, %105
%107 = trunc i64 %106 to i32
%108 = add i32 %107, 255
%109 = sub i32 %108, %75
%110 = call i32 @strncpy(i8* %104, i8* %101, i32 %109)
%111 = call i32 @strlen(i8* %40)
%112 = icmp slt i32 %111, 2
br i1 %112, label %149, label %22
113: ; preds = %74
%114 = call i64 @strtok_r(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %1)
%115 = inttoptr i64 %114 to i8*
%116 = call i32 @strlen(i8* %115)
%117 = add nsw i32 %116, -1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
store i8 0, i8* %119
%120 = call i32 @strlen(i8* %115)
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %115, i64 %121
br label %123
123: ; preds = %127, %113
%124 = phi i8* [ %122, %113 ], [ %125, %127 ]
%125 = getelementptr inbounds i8, i8* %124, i64 -1
%126 = icmp ugt i8* %125, %115
br i1 %126, label %127, label %131
127: ; preds = %123
%128 = load i8, i8* %125
%129 = call i64 @isspace(i8 signext %128)
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %123
131: ; preds = %123, %127
%132 = load i8*, i8** %1
%133 = load i8, i8* %132
%134 = icmp eq i8 %133, 0
br i1 %134, label %146, label %135
135: ; preds = %131, %140
%136 = phi i8 [ %142, %140 ], [ %133, %131 ]
%137 = call i64 @isspace(i8 signext %136)
%138 = icmp eq i64 %137, 0
%139 = load i8*, i8** %1
br i1 %138, label %146, label %140
140: ; preds = %135
%141 = getelementptr inbounds i8, i8* %139, i64 1
store i8* %141, i8** %1
%142 = load i8, i8* %141
%143 = icmp eq i8 %142, 0
br i1 %143, label %144, label %135
144: ; preds = %140
%145 = getelementptr inbounds i8, i8* %139, i64 1
br label %146
146: ; preds = %135, %144, %131
%147 = phi i8* [ %132, %131 ], [ %145, %144 ], [ %139, %135 ]
%148 = call i32 @install(i8* %115, i8* %147)
br label %149
149: ; preds = %100, %47, %47, %49, %35, %43, %15, %146
%150 = phi i8* [ %40, %146 ], [ %16, %15 ], [ %44, %43 ], [ %23, %35 ], [ %40, %100 ], [ %40, %47 ], [ %40, %47 ], [ %40, %49 ]
%151 = call i64 @fgets(i8* %150, i32 254, i32* %8)
%152 = icmp eq i64 %151, 0
br i1 %152, label %153, label %15
153: ; preds = %149, %10
%154 = call i32 @fclose(i32* %8)
br label %155
155: ; preds = %0, %153
%156 = call i32 @free(i8* %3)
%157 = call i32 @free(i8* %7)
%158 = call i32 @free(i8* %5)
ret i32 0
}