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

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ assert(void *);
float atof(char const *);
int /*<<< orphan*/ is_float(char const *);
int config_parse_float(const char *filename, unsigned line, const char *section,
                       const char *lvalue, int ltype, const char *rvalue,
                       void *data) {
  float *i = (float *)data;
  assert(filename);
  assert(lvalue);
  assert(rvalue);
  assert(data);
  if (!is_float(rvalue))
    return -EINVAL;
  *i = atof(rvalue);
  return 0;
}


x86 assembly (clang, -O0):
<config_parse_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1050 <assert@plt>
mov    0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x38(%rbp),%rdi
call   1030 <is_float@plt>
cmp    $0x0,%eax
jne    11a4 <config_parse_float+0x74>
xor    %eax,%eax
mov    0x2e46(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    11bc <config_parse_float+0x8c>
mov    -0x38(%rbp),%rdi
call   1040 <atof@plt>
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_parse_float>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%rbx
mov    %rcx,%r15
mov    0x20(%rsp),%r14
call   1050 <assert@plt>
mov    %r15,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1050 <assert@plt>
mov    %r14,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <is_float@plt>
test   %eax,%eax
je     117a <config_parse_float+0x4a>
mov    %rbx,%rdi
call   1040 <atof@plt>
movss  %xmm0,(%r14)
xor    %eax,%eax
jmp    1185 <config_parse_float+0x55>
mov    0x2e5f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @config_parse_float(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca float*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i8* %5, i8** %14
store i8* %6, i8** %15
%17 = load i8*, i8** %15
%18 = bitcast i8* %17 to float*
store float* %18, float** %16
%19 = load i8*, i8** %9
%20 = call i32 @assert(i8* %19)
%21 = load i8*, i8** %12
%22 = call i32 @assert(i8* %21)
%23 = load i8*, i8** %14
%24 = call i32 @assert(i8* %23)
%25 = load i8*, i8** %15
%26 = call i32 @assert(i8* %25)
%27 = load i8*, i8** %14
%28 = call i32 @is_float(i8* %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %7
%31 = load i32, i32* @EINVAL
%32 = sub nsw i32 0, %31
store i32 %32, i32* %8
br label %37
33: ; preds = %7
%34 = load i8*, i8** %14
%35 = call float @atof(i8* %34)
%36 = load float*, float** %16
store float %35, float* %36
store i32 0, i32* %8
br label %37
37: ; preds = %33, %30
%38 = load i32, i32* %8
ret i32 %38
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @config_parse_float(i8* %0, i32 %1, i8* nocapture readnone %2, i8* %3, i32 %4, i8* %5, i8* %6) {
%8 = tail call i32 @assert(i8* %0)
%9 = tail call i32 @assert(i8* %3)
%10 = tail call i32 @assert(i8* %5)
%11 = tail call i32 @assert(i8* %6)
%12 = tail call i32 @is_float(i8* %5)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = load i32, i32* @EINVAL
%16 = sub nsw i32 0, %15
br label %20
17: ; preds = %7
%18 = bitcast i8* %6 to float*
%19 = tail call float @atof(i8* %5)
store float %19, float* %18
br label %20
20: ; preds = %17, %14
%21 = phi i32 [ 0, %17 ], [ %16, %14 ]
ret i32 %21
}