#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 */
double floor(double);
int sscanf(char *, char *, ...);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char const *);
char *wcsutil_dot_to_locale(char const *, char *);
int wcsutil_str2double2(const char *buf, double *value) {
  value[0] = 0.0;
  value[1] = 0.0;
  char ltmp[72];
  if (sscanf(wcsutil_dot_to_locale(buf, ltmp), "%lf", value) < 1) {
    return 1;
  }
  value[0] = floor(value[0]);
  char ctmp[72];
  strcpy(ctmp, buf);
  char *dptr = strchr(ctmp, '.');
  char *eptr;
  if ((eptr = strchr(ctmp, 'E')) == NULL) {
    if ((eptr = strchr(ctmp, 'D')) == NULL) {
      if ((eptr = strchr(ctmp, 'e')) == NULL) {
        eptr = strchr(ctmp, 'd');
      }
    }
  }
  int exp = 0;
  if (eptr) {
    if (sscanf(eptr + 1, "%d", &exp) < 1) {
      return 1;
    }
    if (!dptr) {
      dptr = eptr;
      eptr++;
    }
    if (dptr + exp <= ctmp) {
      return sscanf(wcsutil_dot_to_locale(buf, ctmp), "%lf", value + 1) < 1;
    } else if (eptr <= dptr + exp + 1) {
      return 0;
    }
  }
  if (dptr) {
    char *cptr = ctmp;
    while (cptr <= dptr + exp) {
      if ('0' < *cptr && *cptr <= '9')
        *cptr = '0';
      cptr++;
    }
    if (sscanf(wcsutil_dot_to_locale(ctmp, ltmp), "%lf", value + 1) < 1) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<wcsutil_str2double2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <wcsutil_dot_to_locale@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rdx
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jge    11b1 <wcsutil_str2double2+0x61>
movl   $0x1,-0x4(%rbp)
jmp    145b <wcsutil_str2double2+0x30b>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <floor@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rax,-0xb8(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x45,%esi
call   1040 <strchr@plt>
mov    %rax,-0xc0(%rbp)
cmp    $0x0,%rax
jne    1276 <wcsutil_str2double2+0x126>
lea    -0xb0(%rbp),%rdi
mov    $0x44,%esi
call   1040 <strchr@plt>
mov    %rax,-0xc0(%rbp)
cmp    $0x0,%rax
jne    1271 <wcsutil_str2double2+0x121>
lea    -0xb0(%rbp),%rdi
mov    $0x65,%esi
call   1040 <strchr@plt>
mov    %rax,-0xc0(%rbp)
cmp    $0x0,%rax
jne    126c <wcsutil_str2double2+0x11c>
lea    -0xb0(%rbp),%rdi
mov    $0x64,%esi
call   1040 <strchr@plt>
mov    %rax,-0xc0(%rbp)
jmp    1271 <wcsutil_str2double2+0x121>
jmp    1276 <wcsutil_str2double2+0x126>
movl   $0x0,-0xc4(%rbp)
cmpq   $0x0,-0xc0(%rbp)
je     1389 <wcsutil_str2double2+0x239>
mov    -0xc0(%rbp),%rdi
add    $0x1,%rdi
lea    0xd64(%rip),%rsi
lea    -0xc4(%rbp),%rdx
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jge    12c3 <wcsutil_str2double2+0x173>
movl   $0x1,-0x4(%rbp)
jmp    145b <wcsutil_str2double2+0x30b>
cmpq   $0x0,-0xb8(%rbp)
jne    12f1 <wcsutil_str2double2+0x1a1>
mov    -0xc0(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xc0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc0(%rbp)
mov    -0xb8(%rbp),%rax
movslq -0xc4(%rbp),%rcx
add    %rcx,%rax
lea    -0xb0(%rbp),%rcx
cmp    %rcx,%rax
ja     134e <wcsutil_str2double2+0x1fe>
mov    -0x10(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1060 <wcsutil_dot_to_locale@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    145b <wcsutil_str2double2+0x30b>
mov    -0xc0(%rbp),%rax
mov    -0xb8(%rbp),%rcx
movslq -0xc4(%rbp),%rdx
add    %rdx,%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
ja     137f <wcsutil_str2double2+0x22f>
movl   $0x0,-0x4(%rbp)
jmp    145b <wcsutil_str2double2+0x30b>
jmp    1384 <wcsutil_str2double2+0x234>
jmp    1389 <wcsutil_str2double2+0x239>
cmpq   $0x0,-0xb8(%rbp)
je     1454 <wcsutil_str2double2+0x304>
lea    -0xb0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    -0xb8(%rbp),%rcx
movslq -0xc4(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
ja     1411 <wcsutil_str2double2+0x2c1>
mov    -0xd0(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jge    13fa <wcsutil_str2double2+0x2aa>
mov    -0xd0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     13fa <wcsutil_str2double2+0x2aa>
mov    -0xd0(%rbp),%rax
movb   $0x30,(%rax)
mov    -0xd0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xd0(%rbp)
jmp    13a5 <wcsutil_str2double2+0x255>
lea    -0xb0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <wcsutil_dot_to_locale@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rdx
add    $0x8,%rdx
lea    0xbcd(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jge    144f <wcsutil_str2double2+0x2ff>
movl   $0x1,-0x4(%rbp)
jmp    145b <wcsutil_str2double2+0x30b>
jmp    1454 <wcsutil_str2double2+0x304>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_str2double2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%rbx
mov    %rdi,%r15
pxor   %xmm0,%xmm0
movdqu %xmm0,(%rsi)
lea    0x60(%rsp),%rsi
call   1060 <wcsutil_dot_to_locale@plt>
lea    0xea0(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
test   %eax,%eax
jle    152d <wcsutil_str2double2+0x3dd>
lea    0x8(%rbx),%r14
movq   (%rbx),%xmm0
call   1070 <floor@plt>
movq   %xmm0,(%rbx)
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rax,%r12
mov    %r13,%rdi
mov    $0x45,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    120d <wcsutil_str2double2+0xbd>
lea    0x10(%rsp),%rdi
mov    $0x44,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    120d <wcsutil_str2double2+0xbd>
lea    0x10(%rsp),%rdi
mov    $0x65,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     14ad <wcsutil_str2double2+0x35d>
movl   $0x0,0xc(%rsp)
lea    0x1(%rbx),%rbp
lea    0xe04(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <sscanf@plt>
test   %eax,%eax
jle    152d <wcsutil_str2double2+0x3dd>
test   %r12,%r12
mov    %r12,%rcx
cmove  %rbx,%rcx
movslq 0xc(%rsp),%rdx
lea    (%rcx,%rdx,1),%rsi
cmp    %r13,%rsi
jbe    147e <wcsutil_str2double2+0x32e>
test   %r12,%r12
cmove  %rbp,%rbx
add    $0x1,%rsi
xor    %eax,%eax
cmp    %rsi,%rbx
jbe    1532 <wcsutil_str2double2+0x3e2>
movslq %edx,%rdx
lea    (%rcx,%rdx,1),%rax
cmp    %rax,%r13
ja     14e4 <wcsutil_str2double2+0x394>
add    %rcx,%rdx
add    $0x1,%rdx
lea    0x11(%rsp),%rcx
cmp    %rcx,%rdx
cmova  %rdx,%rcx
sub    %r13,%rcx
cmp    $0x10,%rcx
jb     1519 <wcsutil_str2double2+0x3c9>
mov    %rcx,%rdx
and    $0xfffffffffffffff0,%rdx
lea    (%rsp,%rdx,1),%r13
add    $0x10,%r13
xor    %esi,%esi
movdqa 0xd4e(%rip),%xmm0
movdqa 0xd56(%rip),%xmm1
pcmpeqd %xmm2,%xmm2
jmp    12cd <wcsutil_str2double2+0x17d>
add    $0x10,%rsi
cmp    %rsi,%rdx
je     14df <wcsutil_str2double2+0x38f>
movq   0x10(%rsp,%rsi,1),%xmm3
paddb  %xmm0,%xmm3
movdqa %xmm3,%xmm4
pmaxub %xmm1,%xmm4
pcmpeqb %xmm3,%xmm4
movd   %xmm4,%edi
not    %dil
test   $0x1,%dil
je     12f5 <wcsutil_str2double2+0x1a5>
movb   $0x30,0x10(%rsp,%rsi,1)
movdqa %xmm4,%xmm3
pxor   %xmm2,%xmm3
movdqa %xmm3,%xmm5
pslld  $0x8,%xmm5
movd   %xmm5,%edi
shr    $0x10,%edi
test   $0x1,%dil
je     1318 <wcsutil_str2double2+0x1c8>
movb   $0x30,0x11(%rsp,%rsi,1)
pshuflw $0x55,%xmm4,%xmm5
pxor   %xmm2,%xmm5
pextrw $0x2,%xmm5,%edi
test   $0x1,%dil
je     1331 <wcsutil_str2double2+0x1e1>
movb   $0x30,0x12(%rsp,%rsi,1)
movdqa %xmm3,%xmm5
psllq  $0x18,%xmm5
pextrw $0x3,%xmm5,%edi
test   $0x1,%dil
je     134a <wcsutil_str2double2+0x1fa>
movb   $0x30,0x13(%rsp,%rsi,1)
pshufd $0x55,%xmm4,%xmm4
pxor   %xmm2,%xmm4
pextrw $0x4,%xmm4,%edi
test   $0x1,%dil
je     1363 <wcsutil_str2double2+0x213>
movb   $0x30,0x14(%rsp,%rsi,1)
movdqa %xmm3,%xmm4
pslldq $0x5,%xmm4
pextrw $0x5,%xmm4,%edi
test   $0x1,%dil
je     137c <wcsutil_str2double2+0x22c>
movb   $0x30,0x15(%rsp,%rsi,1)
pextrw $0x3,%xmm3,%edi
test   $0x1,%dil
je     138c <wcsutil_str2double2+0x23c>
movb   $0x30,0x16(%rsp,%rsi,1)
pslldq $0x7,%xmm3
pextrw $0x7,%xmm3,%edi
test   $0x1,%dil
je     13a1 <wcsutil_str2double2+0x251>
movb   $0x30,0x17(%rsp,%rsi,1)
movq   0x18(%rsp,%rsi,1),%xmm3
paddb  %xmm0,%xmm3
movdqa %xmm3,%xmm4
pmaxub %xmm1,%xmm4
pcmpeqb %xmm3,%xmm4
movd   %xmm4,%edi
not    %dil
test   $0x1,%dil
je     13c9 <wcsutil_str2double2+0x279>
movb   $0x30,0x18(%rsp,%rsi,1)
movdqa %xmm4,%xmm3
pxor   %xmm2,%xmm3
movdqa %xmm3,%xmm5
pslld  $0x8,%xmm5
movd   %xmm5,%edi
shr    $0x10,%edi
test   $0x1,%dil
je     13ec <wcsutil_str2double2+0x29c>
movb   $0x30,0x19(%rsp,%rsi,1)
pshuflw $0x55,%xmm4,%xmm5
pxor   %xmm2,%xmm5
pextrw $0x2,%xmm5,%edi
test   $0x1,%dil
je     1405 <wcsutil_str2double2+0x2b5>
movb   $0x30,0x1a(%rsp,%rsi,1)
movdqa %xmm3,%xmm5
psllq  $0x18,%xmm5
pextrw $0x3,%xmm5,%edi
test   $0x1,%dil
je     141e <wcsutil_str2double2+0x2ce>
movb   $0x30,0x1b(%rsp,%rsi,1)
pshufd $0x55,%xmm4,%xmm4
pxor   %xmm2,%xmm4
pextrw $0x4,%xmm4,%edi
test   $0x1,%dil
je     1437 <wcsutil_str2double2+0x2e7>
movb   $0x30,0x1c(%rsp,%rsi,1)
movdqa %xmm3,%xmm4
pslldq $0x5,%xmm4
pextrw $0x5,%xmm4,%edi
test   $0x1,%dil
je     1450 <wcsutil_str2double2+0x300>
movb   $0x30,0x1d(%rsp,%rsi,1)
pextrw $0x3,%xmm3,%edi
test   $0x1,%dil
je     1460 <wcsutil_str2double2+0x310>
movb   $0x30,0x1e(%rsp,%rsi,1)
pslldq $0x7,%xmm3
pextrw $0x7,%xmm3,%edi
test   $0x1,%dil
je     12c0 <wcsutil_str2double2+0x170>
movb   $0x30,0x1f(%rsp,%rsi,1)
jmp    12c0 <wcsutil_str2double2+0x170>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1060 <wcsutil_dot_to_locale@plt>
lea    0xb8e(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setle  %al
jmp    1532 <wcsutil_str2double2+0x3e2>
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1040 <strchr@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
test   %rax,%rax
jne    1215 <wcsutil_str2double2+0xc5>
test   %r12,%r12
je     150b <wcsutil_str2double2+0x3bb>
xor    %edx,%edx
mov    %r12,%rcx
jmp    1269 <wcsutil_str2double2+0x119>
cmp    %rdx,%rcx
jne    1519 <wcsutil_str2double2+0x3c9>
lea    0x10(%rsp),%rdi
lea    0x60(%rsp),%rsi
call   1060 <wcsutil_dot_to_locale@plt>
lea    0xb26(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <sscanf@plt>
test   %eax,%eax
jle    152d <wcsutil_str2double2+0x3dd>
xor    %eax,%eax
jmp    1532 <wcsutil_str2double2+0x3e2>
nop
add    $0x1,%r13
cmp    %rax,%r13
ja     14e4 <wcsutil_str2double2+0x394>
movzbl 0x0(%r13),%ecx
add    $0xcf,%cl
cmp    $0x8,%cl
ja     1510 <wcsutil_str2double2+0x3c0>
movb   $0x30,0x0(%r13)
jmp    1510 <wcsutil_str2double2+0x3c0>
mov    $0x1,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @wcsutil_str2double2(i8* %0, double* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca double*
%6 = alloca [72 x i8]
%7 = alloca [72 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %4
store double* %1, double** %5
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
store double 0.000000e+00, double* %13
%14 = load double*, double** %5
%15 = getelementptr inbounds double, double* %14, i64 1
store double 0.000000e+00, double* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds [72 x i8], [72 x i8]* %6, i64 0, i64 0
%18 = call i8* @wcsutil_dot_to_locale(i8* %16, i8* %17)
%19 = load double*, double** %5
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %19)
%21 = icmp slt i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 1, i32* %3
br label %132
23: ; preds = %2
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 0
%26 = load double, double* %25
%27 = call double @llvm.floor.f64(double %26)
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 0
store double %27, double* %29
%30 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%31 = load i8*, i8** %4
%32 = call i32 @strcpy(i8* %30, i8* %31)
%33 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%34 = call i8* @strchr(i8* %33, i8 signext 46)
store i8* %34, i8** %8
%35 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%36 = call i8* @strchr(i8* %35, i8 signext 69)
store i8* %36, i8** %9
%37 = icmp eq i8* %36, null
br i1 %37, label %38, label %51
38: ; preds = %23
%39 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%40 = call i8* @strchr(i8* %39, i8 signext 68)
store i8* %40, i8** %9
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %50
42: ; preds = %38
%43 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%44 = call i8* @strchr(i8* %43, i8 signext 101)
store i8* %44, i8** %9
%45 = icmp eq i8* %44, null
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%48 = call i8* @strchr(i8* %47, i8 signext 100)
store i8* %48, i8** %9
br label %49
49: ; preds = %46, %42
br label %50
50: ; preds = %49, %38
br label %51
51: ; preds = %50, %23
store i32 0, i32* %10
%52 = load i8*, i8** %9
%53 = icmp ne i8* %52, null
br i1 %53, label %54, label %94
54: ; preds = %51
%55 = load i8*, i8** %9
%56 = getelementptr inbounds i8, i8* %55, i64 1
%57 = call i32 (i8*, i8*, ...) @sscanf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%58 = icmp slt i32 %57, 1
br i1 %58, label %59, label %60
59: ; preds = %54
store i32 1, i32* %3
br label %132
60: ; preds = %54
%61 = load i8*, i8** %8
%62 = icmp ne i8* %61, null
br i1 %62, label %67, label %63
63: ; preds = %60
%64 = load i8*, i8** %9
store i8* %64, i8** %8
%65 = load i8*, i8** %9
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %9
br label %67
67: ; preds = %63, %60
%68 = load i8*, i8** %8
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%73 = icmp ule i8* %71, %72
br i1 %73, label %74, label %83
74: ; preds = %67
%75 = load i8*, i8** %4
%76 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%77 = call i8* @wcsutil_dot_to_locale(i8* %75, i8* %76)
%78 = load double*, double** %5
%79 = getelementptr inbounds double, double* %78, i64 1
%80 = call i32 (i8*, i8*, ...) @sscanf(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %79)
%81 = icmp slt i32 %80, 1
%82 = zext i1 %81 to i32
store i32 %82, i32* %3
br label %132
83: ; preds = %67
%84 = load i8*, i8** %9
%85 = load i8*, i8** %8
%86 = load i32, i32* %10
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
%89 = getelementptr inbounds i8, i8* %88, i64 1
%90 = icmp ule i8* %84, %89
br i1 %90, label %91, label %92
91: ; preds = %83
store i32 0, i32* %3
br label %132
92: ; preds = %83
br label %93
93: ; preds = %92
br label %94
94: ; preds = %93, %51
%95 = load i8*, i8** %8
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %131
97: ; preds = %94
%98 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
store i8* %98, i8** %11
br label %99
99: ; preds = %118, %97
%100 = load i8*, i8** %11
%101 = load i8*, i8** %8
%102 = load i32, i32* %10
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = icmp ule i8* %100, %104
br i1 %105, label %106, label %121
106: ; preds = %99
%107 = load i8*, i8** %11
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp slt i32 48, %109
br i1 %110, label %111, label %118
111: ; preds = %106
%112 = load i8*, i8** %11
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp sle i32 %114, 57
br i1 %115, label %116, label %118
116: ; preds = %111
%117 = load i8*, i8** %11
store i8 48, i8* %117
br label %118
118: ; preds = %116, %111, %106
%119 = load i8*, i8** %11
%120 = getelementptr inbounds i8, i8* %119, i32 1
store i8* %120, i8** %11
br label %99
121: ; preds = %99
%122 = getelementptr inbounds [72 x i8], [72 x i8]* %7, i64 0, i64 0
%123 = getelementptr inbounds [72 x i8], [72 x i8]* %6, i64 0, i64 0
%124 = call i8* @wcsutil_dot_to_locale(i8* %122, i8* %123)
%125 = load double*, double** %5
%126 = getelementptr inbounds double, double* %125, i64 1
%127 = call i32 (i8*, i8*, ...) @sscanf(i8* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %126)
%128 = icmp slt i32 %127, 1
br i1 %128, label %129, label %130
129: ; preds = %121
store i32 1, i32* %3
br label %132
130: ; preds = %121
br label %131
131: ; preds = %130, %94
store i32 0, i32* %3
br label %132
132: ; preds = %131, %129, %91, %74, %59, %22
%133 = load i32, i32* %3
ret i32 %133
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @wcsutil_str2double2(i8* %0, double* %1) {
%3 = alloca [72 x i8]
%4 = alloca [72 x i8]
%5 = ptrtoint [72 x i8]* %4 to i64
%6 = alloca i32
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = getelementptr inbounds [72 x i8], [72 x i8]* %3, i64 0, i64 0
%9 = bitcast double* %1 to i8*
%10 = call i8* @wcsutil_dot_to_locale(i8* %0, i8* %8)
%11 = call i32 (i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%12 = icmp slt i32 %11, 1
br i1 %12, label %187, label %13
13: ; preds = %2
%14 = load double, double* %1
%15 = call double @llvm.floor.f64(double %14)
store double %15, double* %1
%16 = getelementptr inbounds [72 x i8], [72 x i8]* %4, i64 0, i64 0
%17 = call i32 @strcpy(i8* %16, i8* %0)
%18 = call i8* @strchr(i8* %16, i8 signext 46)
%19 = call i8* @strchr(i8* %16, i8 signext 69)
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %13
%22 = call i8* @strchr(i8* %16, i8 signext 68)
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = call i8* @strchr(i8* %16, i8 signext 101)
%26 = icmp eq i8* %25, null
br i1 %26, label %30, label %27
27: ; preds = %24, %21, %13
%28 = phi i8* [ %19, %13 ], [ %22, %21 ], [ %25, %24 ]
%29 = bitcast i32* %6 to i8*
store i32 0, i32* %6
br label %34
30: ; preds = %24
%31 = call i8* @strchr(i8* %16, i8 signext 100)
%32 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%33 = icmp eq i8* %31, null
br i1 %33, label %55, label %34
34: ; preds = %27, %30
%35 = phi i8* [ %28, %27 ], [ %31, %30 ]
%36 = getelementptr inbounds i8, i8* %35, i64 1
%37 = call i32 (i8*, i8*, ...) @sscanf(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%38 = icmp slt i32 %37, 1
br i1 %38, label %184, label %39
39: ; preds = %34
%40 = icmp eq i8* %18, null
%41 = select i1 %40, i8* %35, i8* %18
%42 = load i32, i32* %6
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = icmp ugt i8* %44, %16
br i1 %45, label %51, label %46
46: ; preds = %39
%47 = call i8* @wcsutil_dot_to_locale(i8* %0, i8* %16)
%48 = call i32 (i8*, i8*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%49 = icmp slt i32 %48, 1
%50 = zext i1 %49 to i32
br label %184
51: ; preds = %39
%52 = select i1 %40, i8* %36, i8* %35
%53 = getelementptr inbounds i8, i8* %44, i64 1
%54 = icmp ugt i8* %52, %53
br i1 %54, label %57, label %184
55: ; preds = %30
%56 = icmp eq i8* %18, null
br i1 %56, label %183, label %57
57: ; preds = %51, %55
%58 = phi i8* [ %18, %55 ], [ %41, %51 ]
%59 = phi i32 [ 0, %55 ], [ %42, %51 ]
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
%62 = icmp ugt i8* %16, %61
br i1 %62, label %179, label %63
63: ; preds = %57
%64 = ptrtoint i8* %58 to i64
%65 = add i64 %64, %60
%66 = add i64 %65, 1
%67 = or i64 %5, 1
%68 = call i64 @llvm.umax.i64(i64 %66, i64 %67)
%69 = sub i64 %68, %5
%70 = icmp ult i64 %69, 16
br i1 %70, label %168, label %71
71: ; preds = %63
%72 = and i64 %69, -16
%73 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %72
br label %74
74: ; preds = %163, %71
%75 = phi i64 [ 0, %71 ], [ %164, %163 ]
%76 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %75
%77 = bitcast i8* %76 to <8 x i8>*
%78 = load <8 x i8>, <8 x i8>* %77
%79 = getelementptr i8, i8* %76, i64 8
%80 = bitcast i8* %79 to <8 x i8>*
%81 = load <8 x i8>, <8 x i8>* %80
%82 = add <8 x i8> %78, <i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49>
%83 = add <8 x i8> %81, <i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49, i8 -49>
%84 = icmp ult <8 x i8> %82, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
%85 = icmp ult <8 x i8> %83, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
%86 = extractelement <8 x i1> %84, i64 0
br i1 %86, label %87, label %88
87: ; preds = %74
store i8 48, i8* %76
br label %88
88: ; preds = %87, %74
%89 = extractelement <8 x i1> %84, i64 1
br i1 %89, label %90, label %93
90: ; preds = %88
%91 = or i64 %75, 1
%92 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %91
store i8 48, i8* %92
br label %93
93: ; preds = %90, %88
%94 = extractelement <8 x i1> %84, i64 2
br i1 %94, label %95, label %98
95: ; preds = %93
%96 = or i64 %75, 2
%97 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %96
store i8 48, i8* %97
br label %98
98: ; preds = %95, %93
%99 = extractelement <8 x i1> %84, i64 3
br i1 %99, label %100, label %103
100: ; preds = %98
%101 = or i64 %75, 3
%102 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %101
store i8 48, i8* %102
br label %103
103: ; preds = %100, %98
%104 = extractelement <8 x i1> %84, i64 4
br i1 %104, label %105, label %108
105: ; preds = %103
%106 = or i64 %75, 4
%107 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %106
store i8 48, i8* %107
br label %108
108: ; preds = %105, %103
%109 = extractelement <8 x i1> %84, i64 5
br i1 %109, label %110, label %113
110: ; preds = %108
%111 = or i64 %75, 5
%112 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %111
store i8 48, i8* %112
br label %113
113: ; preds = %110, %108
%114 = extractelement <8 x i1> %84, i64 6
br i1 %114, label %115, label %118
115: ; preds = %113
%116 = or i64 %75, 6
%117 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %116
store i8 48, i8* %117
br label %118
118: ; preds = %115, %113
%119 = extractelement <8 x i1> %84, i64 7
br i1 %119, label %120, label %123
120: ; preds = %118
%121 = or i64 %75, 7
%122 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %121
store i8 48, i8* %122
br label %123
123: ; preds = %120, %118
%124 = extractelement <8 x i1> %85, i64 0
br i1 %124, label %125, label %128
125: ; preds = %123
%126 = or i64 %75, 8
%127 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %126
store i8 48, i8* %127
br label %128
128: ; preds = %125, %123
%129 = extractelement <8 x i1> %85, i64 1
br i1 %129, label %130, label %133
130: ; preds = %128
%131 = or i64 %75, 9
%132 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %131
store i8 48, i8* %132
br label %133
133: ; preds = %130, %128
%134 = extractelement <8 x i1> %85, i64 2
br i1 %134, label %135, label %138
135: ; preds = %133
%136 = or i64 %75, 10
%137 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %136
store i8 48, i8* %137
br label %138
138: ; preds = %135, %133
%139 = extractelement <8 x i1> %85, i64 3
br i1 %139, label %140, label %143
140: ; preds = %138
%141 = or i64 %75, 11
%142 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %141
store i8 48, i8* %142
br label %143
143: ; preds = %140, %138
%144 = extractelement <8 x i1> %85, i64 4
br i1 %144, label %145, label %148
145: ; preds = %143
%146 = or i64 %75, 12
%147 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %146
store i8 48, i8* %147
br label %148
148: ; preds = %145, %143
%149 = extractelement <8 x i1> %85, i64 5
br i1 %149, label %150, label %153
150: ; preds = %148
%151 = or i64 %75, 13
%152 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %151
store i8 48, i8* %152
br label %153
153: ; preds = %150, %148
%154 = extractelement <8 x i1> %85, i64 6
br i1 %154, label %155, label %158
155: ; preds = %153
%156 = or i64 %75, 14
%157 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %156
store i8 48, i8* %157
br label %158
158: ; preds = %155, %153
%159 = extractelement <8 x i1> %85, i64 7
br i1 %159, label %160, label %163
160: ; preds = %158
%161 = or i64 %75, 15
%162 = getelementptr [72 x i8], [72 x i8]* %4, i64 0, i64 %161
store i8 48, i8* %162
br label %163
163: ; preds = %160, %158
%164 = add nuw i64 %75, 16
%165 = icmp eq i64 %164, %72
br i1 %165, label %166, label %74
166: ; preds = %163
%167 = icmp eq i64 %69, %72
br i1 %167, label %179, label %168
168: ; preds = %63, %166
%169 = phi i8* [ %16, %63 ], [ %73, %166 ]
br label %170
170: ; preds = %168, %176
%171 = phi i8* [ %177, %176 ], [ %169, %168 ]
%172 = load i8, i8* %171
%173 = add i8 %172, -49
%174 = icmp ult i8 %173, 9
br i1 %174, label %175, label %176
175: ; preds = %170
store i8 48, i8* %171
br label %176
176: ; preds = %175, %170
%177 = getelementptr inbounds i8, i8* %171, i64 1
%178 = icmp ugt i8* %177, %61
br i1 %178, label %179, label %170
179: ; preds = %176, %166, %57
%180 = call i8* @wcsutil_dot_to_locale(i8* %16, i8* %8)
%181 = call i32 (i8*, i8*, ...) @sscanf(i8* %180, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%182 = icmp slt i32 %181, 1
br i1 %182, label %184, label %183
183: ; preds = %179, %55
br label %184
184: ; preds = %51, %34, %179, %183, %46
%185 = phi i32 [ %50, %46 ], [ 0, %183 ], [ 1, %179 ], [ 1, %34 ], [ 0, %51 ]
%186 = bitcast i32* %6 to i8*
br label %187
187: ; preds = %2, %184
%188 = phi i32 [ %185, %184 ], [ 1, %2 ]
ret i32 %188
}