#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 DBL_MAX;
double DBL_MIN;
int LONG_MAX;
scalar_t__ isdigit(char);
scalar_t__ isspace(char);
int my_atof(char *string, double *pnumber) {
  double retval;
  double one_tenth = 0.1;
  double ten = 10.0;
  double zero = 0.0;
  int found_digits = 0;
  int is_negative = 0;
  char *num;
  if (pnumber == 0) {
    return 0;
  }
  if (string == 0) {
    *pnumber = zero;
    return 0;
  }
  retval = zero;
  num = string;
  while (isspace(*num))
    num++;
  if (*num == '+')
    num++;
  else if (*num == '-') {
    is_negative = 1;
    num++;
  }
  while (isdigit(*num)) {
    found_digits = 1;
    retval *= ten;
    retval += *num - '0';
    num++;
  }
  if (*num == '.') {
    double scale = one_tenth;
    num++;
    while (isdigit(*num)) {
      found_digits = 1;
      retval += scale * (*num - '0');
      num++;
      scale *= one_tenth;
    }
  }
  if (!found_digits) {
    *pnumber = zero;
    return 0;
  }
  if (retval == zero) {
    *pnumber = zero;
    return 1;
  }
  if ((*num == 'e') || (*num == 'E')) {
    int neg_exponent = 0;
    int get_out = 0;
    long index;
    long exponent = 0;
    double getting_too_big = DBL_MAX * one_tenth;
    double getting_too_small = DBL_MIN * ten;
    num++;
    if (*num == '+')
      num++;
    else if (*num == '-') {
      num++;
      neg_exponent = 1;
    }
    if (!isdigit(*num)) {
      if (is_negative)
        retval = -retval;
      *pnumber = retval;
      return (1);
    }
    while (isdigit(*num) && (exponent < LONG_MAX / 10)) {
      exponent *= 10;
      exponent += *num - '0';
      num++;
    }
    if (neg_exponent) {
      for (index = 1; index <= exponent && !get_out; index++)
        if (retval < getting_too_small) {
          get_out = 1;
          retval = DBL_MIN;
        } else
          retval *= one_tenth;
    } else
      for (index = 1; index <= exponent && !get_out; index++) {
        if (retval > getting_too_big) {
          get_out = 1;
          retval = DBL_MAX;
        } else
          retval *= ten;
      }
  }
  if (is_negative)
    retval = -retval;
  *pnumber = retval;
  return (1);
}


