// File: /workspace/github_cpp_makefile_star2_O2/AndrewAlbert[P]Compiler-Theory/SourceCode/parser.cpp
// Function: Parser::Factor(int&, int&)
bool Parser::Factor(int &type, int &size){
	int tempType, tempSize;
	if( CheckToken(T_LPAREN) ){
		if( Expression(tempType, tempSize) ){
			type = tempType;
			size = tempSize;
			if( CheckToken(T_RPAREN) ){
				return true;
			}
			else ReportFatalError("expected ')' in factor around the expression");
		}
		else ReportFatalError("expected expression within parenthesis of factor");
	}
	else if( CheckToken(T_SUBTRACT) ){
		if( Integer() ){
			type = TYPE_INTEGER;
			size = 0;
			generator->NegateTopRegisters( type, size );
			return true;
		}
		else if( Float() ){
			type = TYPE_FLOAT;
			size = 0;
			generator->NegateTopRegisters( type, size );
			return true;
		}
		else if( Name(tempType, tempSize) ){
			type = tempType;
			size = tempSize;
			if( !isNumber(type) ) ReportError(" negation '-' before variable name is valid only for integers and floats.");
			generator->NegateTopRegisters( type, size );
			return true;
		}
		else return false;
	}
	else if( Name(tempType, tempSize) ){
		type = tempType;
		size = tempSize;
		return true;
	}
	else if( Integer() ){
		type = TYPE_INTEGER;
		size = 0;
		return true;
	}
	else if( Float() ){
		type = TYPE_FLOAT;
		size = 0;
		return true;
	}
	else if( String() ){
		type = TYPE_STRING;
		size = 0;
		return true;
	}
	else if( Char() ){
		type = TYPE_CHAR;
		size = 0;
		return true;
	}
	else if( Bool() ){
		type = TYPE_BOOL;
		size = 0;
		return true;
	}
	else{
		return false;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0x12d, %esi            # imm = 0x12D
callq 0x49b0
testb %al, %al
je 0x890c
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x64cc
testb %al, %al
je 0x8a80
movl 0xc(%rsp), %eax
movl %eax, (%r15)
movl 0x8(%rsp), %eax
movl %eax, (%r14)
movq %rbx, %rdi
movl $0x12e, %esi            # imm = 0x12E
callq 0x49b0
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x8a72
leaq 0x9c98(%rip), %rsi      # 0x12588
leaq 0x50(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x36b8
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x4278
movq %rbx, %rdi
movl $0x133, %esi            # imm = 0x133
callq 0x49b0
testb %al, %al
je 0x8932
movq %rbx, %rdi
callq 0x8e10
testb %al, %al
je 0x895b
movl $0x10a, (%r15)          # imm = 0x10A
jmp 0x896e
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x8f60
testb %al, %al
je 0x8988
movl 0xc(%rsp), %eax
movl %eax, (%r15)
movl 0x8(%rsp), %eax
movl %eax, (%r14)
jmp 0x8a70
movq %rbx, %rdi
callq 0x8eb8
testb %al, %al
je 0x89a4
movl $0x10b, (%r15)          # imm = 0x10B
andl $0x0, (%r14)
movq 0x98(%rbx), %rdi
movl (%r15), %esi
xorl %edx, %edx
callq 0xda50
jmp 0x8a70
movq %rbx, %rdi
callq 0x8e10
testb %al, %al
je 0x8a1a
movl $0x10a, (%r15)          # imm = 0x10A
jmp 0x8a6c
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x8f60
testb %al, %al
je 0x8a7c
movl 0xc(%rsp), %eax
movl %eax, (%r15)
movl 0x8(%rsp), %edx
movl %edx, (%r14)
movl (%r15), %esi
movl %esi, %eax
andl $-0x2, %eax
cmpl $0x10a, %eax            # imm = 0x10A
je 0x8a0e
leaq 0x9c04(%rip), %rsi      # 0x125e6
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x36b8
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x47e0
leaq 0x10(%rsp), %rdi
callq 0x20f0
movl (%r15), %esi
movl (%r14), %edx
movq 0x98(%rbx), %rdi
jmp 0x897e
movq %rbx, %rdi
callq 0x8eb8
testb %al, %al
je 0x8a2f
movl $0x10b, (%r15)          # imm = 0x10B
jmp 0x8a6c
movq %rbx, %rdi
callq 0x93a8
testb %al, %al
je 0x8a44
movl $0x10d, (%r15)          # imm = 0x10D
jmp 0x8a6c
movq %rbx, %rdi
callq 0x9450
testb %al, %al
je 0x8a59
movl $0x10e, (%r15)          # imm = 0x10E
jmp 0x8a6c
movq %rbx, %rdi
callq 0x94f8
testb %al, %al
je 0x8a7c
movl $0x10c, (%r15)          # imm = 0x10C
andl $0x0, (%r14)
movb $0x1, %al
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x8a72
leaq 0x9b2e(%rip), %rsi      # 0x125b5
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x36b8
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x4278
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x8ac3
jmp 0x8aca
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x8ac3
jmp 0x8aca
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x20f0
jmp 0x8acd
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2310
nop