// File: iamlouk[P]asbi/src/types.cc
// Function: asbi::Value::to_string[abi:cxx11](bool) const
std::string Value::to_string(bool debug) const {
	assert(type != type_t::StackPlaceholder);
	switch (type) {
	case type_t::Bool:
		return _boolean ? "true" : "false";
	case type_t::Number:{
		auto integer = static_cast<int>(_number);
		return integer == _number ? std::to_string(integer) : std::to_string(_number);
	}
	case type_t::Nil:
		return "nil";
	case type_t::Symbol:
		return std::string(":") + _string->data;
	case type_t::String:
		return debug ? std::string("\"") + _string->data + "\"" : _string->data;
	case type_t::Lambda:{
		std::stringstream ss;
		ss << "<Lambda#" << (void*)_lambda->ops << ">";
		return ss.str();
	}
	case type_t::Map:{
		std::stringstream ss;
		ss << "[";
		for (auto val: _map->vecdata)
			ss << val.to_string(true) << ", ";
		for (auto [key, val]: _map->data)
			ss << key.to_string(true) << " ~ " << val.to_string(true) << ", ";
		ss << "]";
		return ss.str();
	}
	case type_t::Macro:{
		std::stringstream ss;
		ss << "<Macro#" << (void*)_lambda->ops << ">";
		return ss.str();
	}
	case type_t::StackPlaceholder:
		return std::string("<StackPlaceholder>");
	}
}

