#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*/ stringToReal(char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, double);
int /*<<< orphan*/ testError(int /*<<< orphan*/);
void testStringToReal(void) {
  test(stringToReal("1234"), 1234.0);
  test(stringToReal("-4.2"), -4.2);
  test(stringToReal("1.28E-15"), 1.28E-15);
  testError(stringToReal("X"));
}


x86 assembly (clang, -O0):
<testStringToReal>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
call   1030 <stringToReal@plt>
mov    %eax,%edi
movsd  0xec6(%rip),%xmm0
call   1050 <test@plt>
lea    0xec7(%rip),%rdi
call   1030 <stringToReal@plt>
mov    %eax,%edi
movsd  0xea3(%rip),%xmm0
call   1050 <test@plt>
lea    0xeb1(%rip),%rdi
call   1030 <stringToReal@plt>
mov    %eax,%edi
movsd  0xe80(%rip),%xmm0
call   1050 <test@plt>
lea    0xe9f(%rip),%rdi
call   1030 <stringToReal@plt>
mov    %eax,%edi
call   1040 <testError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStringToReal>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <stringToReal@plt>
movsd  0xebb(%rip),%xmm0
mov    %eax,%edi
call   1050 <test@plt>
lea    0xeca(%rip),%rdi
call   1030 <stringToReal@plt>
movsd  0xea8(%rip),%xmm0
mov    %eax,%edi
call   1050 <test@plt>
lea    0xeb4(%rip),%rdi
call   1030 <stringToReal@plt>
movsd  0xe95(%rip),%xmm0
mov    %eax,%edi
call   1050 <test@plt>
lea    0xea2(%rip),%rdi
call   1030 <stringToReal@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <testError@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
@.str.1 = [5 x i8] c"-4.2\00"
@.str.2 = [9 x i8] c"1.28E-15\00"
@.str.3 = [2 x i8] c"X\00"
define void @testStringToReal() {
%1 = call i32 @stringToReal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test(i32 %1, double 1.234000e+03)
%3 = call i32 @stringToReal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @test(i32 %3, double -4.200000e+00)
%5 = call i32 @stringToReal(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @test(i32 %5, double 1.280000e-15)
%7 = call i32 @stringToReal(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @testError(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
@.str.1 = [5 x i8] c"-4.2\00"
@.str.2 = [9 x i8] c"1.28E-15\00"
@.str.3 = [2 x i8] c"X\00"
define void @testStringToReal() {
%1 = tail call i32 @stringToReal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, double 1.234000e+03)
%3 = tail call i32 @stringToReal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, double -4.200000e+00)
%5 = tail call i32 @stringToReal(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @test(i32 %5, double 1.280000e-15)
%7 = tail call i32 @stringToReal(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @testError(i32 %7)
ret void
}