// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x31e6(%rip), %rsi      # 0xc582
leaq -0x48(%rbp), %rdx
callq 0x3100
movl (%r14), %eax
cmpq $0x8, %rax
ja 0x93d2
leaq 0x30a7(%rip), %rcx      # 0xc45c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3370
jmp 0x952e
leaq 0x314a(%rip), %rsi      # 0xc523
movq %rbx, %rdi
callq 0x3350
jmp 0x952e
movl 0x4(%r14), %esi
leaq -0x48(%rbp), %rdi
callq 0x8440
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
jmp 0x9525
leaq 0x3120(%rip), %rsi      # 0xc52b
movq %rbx, %rdi
callq 0x3350
xorl %r13d, %r13d
leaq -0x48(%rbp), %r15
pushq $0x20
popq %r12
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r13
jae 0x9540
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
callq 0x937e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3370
movq %r15, %rdi
callq 0x3140
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
sarq $0x3, %rax
decq %rax
cmpq %rax, %r13
jae 0x9474
movq %rbx, %rdi
movl %r12d, %esi
callq 0x31c0
incq %r13
jmp 0x941e
movzbl 0x4(%r14), %esi
leaq -0x48(%rbp), %rdi
callq 0x89de
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
jmp 0x9525
addq $0x8, %r14
leaq 0x308a(%rip), %rsi      # 0xc52d
leaq -0x68(%rbp), %rdi
movq %r14, %rdx
callq 0x99e4
leaq 0x3081(%rip), %rdx      # 0xc537
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x99bb
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
leaq -0x48(%rbp), %rdi
callq 0x3140
leaq -0x68(%rbp), %rdi
jmp 0x9529
movss 0x4(%r14), %xmm0
leaq -0x48(%rbp), %rdi
callq 0x9af3
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
jmp 0x9525
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3370
jmp 0x952e
movl 0x4(%r14), %esi
leaq -0x48(%rbp), %rdi
callq 0x81e9
leaq -0x48(%rbp), %rsi
movq %rbx, %rdi
callq 0x3370
leaq -0x48(%rbp), %rdi
callq 0x3140
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ff1(%rip), %rsi      # 0xc538
movq %rbx, %rdi
callq 0x3350
jmp 0x952e
jmp 0x9584
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x3140
jmp 0x9568
jmp 0x9589
jmp 0x9589
movq %rax, %r14
leaq -0x68(%rbp), %rdi
jmp 0x9590
jmp 0x9589
jmp 0x9589
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
jmp 0x9584
movq %rax, %r14
jmp 0x9595
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3140
movq %r14, %rdi
callq 0x3320
nop