// File: /workspace/github_cpp_makefile_star2_O3/swxlion[P]swxJson/src/swxJson.cpp
// Function: swxJson::Json::output(std::ostream&) const
std::ostream& Json::output(std::ostream& os) const
{
	if (_type == JSON_String)
	{
		std::string * str = (std::string*)_data;
		os << '"' << gc_JsonStringEscaper.escape(str) << '"';
	}
	else if (_type == JSON_Integer)
	{
		intmax_t * data = (intmax_t*)_data;
		os << (*data);
	}
	else if (_type == JSON_UInteger)
	{
		uintmax_t * data = (uintmax_t*)_data;
		os << (*data);
	}
	else if (_type == JSON_Object)
	{
		std::map<std::string, JsonPtr>* data = (std::map<std::string, JsonPtr>*)_data;
		os << "{";
		
		bool first = true;
		for (auto& pair: *data)
		{
			if (first)
				first = false;
			else
				os << ", ";

			os << '"' << gc_JsonStringEscaper.escape(&(pair.first)) << "\":";
			pair.second->output(os);
		}

		os << "}";
	}
	else if (_type == JSON_Array)
	{
		std::list<JsonPtr>* data = (std::list<JsonPtr>*)_data;
		os << "[";
		
		bool first = true;
		for (JsonPtr node: *data)
		{
			if (first)
				first = false;
			else
				os << ", ";

			node->output(os);
		}

		os << "]";
	}
	else if (_type == JSON_Real)
	{
		double * data = (double*)_data;
		os << (*data);
	}
	else if (_type == JSON_Boolean)
	{
		os << ((bool)_data ? "true" : "false");
	}
	else if (_type == JSON_Null)
	{
		os << "null";
	}
	else if (_type == JSON_Uninit)
	{
		os << "null";
	}

	return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl (%rdi), %eax
cmpq $0x8, %rax
ja 0x1731e
leaq 0x957e(%rip), %rcx      # 0x2062c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x85b6(%rip), %rsi      # 0x1f674
movl $0x4, %edx
jmp 0x17316
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xb170
jmp 0x1731e
movq 0x8(%rdi), %r14
leaq 0x8(%rsp), %rsi
movb $0x22, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq %rax, %r15
leaq 0x11121(%rip), %rsi     # 0x28220
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x1bffa
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0xb290
leaq 0x7(%rsp), %rsi
movb $0x22, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0xb290
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1731e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb260
jmp 0x1731e
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xb220
jmp 0x1731e
movq 0x8(%rdi), %r13
leaq 0x9528(%rip), %rsi      # 0x206a0
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq 0x18(%r13), %r14
addq $0x8, %r13
cmpq %r13, %r14
je 0x17247
movb $0x1, %al
leaq 0x8(%rsp), %r15
testb $0x1, %al
jne 0x171b5
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x94f2(%rip), %rsi      # 0x206a2
callq 0xb290
leaq 0x20(%r14), %rbp
movb $0x22, 0x8(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb290
movq %rax, %r12
movq %r15, %rdi
leaq 0x11045(%rip), %rsi     # 0x28220
movq %rbp, %rdx
callq 0x1bffa
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0xb290
movl $0x2, %edx
movq %rax, %rdi
leaq 0x94a1(%rip), %rsi      # 0x206a5
callq 0xb290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x17225
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb260
movq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0x1708a
movq %r14, %rdi
callq 0xb190
movq %rax, %r14
xorl %eax, %eax
cmpq %r13, %r14
jne 0x1719d
leaq 0x945a(%rip), %rsi      # 0x206a8
jmp 0x172dd
movq 0x8(%rdi), %r13
leaq 0x8062(%rip), %rsi      # 0x1f2c0
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq (%r13), %rbp
cmpq %r13, %rbp
je 0x172d6
movb $0x1, %al
movq 0x10d53(%rip), %r14     # 0x27fd0
movq 0x10(%rbp), %r12
movq 0x18(%rbp), %r15
testq %r15, %r15
je 0x1729b
cmpb $0x0, (%r14)
je 0x17296
incl 0x8(%r15)
jmp 0x1729b
lock
incl 0x8(%r15)
testb $0x1, %al
jne 0x172b3
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x93f4(%rip), %rsi      # 0x206a2
callq 0xb290
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1708a
testq %r15, %r15
je 0x172cb
movq %r15, %rdi
callq 0x16c72
movq (%rbp), %rbp
xorl %eax, %eax
cmpq %r13, %rbp
jne 0x1727d
leaq 0x95bd(%rip), %rsi      # 0x2089a
movl $0x1, %edx
jmp 0x17316
movq 0x8(%rdi), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0xb330
jmp 0x1731e
xorl %edx, %edx
cmpq $0x0, 0x8(%rdi)
sete %dl
leaq 0x81c4(%rip), %rax      # 0x1f4cb
leaq 0x81cb(%rip), %rsi      # 0x1f4d9
cmoveq %rax, %rsi
orq $0x4, %rdx
movq %rbx, %rdi
callq 0xb290
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x1735d
movq %rax, %rbx
testq %r15, %r15
je 0x1736f
movq %r15, %rdi
callq 0x16c72
jmp 0x1736f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1736f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb260
movq %rbx, %rdi
callq 0xb3b0