// File: /workspace/github_c_makefile_star2_O3/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 0x8756
callq 0x9b62
movq (%rbx), %rdi
movabsq $0x100000000, %r13      # imm = 0x100000000
jmp 0x8759
xorl %r13d, %r13d
leaq 0x20(%rbx), %rax
movq 0x38(%rdi), %rsi
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x861b
movq %rax, %r12
testq %rax, %rax
je 0x879e
movl 0x8(%r12), %eax
cmpl $0x8, %eax
ja 0x87b3
movl $0x160, %ecx            # imm = 0x160
btl %eax, %ecx
jae 0x87b3
cmpl $0x3f, %ebp
jne 0x87b3
movq (%rbx), %rdi
movq (%r12), %rdx
leaq 0x4120(%rip), %rsi      # 0xc8bc
jmp 0x87ac
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leaq 0x40f4(%rip), %rsi      # 0xc8a0
xorl %eax, %eax
callq 0x96c6
movq (%rbx), %rdi
movl $0x1, %ebp
leaq 0x4117(%rip), %r15      # 0xc8d9
movl %ebp, %esi
callq 0x9b26
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x1, %eax
je 0x87e9
cmpl $0x16, %eax
je 0x87e9
movq %r15, %rsi
xorl %eax, %eax
callq 0x96c6
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
incl %ebp
cmpl $0x1, %eax
jne 0x87c2
movl %ebp, %esi
callq 0x9b26
movq (%rbx), %rax
cmpl $0x22, 0x30(%rax)
jne 0x89dd
movq %rbx, %rdi
movl $0x16, %esi
callq 0x8a85
movq %rax, %r15
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movq (%rbx), %rdi
callq 0x9b62
movw $0x0, 0x18(%r15)
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x884b
xorl %ebp, %ebp
incl %ebp
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x8836
movw %bp, 0x18(%r15)
movq %rbx, %rdi
callq 0x8acc
movq %rax, %r12
movq %rax, 0x20(%r15)
movq (%rbx), %rdi
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x22, 0x30(%rdi)
je 0x887e
movq 0x18(%r12), %rdx
leaq 0x408e(%rip), %rsi      # 0xc905
xorl %eax, %eax
callq 0x96c6
movb $0x0, 0x34(%r15)
movl $0x240, %edi            # imm = 0x240
callq 0x1180
movq %rax, %r12
movq %rax, 0x38(%r15)
testq %rax, %rax
jne 0x88ac
leaq 0x2787(%rip), %rdi      # 0xb027
leaq 0x408a(%rip), %rsi      # 0xc931
callq 0x97b3
movq (%rbx), %rdi
xorl %r13d, %r13d
callq 0x9b62
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x23, %eax
je 0x89ab
cmpl $0x40, %eax
je 0x89ab
cmpl $0x8, %r13d
jne 0x88e9
leaq 0x4064(%rip), %rsi      # 0xc940
xorl %eax, %eax
callq 0x96c6
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x3f, %eax
je 0x88fc
cmpl $0x1c, %eax
je 0x8a66
movl %r13d, %r14d
jmp 0x8911
movl %r13d, %r14d
leaq (%r14,%r14,8), %rax
movb $0x1, 0x1c(%r12,%rax,8)
callq 0x9b62
movq (%rbx), %rdi
leaq (%r14,%r14,8), %r14
movl $0x13, (%r12,%r14,8)
movq 0x4(%r15), %rax
movq %rax, 0x4(%r12,%r14,8)
movq 0x38(%rdi), %rsi
movq (%rsp), %rdi
callq 0x861b
movq %rax, %rbp
testq %rax, %rax
jne 0x8954
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leal 0x1(%r13), %ecx
leaq 0x406e(%rip), %rsi      # 0xc9bb
xorl %eax, %eax
callq 0x96c6
movq %rbp, 0x10(%r12,%r14,8)
movw $0x0, 0x18(%r12,%r14,8)
movq (%rbx), %rdi
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x898c
leaq (%r12,%r14,8), %rbp
addq $0x18, %rbp
incw (%rbp)
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x897a
movq %rbx, %rdi
callq 0x8c24
movq %rax, 0x20(%r12,%r14,8)
incl %r13d
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x24, %eax
je 0x88b2
movl %r13d, 0x30(%r15)
cmpl $0x23, %eax
je 0x89c5
leaq 0x4034(%rip), %rsi      # 0xc9ef
xorl %eax, %eax
callq 0x96c6
movq (%rbx), %rdi
callq 0x9b62
movq (%rbx), %rax
cmpl $0x2a, 0x30(%rax)
jne 0x8a48
movq $0x0, 0x28(%r15)
jmp 0x8a54
movq %rbx, %rdi
movl $0x13, %esi
callq 0x8a85
movq %rax, %r15
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movw $0x0, 0x18(%rax)
movq (%rbx), %rdi
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8a23
xorl %ebp, %ebp
incl %ebp
callq 0x9b62
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x8a0e
movw %bp, 0x18(%r15)
movq %rbx, %rdi
callq 0x8c24
movq %rax, 0x20(%r15)
movq (%rbx), %rdi
cmpl $0x2a, 0x30(%rdi)
je 0x8a54
leaq 0x42e9(%rip), %rsi      # 0xcd28
xorl %eax, %eax
callq 0x96c6
jmp 0x8a54
movq %rbx, %rdi
callq 0x8c7e
movq %rax, 0x28(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x325d(%rip), %rdi      # 0xbcca
leaq 0x3ee8(%rip), %rsi      # 0xc95c
leaq 0x3ef5(%rip), %rcx      # 0xc970
movl $0x212, %edx            # imm = 0x212
callq 0x1100