// File: /workspace/github_cpp_makefile_star2_O3/kram[P]kram/./src/parser/parser.cpp
// Function: Parser::Parser(std::vector<lexer::Token*, std::allocator<lexer::Token*>>)
Parser::Parser(std::vector<lexer::Token*> tokens) {

	// Initialize variables
	this->tokens = tokens;
	this->lenght = tokens.size();
	this->index = 0;
	this->has_advanced = false;

	// Hashmap of comparisions
	this->comparisions[lexer::Type::OPERATOR_EQEQ] = true;
	this->comparisions[lexer::Type::OPERATOR_GT] = true;
	this->comparisions[lexer::Type::OPERATOR_GTEQ] = true;
	this->comparisions[lexer::Type::OPERATOR_LT] = true;
	this->comparisions[lexer::Type::OPERATOR_LTEQ] = true;
	this->comparisions[lexer::Type::OPERATOR_DOUBLE_AND] = true;
	this->comparisions[lexer::Type::OPERATOR_DOUBLE_OR] = true;
	this->comparisions[lexer::Type::OPERATOR_NOT_EQ] = true;

	// 123++
	this->leftOnlyInfix[lexer::Type::OPERATOR_PLUS_PLUS] = true;
	this->leftOnlyInfix[lexer::Type::OPERATOR_MINUS_MINUS] = true;

	// -123
	this->rightOnlyInfix[lexer::Type::OPERATOR_MINUS] = true;

	// List of all operators starting a new sub-expression
	this->startOperators[lexer::Type::OPERATOR_EQEQ] = true;
	this->startOperators[lexer::Type::OPERATOR_GT] = true;
	this->startOperators[lexer::Type::OPERATOR_GTEQ] = true;
	this->startOperators[lexer::Type::OPERATOR_LT] = true;
	this->startOperators[lexer::Type::OPERATOR_LTEQ] = true;
	this->startOperators[lexer::Type::OPERATOR_DOUBLE_AND] = true;
	this->startOperators[lexer::Type::OPERATOR_DOUBLE_OR] = true;
	this->startOperators[lexer::Type::OPERATOR_PLUS_PLUS] = true;
	this->startOperators[lexer::Type::OPERATOR_MINUS_MINUS] = true;
	this->startOperators[lexer::Type::OPERATOR_MINUS] = true;
	this->startOperators[lexer::Type::OPERATOR_PLUS] = true;
	this->startOperators[lexer::Type::OPERATOR_MUL] = true;
	this->startOperators[lexer::Type::OPERATOR_DIV] = true;
	this->startOperators[lexer::Type::OPERATOR_PAREN_L] = true;
	this->startOperators[lexer::Type::OPERATOR_EQ] = true;
	this->startOperators[lexer::Type::OPERATOR_2DOT] = true;
	this->startOperators[lexer::Type::OPERATOR_3DOT] = true;
	this->startOperators[lexer::Type::OPERATOR_NOT_EQ] = true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x28(%rdi), %r14
leaq 0x58(%rdi), %rax
movq %rax, 0x28(%rdi)
movl $0x1, %eax
movq %rax, 0x30(%rdi)
movups %xmm0, 0x38(%rdi)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x48(%rdi)
movups %xmm0, 0x50(%rdi)
leaq 0x60(%rdi), %r15
leaq 0x90(%rdi), %rdx
movq %rdx, 0x60(%rdi)
movq %rax, 0x68(%rdi)
movups %xmm0, 0x70(%rdi)
movl %ecx, 0x80(%rdi)
movups %xmm0, 0x88(%rdi)
leaq 0x98(%rdi), %r12
leaq 0xc8(%rdi), %rdx
movq %rdx, 0x98(%rdi)
movq %rax, 0xa0(%rdi)
movups %xmm0, 0xa8(%rdi)
movl %ecx, 0xb8(%rdi)
movups %xmm0, 0xc0(%rdi)
leaq 0xd0(%rdi), %r13
leaq 0x100(%rdi), %rdx
movq %rdx, 0xd0(%rdi)
movq %rax, 0xd8(%rdi)
movups %xmm0, 0xe0(%rdi)
movl %ecx, 0xf0(%rdi)
movups %xmm0, 0xf8(%rdi)
callq 0x110ce
movq 0x8(%rbp), %rax
subq (%rbp), %rax
shrq $0x3, %rax
movl %eax, 0x1c(%rbx)
movl $0x0, 0x18(%rbx)
movb $0x0, 0x20(%rbx)
leaq 0x4(%rsp), %rsi
movl $0x18, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x19, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1a, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1b, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1c, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1d, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1e, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x17, (%rsi)
movq %r14, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1f, (%rsi)
movq %r12, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x20, (%rsi)
movq %r12, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x22, (%rsi)
movq %r13, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x18, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x19, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1a, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1b, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1c, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1d, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1e, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x1f, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x20, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x22, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x21, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x23, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x24, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x26, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x16, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x2c, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x2d, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
leaq 0x4(%rsp), %rsi
movl $0x17, (%rsi)
movq %r15, %rdi
callq 0x11306
movb $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
jmp 0xdbf2
movq %rax, %rbp
movq %r13, %rdi
callq 0x4644
movq %r12, %rdi
callq 0x4644
movq %r15, %rdi
callq 0x4644
movq %r14, %rdi
callq 0x4644
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xdc22
callq 0x3230
movq %rbp, %rdi
callq 0x33c0