// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/sqlite3.c
// Function: sqlite3AtoF
SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
#ifndef SQLITE_OMIT_FLOATING_POINT
  int incr;
  const char *zEnd = z + length;
  /* sign * significand * (10 ^ (esign * exponent)) */
  int sign = 1;    /* sign of significand */
  i64 s = 0;       /* significand */
  int d = 0;       /* adjust exponent for shifting decimal point */
  int esign = 1;   /* sign of exponent */
  int e = 0;       /* exponent */
  int eValid = 1;  /* True exponent is either not used or is well-formed */
  double result;
  int nDigits = 0;
  int nonNum = 0;  /* True if input contains UTF16 with high byte non-zero */

  assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
  *pResult = 0.0;   /* Default return value, in case of an error */

  if( enc==SQLITE_UTF8 ){
    incr = 1;
  }else{
    int i;
    incr = 2;
    assert( SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );
    for(i=3-enc; i<length && z[i]==0; i+=2){}
    nonNum = i<length;
    zEnd = &z[i^1];
    z += (enc&1);
  }

  /* skip leading spaces */
  while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;
  if( z>=zEnd ) return 0;

  /* get sign of significand */
  if( *z=='-' ){
    sign = -1;
    z+=incr;
  }else if( *z=='+' ){
    z+=incr;
  }

  /* copy max significant digits to significand */
  while( z<zEnd && sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){
    s = s*10 + (*z - '0');
    z+=incr; nDigits++;
  }

  /* skip non-significant significand digits
  ** (increase exponent by d to shift decimal left) */
  while( z<zEnd && sqlite3Isdigit(*z) ){ z+=incr; nDigits++; d++; }
  if( z>=zEnd ) goto do_atof_calc;

  /* if decimal point is present */
  if( *z=='.' ){
    z+=incr;
    /* copy digits from after decimal to significand
    ** (decrease exponent by d to shift decimal right) */
    while( z<zEnd && sqlite3Isdigit(*z) ){
      if( s<((LARGEST_INT64-9)/10) ){
        s = s*10 + (*z - '0');
        d--;
      }
      z+=incr; nDigits++;
    }
  }
  if( z>=zEnd ) goto do_atof_calc;

  /* if exponent is present */
  if( *z=='e' || *z=='E' ){
    z+=incr;
    eValid = 0;

    /* This branch is needed to avoid a (harmless) buffer overread.  The 
    ** special comment alerts the mutation tester that the correct answer
    ** is obtained even if the branch is omitted */
    if( z>=zEnd ) goto do_atof_calc;              /*PREVENTS-HARMLESS-OVERREAD*/

    /* get sign of exponent */
    if( *z=='-' ){
      esign = -1;
      z+=incr;
    }else if( *z=='+' ){
      z+=incr;
    }
    /* copy digits to exponent */
    while( z<zEnd && sqlite3Isdigit(*z) ){
      e = e<10000 ? (e*10 + (*z - '0')) : 10000;
      z+=incr;
      eValid = 1;
    }
  }

  /* skip trailing spaces */
  while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;

do_atof_calc:
  /* adjust exponent by d, and update sign */
  e = (e*esign) + d;
  if( e<0 ) {
    esign = -1;
    e *= -1;
  } else {
    esign = 1;
  }

  if( s==0 ) {
    /* In the IEEE 754 standard, zero is signed. */
    result = sign<0 ? -(double)0 : (double)0;
  } else {
    /* Attempt to reduce exponent.
    **
    ** Branches that are not required for the correct answer but which only
    ** help to obtain the correct answer faster are marked with special
    ** comments, as a hint to the mutation tester.
    */
    while( e>0 ){                                       /*OPTIMIZATION-IF-TRUE*/
      if( esign>0 ){
        if( s>=(LARGEST_INT64/10) ) break;             /*OPTIMIZATION-IF-FALSE*/
        s *= 10;
      }else{
        if( s%10!=0 ) break;                           /*OPTIMIZATION-IF-FALSE*/
        s /= 10;
      }
      e--;
    }

    /* adjust the sign of significand */
    s = sign<0 ? -s : s;

    if( e==0 ){                                         /*OPTIMIZATION-IF-TRUE*/
      result = (double)s;
    }else{
      /* attempt to handle extremely small/large numbers better */
      if( e>307 ){                                      /*OPTIMIZATION-IF-TRUE*/
        if( e<342 ){                                    /*OPTIMIZATION-IF-TRUE*/
          LONGDOUBLE_TYPE scale = sqlite3Pow10(e-308);
          if( esign<0 ){
            result = s / scale;
            result /= 1.0e+308;
          }else{
            result = s * scale;
            result *= 1.0e+308;
          }
        }else{ assert( e>=342 );
          if( esign<0 ){
            result = 0.0*s;
          }else{
#ifdef INFINITY
            result = INFINITY*s;
#else
            result = 1e308*1e308*s;  /* Infinity */
#endif
          }
        }
      }else{
        LONGDOUBLE_TYPE scale = sqlite3Pow10(e);
        if( esign<0 ){
          result = s / scale;
        }else{
          result = s * scale;
        }
      }
    }
  }

  /* store the result */
  *pResult = result;

  /* return true if number and no extra non-whitespace chracters after */
  return z==zEnd && nDigits>0 && eValid && nonNum==0;
