#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*/ algo_help();
int algo_index(char *);
int /*<<< orphan*/ *fgets(char *, size_t const, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
char *malloc(size_t const);
scalar_t__ sscanf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int readconfigfile(int *w, int *h, int *i, double *minR, double *maxR,
                   double *minI, double *maxI, double *cR, double *cI, int *a,
                   char *fn) {
  FILE *f = fopen(fn, "r");
  if (f == NULL) {
    fprintf(stderr, "Config file does not exist (%s)\n", fn);
    return -1;
  }
  const size_t line_size = 128;
  char *line = malloc(line_size);
  char *buffer = malloc(line_size);
  while (fgets(line, line_size, f) != NULL) {
    if (sscanf(line, "W %d", w)) {
      fprintf(stdout, "Width : %d\n", *w);
      continue;
    }
    if (sscanf(line, "H %d", h)) {
      fprintf(stdout, "Height : %d\n", *h);
      continue;
    }
    if (sscanf(line, "i %d", i)) {
      fprintf(stdout, "Iterations : %d\n", *i);
      continue;
    }
    if (sscanf(line, "a %s", buffer)) {
      (*a) = algo_index(buffer);
      if ((*a) < 0) {
        fprintf(stderr, "Invalid algorithm. Choose one :\n");
        algo_help();
        return -1;
      }
      fprintf(stdout, "Algorithm : %s\n", buffer);
      continue;
    }
    if (sscanf(line, "minR %lf", minR)) {
      fprintf(stdout, "minR : %lf\n", *minR);
      continue;
    }
    if (sscanf(line, "maxR %lf", maxR)) {
      fprintf(stdout, "maxR : %lf\n", *maxR);
      continue;
    }
    if (sscanf(line, "minI %lf", minI)) {
      fprintf(stdout, "minI : %lf\n", *minI);
      continue;
    }
    if (sscanf(line, "maxI %lf", maxI)) {
      fprintf(stdout, "maxI : %lf\n", *maxI);
      continue;
    }
    if (sscanf(line, "cR %lf", cR)) {
      fprintf(stdout, "cR : %lf\n", *cR);
      continue;
    }
    if (sscanf(line, "cI %lf", cI)) {
      fprintf(stdout, "cI : %lf\n", *cI);
      continue;
    }
  }
  free(line);
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<readconfigfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x30(%rbp),%rdi
lea    0xe41(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11fa <readconfigfile+0x7a>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
mov    0x30(%rbp),%rdx
lea    0xe1b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153e <readconfigfile+0x3be>
movq   $0x80,-0x48(%rbp)
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0x80,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1525 <readconfigfile+0x3a5>
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdda(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     127c <readconfigfile+0xfc>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xdb8(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xda9(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     12be <readconfigfile+0x13e>
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xd79(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1300 <readconfigfile+0x180>
mov    0x2cf3(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xd57(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xd4d(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1388 <readconfigfile+0x208>
mov    -0x58(%rbp),%rdi
call   1060 <algo_index@plt>
mov    %eax,%ecx
mov    0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jge    1368 <readconfigfile+0x1e8>
mov    0x2c9b(%rip),%rax
mov    (%rax),%edi
lea    0xd13(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1090 <algo_help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    153e <readconfigfile+0x3be>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xd06(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xcfb(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     13cc <readconfigfile+0x24c>
mov    0x2c29(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xcdb(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1410 <readconfigfile+0x290>
mov    0x2be5(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xcac(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xc9d(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1454 <readconfigfile+0x2d4>
mov    0x2ba1(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xc7d(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    0x10(%rbp),%rdx
lea    0xc6e(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1498 <readconfigfile+0x318>
mov    0x2b5d(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xc4e(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    0x18(%rbp),%rdx
lea    0xc3f(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     14dc <readconfigfile+0x35c>
mov    0x2b19(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xc1d(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
mov    0x20(%rbp),%rdx
lea    0xc0c(%rip),%rsi
mov    $0x0,%al
call   1080 <sscanf@plt>
cmp    $0x0,%rax
je     1520 <readconfigfile+0x3a0>
mov    0x2ad5(%rip),%rax
mov    (%rax),%edi
mov    0x20(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xbea(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    121e <readconfigfile+0x9e>
jmp    121e <readconfigfile+0x9e>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readconfigfile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,%r12
mov    %r8,%r13
mov    %rcx,0x18(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x80(%rsp),%r15
lea    0xe4d(%rip),%rsi
mov    %r15,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1494 <readconfigfile+0x314>
mov    %rax,%r14
mov    %r13,0x10(%rsp)
mov    %r12,0x8(%rsp)
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    $0x80,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    $0x80,%esi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1480 <readconfigfile+0x300>
mov    0x68(%rsp),%r13
mov    %rbx,(%rsp)
jmp    1243 <readconfigfile+0xc3>
nop
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%edx
lea    0xe05(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x80,%esi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <fgets@plt>
test   %rax,%rax
je     1480 <readconfigfile+0x300>
mov    %r15,%rdi
lea    0xdd6(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
jne    1210 <readconfigfile+0x90>
mov    %r15,%rdi
lea    0xdce(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     1289 <readconfigfile+0x109>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
lea    0xdb2(%rip),%rsi
jmp    1223 <readconfigfile+0xa3>
mov    %r12,%rbx
mov    %r15,%rdi
lea    0xdb0(%rip),%rsi
mov    0x20(%rsp),%r12
mov    %r12,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     12d1 <readconfigfile+0x151>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%edx
lea    0xd8d(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%r12
mov    (%rsp),%rbx
jmp    122a <readconfigfile+0xaa>
mov    %r15,%rdi
lea    0xd81(%rip),%rsi
mov    %rbx,%r12
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     1327 <readconfigfile+0x1a7>
mov    %r12,%rdi
call   1060 <algo_index@plt>
mov    0x78(%rsp),%rcx
mov    %eax,(%rcx)
test   %eax,%eax
js     14c2 <readconfigfile+0x342>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xd6e(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rsp),%rbx
jmp    122a <readconfigfile+0xaa>
mov    %r15,%rdi
lea    0xd61(%rip),%rsi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     135b <readconfigfile+0x1db>
mov    0x2c8c(%rip),%rax
mov    (%rax),%edi
movsd  (%rbx),%xmm0
lea    0xd42(%rip),%rsi
jmp    13c1 <readconfigfile+0x241>
mov    %r15,%rdi
lea    0xd42(%rip),%rsi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     138f <readconfigfile+0x20f>
mov    0x2c58(%rip),%rax
mov    (%rax),%edi
movsd  (%rbx),%xmm0
lea    0xd23(%rip),%rsi
jmp    13c1 <readconfigfile+0x241>
mov    %r15,%rdi
lea    0xd23(%rip),%rsi
mov    0x8(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     13d1 <readconfigfile+0x251>
mov    0x2c24(%rip),%rax
mov    (%rax),%edi
movsd  (%rbx),%xmm0
lea    0xd04(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    (%rsp),%rbx
jmp    122a <readconfigfile+0xaa>
mov    %r15,%rdi
lea    0xcf6(%rip),%rsi
mov    0x60(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
mov    (%rsp),%rbx
je     140b <readconfigfile+0x28b>
mov    0x2be1(%rip),%rax
mov    (%rax),%edi
mov    0x60(%rsp),%rax
movsd  (%rax),%xmm0
lea    0xcd1(%rip),%rsi
jmp    1474 <readconfigfile+0x2f4>
mov    %r15,%rdi
lea    0xcd1(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     143c <readconfigfile+0x2bc>
mov    0x2bad(%rip),%rax
mov    (%rax),%edi
movsd  0x0(%r13),%xmm0
lea    0xcb3(%rip),%rsi
jmp    1474 <readconfigfile+0x2f4>
mov    %r15,%rdi
lea    0xcb1(%rip),%rsi
mov    0x70(%rsp),%rdx
xor    %eax,%eax
call   1080 <sscanf@plt>
test   %rax,%rax
je     122a <readconfigfile+0xaa>
mov    0x2b76(%rip),%rax
mov    (%rax),%edi
mov    0x70(%rsp),%rax
movsd  (%rax),%xmm0
lea    0xc8a(%rip),%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
jmp    122a <readconfigfile+0xaa>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    14b3 <readconfigfile+0x333>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
lea    0xb5e(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b17(%rip),%rax
mov    (%rax),%edi
lea    0xb8f(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1090 <algo_help@plt>
jmp    14ae <readconfigfile+0x32e>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"Config file does not exist (%s)\0A\00"
@.str.2 = [5 x i8] c"W %d\00"
@stdout = global i32 0
@.str.3 = [12 x i8] c"Width : %d\0A\00"
@.str.4 = [5 x i8] c"H %d\00"
@.str.5 = [13 x i8] c"Height : %d\0A\00"
@.str.6 = [5 x i8] c"i %d\00"
@.str.7 = [17 x i8] c"Iterations : %d\0A\00"
@.str.8 = [5 x i8] c"a %s\00"
@.str.9 = [33 x i8] c"Invalid algorithm. Choose one :\0A\00"
@.str.10 = [16 x i8] c"Algorithm : %s\0A\00"
@.str.11 = [9 x i8] c"minR %lf\00"
@.str.12 = [12 x i8] c"minR : %lf\0A\00"
@.str.13 = [9 x i8] c"maxR %lf\00"
@.str.14 = [12 x i8] c"maxR : %lf\0A\00"
@.str.15 = [9 x i8] c"minI %lf\00"
@.str.16 = [12 x i8] c"minI : %lf\0A\00"
@.str.17 = [9 x i8] c"maxI %lf\00"
@.str.18 = [12 x i8] c"maxI : %lf\0A\00"
@.str.19 = [7 x i8] c"cR %lf\00"
@.str.20 = [10 x i8] c"cR : %lf\0A\00"
@.str.21 = [7 x i8] c"cI %lf\00"
@.str.22 = [10 x i8] c"cI : %lf\0A\00"
define i32 @readconfigfile(i32* %0, i32* %1, i32* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32* %9, i8* %10) {
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca i32*
%23 = alloca i8*
%24 = alloca i32*
%25 = alloca i64
%26 = alloca i8*
%27 = alloca i8*
store i32* %0, i32** %13
store i32* %1, i32** %14
store i32* %2, i32** %15
store double* %3, double** %16
store double* %4, double** %17
store double* %5, double** %18
store double* %6, double** %19
store double* %7, double** %20
store double* %8, double** %21
store i32* %9, i32** %22
store i8* %10, i8** %23
%28 = load i8*, i8** %23
%29 = call i32* @fopen(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %29, i32** %24
%30 = load i32*, i32** %24
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %36
32: ; preds = %11
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %23
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %34)
store i32 -1, i32* %12
br label %160
36: ; preds = %11
store i64 128, i64* %25
%37 = call i8* @malloc(i64 128)
store i8* %37, i8** %26
%38 = call i8* @malloc(i64 128)
store i8* %38, i8** %27
br label %39
39: ; preds = %154, %149, %139, %129, %119, %109, %99, %90, %69, %59, %49, %36
%40 = load i8*, i8** %26
%41 = load i32*, i32** %24
%42 = call i32* @fgets(i8* %40, i64 128, i32* %41)
%43 = icmp ne i32* %42, null
br i1 %43, label %44, label %155
44: ; preds = %39
%45 = load i8*, i8** %26
%46 = load i32*, i32** %13
%47 = call i64 (i8*, i8*, ...) @sscanf(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %54
49: ; preds = %44
%50 = load i32, i32* @stdout
%51 = load i32*, i32** %13
%52 = load i32, i32* %51
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %52)
br label %39
54: ; preds = %44
%55 = load i8*, i8** %26
%56 = load i32*, i32** %14
%57 = call i64 (i8*, i8*, ...) @sscanf(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %54
%60 = load i32, i32* @stdout
%61 = load i32*, i32** %14
%62 = load i32, i32* %61
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %62)
br label %39
64: ; preds = %54
%65 = load i8*, i8** %26
%66 = load i32*, i32** %15
%67 = call i64 (i8*, i8*, ...) @sscanf(i8* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32* %66)
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %74
69: ; preds = %64
%70 = load i32, i32* @stdout
%71 = load i32*, i32** %15
%72 = load i32, i32* %71
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %72)
br label %39
74: ; preds = %64
%75 = load i8*, i8** %26
%76 = load i8*, i8** %27
%77 = call i64 (i8*, i8*, ...) @sscanf(i8* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %76)
%78 = icmp ne i64 %77, 0
br i1 %78, label %79, label %94
79: ; preds = %74
%80 = load i8*, i8** %27
%81 = call i32 @algo_index(i8* %80)
%82 = load i32*, i32** %22
store i32 %81, i32* %82
%83 = load i32*, i32** %22
%84 = load i32, i32* %83
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %90
86: ; preds = %79
%87 = load i32, i32* @stderr
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%89 = call i32 (...) @algo_help()
store i32 -1, i32* %12
br label %160
90: ; preds = %79
%91 = load i32, i32* @stdout
%92 = load i8*, i8** %27
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %92)
br label %39
94: ; preds = %74
%95 = load i8*, i8** %26
%96 = load double*, double** %16
%97 = call i64 (i8*, i8*, ...) @sscanf(i8* %95, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), double* %96)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %104
99: ; preds = %94
%100 = load i32, i32* @stdout
%101 = load double*, double** %16
%102 = load double, double* %101
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double %102)
br label %39
104: ; preds = %94
%105 = load i8*, i8** %26
%106 = load double*, double** %17
%107 = call i64 (i8*, i8*, ...) @sscanf(i8* %105, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), double* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %114
109: ; preds = %104
%110 = load i32, i32* @stdout
%111 = load double*, double** %17
%112 = load double, double* %111
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), double %112)
br label %39
114: ; preds = %104
%115 = load i8*, i8** %26
%116 = load double*, double** %18
%117 = call i64 (i8*, i8*, ...) @sscanf(i8* %115, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), double* %116)
%118 = icmp ne i64 %117, 0
br i1 %118, label %119, label %124
119: ; preds = %114
%120 = load i32, i32* @stdout
%121 = load double*, double** %18
%122 = load double, double* %121
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), double %122)
br label %39
124: ; preds = %114
%125 = load i8*, i8** %26
%126 = load double*, double** %19
%127 = call i64 (i8*, i8*, ...) @sscanf(i8* %125, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), double* %126)
%128 = icmp ne i64 %127, 0
br i1 %128, label %129, label %134
129: ; preds = %124
%130 = load i32, i32* @stdout
%131 = load double*, double** %19
%132 = load double, double* %131
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), double %132)
br label %39
134: ; preds = %124
%135 = load i8*, i8** %26
%136 = load double*, double** %20
%137 = call i64 (i8*, i8*, ...) @sscanf(i8* %135, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), double* %136)
%138 = icmp ne i64 %137, 0
br i1 %138, label %139, label %144
139: ; preds = %134
%140 = load i32, i32* @stdout
%141 = load double*, double** %20
%142 = load double, double* %141
%143 = call i32 (i32, i8*, ...) @fprintf(i32 %140, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), double %142)
br label %39
144: ; preds = %134
%145 = load i8*, i8** %26
%146 = load double*, double** %21
%147 = call i64 (i8*, i8*, ...) @sscanf(i8* %145, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), double* %146)
%148 = icmp ne i64 %147, 0
br i1 %148, label %149, label %154
149: ; preds = %144
%150 = load i32, i32* @stdout
%151 = load double*, double** %21
%152 = load double, double* %151
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), double %152)
br label %39
154: ; preds = %144
br label %39
155: ; preds = %39
%156 = load i8*, i8** %26
%157 = call i32 @free(i8* %156)
%158 = load i8*, i8** %27
%159 = call i32 @free(i8* %158)
store i32 0, i32* %12
br label %160
160: ; preds = %155, %86, %32
%161 = load i32, i32* %12
ret i32 %161
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [33 x i8] c"Config file does not exist (%s)\0A\00"
@.str.2 = [5 x i8] c"W %d\00"
@stdout = global i32 0
@.str.3 = [12 x i8] c"Width : %d\0A\00"
@.str.4 = [5 x i8] c"H %d\00"
@.str.5 = [13 x i8] c"Height : %d\0A\00"
@.str.6 = [5 x i8] c"i %d\00"
@.str.7 = [17 x i8] c"Iterations : %d\0A\00"
@.str.8 = [5 x i8] c"a %s\00"
@.str.9 = [33 x i8] c"Invalid algorithm. Choose one :\0A\00"
@.str.10 = [16 x i8] c"Algorithm : %s\0A\00"
@.str.11 = [9 x i8] c"minR %lf\00"
@.str.12 = [12 x i8] c"minR : %lf\0A\00"
@.str.13 = [9 x i8] c"maxR %lf\00"
@.str.14 = [12 x i8] c"maxR : %lf\0A\00"
@.str.15 = [9 x i8] c"minI %lf\00"
@.str.16 = [12 x i8] c"minI : %lf\0A\00"
@.str.17 = [9 x i8] c"maxI %lf\00"
@.str.18 = [12 x i8] c"maxI : %lf\0A\00"
@.str.19 = [7 x i8] c"cR %lf\00"
@.str.20 = [10 x i8] c"cR : %lf\0A\00"
@.str.21 = [7 x i8] c"cI %lf\00"
@.str.22 = [10 x i8] c"cI : %lf\0A\00"
define i32 @readconfigfile(i32* %0, i32* %1, i32* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, i32* nocapture writeonly %9, i8* %10) {
%12 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %104
17: ; preds = %11
%18 = tail call dereferenceable_or_null(128) i8* @malloc(i64 128)
%19 = tail call dereferenceable_or_null(128) i8* @malloc(i64 128)
%20 = tail call i32* @fgets(i8* %18, i64 128, i32* %12)
%21 = icmp eq i32* %20, null
br i1 %21, label %101, label %22
22: ; preds = %17, %29
%23 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %0)
%24 = icmp eq i64 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = load i32, i32* @stdout
%27 = load i32, i32* %0
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25, %35, %42, %56, %62, %69, %76, %83, %90, %97, %94
%30 = tail call i32* @fgets(i8* %18, i64 128, i32* %12)
%31 = icmp eq i32* %30, null
br i1 %31, label %101, label %22
32: ; preds = %22
%33 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%34 = icmp eq i64 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %32
%36 = load i32, i32* @stdout
%37 = load i32, i32* %1
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %37)
br label %29
39: ; preds = %32
%40 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%41 = icmp eq i64 %40, 0
br i1 %41, label %46, label %42
42: ; preds = %39
%43 = load i32, i32* @stdout
%44 = load i32, i32* %2
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %44)
br label %29
46: ; preds = %39
%47 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %19)
%48 = icmp eq i64 %47, 0
br i1 %48, label %59, label %49
49: ; preds = %46
%50 = tail call i32 @algo_index(i8* %19)
store i32 %50, i32* %9
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%55 = tail call i32 (...) @algo_help()
br label %104
56: ; preds = %49
%57 = load i32, i32* @stdout
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %19)
br label %29
59: ; preds = %46
%60 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), double* %3)
%61 = icmp eq i64 %60, 0
br i1 %61, label %66, label %62
62: ; preds = %59
%63 = load i32, i32* @stdout
%64 = load double, double* %3
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), double %64)
br label %29
66: ; preds = %59
%67 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), double* %4)
%68 = icmp eq i64 %67, 0
br i1 %68, label %73, label %69
69: ; preds = %66
%70 = load i32, i32* @stdout
%71 = load double, double* %4
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), double %71)
br label %29
73: ; preds = %66
%74 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), double* %5)
%75 = icmp eq i64 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %73
%77 = load i32, i32* @stdout
%78 = load double, double* %5
%79 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0), double %78)
br label %29
80: ; preds = %73
%81 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), double* %6)
%82 = icmp eq i64 %81, 0
br i1 %82, label %87, label %83
83: ; preds = %80
%84 = load i32, i32* @stdout
%85 = load double, double* %6
%86 = tail call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.18, i64 0, i64 0), double %85)
br label %29
87: ; preds = %80
%88 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), double* %7)
%89 = icmp eq i64 %88, 0
br i1 %89, label %94, label %90
90: ; preds = %87
%91 = load i32, i32* @stdout
%92 = load double, double* %7
%93 = tail call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0), double %92)
br label %29
94: ; preds = %87
%95 = tail call i64 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), double* %8)
%96 = icmp eq i64 %95, 0
br i1 %96, label %29, label %97
97: ; preds = %94
%98 = load i32, i32* @stdout
%99 = load double, double* %8
%100 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.22, i64 0, i64 0), double %99)
br label %29
101: ; preds = %29, %17
%102 = tail call i32 @free(i8* %18)
%103 = tail call i32 @free(i8* %19)
br label %104
104: ; preds = %52, %101, %14
%105 = phi i32 [ -1, %14 ], [ -1, %52 ], [ 0, %101 ]
ret i32 %105
}