void testReadFloat() {
  char str[255];
  char *msg = &str;
  char passed = 0;
  char signedChar;
  float signedFloat;
  printf("Testing fiolSReadFloat...\r\n");
  msg = "28 -4489.67 +42.888888";
  passed = 1;
  printf("\t(\"%s\")\r\n", msg);
  msg += fiolSReadFloat(msg, &signedFloat);
  if (signedFloat - 28 > 0.0001) {
    printf("\t\tfailed, returned %f instead of %f\r\n", signedFloat, 28.0);
    passed = 0;
  }
  msg += fiolSReadChar(msg, &signedChar);
  if (signedChar != ' ') {
    printf("\t\tfailed, returned '%c' instead of '%c'\r\n", signedChar, ' ');
    passed = 0;
  }
  msg += fiolSReadFloat(msg, &signedFloat);
  if (signedFloat - (-4489.67) > 0.0001) {
    printf("\t\tfailed, returned %f instead of %f\r\n", signedFloat, -4489.67);
    passed = 0;
  }
  msg += fiolSReadChar(msg, &signedChar);
  if (signedChar != ' ') {
    printf("\t\tfailed, returned '%c' instead of '%c'\r\n", signedChar, ' ');
    passed = 0;
  }
  msg += fiolSReadFloat(msg, &signedFloat);
  if (signedFloat - (+42.888888) > 0.0001) {
    printf("\t\tfailed, returned %f instead of %f\r\n", signedFloat,
           +42.888888);
    passed = 0;
  }
  if (passed == 1)
    printf("\t\tPassed!\r\n");
}


