// File: tomfunkhouser[P]gaps/pkgs/RNBasics/json.cpp
// Function: Json::BuiltStyledStreamWriter::writeValue(Json::Value const&)
void BuiltStyledStreamWriter::writeValue(Value const& value) {
  switch (value.type()) {
  case nullValue:
    pushValue(nullSymbol_);
    break;
  case intValue:
    pushValue(valueToString(value.asLargestInt()));
    break;
  case uintValue:
    pushValue(valueToString(value.asLargestUInt()));
    break;
  case realValue:
    pushValue(valueToString(value.asDouble(), useSpecialFloats_, precision_));
    break;
  case stringValue:
  {
    // Is NULL is possible for value.string_?
    char const* str;
    char const* end;
    bool ok = value.getString(&str, &end);
    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
    else pushValue("");
    break;
  }
  case booleanValue:
    pushValue(valueToString(value.asBool()));
    break;
  case arrayValue:
    writeArrayValue(value);
    break;
  case objectValue: {
    Value::Members members(value.getMemberNames());
    if (members.empty())
      pushValue("{}");
    else {
      writeWithIndent("{");
      indent();
      Value::Members::iterator it = members.begin();
      for (;;) {
        std::string const& name = *it;
        Value const& childValue = value[name];
        writeCommentBeforeValue(childValue);
        writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
        *sout_ << colonSymbol_;
        writeValue(childValue);
        if (++it == members.end()) {
          writeCommentAfterValueOnSameLine(childValue);
          break;
        }
        *sout_ << ",";
        writeCommentAfterValueOnSameLine(childValue);
      }
      unindent();
      writeWithIndent("}");
    }
  } break;
  }
}

