// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rsi, %rbx
movl (%rdi), %eax
cmpq $0x8, %rax
ja 0x1759c
leaq 0xa312(%rip), %rcx      # 0x2162c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x934a(%rip), %rsi      # 0x20674
movl $0x4, %edx
jmp 0x17594
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xb170
jmp 0x1759c
movq 0x8(%rdi), %r14
leaq 0x10(%rsp), %rsi
movb $0x22, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq %rax, %r15
leaq 0x11eb5(%rip), %rsi     # 0x29220
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x1c334
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0xb290
leaq 0xf(%rsp), %rsi
movb $0x22, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0xb290
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1759c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb260
jmp 0x1759c
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xb220
jmp 0x1759c
movq 0x8(%rdi), %r15
leaq 0xa2bc(%rip), %rsi      # 0x216a0
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq 0x18(%r15), %r14
addq $0x8, %r15
movq %r15, 0x30(%rsp)
cmpq %r15, %r14
je 0x174c0
movb $0x1, %r15b
testb $0x1, %r15b
je 0x17415
xorl %r15d, %r15d
jmp 0x17429
movl $0x2, %edx
movq %rbx, %rdi
leaq 0xa27e(%rip), %rsi      # 0x216a2
callq 0xb290
leaq 0x20(%r14), %rbp
movb $0x22, 0x10(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
callq 0xb290
movq %rax, %r12
movq %r13, %rdi
leaq 0x11dcc(%rip), %rsi     # 0x29220
movq %rbp, %rdx
callq 0x1c334
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0xb290
movl $0x2, %edx
movq %rax, %rdi
leaq 0xa228(%rip), %rsi      # 0x216a5
callq 0xb290
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1749e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb260
movq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0x172f6
movq %r14, %rdi
callq 0xb190
movq %rax, %r14
cmpq 0x30(%rsp), %rax
jne 0x1740a
leaq 0xa1e1(%rip), %rsi      # 0x216a8
jmp 0x1755b
movq 0x8(%rdi), %r13
leaq 0x8de9(%rip), %rsi      # 0x202c0
movl $0x1, %edx
movq %rbx, %rdi
callq 0xb290
movq (%r13), %rbp
cmpq %r13, %rbp
je 0x17554
movb $0x1, %r14b
movq 0x10(%rbp), %r12
movq 0x18(%rbp), %r15
testq %r15, %r15
je 0x17514
movq 0x11acc(%rip), %rax     # 0x28fd0
cmpb $0x0, (%rax)
je 0x1750f
incl 0x8(%r15)
jmp 0x17514
lock
incl 0x8(%r15)
testb $0x1, %r14b
je 0x1751f
xorl %r14d, %r14d
jmp 0x17533
movl $0x2, %edx
movq %rbx, %rdi
leaq 0xa174(%rip), %rsi      # 0x216a2
callq 0xb290
movq %r12, %rdi
movq %rbx, %rsi
callq 0x172f6
testq %r15, %r15
je 0x1754b
movq %r15, %rdi
callq 0x16eec
movq (%rbp), %rbp
cmpq %r13, %rbp
jne 0x174f0
leaq 0xa33f(%rip), %rsi      # 0x2189a
movl $0x1, %edx
jmp 0x17594
movq 0x8(%rdi), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0xb330
jmp 0x1759c
xorl %edx, %edx
cmpq $0x0, 0x8(%rdi)
sete %dl
leaq 0x8f46(%rip), %rax      # 0x204cb
leaq 0x8f4d(%rip), %rsi      # 0x204d9
cmoveq %rax, %rsi
orq $0x4, %rdx
movq %rbx, %rdi
callq 0xb290
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x175db
movq %rax, %rbx
testq %r15, %r15
je 0x175ed
movq %r15, %rdi
callq 0x16eec
jmp 0x175ed
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x175ed
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb260
movq %rbx, %rdi
callq 0xb3b0