#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 */
float atof(char const *);
char *parse_skip_whitespace(char const *);
char *strstr(char const *, char *);
int parse_read_float_range(const char *str, float *min, float *max) {
  if (!str)
    return 0;
  str = parse_skip_whitespace(str);
  *min = atof(str);
  str = strstr(str, "-");
  if (!str) {
    *max = *min;
    return 1;
  }
  str++;
  *max = atof(str);
  return 1;
}


x86 assembly (clang, -O0):
<parse_read_float_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <parse_read_float_range+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11d8 <parse_read_float_range+0xa8>
mov    -0x10(%rbp),%rdi
call   1040 <parse_skip_whitespace@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b4 <parse_read_float_range+0x84>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11d8 <parse_read_float_range+0xa8>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_read_float_range>:
test   %rdi,%rdi
je     117f <parse_read_float_range+0x4f>
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
call   1050 <parse_skip_whitespace@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <atof@plt>
movss  %xmm0,0xc(%rsp)
movss  %xmm0,(%r15)
mov    %rbx,%rdi
mov    $0x2d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1182 <parse_read_float_range+0x52>
add    $0x1,%rax
mov    %rax,%rdi
call   1030 <atof@plt>
jmp    1188 <parse_read_float_range+0x58>
xor    %eax,%eax
ret
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @parse_read_float_range(i8* %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = tail call i8* @parse_skip_whitespace(i8* %0)
%7 = tail call float @atof(i8* %6)
store float %7, float* %1
%8 = tail call i8* @strchr(i8* dereferenceable(1) %6, i32 45)
%9 = icmp eq i8* %8, null
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = tail call float @atof(i8* %11)
br label %13
13: ; preds = %5, %10
%14 = phi float [ %12, %10 ], [ %7, %5 ]
store float %14, float* %2
br label %15
15: ; preds = %13, %3
%16 = phi i32 [ 0, %3 ], [ 1, %13 ]
ret i32 %16
}