#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*/ sprintf(char *, char *);
scalar_t__ test_parse_double(char *);
int test_suite() {
  char buf[50];
  int fail = 0;
  fail += test_parse_double("1.23434");
  fail += test_parse_double("1234.34");
  fail += test_parse_double("1234.34e4");
  fail += test_parse_double("1234.34e-4");
  fail += test_parse_double("1.23434E+4");
  fail += test_parse_double("3.2897984798741413E+194");
  fail += test_parse_double("-3.2897984798741413E-194");
  sprintf(buf, "3289798479874141.314124124128497098e109");
  fail += test_parse_double(buf);
  sprintf(buf, "3289798479874141.314124124128497098e209");
  fail += test_parse_double(buf);
  sprintf(buf, "-3289798479874141.314124124128497098e209");
  fail += test_parse_double(buf);
  sprintf(buf, "3289798479874141.314124124128497098e+209");
  fail += test_parse_double(buf);
  sprintf(buf, "-3289798479874141.314124124128497098e-209");
  fail += test_parse_double(buf);
  return fail;
}


x86 assembly (clang, -O0):
<test_suite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x44(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xea8(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xe8b(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xe7d(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    0xe7c(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rcx
movslq -0x44(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_suite>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xee0(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r14
lea    0xed9(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r15
add    %r14d,%r15d
lea    0xecf(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rbx
add    %r15d,%ebx
lea    0xec7(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r14
add    %ebx,%r14d
lea    0xec0(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rbx
add    %r14d,%ebx
lea    0xeb9(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r14
add    %ebx,%r14d
lea    0xebf(%rip),%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r15
add    %r14d,%r15d
movabs $0x39303165383930,%rax
mov    %rax,0x20(%rsp)
movups 0xeb7(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rbx
add    %r15d,%ebx
movabs $0x39303265383930,%rax
mov    %rax,0x20(%rsp)
movups 0xea9(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xeae(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %r14,%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r15
add    %ebx,%r15d
movups 0xe83(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe88(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe85(%rip),%xmm0
movups %xmm0,0x19(%rsp)
mov    %r14,%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%rbx
add    %r15d,%ebx
movups 0xe7b(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe80(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe7d(%rip),%xmm0
movups %xmm0,0x19(%rsp)
mov    %r14,%rdi
call   1030 <test_parse_double@plt>
mov    %rax,%r15
add    %ebx,%r15d
movups 0xe73(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe78(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe76(%rip),%xmm0
movups %xmm0,0x1a(%rsp)
mov    %r14,%rdi
call   1030 <test_parse_double@plt>
add    %r15d,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"1.23434\00"
@.str.1 = [8 x i8] c"1234.34\00"
@.str.2 = [10 x i8] c"1234.34e4\00"
@.str.3 = [11 x i8] c"1234.34e-4\00"
@.str.4 = [11 x i8] c"1.23434E+4\00"
@.str.5 = [24 x i8] c"3.2897984798741413E+194\00"
@.str.6 = [25 x i8] c"-3.2897984798741413E-194\00"
@.str.7 = [40 x i8] c"3289798479874141.314124124128497098e109\00"
@.str.8 = [40 x i8] c"3289798479874141.314124124128497098e209\00"
@.str.9 = [41 x i8] c"-3289798479874141.314124124128497098e209\00"
@.str.10 = [41 x i8] c"3289798479874141.314124124128497098e+209\00"
@.str.11 = [42 x i8] c"-3289798479874141.314124124128497098e-209\00"
define i32 @test_suite() {
%1 = alloca [50 x i8]
%2 = alloca i32
store i32 0, i32* %2
%3 = call i64 @test_parse_double(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 @test_parse_double(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = call i64 @test_parse_double(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
%18 = call i64 @test_parse_double(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = add nsw i64 %20, %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = call i64 @test_parse_double(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = add nsw i64 %25, %23
%27 = trunc i64 %26 to i32
store i32 %27, i32* %2
%28 = call i64 @test_parse_double(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = add nsw i64 %30, %28
%32 = trunc i64 %31 to i32
store i32 %32, i32* %2
%33 = call i64 @test_parse_double(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = add nsw i64 %35, %33
%37 = trunc i64 %36 to i32
store i32 %37, i32* %2
%38 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%39 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
%40 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%41 = call i64 @test_parse_double(i8* %40)
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = add nsw i64 %43, %41
%45 = trunc i64 %44 to i32
store i32 %45, i32* %2
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%47 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%48 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%49 = call i64 @test_parse_double(i8* %48)
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = add nsw i64 %51, %49
%53 = trunc i64 %52 to i32
store i32 %53, i32* %2
%54 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%55 = call i32 @sprintf(i8* %54, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%56 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%57 = call i64 @test_parse_double(i8* %56)
%58 = load i32, i32* %2
%59 = sext i32 %58 to i64
%60 = add nsw i64 %59, %57
%61 = trunc i64 %60 to i32
store i32 %61, i32* %2
%62 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%63 = call i32 @sprintf(i8* %62, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%64 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%65 = call i64 @test_parse_double(i8* %64)
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = add nsw i64 %67, %65
%69 = trunc i64 %68 to i32
store i32 %69, i32* %2
%70 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%71 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%72 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%73 = call i64 @test_parse_double(i8* %72)
%74 = load i32, i32* %2
%75 = sext i32 %74 to i64
%76 = add nsw i64 %75, %73
%77 = trunc i64 %76 to i32
store i32 %77, i32* %2
%78 = load i32, i32* %2
ret i32 %78
}

LLVM IR (-O2):
@.str = [8 x i8] c"1.23434\00"
@.str.1 = [8 x i8] c"1234.34\00"
@.str.2 = [10 x i8] c"1234.34e4\00"
@.str.3 = [11 x i8] c"1234.34e-4\00"
@.str.4 = [11 x i8] c"1.23434E+4\00"
@.str.5 = [24 x i8] c"3.2897984798741413E+194\00"
@.str.6 = [25 x i8] c"-3.2897984798741413E-194\00"
@.str.7 = [40 x i8] c"3289798479874141.314124124128497098e109\00"
@.str.8 = [40 x i8] c"3289798479874141.314124124128497098e209\00"
@.str.9 = [41 x i8] c"-3289798479874141.314124124128497098e209\00"
@.str.10 = [41 x i8] c"3289798479874141.314124124128497098e+209\00"
@.str.11 = [42 x i8] c"-3289798479874141.314124124128497098e-209\00"
define i32 @test_suite() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = add i64 %4, %3
%6 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%7 = add i64 %5, %6
%8 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%9 = add i64 %7, %8
%10 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%11 = add i64 %9, %10
%12 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%13 = add i64 %11, %12
%14 = tail call i64 @test_parse_double(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
%15 = add i64 %13, %14
%16 = call i64 @test_parse_double(i8* %2)
%17 = add i64 %15, %16
%18 = call i64 @test_parse_double(i8* %2)
%19 = add i64 %17, %18
%20 = call i64 @test_parse_double(i8* %2)
%21 = add i64 %19, %20
%22 = call i64 @test_parse_double(i8* %2)
%23 = add i64 %21, %22
%24 = call i64 @test_parse_double(i8* %2)
%25 = add i64 %23, %24
%26 = trunc i64 %25 to i32
ret i32 %26
}