#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 */
scalar_t__ configAddEntry(int, int, char *, char *, int, int);
int configReadID(char *, char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
char *strdup(char *);
int strlen(char *);
int configLoadFile(char *filename) {
  FILE *file;
  char line[256];
  char scan_name[128];
  int linecount = 0;
  char *name;
  char *options;
  int options_index;
  int wildcard;
  int absolute;
  int uid;
  int gid;
  file = fopen(filename, "r");
  if (file == NULL) {
    printf("Error! Reading configfile %s failed!\n", filename);
    return -1;
  }
  while (fgets(line, 256, file) != NULL) {
    linecount++;
    if (line[0] == '#')
      continue;
    line[strlen(line) - 1] = '\0';
    scan_name[0] = '\0';
    sscanf(line, "%127s", scan_name);
    scan_name[127] = '\0';
    options_index = strlen(scan_name);
    if (scan_name[options_index - 1] == ':') {
      scan_name[options_index - 1] = '\0';
      if (scan_name[0] == '%') {
        if (!strcmp(&scan_name[1], "ALL"))
          gid = -1;
        else
          gid = configReadID("/etc/group", &scan_name[1]);
        uid = -1;
      } else {
        if (!strcmp(scan_name, "ALL"))
          uid = -1;
        else
          uid = configReadID("/etc/passwd", scan_name);
        gid = -1;
      }
      if ((uid != -2) && (gid != -2)) {
        sscanf(&line[strlen(scan_name) + 1], "%127s", scan_name);
      } else {
        scan_name[0] = '\0';
        printf("Warning! Line %i in config file contains invalid user or "
               "group. Ignored.\n",
               linecount);
      }
      options_index += strlen(scan_name);
    } else {
      uid = -1;
      gid = -1;
    }
    name = strdup(scan_name);
    options = strdup(&line[options_index + 1]);
    if ((name == NULL) || (options == NULL)) {
      printf("Error! Malloc failed. Abort reading config file.\n");
      if (name)
        free(name);
      if (options)
        free(options);
      break;
    }
    if ((strlen(options) > 0) && (strlen(name) > 0)) {
      if (name[strlen(name) - 1] == '*')
        wildcard = 1;
      else
        wildcard = 0;
      if (name[0] == '/')
        absolute = 1;
      else
        absolute = 0;
      if (configAddEntry(uid, gid, name, options, wildcard, absolute)) {
        printf("Error! Malloc failed. Abort reading config file.\n");
        if (name)
          free(name);
        if (options)
          free(options);
        break;
      }
    } else {
      if (strlen(name) > 0)
        printf("Warning! Line %i in config file has no ionice options.\n",
               linecount);
      if (name)
        free(name);
      if (options)
        free(options);
      name = options = NULL;
    }
  }
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<configLoadFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x1a4(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1206 <configLoadFile+0x56>
mov    -0x10(%rbp),%rsi
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1669 <configLoadFile+0x4b9>
jmp    120b <configLoadFile+0x5b>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     1659 <configLoadFile+0x4a9>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
movsbl -0x120(%rbp),%eax
cmp    $0x23,%eax
jne    124e <configLoadFile+0x9e>
jmp    120b <configLoadFile+0x5b>
lea    -0x120(%rbp),%rdi
call   1070 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x120(%rbp,%rax,1)
movb   $0x0,-0x1a0(%rbp)
lea    -0x120(%rbp),%rdi
lea    -0x1a0(%rbp),%rdx
lea    0xda5(%rip),%rsi
call   10b0 <sscanf@plt>
movb   $0x0,-0x121(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x1bc(%rbp)
mov    -0x1bc(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x1a0(%rbp,%rax,1),%eax
ff
cmp    $0x3a,%eax
jne    140e <configLoadFile+0x25e>
mov    -0x1bc(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x1a0(%rbp,%rax,1)
movsbl -0x1a0(%rbp),%eax
cmp    $0x25,%eax
jne    133b <configLoadFile+0x18b>
lea    -0x1a0(%rbp),%rdi
add    $0x1,%rdi
lea    0xd3c(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    130f <configLoadFile+0x15f>
movl   $0xffffffff,-0x1cc(%rbp)
ff ff ff
jmp    132c <configLoadFile+0x17c>
lea    -0x1a0(%rbp),%rsi
add    $0x1,%rsi
lea    0xd11(%rip),%rdi
call   1060 <configReadID@plt>
mov    %eax,-0x1cc(%rbp)
movl   $0xffffffff,-0x1c8(%rbp)
ff ff ff
jmp    1389 <configLoadFile+0x1d9>
lea    -0x1a0(%rbp),%rdi
lea    0xce5(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    1366 <configLoadFile+0x1b6>
movl   $0xffffffff,-0x1c8(%rbp)
ff ff ff
jmp    137f <configLoadFile+0x1cf>
lea    -0x1a0(%rbp),%rsi
lea    0xcc9(%rip),%rdi
call   1060 <configReadID@plt>
mov    %eax,-0x1c8(%rbp)
movl   $0xffffffff,-0x1cc(%rbp)
ff ff ff
cmpl   $0xfffffffe,-0x1c8(%rbp)
je     13d6 <configLoadFile+0x226>
cmpl   $0xfffffffe,-0x1cc(%rbp)
je     13d6 <configLoadFile+0x226>
lea    -0x1a0(%rbp),%rdi
call   1070 <strlen@plt>
add    $0x1,%eax
cltq
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
lea    -0x1a0(%rbp),%rdx
lea    0xc5c(%rip),%rsi
call   10b0 <sscanf@plt>
jmp    13f1 <configLoadFile+0x241>
movb   $0x0,-0x1a0(%rbp)
mov    -0x1a4(%rbp),%esi
lea    0xc5f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1a0(%rbp),%rdi
call   1070 <strlen@plt>
add    -0x1bc(%rbp),%eax
mov    %eax,-0x1bc(%rbp)
jmp    1422 <configLoadFile+0x272>
movl   $0xffffffff,-0x1c8(%rbp)
ff ff ff
movl   $0xffffffff,-0x1cc(%rbp)
ff ff ff
lea    -0x1a0(%rbp),%rdi
call   10d0 <strdup@plt>
mov    %rax,-0x1b0(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x120(%rbp),%rdi
add    %rax,%rdi
call   10d0 <strdup@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b0(%rbp)
je     1472 <configLoadFile+0x2c2>
cmpq   $0x0,-0x1b8(%rbp)
jne    14b9 <configLoadFile+0x309>
lea    0xc1a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpq   $0x0,-0x1b0(%rbp)
je     149a <configLoadFile+0x2ea>
mov    -0x1b0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x1b8(%rbp)
je     14b4 <configLoadFile+0x304>
mov    -0x1b8(%rbp),%rdi
call   1030 <free@plt>
jmp    1659 <configLoadFile+0x4a9>
mov    -0x1b8(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x0,%eax
jle    15e1 <configLoadFile+0x431>
mov    -0x1b0(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x0,%eax
jle    15e1 <configLoadFile+0x431>
mov    -0x1b0(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
mov    -0x1b0(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0x1d8(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1528 <configLoadFile+0x378>
movl   $0x1,-0x1c0(%rbp)
jmp    1532 <configLoadFile+0x382>
movl   $0x0,-0x1c0(%rbp)
mov    -0x1b0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1554 <configLoadFile+0x3a4>
movl   $0x1,-0x1c4(%rbp)
jmp    155e <configLoadFile+0x3ae>
movl   $0x0,-0x1c4(%rbp)
mov    -0x1c8(%rbp),%edi
mov    -0x1cc(%rbp),%esi
mov    -0x1b0(%rbp),%rdx
mov    -0x1b8(%rbp),%rcx
mov    -0x1c0(%rbp),%r8d
mov    -0x1c4(%rbp),%r9d
call   1040 <configAddEntry@plt>
cmp    $0x0,%rax
je     15dc <configLoadFile+0x42c>
lea    0xaf7(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpq   $0x0,-0x1b0(%rbp)
je     15bd <configLoadFile+0x40d>
mov    -0x1b0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x1b8(%rbp)
je     15d7 <configLoadFile+0x427>
mov    -0x1b8(%rbp),%rdi
call   1030 <free@plt>
jmp    1659 <configLoadFile+0x4a9>
jmp    1654 <configLoadFile+0x4a4>
mov    -0x1b0(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x0,%eax
jle    160a <configLoadFile+0x45a>
mov    -0x1a4(%rbp),%esi
lea    0xac2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpq   $0x0,-0x1b0(%rbp)
je     1624 <configLoadFile+0x474>
mov    -0x1b0(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x1b8(%rbp)
je     163e <configLoadFile+0x48e>
mov    -0x1b8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x1b8(%rbp)
movq   $0x0,-0x1b0(%rbp)
jmp    120b <configLoadFile+0x5b>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configLoadFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rdi,%rbp
lea    0xe35(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1435 <configLoadFile+0x285>
mov    %rax,%rbx
lea    0x90(%rsp),%r12
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
je     148e <configLoadFile+0x2de>
mov    $0x1,%ebp
mov    %rbx,0x8(%rsp)
jmp    1241 <configLoadFile+0x91>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rbx
mov    %r12,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   10a0 <fgets@plt>
add    $0x1,%ebp
test   %rax,%rax
je     148e <configLoadFile+0x2de>
cmpb   $0x23,0x90(%rsp)
23
je     1225 <configLoadFile+0x75>
mov    %r12,%rdi
call   1080 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r12,1)
movb   $0x0,0x10(%rsp)
mov    %r12,%rdi
lea    0xdbe(%rip),%rsi
lea    0x10(%rsp),%r13
mov    %r13,%rdx
call   10b0 <sscanf@plt>
movb   $0x0,0x8f(%rsp)
mov    %r13,%rdi
call   1080 <strlen@plt>
mov    %eax,%r14d
cltq
cmpb   $0x3a,-0x1(%rax,%r13,1)
jne    12d0 <configLoadFile+0x120>
movb   $0x0,0xf(%rsp,%rax,1)
cmpb   $0x25,0x10(%rsp)
jne    12e6 <configLoadFile+0x136>
mov    $0xffffffff,%r15d
cmpl   $0x4c4c41,0x11(%rsp)
je     1311 <configLoadFile+0x161>
lea    0xd7b(%rip),%rdi
lea    0x11(%rsp),%rsi
call   1070 <configReadID@plt>
mov    %eax,%ebx
jmp    1320 <configLoadFile+0x170>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xffffffff,%r15d
mov    %r14d,%ebx
movl   $0xffffffff,0x4(%rsp)
ff
jmp    1374 <configLoadFile+0x1c4>
mov    $0xffffffff,%ebx
cmpl   $0x4c4c41,0x10(%rsp)
jne    12fd <configLoadFile+0x14d>
mov    $0xffffffff,%r15d
jmp    1320 <configLoadFile+0x170>
lea    0xd39(%rip),%rdi
mov    %r13,%rsi
call   1070 <configReadID@plt>
mov    %eax,%r15d
jmp    1320 <configLoadFile+0x170>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
cmp    $0xfffffffe,%r15d
mov    %ebx,0x4(%rsp)
je     1352 <configLoadFile+0x1a2>
cmp    $0xfffffffe,%ebx
je     1352 <configLoadFile+0x1a2>
mov    %r13,%rdi
call   1080 <strlen@plt>
cltq
lea    (%rax,%r12,1),%rdi
add    $0x1,%rdi
lea    0xce0(%rip),%rsi
mov    %r13,%rdx
call   10b0 <sscanf@plt>
jmp    1367 <configLoadFile+0x1b7>
movb   $0x0,0x10(%rsp)
lea    0xceb(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r13,%rdi
call   1080 <strlen@plt>
mov    %eax,%ebx
add    %r14d,%ebx
mov    %r13,%rdi
call   10d0 <strdup@plt>
mov    %rax,%r13
movslq %ebx,%rax
lea    (%rax,%r12,1),%rdi
add    $0x1,%rdi
call   10d0 <strdup@plt>
mov    %rax,%r14
test   %r13,%r13
je     144d <configLoadFile+0x29d>
test   %r14,%r14
je     144d <configLoadFile+0x29d>
mov    %r14,%rdi
call   1080 <strlen@plt>
test   %eax,%eax
jle    1410 <configLoadFile+0x260>
mov    %r13,%rdi
call   1080 <strlen@plt>
test   %eax,%eax
jle    1410 <configLoadFile+0x260>
mov    %r13,%rdi
call   1080 <strlen@plt>
cltq
xor    %r8d,%r8d
cmpb   $0x2a,-0x1(%rax,%r13,1)
sete   %r8b
xor    %r9d,%r9d
cmpb   $0x2f,0x0(%r13)
sete   %r9b
mov    %r15d,%edi
mov    0x4(%rsp),%esi
mov    %r13,%rdx
mov    %r14,%rcx
call   1040 <configAddEntry@plt>
test   %rax,%rax
mov    0x8(%rsp),%rbx
je     1225 <configLoadFile+0x75>
jmp    1472 <configLoadFile+0x2c2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1080 <strlen@plt>
test   %eax,%eax
jle    1210 <configLoadFile+0x60>
lea    0xc6c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1210 <configLoadFile+0x60>
lea    0xbc6(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0xffffffff,%eax
jmp    1498 <configLoadFile+0x2e8>
lea    0xc77(%rip),%rdi
call   1050 <puts@plt>
test   %r13,%r13
je     1466 <configLoadFile+0x2b6>
mov    %r13,%rdi
call   1030 <free@plt>
test   %r14,%r14
mov    0x8(%rsp),%rbx
jne    1486 <configLoadFile+0x2d6>
jmp    148e <configLoadFile+0x2de>
lea    0xc52(%rip),%rdi
call   1050 <puts@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [38 x i8] c"Error! Reading configfile %s failed!\0A\00"
@.str.2 = [6 x i8] c"%127s\00"
@.str.3 = [4 x i8] c"ALL\00"
@.str.4 = [11 x i8] c"/etc/group\00"
@.str.5 = [12 x i8] c"/etc/passwd\00"
@.str.6 = [74 x i8] c"Warning! Line %i in config file contains invalid user or group. Ignored.\0A\00"
@.str.7 = [50 x i8] c"Error! Malloc failed. Abort reading config file.\0A\00"
@.str.8 = [56 x i8] c"Warning! Line %i in config file has no ionice options.\0A\00"
define i32 @configLoadFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [256 x i8]
%6 = alloca [128 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %7
%15 = load i8*, i8** %3
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %16, i32** %4
%17 = load i32*, i32** %4
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i8*, i8** %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %20)
store i32 -1, i32* %2
br label %210
22: ; preds = %1
br label %23
23: ; preds = %206, %35, %22
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%25 = load i32*, i32** %4
%26 = call i32* @fgets(i8* %24, i32 256, i32* %25)
%27 = icmp ne i32* %26, null
br i1 %27, label %28, label %207
28: ; preds = %23
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 35
br i1 %34, label %35, label %36
35: ; preds = %28
br label %23
36: ; preds = %28
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
%39 = sub nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %40
store i8 0, i8* %41
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
store i8 0, i8* %42
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%44 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%45 = call i32 @sscanf(i8* %43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 127
store i8 0, i8* %46
%47 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%48 = call i32 @strlen(i8* %47)
store i32 %48, i32* %10
%49 = load i32, i32* %10
%50 = sub nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 58
br i1 %55, label %56, label %106
56: ; preds = %36
%57 = load i32, i32* %10
%58 = sub nsw i32 %57, 1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 %59
store i8 0, i8* %60
%61 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 37
br i1 %64, label %65, label %74
65: ; preds = %56
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 1
%67 = call i32 @strcmp(i8* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%68 = icmp ne i32 %67, 0
br i1 %68, label %70, label %69
69: ; preds = %65
store i32 -1, i32* %14
br label %73
70: ; preds = %65
%71 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 1
%72 = call i32 @configReadID(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %71)
store i32 %72, i32* %14
br label %73
73: ; preds = %70, %69
store i32 -1, i32* %13
br label %83
74: ; preds = %56
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%76 = call i32 @strcmp(i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%77 = icmp ne i32 %76, 0
br i1 %77, label %79, label %78
78: ; preds = %74
store i32 -1, i32* %13
br label %82
79: ; preds = %74
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%81 = call i32 @configReadID(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %80)
store i32 %81, i32* %13
br label %82
82: ; preds = %79, %78
store i32 -1, i32* %14
br label %83
83: ; preds = %82, %73
%84 = load i32, i32* %13
%85 = icmp ne i32 %84, -2
br i1 %85, label %86, label %97
86: ; preds = %83
%87 = load i32, i32* %14
%88 = icmp ne i32 %87, -2
br i1 %88, label %89, label %97
89: ; preds = %86
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%91 = call i32 @strlen(i8* %90)
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %93
%95 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%96 = call i32 @sscanf(i8* %94, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %95)
br label %101
97: ; preds = %86, %83
%98 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
store i8 0, i8* %98
%99 = load i32, i32* %7
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.6, i64 0, i64 0), i32 %99)
br label %101
101: ; preds = %97, %89
%102 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%103 = call i32 @strlen(i8* %102)
%104 = load i32, i32* %10
%105 = add nsw i32 %104, %103
store i32 %105, i32* %10
br label %107
106: ; preds = %36
store i32 -1, i32* %13
store i32 -1, i32* %14
br label %107
107: ; preds = %106, %101
%108 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%109 = call i8* @strdup(i8* %108)
store i8* %109, i8** %8
%110 = load i32, i32* %10
%111 = add nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %112
%114 = call i8* @strdup(i8* %113)
store i8* %114, i8** %9
%115 = load i8*, i8** %8
%116 = icmp eq i8* %115, null
br i1 %116, label %120, label %117
117: ; preds = %107
%118 = load i8*, i8** %9
%119 = icmp eq i8* %118, null
br i1 %119, label %120, label %134
120: ; preds = %117, %107
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%122 = load i8*, i8** %8
%123 = icmp ne i8* %122, null
br i1 %123, label %124, label %127
124: ; preds = %120
%125 = load i8*, i8** %8
%126 = call i32 @free(i8* %125)
br label %127
127: ; preds = %124, %120
%128 = load i8*, i8** %9
%129 = icmp ne i8* %128, null
br i1 %129, label %130, label %133
130: ; preds = %127
%131 = load i8*, i8** %9
%132 = call i32 @free(i8* %131)
br label %133
133: ; preds = %130, %127
br label %207
134: ; preds = %117
%135 = load i8*, i8** %9
%136 = call i32 @strlen(i8* %135)
%137 = icmp sgt i32 %136, 0
br i1 %137, label %138, label %186
138: ; preds = %134
%139 = load i8*, i8** %8
%140 = call i32 @strlen(i8* %139)
%141 = icmp sgt i32 %140, 0
br i1 %141, label %142, label %186
142: ; preds = %138
%143 = load i8*, i8** %8
%144 = load i8*, i8** %8
%145 = call i32 @strlen(i8* %144)
%146 = sub nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %143, i64 %147
%149 = load i8, i8* %148
%150 = sext i8 %149 to i32
%151 = icmp eq i32 %150, 42
br i1 %151, label %152, label %153
152: ; preds = %142
store i32 1, i32* %11
br label %154
153: ; preds = %142
store i32 0, i32* %11
br label %154
154: ; preds = %153, %152
%155 = load i8*, i8** %8
%156 = getelementptr inbounds i8, i8* %155, i64 0
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %158, 47
br i1 %159, label %160, label %161
160: ; preds = %154
store i32 1, i32* %12
br label %162
161: ; preds = %154
store i32 0, i32* %12
br label %162
162: ; preds = %161, %160
%163 = load i32, i32* %13
%164 = load i32, i32* %14
%165 = load i8*, i8** %8
%166 = load i8*, i8** %9
%167 = load i32, i32* %11
%168 = load i32, i32* %12
%169 = call i64 @configAddEntry(i32 %163, i32 %164, i8* %165, i8* %166, i32 %167, i32 %168)
%170 = icmp ne i64 %169, 0
br i1 %170, label %171, label %185
171: ; preds = %162
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%173 = load i8*, i8** %8
%174 = icmp ne i8* %173, null
br i1 %174, label %175, label %178
175: ; preds = %171
%176 = load i8*, i8** %8
%177 = call i32 @free(i8* %176)
br label %178
178: ; preds = %175, %171
%179 = load i8*, i8** %9
%180 = icmp ne i8* %179, null
br i1 %180, label %181, label %184
181: ; preds = %178
%182 = load i8*, i8** %9
%183 = call i32 @free(i8* %182)
br label %184
184: ; preds = %181, %178
br label %207
185: ; preds = %162
br label %206
186: ; preds = %138, %134
%187 = load i8*, i8** %8
%188 = call i32 @strlen(i8* %187)
%189 = icmp sgt i32 %188, 0
br i1 %189, label %190, label %193
190: ; preds = %186
%191 = load i32, i32* %7
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i32 %191)
br label %193
193: ; preds = %190, %186
%194 = load i8*, i8** %8
%195 = icmp ne i8* %194, null
br i1 %195, label %196, label %199
196: ; preds = %193
%197 = load i8*, i8** %8
%198 = call i32 @free(i8* %197)
br label %199
199: ; preds = %196, %193
%200 = load i8*, i8** %9
%201 = icmp ne i8* %200, null
br i1 %201, label %202, label %205
202: ; preds = %199
%203 = load i8*, i8** %9
%204 = call i32 @free(i8* %203)
br label %205
205: ; preds = %202, %199
store i8* null, i8** %9
store i8* null, i8** %8
br label %206
206: ; preds = %205, %185
br label %23
207: ; preds = %184, %133, %23
%208 = load i32*, i32** %4
%209 = call i32 @fclose(i32* %208)
store i32 0, i32* %2
br label %210
210: ; preds = %207, %19
%211 = load i32, i32* %2
ret i32 %211
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [38 x i8] c"Error! Reading configfile %s failed!\0A\00"
@.str.2 = [6 x i8] c"%127s\00"
@.str.3 = [4 x i8] c"ALL\00"
@.str.4 = [11 x i8] c"/etc/group\00"
@.str.5 = [12 x i8] c"/etc/passwd\00"
@.str.6 = [74 x i8] c"Warning! Line %i in config file contains invalid user or group. Ignored.\0A\00"
@.str.8 = [56 x i8] c"Warning! Line %i in config file has no ionice options.\0A\00"
@str.9 = [49 x i8] c"Error! Malloc failed. Abort reading config file.\00"
define i32 @configLoadFile(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = call i32* @fgets(i8* %4, i32 256, i32* %6)
%10 = icmp eq i32* %9, null
br i1 %10, label %116, label %11
11: ; preds = %8
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 127
%13 = bitcast [128 x i8]* %3 to i32*
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 1
br label %17
15: ; preds = %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %118
17: ; preds = %11, %111
%18 = phi i32 [ 0, %11 ], [ %19, %111 ]
%19 = add nuw nsw i32 %18, 1
%20 = load i8, i8* %4
%21 = icmp eq i8 %20, 35
br i1 %21, label %111, label %22
22: ; preds = %17
%23 = call i32 @strlen(i8* %4)
%24 = add nsw i32 %23, -1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %25
store i8 0, i8* %26
store i8 0, i8* %5
%27 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %5)
store i8 0, i8* %12
%28 = call i32 @strlen(i8* %5)
%29 = add nsw i32 %28, -1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 58
br i1 %33, label %34, label %64
34: ; preds = %22
store i8 0, i8* %31
%35 = load i8, i8* %5
%36 = icmp eq i8 %35, 37
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = call i32 @bcmp(i8* dereferenceable(4) %14, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 4)
%39 = icmp eq i32 %38, 0
br i1 %39, label %47, label %40
40: ; preds = %37
%41 = call i32 @configReadID(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %14)
br label %47
42: ; preds = %34
%43 = load i32, i32* %13
%44 = icmp eq i32 %43, 5000257
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = call i32 @configReadID(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %5)
br label %47
47: ; preds = %45, %42, %40, %37
%48 = phi i32 [ -1, %37 ], [ -1, %40 ], [ %46, %45 ], [ -1, %42 ]
%49 = phi i32 [ -1, %37 ], [ %41, %40 ], [ -1, %45 ], [ -1, %42 ]
%50 = icmp ne i32 %48, -2
%51 = icmp ne i32 %49, -2
%52 = select i1 %50, i1 %51, i1 false
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = call i32 @strlen(i8* %5)
%55 = add nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %56
%58 = call i32 @sscanf(i8* %57, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %61
59: ; preds = %47
store i8 0, i8* %5
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.6, i64 0, i64 0), i32 %19)
br label %61
61: ; preds = %59, %53
%62 = call i32 @strlen(i8* %5)
%63 = add nsw i32 %62, %28
br label %64
64: ; preds = %22, %61
%65 = phi i32 [ %63, %61 ], [ %28, %22 ]
%66 = phi i32 [ %48, %61 ], [ -1, %22 ]
%67 = phi i32 [ %49, %61 ], [ -1, %22 ]
%68 = call i8* @strdup(i8* %5)
%69 = add nsw i32 %65, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %70
%72 = call i8* @strdup(i8* %71)
%73 = icmp eq i8* %68, null
%74 = icmp eq i8* %72, null
%75 = select i1 %73, i1 true, i1 %74
br i1 %75, label %76, label %81
76: ; preds = %64
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.9, i64 0, i64 0))
br i1 %73, label %80, label %78
78: ; preds = %76
%79 = call i32 @free(i8* %68)
br label %80
80: ; preds = %78, %76
br i1 %74, label %116, label %114
81: ; preds = %64
%82 = call i32 @strlen(i8* %72)
%83 = icmp sgt i32 %82, 0
br i1 %83, label %84, label %103
84: ; preds = %81
%85 = call i32 @strlen(i8* %68)
%86 = icmp sgt i32 %85, 0
br i1 %86, label %87, label %103
87: ; preds = %84
%88 = call i32 @strlen(i8* %68)
%89 = add nsw i32 %88, -1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %68, i64 %90
%92 = load i8, i8* %91
%93 = icmp eq i8 %92, 42
%94 = zext i1 %93 to i32
%95 = load i8, i8* %68
%96 = icmp eq i8 %95, 47
%97 = zext i1 %96 to i32
%98 = call i64 @configAddEntry(i32 %66, i32 %67, i8* %68, i8* %72, i32 %94, i32 %97)
%99 = icmp eq i64 %98, 0
br i1 %99, label %111, label %100
100: ; preds = %87
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.9, i64 0, i64 0))
%102 = call i32 @free(i8* %68)
br label %114
103: ; preds = %84, %81
%104 = call i32 @strlen(i8* %68)
%105 = icmp sgt i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0), i32 %19)
br label %108
108: ; preds = %103, %106
%109 = call i32 @free(i8* %68)
%110 = call i32 @free(i8* %72)
br label %111
111: ; preds = %87, %108, %17
%112 = call i32* @fgets(i8* %4, i32 256, i32* %6)
%113 = icmp eq i32* %112, null
br i1 %113, label %116, label %17
114: ; preds = %80, %100
%115 = call i32 @free(i8* %72)
br label %116
116: ; preds = %111, %114, %8, %80
%117 = call i32 @fclose(i32* %6)
br label %118
118: ; preds = %116, %15
%119 = phi i32 [ -1, %15 ], [ 0, %116 ]
ret i32 %119
}