// Assembly:
subq $0x248, %rsp            # imm = 0x248
movq %rdi, 0x240(%rsp)
movq %rsi, 0x238(%rsp)
movq 0x240(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x238(%rsp), %rdi
callq 0xed7d0
movl %eax, %ecx
movq %rcx, 0x70(%rsp)
subl $0x7, %eax
ja 0xf7437
movq 0x70(%rsp), %rax
leaq 0x733af(%rip), %rcx     # 0x16a0ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x68(%rsp), %rdi
movq %rdi, %rsi
addq $0x98, %rsi
callq 0xf75d0
jmp 0xf7437
movq 0x238(%rsp), %rdi
callq 0xef040
movq %rax, %rsi
leaq 0x218(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xedfd0
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0xf75d0
jmp 0xf6d52
leaq 0x218(%rsp), %rdi
callq 0x12430
jmp 0xf7437
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x218(%rsp), %rdi
callq 0x12430
jmp 0xf743f
movq 0x238(%rsp), %rdi
callq 0xef050
movq %rax, %rsi
leaq 0x1e8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xee0e0
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0xf75d0
jmp 0xf6dbd
leaq 0x1e8(%rsp), %rdi
callq 0x12430
jmp 0xf7437
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x12430
jmp 0xf743f
movq 0x238(%rsp), %rdi
callq 0xef060
movq 0x68(%rsp), %rax
movzbl 0xd8(%rax), %esi
shrl $0x2, %esi
andl $0x1, %esi
movl 0xdc(%rax), %edx
leaq 0x1c8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xf2a90
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0xf75d0
jmp 0xf6e3d
leaq 0x1c8(%rsp), %rdi
callq 0x12430
jmp 0xf7437
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x12430
jmp 0xf743f
movq 0x238(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
callq 0xedf30
andb $0x1, %al
movb %al, 0x1b7(%rsp)
testb $0x1, 0x1b7(%rsp)
je 0xf6f13
movq 0x1c0(%rsp), %rsi
movl 0x1b8(%rsp), %edx
movl %esi, %eax
subl %eax, %edx
leaq 0x190(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xf3a00
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0xf75d0
jmp 0xf6edb
leaq 0x190(%rsp), %rdi
callq 0x12430
jmp 0xf6fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x12430
jmp 0xf743f
leaq 0x16f(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x12c30
movq 0x40(%rsp), %rdx
leaq 0x706ce(%rip), %rsi     # 0x1675ff
leaq 0x170(%rsp), %rdi
callq 0x22830
jmp 0xf6f40
movq 0x68(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xf75d0
jmp 0xf6f54
leaq 0x170(%rsp), %rdi
callq 0x12430
leaq 0x16f(%rsp), %rdi
callq 0x12760
jmp 0xf6fb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0xf6fa7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x12430
leaq 0x16f(%rsp), %rdi
callq 0x12760
jmp 0xf743f
jmp 0xf7437
movq 0x238(%rsp), %rdi
callq 0xe9f30
movzbl %al, %esi
leaq 0x148(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xf2cb0
movq 0x68(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0xf75d0
jmp 0xf6ff1
leaq 0x148(%rsp), %rdi
callq 0x12430
jmp 0xf7437
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x12430
jmp 0xf743f
movq 0x68(%rsp), %rdi
movq 0x238(%rsp), %rsi
callq 0xf7620
jmp 0xf7437
movq 0x238(%rsp), %rsi
leaq 0x130(%rsp), %rdi
callq 0xeafb0
leaq 0x130(%rsp), %rdi
callq 0xfad40
testb $0x1, %al
jne 0xf706b
jmp 0xf7114
leaq 0x10f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x12c30
movq 0x30(%rsp), %rdx
leaq 0x73b7e(%rip), %rsi     # 0x16ac07
leaq 0x110(%rsp), %rdi
callq 0x22830
jmp 0xf7098
movq 0x68(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xf75d0
jmp 0xf70ac
leaq 0x110(%rsp), %rdi
callq 0x12430
leaq 0x10f(%rsp), %rdi
callq 0x12760
jmp 0xf7419
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0xf7102
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x12430
leaq 0x10f(%rsp), %rdi
callq 0x12760
jmp 0xf7428
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x12c30
movq 0x28(%rsp), %rdx
leaq 0x73ad8(%rip), %rsi     # 0x16ac0a
leaq 0xe8(%rsp), %rdi
callq 0x22830
jmp 0xf7141
movq 0x68(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xf7a90
jmp 0xf7155
leaq 0xe8(%rsp), %rdi
callq 0x12430
leaq 0xe7(%rsp), %rdi
callq 0x12760
movq 0x68(%rsp), %rdi
callq 0xf7af0
jmp 0xf717b
leaq 0x130(%rsp), %rdi
callq 0xfac70
movq %rax, 0xd8(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0xfad10
movq %rax, 0xd0(%rsp)
movq 0x238(%rsp), %rdi
movq 0xd0(%rsp), %rsi
callq 0xeb2b0
movq %rax, 0x20(%rsp)
jmp 0xf71c1
movq 0x68(%rsp), %rdi
movq 0x20(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rsi
callq 0xf6a90
jmp 0xf71e2
movq 0xd0(%rsp), %rdi
callq 0x12930
movq %rax, 0x18(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x12a90
movq 0x18(%rsp), %rsi
movl %eax, %edx
leaq 0xa8(%rsp), %rdi
callq 0xf3a00
jmp 0xf7217
movq 0x68(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xf7a90
jmp 0xf722b
leaq 0xa8(%rsp), %rdi
callq 0x12430
movq 0x68(%rsp), %rsi
movq 0x8(%rsi), %rdi
addq $0x78, %rsi
callq 0x12600
jmp 0xf724c
movq 0x68(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0xf6cb0
jmp 0xf7260
leaq 0xd8(%rsp), %rdi
callq 0xfad20
movq %rax, 0x10(%rsp)
leaq 0x130(%rsp), %rdi
callq 0xface0
movq 0x10(%rsp), %rdi
movq %rax, 0xa0(%rsp)
leaq 0xa0(%rsp), %rsi
callq 0xfad90
testb $0x1, %al
jne 0xf72a2
jmp 0xf7343
movq 0x68(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0xf7450
jmp 0xf72b6
jmp 0xf7373
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0xf72f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x12430
leaq 0xe7(%rsp), %rdi
callq 0x12760
jmp 0xf7428
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0xf7428
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x12430
jmp 0xf7428
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x70596(%rip), %rsi     # 0x1678e9
callq 0x126b0
jmp 0xf735a
movq 0x68(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0xf7450
jmp 0xf736e
jmp 0xf7190
movq 0x68(%rsp), %rdi
callq 0xf7b10
jmp 0xf737f
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x12c30
movq 0x8(%rsp), %rdx
leaq 0x7386e(%rip), %rsi     # 0x16ac08
leaq 0x80(%rsp), %rdi
callq 0x22830
jmp 0xf73a9
movq 0x68(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xf7a90
jmp 0xf73bd
leaq 0x80(%rsp), %rdi
callq 0x12430
leaq 0x7f(%rsp), %rdi
callq 0x12760
jmp 0xf7419
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
jmp 0xf740d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x210(%rsp)
movl %eax, 0x20c(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x12430
leaq 0x7f(%rsp), %rdi
callq 0x12760
jmp 0xf7428
leaq 0x130(%rsp), %rdi
callq 0xf9da0
jmp 0xf7437
leaq 0x130(%rsp), %rdi
callq 0xf9da0
jmp 0xf743f
addq $0x248, %rsp            # imm = 0x248
retq
movq 0x210(%rsp), %rdi
callq 0x12c20
nopl (%rax)