// File: 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
subq $0x80, %rsp
movq %rdi, -0x78(%rbp)
movb %sil, %al
movq %rdi, %rsi
movq %rsi, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x1c(%rbp)
jne 0x18026
leaq -0x53(%rbp), %rdi
movl -0x18(%rbp), %ecx
movl $0xf, %esi
leaq 0x20baf(%rip), %rdx     # 0x38bcc
movb $0x0, %al
callq 0x5710
jmp 0x18040
leaq -0x53(%rbp), %rdi
movl -0x18(%rbp), %ecx
movl $0xf, %esi
leaq 0x20b9a(%rip), %rdx     # 0x38bd3
movb $0x0, %al
callq 0x5710
movsd -0x10(%rbp), %xmm0
callq 0x23e70
testb $0x1, %al
jne 0x18053
jmp 0x180da
leaq -0x40(%rbp), %rdi
leaq -0x53(%rbp), %rdx
movsd -0x10(%rbp), %xmm0
movl $0x24, %esi
movb $0x1, %al
callq 0x5710
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movslq -0x44(%rbp), %rax
addq %rax, %rsi
callq 0x1ddb0
cmpl $0x1, -0x1c(%rbp)
jne 0x1809d
leaq -0x40(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movslq -0x44(%rbp), %rax
addq %rax, %rsi
callq 0x1ddf0
leaq -0x40(%rbp), %rdi
movl $0x2e, %esi
callq 0x5140
cmpq $0x0, %rax
jne 0x180d5
leaq -0x40(%rbp), %rdi
movl $0x65, %esi
callq 0x5140
cmpq $0x0, %rax
jne 0x180d5
leaq -0x40(%rbp), %rdi
leaq 0x20b0a(%rip), %rsi     # 0x38bda
callq 0x57a0
jmp 0x1817d
movsd -0x10(%rbp), %xmm0
ucomisd -0x10(%rbp), %xmm0
jne 0x180ea
jp 0x180ea
jmp 0x18117
leaq -0x40(%rbp), %rdi
movb -0x11(%rbp), %cl
leaq 0x20739(%rip), %rdx     # 0x38831
leaq 0x20ade(%rip), %rax     # 0x38bdd
testb $0x1, %cl
cmovneq %rax, %rdx
movl $0x24, %esi
movb $0x0, %al
callq 0x5710
movl %eax, -0x44(%rbp)
jmp 0x1817b
xorps %xmm0, %xmm0
ucomisd -0x10(%rbp), %xmm0
jbe 0x1814e
leaq -0x40(%rbp), %rdi
movb -0x11(%rbp), %cl
leaq 0x20abc(%rip), %rdx     # 0x38beb
leaq 0x20aab(%rip), %rax     # 0x38be1
testb $0x1, %cl
cmovneq %rax, %rdx
movl $0x24, %esi
movb $0x0, %al
callq 0x5710
movl %eax, -0x44(%rbp)
jmp 0x18179
leaq -0x40(%rbp), %rdi
movb -0x11(%rbp), %cl
leaq 0x20a90(%rip), %rdx     # 0x38bec
leaq 0x20a7f(%rip), %rax     # 0x38be2
testb $0x1, %cl
cmovneq %rax, %rdx
movl $0x24, %esi
movb $0x0, %al
callq 0x5710
movl %eax, -0x44(%rbp)
jmp 0x1817b
jmp 0x1817d
cmpl $0x0, -0x44(%rbp)
jl 0x18185
jmp 0x181a4
leaq 0x20a68(%rip), %rdi     # 0x38bf4
leaq 0x1fb7f(%rip), %rsi     # 0x37d12
movl $0x10f0, %edx           # imm = 0x10F0
leaq 0x20a5e(%rip), %rcx     # 0x38bfd
callq 0x5320
leaq -0x54(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x5790
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq -0x40(%rbp), %rsi
callq 0x5650
jmp 0x181c4
leaq -0x54(%rbp), %rdi
callq 0x54f0
movq -0x70(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x54f0
movq -0x60(%rbp), %rdi
callq 0x5780
nopl (%rax,%rax)