#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*/ printf(char *, ...);
double sqlSumDoublesCommaSep(char *);
int main(int argc, char *argv[]) {
  if (sqlSumDoublesCommaSep("0,") != 0.0)
    printf("TEST0 ERROR: %s %0.2f\n", "0,", 0.0);
  else
    printf("TEST0 PASSED\n");
  if (sqlSumDoublesCommaSep("0,1.3,") != 1.3)
    printf("TEST1 ERROR: %s %0.2f\n", "0,1.3,", 1.3);
  else
    printf("TEST1 PASSED\n");
  if (sqlSumDoublesCommaSep("0,0.239,0,0,0,0,") != 0.239)
    printf("TEST2 ERROR: %s %0.2f\n", "0,0.239,0,0,0,0,", 0.239);
  else
    printf("TEST2 PASSED\n");
  printf(
      "TEST3: %s %0.2f\n",
      "6.886,6.083,4.729,5.91,6.371,6.007,8.768,4.202,4.455,4.64,10.097,10.619,"
      "6.108,5.037,5.018,4.808,4.543,4.495,5.576,4.57,8.275,4.707,2.55,9.091,9."
      "885,8.17,7.392,7.735,5.353,7.124,8.617,3.426,2.375,7.669,3.826,7.094,6."
      "365,3.263,10.723,10.507,4.843,9.193,13.25,11.635,11.771,8.641,10.448,6."
      "522,9.313,10.304,9.987,9.067,6.12,",
      sqlSumDoublesCommaSep(
          "6.886,6.083,4.729,5.91,6.371,6.007,8.768,4.202,4.455,4.64,10.097,10."
          "619,6.108,5.037,5.018,4.808,4.543,4.495,5.576,4.57,8.275,4.707,2.55,"
          "9.091,9.885,8.17,7.392,7.735,5.353,7.124,8.617,3.426,2.375,7.669,3."
          "826,7.094,6.365,3.263,10.723,10.507,4.843,9.193,13.25,11.635,11.771,"
          "8.641,10.448,6.522,9.313,10.304,9.987,9.067,6.12,"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xf32(%rip),%rdi
call   1040 <sqlSumDoublesCommaSep@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115a <main+0x3a>
jp     115a <main+0x3a>
jmp    1177 <main+0x57>
lea    0xeaf(%rip),%rdi
lea    0xf07(%rip),%rsi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1185 <main+0x65>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1040 <sqlSumDoublesCommaSep@plt>
movsd  0xe67(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ae <main+0x8e>
jp     11ae <main+0x8e>
jmp    11d0 <main+0xb0>
lea    0xe87(%rip),%rdi
lea    0xe79(%rip),%rsi
movsd  0xe3c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11de <main+0xbe>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdi
call   1040 <sqlSumDoublesCommaSep@plt>
movsd  0xe16(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1207 <main+0xe7>
jp     1207 <main+0xe7>
jmp    1229 <main+0x109>
lea    0xe64(%rip),%rdi
lea    0xe4c(%rip),%rsi
movsd  0xdeb(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1237 <main+0x117>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1040 <sqlSumDoublesCommaSep@plt>
lea    0xe4d(%rip),%rdi
lea    0xe57(%rip),%rsi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf1b(%rip),%rdi
call   1050 <sqlSumDoublesCommaSep@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1149 <main+0x19>
jnp    1164 <main+0x34>
lea    0xec0(%rip),%rdi
lea    0xefc(%rip),%rsi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1170 <main+0x40>
lea    0x1054(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1050 <sqlSumDoublesCommaSep@plt>
ucomisd 0xe7c(%rip),%xmm0
jne    1188 <main+0x58>
jnp    11a7 <main+0x77>
lea    0xe9f(%rip),%rdi
lea    0xe91(%rip),%rsi
movsd  0xe62(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11b3 <main+0x83>
lea    0x101e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1050 <sqlSumDoublesCommaSep@plt>
ucomisd 0xe41(%rip),%xmm0
jne    11cb <main+0x9b>
jnp    11ea <main+0xba>
lea    0xe84(%rip),%rdi
lea    0xe6c(%rip),%rsi
movsd  0xe27(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11f6 <main+0xc6>
lea    0xfe8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe81(%rip),%rbx
mov    %rbx,%rdi
call   1050 <sqlSumDoublesCommaSep@plt>
lea    0xe61(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"0,\00"
@.str.1 = [23 x i8] c"TEST0 ERROR: %s %0.2f\0A\00"
@.str.2 = [14 x i8] c"TEST0 PASSED\0A\00"
@.str.3 = [7 x i8] c"0,1.3,\00"
@.str.4 = [23 x i8] c"TEST1 ERROR: %s %0.2f\0A\00"
@.str.5 = [14 x i8] c"TEST1 PASSED\0A\00"
@.str.6 = [17 x i8] c"0,0.239,0,0,0,0,\00"
@.str.7 = [23 x i8] c"TEST2 ERROR: %s %0.2f\0A\00"
@.str.8 = [14 x i8] c"TEST2 PASSED\0A\00"
@.str.9 = [17 x i8] c"TEST3: %s %0.2f\0A\00"
@.str.10 = [321 x i8] c"6.886,6.083,4.729,5.91,6.371,6.007,8.768,4.202,4.455,4.64,10.097,10.619,6.108,5.037,5.018,4.808,4.543,4.495,5.576,4.57,8.275,4.707,2.55,9.091,9.885,8.17,7.392,7.735,5.353,7.124,8.617,3.426,2.375,7.669,3.826,7.094,6.365,3.263,10.723,10.507,4.843,9.193,13.25,11.635,11.771,8.641,10.448,6.522,9.313,10.304,9.987,9.067,6.12,\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = fcmp une double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
br label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%14 = fcmp une double %13, 1.300000e+00
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 1.300000e+00)
br label %19
17: ; preds = %12
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%21 = fcmp une double %20, 2.390000e-01
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double 2.390000e-01)
br label %26
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
%27 = call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.10, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.10, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"0,\00"
@.str.1 = [23 x i8] c"TEST0 ERROR: %s %0.2f\0A\00"
@.str.3 = [7 x i8] c"0,1.3,\00"
@.str.4 = [23 x i8] c"TEST1 ERROR: %s %0.2f\0A\00"
@.str.6 = [17 x i8] c"0,0.239,0,0,0,0,\00"
@.str.7 = [23 x i8] c"TEST2 ERROR: %s %0.2f\0A\00"
@.str.9 = [17 x i8] c"TEST3: %s %0.2f\0A\00"
@.str.10 = [321 x i8] c"6.886,6.083,4.729,5.91,6.371,6.007,8.768,4.202,4.455,4.64,10.097,10.619,6.108,5.037,5.018,4.808,4.543,4.495,5.576,4.57,8.275,4.707,2.55,9.091,9.885,8.17,7.392,7.735,5.353,7.124,8.617,3.426,2.375,7.669,3.826,7.094,6.365,3.263,10.723,10.507,4.843,9.193,13.25,11.635,11.771,8.641,10.448,6.522,9.313,10.304,9.987,9.067,6.12,\00"
@str = [13 x i8] c"TEST0 PASSED\00"
@str.11 = [13 x i8] c"TEST1 PASSED\00"
@str.12 = [13 x i8] c"TEST2 PASSED\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = tail call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = fcmp une double %10, 1.300000e+00
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 1.300000e+00)
br label %16
14: ; preds = %9
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.11, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = tail call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%18 = fcmp une double %17, 2.390000e-01
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double 2.390000e-01)
br label %23
21: ; preds = %16
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.12, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
%24 = tail call double @sqlSumDoublesCommaSep(i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.10, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.10, i64 0, i64 0), double %24)
ret i32 0
}