// File: /workspace/github_cpp_makefile_star2_O2/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 0x16866
leaq 0x8f9a(%rip), %rcx      # 0x1f62c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x7fd2(%rip), %rsi      # 0x1e674
jmp 0x1685e
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe150
jmp 0x16866
movq 0x8(%rdi), %r14
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0xe2a0
movq %rax, %r15
leaq 0x11b54(%rip), %rsi     # 0x28228
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rdx
callq 0x1a53c
movq %r15, %rdi
movq %r12, %rsi
callq 0xe1f0
pushq $0x22
popq %rsi
movq %rax, %rdi
callq 0xe2a0
leaq 0x8(%rsp), %rdi
callq 0xe0c0
jmp 0x16866
movq 0x8(%rdi), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xe220
jmp 0x16866
movq 0x8(%rdi), %r13
leaq 0x8f64(%rip), %rsi      # 0x1f68c
movq %rbx, %rdi
callq 0xe230
movq 0x18(%r13), %r14
addq $0x8, %r13
movb $0x1, %al
leaq 0x8(%rsp), %r12
cmpq %r13, %r14
je 0x16857
testb $0x1, %al
jne 0x1675b
movq %rbx, %rdi
leaq 0x8f38(%rip), %rsi      # 0x1f68e
callq 0xe230
leaq 0x20(%r14), %rbp
movq %rbx, %rdi
pushq $0x22
popq %rsi
callq 0xe2a0
movq %rax, %r15
movq %r12, %rdi
leaq 0x11ab1(%rip), %rsi     # 0x28228
movq %rbp, %rdx
callq 0x1a53c
movq %r15, %rdi
movq %r12, %rsi
callq 0xe1f0
movq %rax, %rdi
leaq 0x8efd(%rip), %rsi      # 0x1f691
callq 0xe230
movq %r12, %rdi
callq 0xe0c0
movq 0x40(%r14), %rdi
movq %rbx, %rsi
callq 0x1666e
movq %r14, %rdi
callq 0xe160
movq %rax, %r14
xorl %eax, %eax
jmp 0x1673f
movq 0x8(%rdi), %r13
leaq 0x7af9(%rip), %rsi      # 0x1e2c0
movq %rbx, %rdi
callq 0xe230
movb $0x1, %r12b
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %r13, %rbp
movq (%rbp), %rbp
cmpq %r13, %rbp
je 0x1684e
leaq 0x10(%rbp), %rsi
movq %r15, %rdi
callq 0x161bc
testb $0x1, %r12b
jne 0x16809
movq %rbx, %rdi
leaq 0x8e8a(%rip), %rsi      # 0x1f68e
callq 0xe230
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x1666e
movq %r14, %rdi
callq 0x161f0
xorl %r12d, %r12d
jmp 0x167df
movq 0x8(%rdi), %rax
movsd (%rax), %xmm0
movq %rbx, %rdi
callq 0xe320
jmp 0x16866
cmpq $0x0, 0x8(%rdi)
leaq 0x7c8a(%rip), %rax      # 0x1e4cb
leaq 0x7c91(%rip), %rsi      # 0x1e4d9
cmoveq %rax, %rsi
jmp 0x1685e
leaq 0x9031(%rip), %rsi      # 0x1f886
jmp 0x1685e
leaq 0x8e36(%rip), %rsi      # 0x1f694
movq %rbx, %rdi
callq 0xe230
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16887
movq %rax, %rbx
movq %r14, %rdi
callq 0x161f0
jmp 0x16894
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xe0c0
movq %rbx, %rdi
callq 0xe3a0