// File: /workspace/github_c_makefile_star2_O1/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 0x886d
callq 0x9cc3
movabsq $0x100000000, %r13      # imm = 0x100000000
jmp 0x8870
xorl %r13d, %r13d
leaq 0x20(%rbx), %rdi
movq (%rbx), %rax
movq 0x38(%rax), %rsi
movq %rdi, (%rsp)
callq 0x8736
movq %rax, %r12
testq %rax, %rax
je 0x88b5
movl 0x8(%r12), %eax
cmpl $0x8, %eax
ja 0x88ca
movl $0x160, %ecx            # imm = 0x160
btl %eax, %ecx
jae 0x88ca
cmpl $0x3f, %ebp
jne 0x88ca
movq (%rbx), %rdi
movq (%r12), %rdx
leaq 0x4009(%rip), %rsi      # 0xc8bc
jmp 0x88c3
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leaq 0x3fdd(%rip), %rsi      # 0xc8a0
xorl %eax, %eax
callq 0x980e
movl $0x1, %ebp
leaq 0x4003(%rip), %r14      # 0xc8d9
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x9c87
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x1, %eax
je 0x88fa
cmpl $0x16, %eax
je 0x88fa
movq %r14, %rsi
xorl %eax, %eax
callq 0x980e
incl %ebp
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x88d6
movl %ebp, %esi
callq 0x9c87
movq (%rbx), %rax
cmpl $0x22, 0x30(%rax)
jne 0x8af3
movq %rbx, %rdi
movl $0x16, %esi
callq 0x8b9b
movq %rax, %r14
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movq (%rbx), %rdi
callq 0x9cc3
movw $0x0, 0x18(%r14)
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8963
movzwl 0x18(%r14), %ebp
incl %ebp
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x894e
movw %bp, 0x18(%r14)
movq %rbx, %rdi
callq 0x8be2
movq %rax, %r12
movq %rax, 0x20(%r14)
movq (%rbx), %rdi
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x22, 0x30(%rdi)
je 0x8996
movq 0x18(%r12), %rdx
leaq 0x3f76(%rip), %rsi      # 0xc905
xorl %eax, %eax
callq 0x980e
movb $0x0, 0x34(%r14)
movl $0x240, %edi            # imm = 0x240
callq 0x1180
movq %rax, %r12
movq %rax, 0x38(%r14)
testq %rax, %rax
jne 0x89c4
leaq 0x266f(%rip), %rdi      # 0xb027
leaq 0x3f72(%rip), %rsi      # 0xc931
callq 0x98fb
xorl %r13d, %r13d
movq (%rbx), %rdi
callq 0x9cc3
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
cmpl $0x23, %eax
je 0x8abd
cmpl $0x40, %eax
je 0x8abd
cmpl $0x8, %r13d
jne 0x89fb
leaq 0x3f4c(%rip), %rsi      # 0xc940
xorl %eax, %eax
callq 0x980e
movq (%rbx), %rdi
movl 0x30(%rdi), %eax
movl %r13d, %r15d
cmpl $0x3f, %eax
je 0x8a13
cmpl $0x1c, %eax
jne 0x8a22
jmp 0x8b7c
leaq (%r15,%r15,8), %rax
movb $0x1, 0x1c(%r12,%rax,8)
callq 0x9cc3
leaq (%r15,%r15,8), %r15
movl $0x13, (%r12,%r15,8)
movq 0x4(%r14), %rax
movq %rax, 0x4(%r12,%r15,8)
movq (%rbx), %rax
movq 0x38(%rax), %rsi
movq (%rsp), %rdi
callq 0x8736
movq %rax, %rbp
testq %rax, %rax
jne 0x8a68
movq (%rbx), %rdi
movq 0x38(%rdi), %rdx
leal 0x1(%r13), %ecx
leaq 0x3f5a(%rip), %rsi      # 0xc9bb
xorl %eax, %eax
callq 0x980e
movq %rbp, 0x10(%r12,%r15,8)
movw $0x0, 0x18(%r12,%r15,8)
movq (%rbx), %rdi
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8aa0
leaq (%r12,%r15,8), %rbp
addq $0x18, %rbp
incw (%rbp)
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x8a8e
movq %rbx, %rdi
callq 0x8d29
movq %rax, 0x20(%r12,%r15,8)
incl %r13d
movq (%rbx), %rax
cmpl $0x24, 0x30(%rax)
je 0x89c7
movl %r13d, 0x30(%r14)
movq (%rbx), %rdi
cmpl $0x23, 0x30(%rdi)
je 0x8ad8
leaq 0x3f1e(%rip), %rsi      # 0xc9ef
xorl %eax, %eax
callq 0x980e
movq (%rbx), %rdi
callq 0x9cc3
movq (%rbx), %rax
cmpl $0x2a, 0x30(%rax)
jne 0x8b5e
movq $0x0, 0x28(%r14)
jmp 0x8b6a
movq %rbx, %rdi
movl $0x13, %esi
callq 0x8b9b
movq %rax, %r14
movq %r12, 0x10(%rax)
movq %r13, 0x18(%rax)
movw $0x0, 0x18(%rax)
movq (%rbx), %rdi
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
je 0x8b39
xorl %ebp, %ebp
incl %ebp
callq 0x9cc3
movq (%rbx), %rdi
cmpl $0x1, 0x30(%rdi)
jne 0x8b24
movw %bp, 0x18(%r14)
movq %rbx, %rdi
callq 0x8d29
movq %rax, 0x20(%r14)
movq (%rbx), %rdi
cmpl $0x2a, 0x30(%rdi)
je 0x8b6a
leaq 0x41d3(%rip), %rsi      # 0xcd28
xorl %eax, %eax
callq 0x980e
jmp 0x8b6a
movq %rbx, %rdi
callq 0x8d83
movq %rax, 0x28(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3147(%rip), %rdi      # 0xbcca
leaq 0x3dd2(%rip), %rsi      # 0xc95c
leaq 0x3ddf(%rip), %rcx      # 0xc970
movl $0x212, %edx            # imm = 0x212
callq 0x1100