#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*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ confSetVar(char *, float);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int sscanf(char *, char *, char *, float *);
void confLoad(char *filename) {
  FILE *file = NULL;
  char name[256];
  char line[256];
  float value;
  file = fopen(filename, "r");
  if (file != NULL) {
    while (fgets(line, sizeof(line), file) != NULL) {
      if (sscanf(line, "%s = %f", name, &value) == 2) {
        confSetVar((char *)name, value);
      }
    }
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<confLoad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11f6 <confLoad+0xa6>
jmp    118b <confLoad+0x3b>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11ed <confLoad+0x9d>
lea    -0x210(%rbp),%rdi
lea    -0x110(%rbp),%rdx
lea    0xe43(%rip),%rsi
lea    -0x214(%rbp),%rcx
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    11e8 <confLoad+0x98>
lea    -0x110(%rbp),%rdi
movss  -0x214(%rbp),%xmm0
ff
call   1040 <confSetVar@plt>
jmp    118b <confLoad+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confLoad>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x210,%rsp
lea    0xe99(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     11f3 <confLoad+0xa3>
mov    %rax,%r15
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11eb <confLoad+0x9b>
lea    0xe6c(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0x110(%rsp),%r12
lea    0xc(%rsp),%r13
jmp    11c5 <confLoad+0x75>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11eb <confLoad+0x9b>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1060 <sscanf@plt>
cmp    $0x2,%eax
jne    11b0 <confLoad+0x60>
movss  0xc(%rsp),%xmm0
mov    %r12,%rdi
call   1040 <confSetVar@plt>
jmp    11b0 <confLoad+0x60>
mov    %r15,%rdi
call   1030 <fclose@plt>
add    $0x210,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [8 x i8] c"%s = %f\00"
define void @confLoad(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca float
store i8* %0, i8** %2
store i32* null, i32** %3
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %30
11: ; preds = %1
br label %12
12: ; preds = %26, %11
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = load i32*, i32** %3
%15 = call i32* @fgets(i8* %13, i32 256, i32* %14)
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%20 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %19, float* %6)
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %26
22: ; preds = %17
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%24 = load float, float* %6
%25 = call i32 @confSetVar(i8* %23, float %24)
br label %26
26: ; preds = %22, %17
br label %12
27: ; preds = %12
%28 = load i32*, i32** %3
%29 = call i32 @fclose(i32* %28)
br label %30
30: ; preds = %27, %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [8 x i8] c"%s = %f\00"
define void @confLoad(i8* nocapture %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca float
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = bitcast float* %4 to i8*
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %24, label %10
10: ; preds = %1
%11 = call i32* @fgets(i8* %6, i32 256, i32* %8)
%12 = icmp eq i32* %11, null
br i1 %12, label %22, label %13
13: ; preds = %10, %19
%14 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %5, float* %4)
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load float, float* %4
%18 = call i32 @confSetVar(i8* %5, float %17)
br label %19
19: ; preds = %16, %13
%20 = call i32* @fgets(i8* %6, i32 256, i32* %8)
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %13
22: ; preds = %19, %10
%23 = call i32 @fclose(i32* %8)
br label %24
24: ; preds = %22, %1
ret void
}