x86 assembly (clang, -O0):
<my_atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <my_atof+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1678 <my_atof+0x558>
cmpq   $0x0,-0x10(%rbp)
jne    119e <my_atof+0x7e>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1678 <my_atof+0x558>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     11d7 <my_atof+0xb7>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    11b0 <my_atof+0x90>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    11f8 <my_atof+0xd8>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1220 <my_atof+0x100>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    121b <my_atof+0xfb>
movl   $0x1,-0x40(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1220 <my_atof+0x100>
jmp    1225 <my_atof+0x105>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     127a <my_atof+0x15a>
movl   $0x1,-0x3c(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1225 <my_atof+0x105>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1307 <my_atof+0x1e7>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1302 <my_atof+0x1e2>
movl   $0x1,-0x3c(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cvtsi2sd %eax,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    12a0 <my_atof+0x180>
jmp    1307 <my_atof+0x1e7>
cmpl   $0x0,-0x3c(%rbp)
jne    132a <my_atof+0x20a>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1678 <my_atof+0x558>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
jne    1359 <my_atof+0x239>
jp     1359 <my_atof+0x239>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1678 <my_atof+0x558>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x65,%eax
je     1379 <my_atof+0x259>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x45,%eax
jne    1639 <my_atof+0x519>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movq   $0x0,-0x68(%rbp)
mov    0x2c42(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x2c25(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    13e6 <my_atof+0x2c6>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    140e <my_atof+0x2ee>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1409 <my_atof+0x2e9>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    140e <my_atof+0x2ee>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1468 <my_atof+0x348>
cmpl   $0x0,-0x40(%rbp)
je     144f <my_atof+0x32f>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1678 <my_atof+0x558>
jmp    146d <my_atof+0x34d>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x79(%rbp)
je     14bc <my_atof+0x39c>
mov    -0x68(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    0x2b43(%rip),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
setl   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    14cc <my_atof+0x3ac>
jmp    14fa <my_atof+0x3da>
imul   $0xa,-0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cltq
add    -0x68(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    146d <my_atof+0x34d>
cmpl   $0x0,-0x54(%rbp)
je     159e <my_atof+0x47e>
movq   $0x1,-0x60(%rbp)
mov    -0x60(%rbp),%rcx
xor    %eax,%eax
cmp    -0x68(%rbp),%rcx
mov    %al,-0x89(%rbp)
jg     1531 <my_atof+0x411>
cmpl   $0x0,-0x58(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x89(%rbp)
mov    -0x89(%rbp),%al
test   $0x1,%al
jne    1544 <my_atof+0x424>
jmp    1599 <my_atof+0x479>
movsd  -0x20(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1574 <my_atof+0x454>
movl   $0x1,-0x58(%rbp)
mov    0x2a6a(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1583 <my_atof+0x463>
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1588 <my_atof+0x468>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    150c <my_atof+0x3ec>
jmp    1634 <my_atof+0x514>
movq   $0x1,-0x60(%rbp)
mov    -0x60(%rbp),%rcx
xor    %eax,%eax
cmp    -0x68(%rbp),%rcx
mov    %al,-0x8a(%rbp)
jg     15cb <my_atof+0x4ab>
cmpl   $0x0,-0x58(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x8a(%rbp)
mov    -0x8a(%rbp),%al
test   $0x1,%al
jne    15de <my_atof+0x4be>
jmp    162f <my_atof+0x50f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    160a <my_atof+0x4ea>
movl   $0x1,-0x58(%rbp)
mov    0x29dc(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1619 <my_atof+0x4f9>
movsd  -0x30(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    161e <my_atof+0x4fe>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    15a6 <my_atof+0x486>
jmp    1634 <my_atof+0x514>
jmp    1639 <my_atof+0x519>
cmpl   $0x0,-0x40(%rbp)
je     1664 <my_atof+0x544>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atof>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
test   %rsi,%rsi
je     1172 <my_atof+0x52>
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %r14d,%r14d
test   %rdi,%rdi
je     1293 <my_atof+0x173>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl 0x0(%rbp),%edi
call   1040 <isspace@plt>
add    $0x1,%rbp
test   %rax,%rax
jne    1150 <my_atof+0x30>
mov    -0x1(%rbp),%al
cmp    $0x2b,%al
je     117e <my_atof+0x5e>
cmp    $0x2d,%al
jne    117a <my_atof+0x5a>
xor    %r12d,%r12d
jmp    1181 <my_atof+0x61>
xor    %r14d,%r14d
jmp    129c <my_atof+0x17c>
add    $0xffffffffffffffff,%rbp
mov    $0x1,%r12b
movsbl 0x0(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rbx
xorpd  %xmm1,%xmm1
test   %rax,%rax
je     11d6 <my_atof+0xb6>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x0(%rbp),%eax
add    $0xffffffd0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe4a(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
movsbl 0x1(%rbp),%edi
add    $0x1,%rbp
call   1030 <isdigit@plt>
movapd (%rsp),%xmm1
test   %rax,%rax
jne    11a0 <my_atof+0x80>
cmpb   $0x2e,0x0(%rbp)
jne    124d <my_atof+0x12d>
movapd %xmm1,(%rsp)
movsbl 0x1(%rbp),%edi
add    $0x1,%rbp
call   1030 <isdigit@plt>
test   %rax,%rax
je     1248 <my_atof+0x128>
movsd  0xe0d(%rip),%xmm2
movapd (%rsp),%xmm1
movsbl 0x0(%rbp),%eax
add    $0xffffffd0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mulsd  0xde5(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
movsbl 0x1(%rbp),%edi
add    $0x1,%rbp
call   1030 <isdigit@plt>
movsd  0x10(%rsp),%xmm2
movapd (%rsp),%xmm1
test   %rax,%rax
jne    1200 <my_atof+0xe0>
jmp    1252 <my_atof+0x132>
movapd (%rsp),%xmm1
test   %rbx,%rbx
je     1293 <my_atof+0x173>
mov    $0x1,%r14d
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1264 <my_atof+0x144>
jnp    1297 <my_atof+0x177>
mov    0x0(%rbp),%al
or     $0x20,%al
cmp    $0x65,%al
jne    12ae <my_atof+0x18e>
mov    0x2d64(%rip),%rcx
mov    0x2d55(%rip),%rdx
mov    0x1(%rbp),%al
cmp    $0x2d,%al
movapd %xmm1,(%rsp)
je     12b7 <my_atof+0x197>
mov    $0x1,%bl
cmp    $0x2b,%al
jne    12bf <my_atof+0x19f>
add    $0x2,%rbp
jmp    12c3 <my_atof+0x1a3>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%r15)
mov    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movapd %xmm1,%xmm0
jmp    1480 <my_atof+0x360>
add    $0x2,%rbp
xor    %ebx,%ebx
jmp    12c3 <my_atof+0x1a3>
add    $0x1,%rbp
movsd  (%rcx),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x18(%rsp)
movsbl 0x0(%rbp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     13fd <my_atof+0x2dd>
movsbl 0x0(%rbp),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     140c <my_atof+0x2ec>
mov    %ebx,0x24(%rsp)
movsd  0x10(%rsp),%xmm6
mulsd  0xcfb(%rip),%xmm6
movsd  0x18(%rsp),%xmm0
mulsd  0xce5(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
add    $0x1,%rbp
xor    %ebx,%ebx
mov    0x2cb2(%rip),%r13
movsd  %xmm6,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq 0x0(%r13),%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cltq
cmp    %rax,%rbx
jge    1388 <my_atof+0x268>
lea    (%rbx,%rbx,4),%rax
movsbq -0x1(%rbp),%rcx
lea    (%rcx,%rax,2),%rbx
add    $0xffffffffffffffd0,%rbx
movsbl 0x0(%rbp),%edi
call   1030 <isdigit@plt>
movsd  0x10(%rsp),%xmm6
add    $0x1,%rbp
test   %rax,%rax
jne    1340 <my_atof+0x220>
cmpb   $0x0,0x24(%rsp)
movapd (%rsp),%xmm5
je     1413 <my_atof+0x2f3>
test   %rbx,%rbx
jle    147c <my_atof+0x35c>
mov    0x2c34(%rip),%rax
movsd  (%rax),%xmm1
mov    $0x1,%eax
movsd  0xc4b(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
movapd %xmm5,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm6,%xmm0
cmpltsd %xmm5,%xmm0
movapd %xmm0,%xmm4
andpd  %xmm1,%xmm4
andnpd %xmm3,%xmm0
orpd   %xmm4,%xmm0
cmp    %rbx,%rax
jge    1480 <my_atof+0x360>
add    $0x1,%rax
ucomisd %xmm6,%xmm5
movapd %xmm0,%xmm5
jbe    13c0 <my_atof+0x2a0>
jmp    1480 <my_atof+0x360>
test   %r12b,%r12b
jne    1472 <my_atof+0x352>
movapd (%rsp),%xmm0
jmp    1489 <my_atof+0x369>
movapd (%rsp),%xmm0
jmp    1480 <my_atof+0x360>
test   %rbx,%rbx
jle    147c <my_atof+0x35c>
mov    0x2bb1(%rip),%rax
movsd  (%rax),%xmm1
mov    $0x1,%eax
movsd  0xbd8(%rip),%xmm2
movapd %xmm5,%xmm0
movsd  0x18(%rsp),%xmm6
nopw   0x0(%rax,%rax,1)
movapd %xmm5,%xmm3
mulsd  %xmm2,%xmm3
cmpltsd %xmm6,%xmm0
movapd %xmm0,%xmm4
andpd  %xmm1,%xmm4
andnpd %xmm3,%xmm0
orpd   %xmm4,%xmm0
cmp    %rbx,%rax
jge    1480 <my_atof+0x360>
add    $0x1,%rax
ucomisd %xmm5,%xmm6
movapd %xmm0,%xmm5
jbe    1440 <my_atof+0x320>
jmp    1480 <my_atof+0x360>
movapd (%rsp),%xmm0
jmp    1297 <my_atof+0x177>
movapd %xmm5,%xmm0
test   %r12b,%r12b
jne    1297 <my_atof+0x177>
xorpd  0xb7f(%rip),%xmm0
jmp    1297 <my_atof+0x177>

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@LONG_MAX = global i32 0
define i32 @my_atof(i8* %0, double* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
%18 = alloca double
%19 = alloca double
store i8* %0, i8** %4
store double* %1, double** %5
store double 1.000000e-01, double* %7
store double 1.000000e+01, double* %8
store double 0.000000e+00, double* %9
store i32 0, i32* %10
store i32 0, i32* %11
%20 = load double*, double** %5
%21 = icmp eq double* %20, null
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 0, i32* %3
br label %258
23: ; preds = %2
%24 = load i8*, i8** %4
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load double, double* %9
%28 = load double*, double** %5
store double %27, double* %28
store i32 0, i32* %3
br label %258
29: ; preds = %23
%30 = load double, double* %9
store double %30, double* %6
%31 = load i8*, i8** %4
store i8* %31, i8** %12
br label %32
32: ; preds = %37, %29
%33 = load i8*, i8** %12
%34 = load i8, i8* %33
%35 = call i64 @isspace(i8 signext %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %12
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %12
br label %32
40: ; preds = %32
%41 = load i8*, i8** %12
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 43
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = load i8*, i8** %12
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %12
br label %57
48: ; preds = %40
%49 = load i8*, i8** %12
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 45
br i1 %52, label %53, label %56
53: ; preds = %48
store i32 1, i32* %11
%54 = load i8*, i8** %12
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %12
br label %56
56: ; preds = %53, %48
br label %57
57: ; preds = %56, %45
br label %58
58: ; preds = %63, %57
%59 = load i8*, i8** %12
%60 = load i8, i8* %59
%61 = call i64 @isdigit(i8 signext %60)
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %76
63: ; preds = %58
store i32 1, i32* %10
%64 = load double, double* %8
%65 = load double, double* %6
%66 = fmul double %65, %64
store double %66, double* %6
%67 = load i8*, i8** %12
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = sub nsw i32 %69, 48
%71 = sitofp i32 %70 to double
%72 = load double, double* %6
%73 = fadd double %72, %71
store double %73, double* %6
%74 = load i8*, i8** %12
%75 = getelementptr inbounds i8, i8* %74, i32 1
store i8* %75, i8** %12
br label %58
76: ; preds = %58
%77 = load i8*, i8** %12
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 46
br i1 %80, label %81, label %105
81: ; preds = %76
%82 = load double, double* %7
store double %82, double* %13
%83 = load i8*, i8** %12
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %12
br label %85
85: ; preds = %90, %81
%86 = load i8*, i8** %12
%87 = load i8, i8* %86
%88 = call i64 @isdigit(i8 signext %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %104
90: ; preds = %85
store i32 1, i32* %10
%91 = load double, double* %13
%92 = load i8*, i8** %12
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = sub nsw i32 %94, 48
%96 = sitofp i32 %95 to double
%97 = load double, double* %6
%98 = call double @llvm.fmuladd.f64(double %91, double %96, double %97)
store double %98, double* %6
%99 = load i8*, i8** %12
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %12
%101 = load double, double* %7
%102 = load double, double* %13
%103 = fmul double %102, %101
store double %103, double* %13
br label %85
104: ; preds = %85
br label %105
105: ; preds = %104, %76
%106 = load i32, i32* %10
%107 = icmp ne i32 %106, 0
br i1 %107, label %111, label %108
108: ; preds = %105
%109 = load double, double* %9
%110 = load double*, double** %5
store double %109, double* %110
store i32 0, i32* %3
br label %258
111: ; preds = %105
%112 = load double, double* %6
%113 = load double, double* %9
%114 = fcmp oeq double %112, %113
br i1 %114, label %115, label %118
115: ; preds = %111
%116 = load double, double* %9
%117 = load double*, double** %5
store double %116, double* %117
store i32 1, i32* %3
br label %258
118: ; preds = %111
%119 = load i8*, i8** %12
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 101
br i1 %122, label %128, label %123
123: ; preds = %118
%124 = load i8*, i8** %12
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = icmp eq i32 %126, 69
br i1 %127, label %128, label %249
128: ; preds = %123, %118
store i32 0, i32* %14
store i32 0, i32* %15
store i64 0, i64* %17
%129 = load double, double* @DBL_MAX
%130 = load double, double* %7
%131 = fmul double %129, %130
store double %131, double* %18
%132 = load double, double* @DBL_MIN
%133 = load double, double* %8
%134 = fmul double %132, %133
store double %134, double* %19
%135 = load i8*, i8** %12
%136 = getelementptr inbounds i8, i8* %135, i32 1
store i8* %136, i8** %12
%137 = load i8*, i8** %12
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 43
br i1 %140, label %141, label %144
141: ; preds = %128
%142 = load i8*, i8** %12
%143 = getelementptr inbounds i8, i8* %142, i32 1
store i8* %143, i8** %12
br label %153
144: ; preds = %128
%145 = load i8*, i8** %12
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 45
br i1 %148, label %149, label %152
149: ; preds = %144
%150 = load i8*, i8** %12
%151 = getelementptr inbounds i8, i8* %150, i32 1
store i8* %151, i8** %12
store i32 1, i32* %14
br label %152
152: ; preds = %149, %144
br label %153
153: ; preds = %152, %141
%154 = load i8*, i8** %12
%155 = load i8, i8* %154
%156 = call i64 @isdigit(i8 signext %155)
%157 = icmp ne i64 %156, 0
br i1 %157, label %167, label %158
158: ; preds = %153
%159 = load i32, i32* %11
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %164
161: ; preds = %158
%162 = load double, double* %6
%163 = fneg double %162
store double %163, double* %6
br label %164
164: ; preds = %161, %158
%165 = load double, double* %6
%166 = load double*, double** %5
store double %165, double* %166
store i32 1, i32* %3
br label %258
167: ; preds = %153
br label %168
168: ; preds = %181, %167
%169 = load i8*, i8** %12
%170 = load i8, i8* %169
%171 = call i64 @isdigit(i8 signext %170)
%172 = icmp ne i64 %171, 0
br i1 %172, label %173, label %179
173: ; preds = %168
%174 = load i64, i64* %17
%175 = load i32, i32* @LONG_MAX
%176 = sdiv i32 %175, 10
%177 = sext i32 %176 to i64
%178 = icmp slt i64 %174, %177
br label %179
179: ; preds = %173, %168
%180 = phi i1 [ false, %168 ], [ %178, %173 ]
br i1 %180, label %181, label %193
181: ; preds = %179
%182 = load i64, i64* %17
%183 = mul nsw i64 %182, 10
store i64 %183, i64* %17
%184 = load i8*, i8** %12
%185 = load i8, i8* %184
%186 = sext i8 %185 to i32
%187 = sub nsw i32 %186, 48
%188 = sext i32 %187 to i64
%189 = load i64, i64* %17
%190 = add nsw i64 %189, %188
store i64 %190, i64* %17
%191 = load i8*, i8** %12
%192 = getelementptr inbounds i8, i8* %191, i32 1
store i8* %192, i8** %12
br label %168
193: ; preds = %179
%194 = load i32, i32* %14
%195 = icmp ne i32 %194, 0
br i1 %195, label %196, label %222
196: ; preds = %193
store i64 1, i64* %16
br label %197
197: ; preds = %218, %196
%198 = load i64, i64* %16
%199 = load i64, i64* %17
%200 = icmp sle i64 %198, %199
br i1 %200, label %201, label %205
201: ; preds = %197
%202 = load i32, i32* %15
%203 = icmp ne i32 %202, 0
%204 = xor i1 %203, true
br label %205
205: ; preds = %201, %197
%206 = phi i1 [ false, %197 ], [ %204, %201 ]
br i1 %206, label %207, label %221
207: ; preds = %205
%208 = load double, double* %6
%209 = load double, double* %19
%210 = fcmp olt double %208, %209
br i1 %210, label %211, label %213
211: ; preds = %207
store i32 1, i32* %15
%212 = load double, double* @DBL_MIN
store double %212, double* %6
br label %217
213: ; preds = %207
%214 = load double, double* %7
%215 = load double, double* %6
%216 = fmul double %215, %214
store double %216, double* %6
br label %217
217: ; preds = %213, %211
br label %218
218: ; preds = %217
%219 = load i64, i64* %16
%220 = add nsw i64 %219, 1
store i64 %220, i64* %16
br label %197
221: ; preds = %205
br label %248
222: ; preds = %193
store i64 1, i64* %16
br label %223
223: ; preds = %244, %222
%224 = load i64, i64* %16
%225 = load i64, i64* %17
%226 = icmp sle i64 %224, %225
br i1 %226, label %227, label %231
227: ; preds = %223
%228 = load i32, i32* %15
%229 = icmp ne i32 %228, 0
%230 = xor i1 %229, true
br label %231
231: ; preds = %227, %223
%232 = phi i1 [ false, %223 ], [ %230, %227 ]
br i1 %232, label %233, label %247
233: ; preds = %231
%234 = load double, double* %6
%235 = load double, double* %18
%236 = fcmp ogt double %234, %235
br i1 %236, label %237, label %239
237: ; preds = %233
store i32 1, i32* %15
%238 = load double, double* @DBL_MAX
store double %238, double* %6
br label %243
239: ; preds = %233
%240 = load double, double* %8
%241 = load double, double* %6
%242 = fmul double %241, %240
store double %242, double* %6
br label %243
243: ; preds = %239, %237
br label %244
244: ; preds = %243
%245 = load i64, i64* %16
%246 = add nsw i64 %245, 1
store i64 %246, i64* %16
br label %223
247: ; preds = %231
br label %248
248: ; preds = %247, %221
br label %249
249: ; preds = %248, %123
%250 = load i32, i32* %11
%251 = icmp ne i32 %250, 0
br i1 %251, label %252, label %255
252: ; preds = %249
%253 = load double, double* %6
%254 = fneg double %253
store double %254, double* %6
br label %255
255: ; preds = %252, %249
%256 = load double, double* %6
%257 = load double*, double** %5
store double %256, double* %257
store i32 1, i32* %3
br label %258
258: ; preds = %255, %164, %115, %108, %26, %22
%259 = load i32, i32* %3
ret i32 %259
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@LONG_MAX = global i32 0
define i32 @my_atof(i8* %0, double* writeonly %1) {
%3 = icmp eq double* %1, null
br i1 %3, label %144, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %141, label %6
6: ; preds = %4, %6
%7 = phi i8* [ %11, %6 ], [ %0, %4 ]
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
%11 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %10, label %12, label %6
12: ; preds = %6
%13 = load i8, i8* %7
switch i8 %13, label %16 [
i8 43, label %14
i8 45, label %15
]
14: ; preds = %12
br label %16
15: ; preds = %12
br label %16
16: ; preds = %12, %15, %14
%17 = phi i1 [ false, %15 ], [ true, %14 ], [ true, %12 ]
%18 = phi i8* [ %11, %15 ], [ %11, %14 ], [ %7, %12 ]
%19 = load i8, i8* %18
%20 = tail call i64 @isdigit(i8 signext %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %35, label %22
22: ; preds = %16, %22
%23 = phi double [ %30, %22 ], [ 0.000000e+00, %16 ]
%24 = phi i8* [ %31, %22 ], [ %18, %16 ]
%25 = fmul double %23, 1.000000e+01
%26 = load i8, i8* %24
%27 = sext i8 %26 to i32
%28 = add nsw i32 %27, -48
%29 = sitofp i32 %28 to double
%30 = fadd double %25, %29
%31 = getelementptr inbounds i8, i8* %24, i64 1
%32 = load i8, i8* %31
%33 = tail call i64 @isdigit(i8 signext %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %22
35: ; preds = %22, %16
%36 = phi i8* [ %18, %16 ], [ %31, %22 ]
%37 = phi double [ 0.000000e+00, %16 ], [ %30, %22 ]
%38 = load i8, i8* %36
%39 = icmp eq i8 %38, 46
br i1 %39, label %40, label %59
40: ; preds = %35
%41 = getelementptr inbounds i8, i8* %36, i64 1
%42 = load i8, i8* %41
%43 = tail call i64 @isdigit(i8 signext %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %59, label %45
45: ; preds = %40, %45
%46 = phi i8* [ %55, %45 ], [ %41, %40 ]
%47 = phi double [ %53, %45 ], [ %37, %40 ]
%48 = phi double [ %54, %45 ], [ 1.000000e-01, %40 ]
%49 = load i8, i8* %46
%50 = sext i8 %49 to i32
%51 = add nsw i32 %50, -48
%52 = sitofp i32 %51 to double
%53 = tail call double @llvm.fmuladd.f64(double %48, double %52, double %47)
%54 = fmul double %48, 1.000000e-01
%55 = getelementptr inbounds i8, i8* %46, i64 1
%56 = load i8, i8* %55
%57 = tail call i64 @isdigit(i8 signext %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %61, label %45
59: ; preds = %40, %35
%60 = phi i8* [ %36, %35 ], [ %41, %40 ]
br i1 %21, label %141, label %61
61: ; preds = %45, %59
%62 = phi double [ %37, %59 ], [ %53, %45 ]
%63 = phi i8* [ %60, %59 ], [ %55, %45 ]
%64 = fcmp oeq double %62, 0.000000e+00
br i1 %64, label %141, label %65
65: ; preds = %61
%66 = load i8, i8* %63
switch i8 %66, label %137 [
i8 101, label %67
i8 69, label %67
]
67: ; preds = %65, %65
%68 = load double, double* @DBL_MAX
%69 = fmul double %68, 1.000000e-01
%70 = load double, double* @DBL_MIN
%71 = fmul double %70, 1.000000e+01
%72 = getelementptr inbounds i8, i8* %63, i64 1
%73 = load i8, i8* %72
switch i8 %73, label %78 [
i8 43, label %74
i8 45, label %76
]
74: ; preds = %67
%75 = getelementptr inbounds i8, i8* %63, i64 2
br label %78
76: ; preds = %67
%77 = getelementptr inbounds i8, i8* %63, i64 2
br label %78
78: ; preds = %67, %76, %74
%79 = phi i8* [ %75, %74 ], [ %77, %76 ], [ %72, %67 ]
%80 = phi i1 [ true, %74 ], [ false, %76 ], [ true, %67 ]
%81 = load i8, i8* %79
%82 = tail call i64 @isdigit(i8 signext %81)
%83 = icmp eq i64 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %78
%85 = load i8, i8* %79
%86 = tail call i64 @isdigit(i8 signext %85)
%87 = icmp eq i64 %86, 0
br i1 %87, label %137, label %91
88: ; preds = %78
%89 = fneg double %62
%90 = select i1 %17, double %62, double %89
br label %141
91: ; preds = %84, %98
%92 = phi i64 [ %103, %98 ], [ 0, %84 ]
%93 = phi i8* [ %104, %98 ], [ %79, %84 ]
%94 = load i32, i32* @LONG_MAX
%95 = sdiv i32 %94, 10
%96 = sext i32 %95 to i64
%97 = icmp slt i64 %92, %96
br i1 %97, label %98, label %108
98: ; preds = %91
%99 = mul nsw i64 %92, 10
%100 = load i8, i8* %93
%101 = sext i8 %100 to i64
%102 = add i64 %99, -48
%103 = add i64 %102, %101
%104 = getelementptr inbounds i8, i8* %93, i64 1
%105 = load i8, i8* %104
%106 = tail call i64 @isdigit(i8 signext %105)
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %91
108: ; preds = %91, %98
%109 = phi i64 [ %92, %91 ], [ %103, %98 ]
%110 = icmp sgt i64 %109, 0
br i1 %80, label %114, label %111
111: ; preds = %108
br i1 %110, label %112, label %137
112: ; preds = %111
%113 = load double, double* @DBL_MIN
br label %117
114: ; preds = %108
br i1 %110, label %115, label %137
115: ; preds = %114
%116 = load double, double* @DBL_MAX
br label %127
117: ; preds = %112, %117
%118 = phi double [ %62, %112 ], [ %122, %117 ]
%119 = phi i64 [ 1, %112 ], [ %123, %117 ]
%120 = fcmp olt double %118, %71
%121 = fmul double %118, 1.000000e-01
%122 = select i1 %120, double %113, double %121
%123 = add nuw nsw i64 %119, 1
%124 = icmp slt i64 %119, %109
%125 = xor i1 %120, true
%126 = select i1 %124, i1 %125, i1 false
br i1 %126, label %117, label %137
127: ; preds = %115, %127
%128 = phi double [ %62, %115 ], [ %132, %127 ]
%129 = phi i64 [ 1, %115 ], [ %133, %127 ]
%130 = fcmp ogt double %128, %69
%131 = fmul double %128, 1.000000e+01
%132 = select i1 %130, double %116, double %131
%133 = add nuw nsw i64 %129, 1
%134 = icmp slt i64 %129, %109
%135 = xor i1 %130, true
%136 = select i1 %134, i1 %135, i1 false
br i1 %136, label %127, label %137
137: ; preds = %117, %127, %84, %114, %111, %65
%138 = phi double [ %62, %65 ], [ %62, %114 ], [ %62, %111 ], [ %62, %84 ], [ %132, %127 ], [ %122, %117 ]
%139 = fneg double %138
%140 = select i1 %17, double %138, double %139
br label %141
141: ; preds = %61, %59, %4, %137, %88
%142 = phi double [ %90, %88 ], [ %140, %137 ], [ 0.000000e+00, %4 ], [ 0.000000e+00, %59 ], [ 0.000000e+00, %61 ]
%143 = phi i32 [ 1, %88 ], [ 1, %137 ], [ 0, %4 ], [ 0, %59 ], [ 1, %61 ]
store double %142, double* %1
br label %144
144: ; preds = %141, %2
%145 = phi i32 [ 0, %2 ], [ %143, %141 ]
ret i32 %145
}