x86 assembly (clang, -O0):
<testReadFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
movb   $0x0,-0x109(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rax
mov    %rax,-0x108(%rbp)
movb   $0x1,-0x109(%rbp)
mov    -0x108(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1040 <fiolSReadFloat@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
movss  -0x110(%rbp),%xmm0
ff
movss  0xe5d(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1206 <testReadFloat+0xd6>
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe71(%rip),%rdi
movsd  0xe10(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movb   $0x0,-0x109(%rbp)
mov    -0x108(%rbp),%rdi
lea    -0x10a(%rbp),%rsi
mov    $0x0,%al
call   1050 <fiolSReadChar@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
movsbl -0x10a(%rbp),%eax
cmp    $0x20,%eax
je     1262 <testReadFloat+0x132>
movsbl -0x10a(%rbp),%esi
lea    0xe38(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x109(%rbp)
mov    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1040 <fiolSReadFloat@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xd6f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd53(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e0 <testReadFloat+0x1b0>
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd97(%rip),%rdi
movsd  0xd3e(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movb   $0x0,-0x109(%rbp)
mov    -0x108(%rbp),%rdi
lea    -0x10a(%rbp),%rsi
mov    $0x0,%al
call   1050 <fiolSReadChar@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
movsbl -0x10a(%rbp),%eax
cmp    $0x20,%eax
je     133c <testReadFloat+0x20c>
movsbl -0x10a(%rbp),%esi
lea    0xd5e(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x109(%rbp)
mov    -0x108(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1040 <fiolSReadFloat@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x108(%rbp)
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xc9d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xc79(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13ba <testReadFloat+0x28a>
movss  -0x110(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xcbd(%rip),%rdi
movsd  0xc6c(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movb   $0x0,-0x109(%rbp)
movsbl -0x109(%rbp),%eax
cmp    $0x1,%eax
jne    13d8 <testReadFloat+0x2a8>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testReadFloat>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
lea    0xed6(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fiolSReadFloat@plt>
movslq %eax,%r14
add    %rbx,%r14
movss  0xc(%rsp),%xmm0
movss  0xe71(%rip),%xmm1
addss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x1,%ebp
ucomisd 0xe64(%rip),%xmm1
jbe    11c2 <testReadFloat+0x82>
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
movsd  0xe57(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xb(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fiolSReadChar@plt>
movslq %eax,%rbx
add    %r14,%rbx
movsbl 0xb(%rsp),%esi
cmp    $0x20,%esi
je     11f6 <testReadFloat+0xb6>
lea    0xe97(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fiolSReadFloat@plt>
movslq %eax,%r14
add    %rbx,%r14
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdfb(%rip),%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xddf(%rip),%xmm1
jbe    1243 <testReadFloat+0x103>
lea    0xe27(%rip),%rdi
movsd  0xde6(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xb(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fiolSReadChar@plt>
movslq %eax,%rbx
add    %r14,%rbx
movsbl 0xb(%rsp),%esi
cmp    $0x20,%esi
je     1277 <testReadFloat+0x137>
lea    0xe16(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebp,%ebp
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fiolSReadFloat@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd90(%rip),%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xd64(%rip),%xmm1
jbe    12be <testReadFloat+0x17e>
lea    0xdac(%rip),%rdi
movsd  0xd7b(%rip),%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
jmp    12ce <testReadFloat+0x18e>
test   %ebp,%ebp
je     12ce <testReadFloat+0x18e>
lea    0xdfb(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Testing fiolSReadFloat...\0D\0A\00"
@.str.1 = [23 x i8] c"28 -4489.67 +42.888888\00"
@.str.2 = [10 x i8] c"\09(\22%s\22)\0D\0A\00"
@.str.3 = [38 x i8] c"\09\09failed, returned %f instead of %f\0D\0A\00"
@.str.4 = [42 x i8] c"\09\09failed, returned '%c' instead of '%c'\0D\0A\00"
@.str.5 = [12 x i8] c"\09\09Passed!\0D\0A\00"
define void @testReadFloat() {
%1 = alloca [255 x i8]
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca float
%6 = bitcast [255 x i8]* %1 to i8*
store i8* %6, i8** %2
store i8 0, i8* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8 1, i8* %3
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* %10, float* %5)
%12 = load i8*, i8** %2
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8* %14, i8** %2
%15 = load float, float* %5
%16 = fsub float %15, 2.800000e+01
%17 = fpext float %16 to double
%18 = fcmp ogt double %17, 1.000000e-04
br i1 %18, label %19, label %23
19: ; preds = %0
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %21, double 2.800000e+01)
store i8 0, i8* %3
br label %23
23: ; preds = %19, %0
%24 = load i8*, i8** %2
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fiolSReadChar to i32 (i8*, i8*, ...)*)(i8* %24, i8* %4)
%26 = load i8*, i8** %2
%27 = sext i32 %25 to i64
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8* %28, i8** %2
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 32
br i1 %31, label %32, label %36
32: ; preds = %23
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %34, i32 32)
store i8 0, i8* %3
br label %36
36: ; preds = %32, %23
%37 = load i8*, i8** %2
%38 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* %37, float* %5)
%39 = load i8*, i8** %2
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds i8, i8* %39, i64 %40
store i8* %41, i8** %2
%42 = load float, float* %5
%43 = fpext float %42 to double
%44 = fsub double %43, -4.489670e+03
%45 = fcmp ogt double %44, 1.000000e-04
br i1 %45, label %46, label %50
46: ; preds = %36
%47 = load float, float* %5
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %48, double -4.489670e+03)
store i8 0, i8* %3
br label %50
50: ; preds = %46, %36
%51 = load i8*, i8** %2
%52 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fiolSReadChar to i32 (i8*, i8*, ...)*)(i8* %51, i8* %4)
%53 = load i8*, i8** %2
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds i8, i8* %53, i64 %54
store i8* %55, i8** %2
%56 = load i8, i8* %4
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 32
br i1 %58, label %59, label %63
59: ; preds = %50
%60 = load i8, i8* %4
%61 = sext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %61, i32 32)
store i8 0, i8* %3
br label %63
63: ; preds = %59, %50
%64 = load i8*, i8** %2
%65 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* %64, float* %5)
%66 = load i8*, i8** %2
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds i8, i8* %66, i64 %67
store i8* %68, i8** %2
%69 = load float, float* %5
%70 = fpext float %69 to double
%71 = fsub double %70, 0x404571C714FCE747
%72 = fcmp ogt double %71, 1.000000e-04
br i1 %72, label %73, label %77
73: ; preds = %63
%74 = load float, float* %5
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %75, double 0x404571C714FCE747)
store i8 0, i8* %3
br label %77
77: ; preds = %73, %63
%78 = load i8, i8* %3
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 1
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %83
83: ; preds = %81, %77
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"28 -4489.67 +42.888888\00"
@.str.2 = [10 x i8] c"\09(\22%s\22)\0D\0A\00"
@.str.3 = [38 x i8] c"\09\09failed, returned %f instead of %f\0D\0A\00"
@.str.4 = [42 x i8] c"\09\09failed, returned '%c' instead of '%c'\0D\0A\00"
@str = [27 x i8] c"Testing fiolSReadFloat...\0D\00"
@str.6 = [11 x i8] c"\09\09Passed!\0D\00"
define void @testReadFloat() {
%1 = alloca i8
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [23 x i8], [23 x i8]* @.str.1, i64 0, i64 %7
%9 = load float, float* %2
%10 = fadd float %9, -2.800000e+01
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 1.000000e-04
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = fpext float %9 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %14, double 2.800000e+01)
br label %16
16: ; preds = %13, %0
%17 = phi i32 [ 0, %13 ], [ 1, %0 ]
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fiolSReadChar to i32 (i8*, i8*, ...)*)(i8* %8, i8* %1)
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %8, i64 %19
%21 = load i8, i8* %1
%22 = icmp eq i8 %21, 32
br i1 %22, label %26, label %23
23: ; preds = %16
%24 = sext i8 %21 to i32
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %24, i32 32)
br label %26
26: ; preds = %23, %16
%27 = phi i32 [ 0, %23 ], [ %17, %16 ]
%28 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* %20, float* %2)
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %20, i64 %29
%31 = load float, float* %2
%32 = fpext float %31 to double
%33 = fadd double %32, 4.489670e+03
%34 = fcmp ogt double %33, 1.000000e-04
br i1 %34, label %35, label %37
35: ; preds = %26
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %32, double -4.489670e+03)
br label %37
37: ; preds = %35, %26
%38 = phi i32 [ 0, %35 ], [ %27, %26 ]
%39 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fiolSReadChar to i32 (i8*, i8*, ...)*)(i8* %30, i8* %1)
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %30, i64 %40
%42 = load i8, i8* %1
%43 = icmp eq i8 %42, 32
br i1 %43, label %47, label %44
44: ; preds = %37
%45 = sext i8 %42 to i32
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %45, i32 32)
br label %47
47: ; preds = %44, %37
%48 = phi i32 [ 0, %44 ], [ %38, %37 ]
%49 = call i32 (i8*, float*, ...) bitcast (i32 (...)* @fiolSReadFloat to i32 (i8*, float*, ...)*)(i8* %41, float* %2)
%50 = load float, float* %2
%51 = fpext float %50 to double
%52 = fadd double %51, 0xC04571C714FCE747
%53 = fcmp ogt double %52, 1.000000e-04
br i1 %53, label %54, label %56
54: ; preds = %47
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %51, double 0x404571C714FCE747)
br label %60
56: ; preds = %47
%57 = icmp eq i32 %48, 1
br i1 %57, label %58, label %60
58: ; preds = %56
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
br label %60
60: ; preds = %54, %58, %56
ret void
}