// Assembly:
subq $0x6c8, %rsp            # imm = 0x6C8
movq %rdi, 0x98(%rsp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, 0xa0(%rsp)
movq %rdi, 0x6c0(%rsp)
movq %rsi, 0x6b8(%rsp)
andb $0x1, %al
movb %al, 0x6b7(%rsp)
movq 0x6b8(%rsp), %rax
movq %rax, 0xa8(%rsp)
cmpl $0x8, (%rax)
je 0x2210c
jmp 0x2212b
leaq 0x16f1a(%rip), %rdi     # 0x3902d
leaq 0x16e6e(%rip), %rsi     # 0x38f88
movl $0xcc, %edx
leaq 0x16f4e(%rip), %rcx     # 0x39074
callq 0x62b0
movq 0xa8(%rsp), %rax
movl (%rax), %eax
movq %rax, 0x90(%rsp)
subq $0x8, %rax
ja 0x22a3c
movq 0x90(%rsp), %rax
leaq 0x16dc2(%rip), %rcx     # 0x38f18
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xa8(%rsp), %rax
movb 0x8(%rax), %dl
leaq 0x163cb(%rip), %rcx     # 0x3853c
leaq 0x163c9(%rip), %rax     # 0x38541
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x80(%rsp)
leaq 0x6b6(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x67b0
movq 0x98(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x7c20
jmp 0x221bb
leaq 0x6b6(%rsp), %rdi
callq 0x64c0
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x6b6(%rsp), %rdi
callq 0x64c0
jmp 0x22a4e
movq 0xa8(%rsp), %rax
cvttsd2si 0x8(%rax), %ecx
movl %ecx, 0x6a0(%rsp)
cvtsi2sdl 0x6a0(%rsp), %xmm0
ucomisd 0x8(%rax), %xmm0
jne 0x2222f
jp 0x2222f
movq 0x98(%rsp), %rdi
movl 0x6a0(%rsp), %esi
callq 0xbd40
jmp 0x22249
movq 0x98(%rsp), %rdi
movq 0xa8(%rsp), %rax
movsd 0x8(%rax), %xmm0
callq 0xbe80
jmp 0x22a3e
leaq 0x69f(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x67b0
movq 0x98(%rsp), %rdi
movq 0x78(%rsp), %rdx
leaq 0x17bc3(%rip), %rsi     # 0x39e37
callq 0x7c20
jmp 0x2227b
leaq 0x69f(%rsp), %rdi
callq 0x64c0
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x69f(%rsp), %rdi
callq 0x64c0
jmp 0x22a4e
leaq 0x677(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x67b0
movq 0x70(%rsp), %rdx
leaq 0x16dd2(%rip), %rsi     # 0x390a3
leaq 0x678(%rsp), %rdi
callq 0x7c20
jmp 0x222e0
movq 0x98(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x20, %rdx
leaq 0x678(%rsp), %rsi
callq 0xbc00
jmp 0x22307
leaq 0x678(%rsp), %rdi
callq 0x6290
leaq 0x677(%rsp), %rdi
callq 0x64c0
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
jmp 0x2235d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x678(%rsp), %rdi
callq 0x6290
leaq 0x677(%rsp), %rdi
callq 0x64c0
jmp 0x22a4e
movb 0x6b7(%rsp), %al
movb $0x0, 0x62e(%rsp)
movb $0x0, 0x62d(%rsp)
movb $0x0, 0x62c(%rsp)
testb $0x1, %al
je 0x22422
leaq 0x62f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x67b0
movq 0x68(%rsp), %rdx
movb $0x1, 0x62e(%rsp)
leaq 0x161c4(%rip), %rsi     # 0x38580
leaq 0x630(%rsp), %rdi
callq 0x7c20
jmp 0x223cb
movq 0xa8(%rsp), %rax
movb $0x1, 0x62d(%rsp)
movq 0x8(%rax), %rdx
addq $0x20, %rdx
leaq 0x650(%rsp), %rdi
leaq 0x630(%rsp), %rsi
callq 0xbc00
jmp 0x223fa
movq 0x98(%rsp), %rdi
movb $0x1, 0x62c(%rsp)
leaq 0x1616f(%rip), %rdx     # 0x38580
leaq 0x650(%rsp), %rsi
callq 0xbbb0
jmp 0x22420
jmp 0x22443
movq 0x98(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rsi
addq $0x20, %rsi
callq 0x61a0
jmp 0x22441
jmp 0x22443
testb $0x1, 0x62c(%rsp)
jne 0x2244f
jmp 0x2245c
leaq 0x650(%rsp), %rdi
callq 0x6290
testb $0x1, 0x62d(%rsp)
jne 0x22468
jmp 0x22475
leaq 0x630(%rsp), %rdi
callq 0x6290
testb $0x1, 0x62e(%rsp)
jne 0x22481
jmp 0x2248e
leaq 0x62f(%rsp), %rdi
callq 0x64c0
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
jmp 0x22509
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
jmp 0x224ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
testb $0x1, 0x62c(%rsp)
jne 0x224df
jmp 0x224ec
leaq 0x650(%rsp), %rdi
callq 0x6290
jmp 0x224ee
testb $0x1, 0x62d(%rsp)
jne 0x224fa
jmp 0x22507
leaq 0x630(%rsp), %rdi
callq 0x6290
jmp 0x22509
testb $0x1, 0x62e(%rsp)
jne 0x22515
jmp 0x22522
leaq 0x62f(%rsp), %rdi
callq 0x64c0
jmp 0x22a4e
leaq 0x4a0(%rsp), %rdi
callq 0x6300
leaq 0x4b0(%rsp), %rdi
leaq 0x16b62(%rip), %rsi     # 0x390a5
callq 0x6450
movq %rax, 0x60(%rsp)
jmp 0x2254f
movq 0x60(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x6360
movq %rax, 0x58(%rsp)
jmp 0x22570
movq 0x58(%rsp), %rdi
leaq 0x16b54(%rip), %rsi     # 0x390d0
callq 0x6450
jmp 0x22583
movq 0x98(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
callq 0x6440
jmp 0x2259a
leaq 0x4a0(%rsp), %rdi
callq 0x6330
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x4a0(%rsp), %rdi
callq 0x6330
jmp 0x22a4e
leaq 0x318(%rsp), %rdi
callq 0x6300
leaq 0x328(%rsp), %rdi
leaq 0x16ac0(%rip), %rsi     # 0x390ae
callq 0x6450
jmp 0x225f5
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x50, %rax
movq %rax, 0x310(%rsp)
movq 0x310(%rsp), %rdi
callq 0x1aad0
movq %rax, 0x308(%rsp)
movq 0x310(%rsp), %rdi
callq 0x1ab00
movq %rax, 0x300(%rsp)
leaq 0x308(%rsp), %rdi
leaq 0x300(%rsp), %rsi
callq 0x1ab30
testb $0x1, %al
jne 0x22655
jmp 0x22720
leaq 0x308(%rsp), %rdi
callq 0x1ab70
movups (%rax), %xmm0
movaps %xmm0, 0x2f0(%rsp)
leaq 0x328(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x2d0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
movl $0x1, %edx
callq 0x220c0
jmp 0x22696
movq 0x50(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x63d0
movq %rax, 0x48(%rsp)
jmp 0x226af
movq 0x48(%rsp), %rdi
leaq 0x169f5(%rip), %rsi     # 0x390b0
callq 0x6450
jmp 0x226c2
leaq 0x2d0(%rsp), %rdi
callq 0x6290
leaq 0x308(%rsp), %rdi
callq 0x1ab80
jmp 0x22637
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
jmp 0x22923
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0x6290
jmp 0x22923
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
addq $0x18, %rax
movq %rax, 0x2c8(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x22fc0
movq %rax, 0x2c0(%rsp)
movq 0x2c8(%rsp), %rdi
callq 0x22d20
movq %rax, 0x2b8(%rsp)
leaq 0x2c0(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0x22ae0
testb $0x1, %al
jne 0x22780
jmp 0x228e4
leaq 0x2c0(%rsp), %rdi
callq 0x22ff0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x2a0(%rsp)
movaps %xmm0, 0x290(%rsp)
leaq 0x290(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x22b20
movq 0x38(%rsp), %rdi
movq %rax, 0x288(%rsp)
callq 0x22b30
movq %rax, 0x280(%rsp)
leaq 0x328(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x288(%rsp), %rsi
leaq 0x260(%rsp), %rdi
movl $0x1, %edx
callq 0x220c0
jmp 0x227f9
movq 0x40(%rsp), %rdi
leaq 0x260(%rsp), %rsi
callq 0x63d0
movq %rax, 0x30(%rsp)
jmp 0x22812
movq 0x30(%rsp), %rdi
leaq 0x16895(%rip), %rsi     # 0x390b3
callq 0x6450
movq %rax, 0x28(%rsp)
jmp 0x2282a
movq 0x280(%rsp), %rsi
leaq 0x240(%rsp), %rdi
movl $0x1, %edx
callq 0x220c0
jmp 0x22846
movq 0x28(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x63d0
movq %rax, 0x20(%rsp)
jmp 0x2285f
movq 0x20(%rsp), %rdi
leaq 0x16845(%rip), %rsi     # 0x390b0
callq 0x6450
jmp 0x22872
leaq 0x240(%rsp), %rdi
callq 0x6290
leaq 0x260(%rsp), %rdi
callq 0x6290
leaq 0x2c0(%rsp), %rdi
callq 0x23010
jmp 0x22762
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
jmp 0x228d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x6290
leaq 0x260(%rsp), %rdi
callq 0x6290
jmp 0x22923
leaq 0x328(%rsp), %rdi
leaq 0x15773(%rip), %rsi     # 0x38066
callq 0x6450
jmp 0x228fa
movq 0x98(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x6440
jmp 0x22911
leaq 0x318(%rsp), %rdi
callq 0x6330
jmp 0x22a3e
leaq 0x318(%rsp), %rdi
callq 0x6330
jmp 0x22a4e
leaq 0xb8(%rsp), %rdi
callq 0x6300
leaq 0xc8(%rsp), %rdi
leaq 0x16766(%rip), %rsi     # 0x390b7
callq 0x6450
movq %rax, 0x18(%rsp)
jmp 0x2295d
movq 0x18(%rsp), %rdi
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rsi
callq 0x6360
movq %rax, 0x10(%rsp)
jmp 0x2297e
movq 0x10(%rsp), %rdi
leaq 0x16746(%rip), %rsi     # 0x390d0
callq 0x6450
jmp 0x22991
movq 0x98(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x6440
jmp 0x229a8
leaq 0xb8(%rsp), %rdi
callq 0x6330
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x6330
jmp 0x22a4e
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x67b0
movq 0x98(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq 0x166bc(%rip), %rsi     # 0x390bf
callq 0x7c20
jmp 0x22a0a
leaq 0xb7(%rsp), %rdi
callq 0x64c0
jmp 0x22a3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x6a8(%rsp)
movl %eax, 0x6a4(%rsp)
leaq 0xb7(%rsp), %rdi
callq 0x64c0
jmp 0x22a4e
ud2
movq 0xa0(%rsp), %rax
addq $0x6c8, %rsp            # imm = 0x6C8
retq
movq 0x6a8(%rsp), %rdi
callq 0x67a0
nopl (%rax,%rax)