// File: /workspace/github_cpp_makefile_star2_O1/RegulusImpact[P]sadboy/include/jsoncpp.cpp
// Function: Json::(anonymous namespace)::valueToString[abi:cxx11](double, bool, unsigned int, Json::PrecisionType)
JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int precision, PrecisionType precisionType) {
  // Allocate a buffer that is more than large enough to store the 16 digits of
  // precision requested below.
  char buffer[36];
  int len = -1;

  char formatString[15];
  if (precisionType == PrecisionType::significantDigits) {
    snprintf(formatString, sizeof(formatString), "%%.%ug", precision);
  } else {
    snprintf(formatString, sizeof(formatString), "%%.%uf", precision);
  }

  // Print into the buffer. We need not request the alternative representation
  // that always has a decimal point because JSON doesn't distinguish the
  // concepts of reals and integers.
  if (isfinite(value)) {
    len = snprintf(buffer, sizeof(buffer), formatString, value);
    fixNumericLocale(buffer, buffer + len);
    // to delete use-less too much zeros in the end of string
    if (precisionType == PrecisionType::decimalPlaces) {
      fixZerosInTheEnd(buffer, buffer + len);
    }

    // try to ensure we preserve the fact that this was given to us as a double on input
    if (!strchr(buffer, '.') && !strchr(buffer, 'e')) {
      strcat(buffer, ".0");
    }

  } else {
    // IEEE standard states that NaN values will not compare to themselves
    if (value != value) {
      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "NaN" : "null");
    } else if (value < 0) {
      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "-Infinity" : "-1e+9999");
    } else {
      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "Infinity" : "1e+9999");
    }
  }
  assert(len >= 0);
  return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %ecx, %r15d
movl %edx, %ecx
movl %esi, %r14d
movq %rdi, %rbx
movq %xmm0, -0x58(%rbp)
movq %xmm0, %r12
testl %r15d, %r15d
leaq 0xdfcc(%rip), %rax      # 0x1f49c
leaq 0xdfcc(%rip), %rdx      # 0x1f4a3
cmoveq %rax, %rdx
leaq -0x67(%rbp), %rdi
movl $0xf, %esi
xorl %eax, %eax
callq 0x4580
btrq $0x3f, %r12
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rax, %r12
jle 0x1152f
movsd -0x58(%rbp), %xmm1
ucomisd %xmm1, %xmm1
jp 0x1165c
pxor %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x115da
leaq 0xdf8e(%rip), %rax      # 0x1f4b1
leaq 0xdf91(%rip), %rdx      # 0x1f4bb
jmp 0x115e8
leaq -0x50(%rbp), %r12
leaq -0x67(%rbp), %rdx
movl $0x24, %esi
movq %r12, %rdi
movsd -0x58(%rbp), %xmm0
movb $0x1, %al
callq 0x4580
movl %eax, %r14d
movslq %eax, %rcx
leaq (%rcx,%rbp), %rax
addq $-0x50, %rax
testl %r14d, %r14d
jle 0x11574
xorl %edx, %edx
cmpb $0x2c, -0x50(%rbp,%rdx)
jne 0x1156c
movb $0x2e, -0x50(%rbp,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x11560
decq %rax
cmpq %r12, %rax
seta %cl
cmpl $0x1, %r15d
jne 0x1159d
testb %cl, %cl
je 0x1159d
cmpb $0x30, (%rax)
jne 0x1159d
cmpb $0x2e, -0x1(%rax)
je 0x11595
movb $0x0, (%rax)
decq %rax
cmpq %r12, %rax
ja 0x11587
leaq -0x50(%rbp), %rdi
movl $0x2e, %esi
callq 0x4140
testq %rax, %rax
jne 0x11602
leaq -0x50(%rbp), %rdi
movl $0x65, %esi
callq 0x4140
testq %rax, %rax
jne 0x11602
leaq -0x50(%rbp), %rdi
callq 0x4170
movw $0x302e, -0x50(%rbp,%rax) # imm = 0x302E
movb $0x0, -0x4e(%rbp,%rax)
jmp 0x11602
leaq 0xded1(%rip), %rax      # 0x1f4b2
leaq 0xded4(%rip), %rdx      # 0x1f4bc
testb %r14b, %r14b
cmovneq %rax, %rdx
leaq -0x50(%rbp), %rdi
movl $0x24, %esi
xorl %eax, %eax
callq 0x4580
movl %eax, %r14d
testl %r14d, %r14d
js 0x1163d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x4170
leaq (%rax,%rbp), %rdx
addq $-0x50, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x173f0
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xde80(%rip), %rdi      # 0x1f4c4
leaq 0xcf97(%rip), %rsi      # 0x1e5e2
leaq 0xde7b(%rip), %rcx      # 0x1f4cd
movl $0x10f0, %edx           # imm = 0x10F0
callq 0x4280
leaq 0xde4a(%rip), %rax      # 0x1f4ad
leaq 0xda97(%rip), %rdx      # 0x1f101
jmp 0x115e8