#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 /*<<< orphan*/ printScalarConversionError(char *);
float strtof(char *, char **);
char stringsToFloats(char **strings, float *floats, unsigned int numData) {
  char *endPtr;
  while (numData--) {
    floats[numData] = strtof(strings[numData], &endPtr);
    if (floats[numData] == 0 && endPtr == strings[numData]) {
      printScalarConversionError(strings[numData]);
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<stringsToFloats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     11b8 <stringsToFloats+0x98>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <strtof@plt>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11b3 <stringsToFloats+0x93>
jp     11b3 <stringsToFloats+0x93>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
cmp    (%rcx,%rdx,8),%rax
jne    11b3 <stringsToFloats+0x93>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1040 <printScalarConversionError@plt>
movb   $0x0,-0x1(%rbp)
jmp    11bc <stringsToFloats+0x9c>
jmp    1133 <stringsToFloats+0x13>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringsToFloats>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    $0x1,%r14b
test   %edx,%edx
je     1189 <stringsToFloats+0x69>
mov    %rsi,%r12
mov    %rdi,%rbp
mov    %edx,%ebx
lea    0x8(%rsp),%r15
jmp    1156 <stringsToFloats+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffffffffffff,%rbx
je     1189 <stringsToFloats+0x69>
mov    -0x8(%rbp,%rbx,8),%rdi
mov    %r15,%rsi
call   1030 <strtof@plt>
movss  %xmm0,-0x4(%r12,%rbx,4)
ucomiss 0xe8f(%rip),%xmm0
jne    1150 <stringsToFloats+0x30>
jp     1150 <stringsToFloats+0x30>
mov    0x8(%rsp),%rdi
cmp    -0x8(%rbp,%rbx,8),%rdi
jne    1150 <stringsToFloats+0x30>
call   1040 <printScalarConversionError@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @stringsToFloats(i8** %0, float* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8**
%6 = alloca float*
%7 = alloca i32
%8 = alloca i8*
store i8** %0, i8*** %5
store float* %1, float** %6
store i32 %2, i32* %7
br label %9
9: ; preds = %45, %3
%10 = load i32, i32* %7
%11 = add i32 %10, -1
store i32 %11, i32* %7
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %46
13: ; preds = %9
%14 = load i8**, i8*** %5
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = call float @strtof(i8* %18, i8** %8)
%20 = load float*, float** %6
%21 = load i32, i32* %7
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float %19, float* %23
%24 = load float*, float** %6
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
%28 = load float, float* %27
%29 = fcmp oeq float %28, 0.000000e+00
br i1 %29, label %30, label %45
30: ; preds = %13
%31 = load i8*, i8** %8
%32 = load i8**, i8*** %5
%33 = load i32, i32* %7
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = icmp eq i8* %31, %36
br i1 %37, label %38, label %45
38: ; preds = %30
%39 = load i8**, i8*** %5
%40 = load i32, i32* %7
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 @printScalarConversionError(i8* %43)
store i8 0, i8* %4
br label %47
45: ; preds = %30, %13
br label %9
46: ; preds = %9
store i8 1, i8* %4
br label %47
47: ; preds = %46, %38
%48 = load i8, i8* %4
ret i8 %48
}

LLVM IR (-O2):
define signext i8 @stringsToFloats(i8** nocapture %0, float* nocapture writeonly %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = icmp eq i32 %2, 0
br i1 %6, label %25, label %7
7: ; preds = %3
%8 = zext i32 %2 to i64
br label %9
9: ; preds = %7, %23
%10 = phi i64 [ %8, %7 ], [ %11, %23 ]
%11 = add nsw i64 %10, -1
%12 = getelementptr inbounds i8*, i8** %0, i64 %11
%13 = load i8*, i8** %12
%14 = call float @strtof(i8* %13, i8** %4)
%15 = getelementptr inbounds float, float* %1, i64 %11
store float %14, float* %15
%16 = fcmp oeq float %14, 0.000000e+00
br i1 %16, label %17, label %23
17: ; preds = %9
%18 = load i8*, i8** %4
%19 = load i8*, i8** %12
%20 = icmp eq i8* %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @printScalarConversionError(i8* %18)
br label %25
23: ; preds = %17, %9
%24 = icmp eq i64 %11, 0
br i1 %24, label %25, label %9
25: ; preds = %23, %3, %21
%26 = phi i8 [ 0, %21 ], [ 1, %3 ], [ 1, %23 ]
ret i8 %26
}