// File: kram[P]kram/./src/parser/parser.cpp
// Function: Parser::keyword_class()
Instruction* Parser::keyword_class() {
	Instruction* ins = new Instruction(Ins::DEFINE_CLASS);

	this->advance();

	lexer::Token* n = this->get_and_expect_token(lexer::Token::NAME(""));
	ins->name = n->value;

	this->advance();
	this->get_and_expect_token(lexer::Token::OPERATOR("{"));

	this->advance();
	ins->right = this->read_until(std::vector<lexer::Token>{
		lexer::Token::OPERATOR("}")
	});

	return ins;
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq 0x1d0(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x80, %edi
callq 0x32e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x70(%rsp)
movl $0x9, %esi
callq 0x26dd0
jmp 0x23c3d
movq 0x68(%rsp), %rdi
movq 0x70(%rsp), %rax
movq %rax, 0x1c8(%rsp)
callq 0x21220
leaq 0x167(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x34a0
movq 0x60(%rsp), %rdx
leaq 0x7bf0(%rip), %rsi      # 0x2b862
leaq 0x168(%rsp), %rdi
callq 0x3390
jmp 0x23c81
leaq 0x188(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0xd8c0
jmp 0x23c98
movq 0x68(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0x229f0
movq %rax, 0x58(%rsp)
jmp 0x23cb1
leaq 0x188(%rsp), %rdi
callq 0xdeb0
leaq 0x168(%rsp), %rdi
callq 0x31f0
leaq 0x167(%rsp), %rdi
callq 0x3310
movq 0x58(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rsi
addq $0x8, %rsi
movq 0x1c8(%rsp), %rdi
addq $0x8, %rdi
callq 0x3040
movq 0x68(%rsp), %rdi
callq 0x21220
leaq 0x117(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x34a0
movq 0x50(%rsp), %rdx
leaq 0x7587(%rip), %rsi      # 0x2b2b1
leaq 0x118(%rsp), %rdi
callq 0x3390
jmp 0x23d39
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xd7e0
jmp 0x23d50
movq 0x68(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x229f0
jmp 0x23d64
leaq 0x138(%rsp), %rdi
callq 0xdeb0
leaq 0x118(%rsp), %rdi
callq 0x31f0
leaq 0x117(%rsp), %rdi
callq 0x3310
movq 0x68(%rsp), %rdi
callq 0x21220
movb $0x1, 0x7e(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x7f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x34a0
movq 0x48(%rsp), %rdx
leaq 0x74ee(%rip), %rsi      # 0x2b2b3
leaq 0x80(%rsp), %rdi
callq 0x3390
jmp 0x23dd4
leaq 0xa8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xd7e0
jmp 0x23deb
movb $0x0, 0x7e(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq $0x1, 0xd8(%rsp)
leaq 0x7d(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x26940
movq 0x40(%rsp), %rcx
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq 0xe0(%rsp), %rdi
callq 0x26950
jmp 0x23e3f
movq 0x68(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
leaq 0xe0(%rsp), %rdx
callq 0x20b20
jmp 0x23e5b
movq 0x1c8(%rsp), %rdi
addq $0x50, %rdi
leaq 0xf8(%rsp), %rsi
callq 0x26e30
leaq 0xf8(%rsp), %rdi
callq 0x5560
leaq 0xe0(%rsp), %rdi
callq 0x269e0
leaq 0x7d(%rsp), %rdi
callq 0x26a40
leaq 0xa8(%rsp), %rax
movq %rax, 0x30(%rsp)
addq $0x28, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x28(%rsp)
callq 0xdeb0
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x38(%rsp)
jne 0x23eae
leaq 0x80(%rsp), %rdi
callq 0x31f0
leaq 0x7f(%rsp), %rdi
callq 0x3310
movq 0x1c8(%rsp), %rax
addq $0x1d8, %rsp            # imm = 0x1D8
retq
movq 0x70(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
callq 0x32b0
jmp 0x2410f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x23f79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x23f6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xdeb0
leaq 0x168(%rsp), %rdi
callq 0x31f0
leaq 0x167(%rsp), %rdi
callq 0x3310
jmp 0x2410f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x23fe5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x23fd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x138(%rsp), %rdi
callq 0xdeb0
leaq 0x118(%rsp), %rdi
callq 0x31f0
leaq 0x117(%rsp), %rdi
callq 0x3310
jmp 0x2410f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x240b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x240a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x24060
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x269e0
leaq 0x7d(%rsp), %rdi
callq 0x26a40
leaq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
addq $0x28, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x10(%rsp)
callq 0xdeb0
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x20(%rsp)
jne 0x24080
jmp 0x240a9
leaq 0x80(%rsp), %rdi
callq 0x31f0
leaq 0x7f(%rsp), %rdi
callq 0x3310
testb $0x1, 0x7e(%rsp)
jne 0x240c9
jmp 0x2410d
movq 0xa0(%rsp), %rax
leaq 0xa8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x8(%rsp)
je 0x2410b
movq 0x8(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, (%rsp)
callq 0xdeb0
movq (%rsp), %rax
leaq 0xa8(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x8(%rsp)
jne 0x240e3
jmp 0x2410d
jmp 0x2410f
movq 0x1c0(%rsp), %rdi
callq 0x3490
nopl (%rax)