// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/parser/parser.c
// Function: opp_parse_type
static struct Opp_Node* opp_parse_type(struct Opp_Parser* parser)
{
	struct Opp_Type_Decl type = {0};

	if (parser->lex->t.id == TUNSIGNED) {
		opp_next(parser->lex);
		type.unsign = 1;
	}

	type.decl = get_type(&parser->tree, parser->lex->t.buffer.buf);

	if (type.decl == NULL)
		opp_error(parser->lex, "Use of undeclared type '%s'", parser->lex->t.buffer.buf);

	else if ((type.decl->t_type == TYPE_FLOAT || type.decl->t_type == TYPE_DOUBLE 
		|| type.decl->t_type == TYPE_STRUCT) && type.unsign)
		opp_error(parser->lex, "Type '%s' cannot be unsigned", type.decl->id);

	int lookahead = 1;
	do {
		opp_peek_tok(parser->lex, lookahead);
		if (parser->lex->t.id != TMUL && parser->lex->t.id != TIDENT)
			opp_error(parser->lex, "Expected a identifier or '*' got unexpected");
		lookahead++;
	} while (parser->lex->t.id != TIDENT);

	opp_peek_tok(parser->lex, lookahead);

	if (parser->lex->t.id == TOPENP)
		return opp_parse_func(parser, type);
	else
		return opp_parse_var_decl(parser, type);
	
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl 0x30(%rdi), %ebp
cmpl $0x3f, %ebp
jne 0x8307
callq 0x95cd
movq (%rbx), %rdi
movabsq $0x100000000, %r13      # imm = 0x100000000
jmp 0x830a
xorl %r13d, %r13d
leaq 0x20(%rbx), %rax
movq 0x38(%rdi), %rsi
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x81d6
movq %rax, %r12
testq %rax, %rax
je 0x834f
movl 0x8(%r12), %eax
cmpl $0x8, %eax
ja 0x8364
movl $0x160, %ecx            # imm = 0x160
btl %eax, %ecx
jae 0x8364
cmpl $0x3f, %ebp
jne 0x8364
movq (%rbx), %rdi
movq (%r12), %rdx
leaq 0x358f(%rip), %rsi      # 0xb8dc
jmp 0x835d
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leaq 0x3563(%rip), %rsi      # 0xb8c0
xorl %eax, %eax
callq 0x919e
movq (%rbx), %rdi
pushq $0x1
popq %rbp
leaq 0x3588(%rip), %r15      # 0xb8f9
movl %ebp, %esi
callq 0x958c
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x1, %eax
je 0x8398
cmpl $0x16, %eax
je 0x8398
movq %r15, %rsi
xorl %eax, %eax
callq 0x919e
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
incl %ebp
cmpl $0x1, %eax
jne 0x8371
movl %ebp, %esi
callq 0x958c
movq (%rbx), %rax
cmpl $0x22, 0x30(%rax)
jne 0x83ee
pushq $0x16
popq %rsi
movq %rbx, %rdi
callq 0x8610
movq %rax, %r15
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movq (%rbx), %rdi
callq 0x95cd
andw $0x0, 0x18(%r15)
movw $0x1, %bp
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8430
movw %bp, 0x18(%r15)
callq 0x95cd
incl %ebp
jmp 0x83d7
pushq $0x13
popq %rsi
movq %rbx, %rdi
callq 0x8610
movq %rax, %r15
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
andw $0x0, 0x18(%rax)
movq (%rbx), %rdi
callq 0x95cd
movw $0x1, %bp
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x85ae
movw %bp, 0x18(%r15)
callq 0x95cd
incl %ebp
jmp 0x8415
movq %rbx, %rdi
callq 0x8658
movq %rax, %r12
movq %rax, 0x20(%r15)
movq (%rbx), %rdi
callq 0x95cd
movq (%rbx), %rdi
cmpl $0x22, 0x30(%rdi)
je 0x8463
movq 0x18(%r12), %rdx
leaq 0x34c9(%rip), %rsi      # 0xb925
xorl %eax, %eax
callq 0x919e
movb $0x0, 0x34(%r15)
movl $0x240, %edi            # imm = 0x240
callq 0x1180
movq %rax, %r12
movq %rax, 0x38(%r15)
testq %rax, %rax
jne 0x8491
leaq 0x1ba2(%rip), %rdi      # 0xa027
leaq 0x34c5(%rip), %rsi      # 0xb951
callq 0x9287
movq (%rbx), %rdi
xorl %r13d, %r13d
callq 0x95cd
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x23, %eax
je 0x857f
cmpl $0x40, %eax
je 0x857f
cmpl $0x8, %r13d
jne 0x84ce
leaq 0x349f(%rip), %rsi      # 0xb960
xorl %eax, %eax
callq 0x919e
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
movl %r13d, %r14d
cmpl $0x3f, %eax
je 0x84e0
cmpl $0x1c, %eax
jne 0x84f2
jmp 0x85f1
imulq $0x48, %r14, %rax
movb $0x1, 0x1c(%r12,%rax)
callq 0x95cd
movq (%rbx), %rdi
imulq $0x48, %r14, %r14
movl $0x13, (%r12,%r14)
movq 0x4(%r15), %rax
movq %rax, 0x4(%r12,%r14)
movq 0x38(%rdi), %rsi
movq (%rsp), %rdi
callq 0x81d6
movq %rax, %rbp
testq %rax, %rax
jne 0x8535
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leal 0x1(%r13), %ecx
leaq 0x34ad(%rip), %rsi      # 0xb9db
xorl %eax, %eax
callq 0x919e
movq %rbp, 0x10(%r12,%r14)
leaq (%r12,%r14), %rbp
addq $0x18, %rbp
andw $0x0, 0x18(%r12,%r14)
movq (%rbx), %rdi
callq 0x95cd
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8560
incw (%rbp)
jmp 0x854c
movq %rbx, %rdi
callq 0x87af
movq %rax, 0x20(%r12,%r14)
incl %r13d
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x24, %eax
je 0x8497
movl %r13d, 0x30(%r15)
cmpl $0x23, %eax
je 0x8599
leaq 0x3480(%rip), %rsi      # 0xba0f
xorl %eax, %eax
callq 0x919e
movq (%rbx), %rdi
callq 0x95cd
movq (%rbx), %rax
cmpl $0x2a, 0x30(%rax)
jne 0x85d3
andq $0x0, 0x28(%r15)
jmp 0x85df
movq %rbx, %rdi
callq 0x87af
movq %rax, 0x20(%r15)
movq (%rbx), %rdi
cmpl $0x2a, 0x30(%rdi)
je 0x85df
leaq 0x377e(%rip), %rsi      # 0xbd48
xorl %eax, %eax
callq 0x919e
jmp 0x85df
movq %rbx, %rdi
callq 0x880f
movq %rax, 0x28(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26d2(%rip), %rdi      # 0xacca
leaq 0x337d(%rip), %rsi      # 0xb97c
leaq 0x338a(%rip), %rcx      # 0xb990
movl $0x212, %edx            # imm = 0x212
callq 0x1100