#else
  return !sqlite3Atoi64(z, pResult, length, enc);
#endif /* SQLITE_OMIT_FLOATING_POINT */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x34(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x1, -0x50(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movq -0x18(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movzbl -0x1d(%rbp), %eax
cmpl $0x1, %eax
jne 0x434133
movl $0x1, -0x24(%rbp)
jmp 0x4341c3
movl $0x2, -0x24(%rbp)
movzbl -0x1d(%rbp), %ecx
movl $0x3, %eax
subl %ecx, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %ecx
xorl %eax, %eax
cmpl -0x1c(%rbp), %ecx
movb %al, -0xd1(%rbp)
jge 0x434170
movq -0x10(%rbp), %rax
movslq -0x64(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0xd1(%rbp)
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x43417c
jmp 0x434189
jmp 0x43417e
movl -0x64(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x64(%rbp)
jmp 0x434148
movl -0x64(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl -0x64(%rbp), %ecx
xorl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movzbl -0x1d(%rbp), %ecx
andl $0x1, %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x4341c5
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xd2(%rbp)
jae 0x4341fa
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x146069(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xd2(%rbp)
movb -0xd2(%rbp), %al
testb $0x1, %al
jne 0x434206
jmp 0x434219
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x4341c5
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x43422f
movl $0x0, -0x4(%rbp)
jmp 0x43487e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x434255
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x434274
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x434272
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x434274
jmp 0x434276
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xd3(%rbp)
jae 0x4342c3
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x145fb8(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %ecx
andl $0x4, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd3(%rbp)
je 0x4342c3
movabsq $0xccccccccccccccb, %rax # imm = 0xCCCCCCCCCCCCCCB
cmpq %rax, -0x40(%rbp)
setl %al
movb %al, -0xd3(%rbp)
movb -0xd3(%rbp), %al
testb $0x1, %al
jne 0x4342cf
jmp 0x434307
imulq $0xa, -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x434276
jmp 0x434309
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xd4(%rbp)
jae 0x43433e
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x145f25(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xd4(%rbp)
movb -0xd4(%rbp), %al
testb $0x1, %al
jne 0x43434a
jmp 0x43436f
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x434309
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x43437e
jmp 0x4345bb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x434433
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xd5(%rbp)
jae 0x4343d4
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x145e8f(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xd5(%rbp)
movb -0xd5(%rbp), %al
testb $0x1, %al
jne 0x4343e0
jmp 0x434431
movabsq $0xccccccccccccccb, %rax # imm = 0xCCCCCCCCCCCCCCB
cmpq %rax, -0x40(%rbp)
jge 0x434412
imulq $0xa, -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x43439f
jmp 0x434433
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x434442
jmp 0x4345bb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
je 0x43445e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x45, %eax
jne 0x434563
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x434485
jmp 0x4345bb
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x4344ab
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x4344ca
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x4344c8
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x4344ca
jmp 0x4344cc
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xd6(%rbp)
jae 0x434501
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x145d62(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xd6(%rbp)
movb -0xd6(%rbp), %al
testb $0x1, %al
jne 0x43450d
jmp 0x434561
cmpl $0x2710, -0x4c(%rbp)    # imm = 0x2710
jge 0x43452e
imull $0xa, -0x4c(%rbp), %eax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0xdc(%rbp)
jmp 0x43453b
movl $0x2710, %eax           # imm = 0x2710
movl %eax, -0xdc(%rbp)
jmp 0x43453b
movl -0xdc(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x4344cc
jmp 0x434563
jmp 0x434565
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xdd(%rbp)
jae 0x43459a
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x145cc9(%rip), %rax    # 0x57a250
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xdd(%rbp)
movb -0xdd(%rbp), %al
testb $0x1, %al
jne 0x4345a6
jmp 0x4345b9
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x434565
jmp 0x4345bb
movl -0x4c(%rbp), %eax
imull -0x48(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jge 0x4345de
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
imull $-0x1, -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x4345e5
movl $0x1, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x434631
movl -0x34(%rbp), %eax
movsd 0x149b71(%rip), %xmm0   # 0x57e168
xorps %xmm1, %xmm1
movsd %xmm1, -0xf0(%rbp)
cmpl $0x0, %eax
movsd %xmm0, -0xe8(%rbp)
jl 0x43461f
movsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x434828
jmp 0x434633
cmpl $0x0, -0x4c(%rbp)
jle 0x43468f
cmpl $0x0, -0x48(%rbp)
jle 0x43465c
movabsq $0xccccccccccccccc, %rax # imm = 0xCCCCCCCCCCCCCCC
cmpq %rax, -0x40(%rbp)
jl 0x434651
jmp 0x43468f
imulq $0xa, -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x434684
movq -0x40(%rbp), %rax
movl $0xa, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x434672
jmp 0x43468f
movq -0x40(%rbp), %rax
movl $0xa, %ecx
cqto
idivq %rcx
movq %rax, -0x40(%rbp)
movl -0x4c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x434633
cmpl $0x0, -0x34(%rbp)
jge 0x4346a4
xorl %eax, %eax
subq -0x40(%rbp), %rax
movq %rax, -0xf8(%rbp)
jmp 0x4346af
movq -0x40(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x4346d0
cvtsi2sdq -0x40(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x434826
cmpl $0x133, -0x4c(%rbp)     # imm = 0x133
jle 0x4347b4
cmpl $0x156, -0x4c(%rbp)     # imm = 0x156
jge 0x43477f
movl -0x4c(%rbp), %edi
addl $0xfffffecc, %edi       # imm = 0xFFFFFECC
callq 0x434890
fstpt -0x80(%rbp)
cmpl $0x0, -0x48(%rbp)
jge 0x434742
movq -0x40(%rbp), %rax
movq %rax, -0xc8(%rbp)
fildll -0xc8(%rbp)
fldt -0x80(%rbp)
fdivrp %st, %st(1)
fstpl -0xd0(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x149a29(%rip), %xmm1   # 0x57e160
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x43477d
movq -0x40(%rbp), %rax
movq %rax, -0xb8(%rbp)
fildll -0xb8(%rbp)
fldt -0x80(%rbp)
fmulp %st, %st(1)
fstpl -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd 0x1499ed(%rip), %xmm0   # 0x57e160
mulsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x4347b2
cmpl $0x0, -0x48(%rbp)
jge 0x434799
cvtsi2sdq -0x40(%rbp), %xmm1
xorps %xmm0, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x4347b0
cvtsi2sdq -0x40(%rbp), %xmm1
movsd 0x1499b1(%rip), %xmm0   # 0x57e158
mulsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x4347b2
jmp 0x434824
movl -0x4c(%rbp), %edi
callq 0x434890
fstpt -0x90(%rbp)
cmpl $0x0, -0x48(%rbp)
jge 0x4347f6
movq -0x40(%rbp), %rax
movq %rax, -0xa8(%rbp)
fildll -0xa8(%rbp)
fldt -0x90(%rbp)
fdivrp %st, %st(1)
fstpl -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x434822
movq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
fildll -0x98(%rbp)
fldt -0x90(%rbp)
fmulp %st, %st(1)
fstpl -0xa0(%rbp)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x434824
jmp 0x434826
jmp 0x434828
movsd -0x58(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0xf9(%rbp)
jne 0x434870
xorl %eax, %eax
cmpl $0x0, -0x5c(%rbp)
movb %al, -0xf9(%rbp)
jle 0x434870
xorl %eax, %eax
cmpl $0x0, -0x50(%rbp)
movb %al, -0xf9(%rbp)
je 0x434870
cmpl $0x0, -0x60(%rbp)
sete %al
movb %al, -0xf9(%rbp)
movb -0xf9(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw (%rax,%rax)