// File: BlinfoldKing[P]lisval/src/lib/parser.cpp
// Function: Token::debug[abi:cxx11]()
string Token::debug() {
	string res = "";
	switch (this->type) {
		case TokenType::ATOM:
		{
			Atom* a = static_cast<Atom*>(this);
			res += a->str;
			break;
		}
		case TokenType::LIST:
			{
				res += "(";
				List* l = static_cast<List*>(this);
				for (size_t i = 0; i < l->list.size(); i++) {
					res += l->list[i]->debug();
					if (i < l->list.size() - 1) res += ' ';
				}
				res += ")";
				break;
			}
		case TokenType::NUMBER:
			{
				Number* a = static_cast<Number*>(this);
				res += to_string(a->value);
				break;
			}
		case TokenType::VARIABLE:
		{
			Variable* a = static_cast<Variable*>(this);
			res += a->str;
			break;
		}
		case TokenType::UNARY_OPERATOR:
		{
			UnaryOperator* a = static_cast<UnaryOperator*>(this);
			res += unaryOperatorToString(a->operator_type);
			break;
		}
		case TokenType::BINARY_OPERATOR:
		{
			BinaryOperator* a = static_cast<BinaryOperator*>(this);
			res += binaryOperatorToString(a->operator_type);
			break;
		}
		case TokenType::BOOLEAN:
		{
			Boolean* a = static_cast<Boolean*>(this);
			res += boolToString(a->value);
			break;
		}
        case TokenType::ERROR:
        {
			Error* a = static_cast<Error*>(this);
		    res += "(:error \""+a->message+"\")";
            break;
        }
		default:
			res += "UNKNOWN";
	}

	return res;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x160(%rbp)
movq %rdi, %rax
movq %rax, -0x170(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x12(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x34a0
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rdx
leaq 0xba1f(%rip), %rsi      # 0x23657
callq 0x33b0
jmp 0x17c3f
leaq -0x12(%rbp), %rdi
callq 0x3300
movq -0x168(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x178(%rbp)
subq $0x8, %rax
ja 0x1805b
movq -0x178(%rbp), %rax
leaq 0xb8d8(%rip), %rcx      # 0x23548
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x12(%rbp), %rdi
callq 0x3300
jmp 0x180a4
movq -0x160(%rbp), %rdi
movq -0x168(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
callq 0x3380
jmp 0x17cb4
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x18098
movq -0x160(%rbp), %rdi
leaq 0xb928(%rip), %rsi      # 0x23600
callq 0x3290
jmp 0x17cdf
movq -0x168(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x11a60
movq %rax, %rcx
movq -0x180(%rbp), %rax
cmpq %rcx, %rax
jae 0x17dc4
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movq -0x40(%rbp), %rsi
callq 0x11a80
movq (%rax), %rsi
leaq -0x60(%rbp), %rdi
callq 0x17be0
jmp 0x17d3c
movq -0x160(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3380
jmp 0x17d4e
leaq -0x60(%rbp), %rdi
callq 0x31c0
movq -0x40(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
callq 0x11a60
movq %rax, %rcx
movq -0x188(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x17db1
movq -0x160(%rbp), %rdi
movl $0x20, %esi
callq 0x31d0
jmp 0x17d95
jmp 0x17db1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31c0
jmp 0x18098
jmp 0x17db3
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x17cf2
movq -0x160(%rbp), %rdi
leaq 0xb83b(%rip), %rsi      # 0x2360d
callq 0x3290
jmp 0x17dd9
jmp 0x18072
movq -0x168(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movss 0x4(%rax), %xmm0
leaq -0x88(%rbp), %rdi
callq 0x19140
jmp 0x17e00
movq -0x160(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3380
jmp 0x17e15
leaq -0x88(%rbp), %rdi
callq 0x31c0
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31c0
jmp 0x18098
movq -0x160(%rbp), %rdi
movq -0x168(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rsi
addq $0x8, %rsi
callq 0x3380
jmp 0x17e6a
jmp 0x18072
movq -0x168(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl 0x4(%rax), %esi
leaq -0xb8(%rbp), %rdi
callq 0x15620
jmp 0x17e95
movq -0x160(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3380
jmp 0x17eaa
leaq -0xb8(%rbp), %rdi
callq 0x31c0
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x31c0
jmp 0x18098
movq -0x168(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movl 0x4(%rax), %esi
leaq -0xe0(%rbp), %rdi
callq 0x15ad0
jmp 0x17efe
movq -0x160(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3380
jmp 0x17f13
leaq -0xe0(%rbp), %rdi
callq 0x31c0
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x31c0
jmp 0x18098
movq -0x168(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
movzbl 0x4(%rax), %esi
andl $0x1, %esi
leaq -0x108(%rbp), %rdi
callq 0x16870
jmp 0x17f6b
movq -0x160(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x3380
jmp 0x17f80
leaq -0x108(%rbp), %rdi
callq 0x31c0
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x31c0
jmp 0x18098
movq -0x168(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdx
addq $0x8, %rdx
leaq 0xb634(%rip), %rsi      # 0x23602
leaq -0x150(%rbp), %rdi
callq 0x18c40
jmp 0x17fdc
leaq 0xb629(%rip), %rdx      # 0x2360c
leaq -0x130(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x18bf0
jmp 0x17ff8
movq -0x160(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x3380
jmp 0x1800d
leaq -0x130(%rbp), %rdi
callq 0x31c0
leaq -0x150(%rbp), %rdi
callq 0x31c0
jmp 0x18072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x1804d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x31c0
leaq -0x150(%rbp), %rdi
callq 0x31c0
jmp 0x18098
movq -0x160(%rbp), %rdi
leaq 0xb58f(%rip), %rsi      # 0x235f8
callq 0x3290
jmp 0x18070
jmp 0x18072
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x18088
movq -0x160(%rbp), %rdi
callq 0x31c0
movq -0x170(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x160(%rbp), %rdi
callq 0x31c0
movq -0x20(%rbp), %rdi
callq 0x3490
nopl (%rax)