// File: /workspace/github_cpp_makefile_star2_O2/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, -0x30(%rbp)
movq %xmm0, %r12
testl %r15d, %r15d
leaq 0xcb24(%rip), %rax      # 0x1a499
leaq 0xcb24(%rip), %rdx      # 0x1a4a0
cmoveq %rax, %rdx
leaq -0x6f(%rbp), %rdi
pushq $0xf
popq %rsi
xorl %eax, %eax
callq 0x4550
btrq $0x3f, %r12
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rax, %r12
jle 0xd9d2
movsd -0x30(%rbp), %xmm1
ucomisd %xmm1, %xmm1
jp 0xdada
pxor %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0xda70
leaq 0xcae8(%rip), %rax      # 0x1a4ae
leaq 0xcaeb(%rip), %rdx      # 0x1a4b8
jmp 0xda7e
leaq -0x60(%rbp), %r12
pushq $0x24
popq %rsi
leaq -0x6f(%rbp), %rdx
movq %r12, %rdi
movsd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x4550
movl %eax, %r14d
cltq
addq %rbp, %rax
addq $-0x60, %rax
cmpq %rax, %r12
jae 0xda0e
cmpb $0x2c, (%r12)
jne 0xda09
movb $0x2e, (%r12)
incq %r12
jmp 0xd9f8
cmpl $0x1, %r15d
jne 0xda37
decq %rax
leaq -0x60(%rbp), %rcx
cmpq %rcx, %rax
jbe 0xda37
movq %rax, %rdx
cmpb $0x30, (%rax)
jne 0xda37
leaq -0x1(%rdx), %rax
cmpb $0x2e, -0x1(%rdx)
je 0xda1b
movb $0x0, (%rdx)
jmp 0xda1b
leaq -0x60(%rbp), %rdi
pushq $0x2e
popq %rsi
callq 0x4120
testq %rax, %rax
jne 0xda96
leaq -0x60(%rbp), %rdi
pushq $0x65
popq %rsi
callq 0x4120
testq %rax, %rax
jne 0xda96
leaq -0x60(%rbp), %rdi
callq 0x4150
movw $0x302e, -0x60(%rbp,%rax) # imm = 0x302E
movb $0x0, -0x5e(%rbp,%rax)
jmp 0xda96
leaq 0xca38(%rip), %rax      # 0x1a4af
leaq 0xca3b(%rip), %rdx      # 0x1a4b9
testb %r14b, %r14b
cmovneq %rax, %rdx
leaq -0x60(%rbp), %rdi
pushq $0x24
popq %rsi
xorl %eax, %eax
callq 0x4550
movl %eax, %r14d
testl %r14d, %r14d
js 0xdabb
leaq -0x60(%rbp), %rsi
leaq -0x21(%rbp), %rdx
movq %rbx, %rdi
callq 0x4130
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc9ff(%rip), %rdi      # 0x1a4c1
leaq 0xbb19(%rip), %rsi      # 0x195e2
leaq 0xc9fa(%rip), %rcx      # 0x1a4ca
movl $0x10f0, %edx           # imm = 0x10F0
callq 0x4270
leaq 0xc9c9(%rip), %rax      # 0x1a4aa
leaq 0xc616(%rip), %rdx      # 0x1a0fe
jmp 0xda7e