// File: /workspace/github_cpp_makefile_star2_O3/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, %r12d
movl %edx, %ecx
movl %esi, %r14d
movq %rdi, %rbx
movq %xmm0, -0x58(%rbp)
movq %xmm0, %r15
testl %r12d, %r12d
leaq 0xcfbb(%rip), %rax      # 0x1d499
leaq 0xcfbb(%rip), %rdx      # 0x1d4a0
cmoveq %rax, %rdx
leaq -0x67(%rbp), %rdi
movl $0xf, %esi
xorl %eax, %eax
callq 0x4570
btrq $0x3f, %r15
movabsq $0x7fefffffffffffff, %rax # imm = 0x7FEFFFFFFFFFFFFF
cmpq %rax, %r15
jle 0x1053d
movsd -0x58(%rbp), %xmm1
ucomisd %xmm1, %xmm1
jp 0x10664
pxor %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x105e5
leaq 0xcf7d(%rip), %rax      # 0x1d4ae
leaq 0xcf80(%rip), %rdx      # 0x1d4b8
jmp 0x105f3
leaq -0x50(%rbp), %r15
leaq -0x67(%rbp), %rdx
movl $0x24, %esi
movq %r15, %rdi
movsd -0x58(%rbp), %xmm0
movb $0x1, %al
callq 0x4570
movl %eax, %r14d
cltq
testl %r14d, %r14d
jle 0x10579
xorl %ecx, %ecx
cmpb $0x2c, -0x50(%rbp,%rcx)
jne 0x10571
movb $0x2e, -0x50(%rbp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x10565
cmpl $0x1, %r12d
jne 0x105a8
addq %rbp, %rax
addq $-0x50, %rax
decq %rax
cmpq %r15, %rax
jbe 0x105a8
movb (%rax), %cl
cmpb $0x30, %cl
jne 0x105a8
movb -0x1(%rax), %cl
cmpb $0x2e, %cl
je 0x105a0
movb $0x0, (%rax)
decq %rax
cmpq %r15, %rax
ja 0x10590
leaq -0x50(%rbp), %rdi
movl $0x2e, %esi
callq 0x4140
testq %rax, %rax
jne 0x1060d
leaq -0x50(%rbp), %rdi
movl $0x65, %esi
callq 0x4140
testq %rax, %rax
jne 0x1060d
leaq -0x50(%rbp), %rdi
callq 0x4170
movw $0x302e, -0x50(%rbp,%rax) # imm = 0x302E
movb $0x0, -0x4e(%rbp,%rax)
jmp 0x1060d
leaq 0xcec3(%rip), %rax      # 0x1d4af
leaq 0xcec6(%rip), %rdx      # 0x1d4b9
testb %r14b, %r14b
cmovneq %rax, %rdx
leaq -0x50(%rbp), %rdi
movl $0x24, %esi
xorl %eax, %eax
callq 0x4570
movl %eax, %r14d
testl %r14d, %r14d
js 0x10645
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 0x161fa
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xce75(%rip), %rdi      # 0x1d4c1
leaq 0xbf8f(%rip), %rsi      # 0x1c5e2
leaq 0xce70(%rip), %rcx      # 0x1d4ca
movl $0x10f0, %edx           # imm = 0x10F0
callq 0x4280
leaq 0xce3f(%rip), %rax      # 0x1d4aa
leaq 0xca8c(%rip), %rdx      # 0x1d0fe
jmp 0x105f3