// File: /workspace/github_cpp_makefile_star2_O1/martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::Primary()
ASexpression* TCparser::Primary() // DONE with AS
	{
		/* Primary --> ID [ FunctionCall ]
					 | NUMBER
					 | STRING
					 | CHARLITERAL
					 | LPAREN Expression RPAREN
					 | MINUS | NOT Primary */
		enteringDEBUG("Primary");
		ASexpression* operand = NULL;
		TCtoken* t = buff;
		int loc;
		int tok = buff->getTokenType();
		switch (tok)
		{
			case ID:
				operand = new ASsimpleExpr(t);
                if (buff->getTokenType() == ID)
                {
                    loc = symTable->find(buff->getLexeme());
                    if (loc == -1)
                    {
                        reportSEMANTIC_ERROR(scanner,"variable not declared Primanry");
                        exit(EXIT_FAILURE);
                    }
                }
                accept(ID);
                if (buff->getTokenType() == LPAREN){
                    try
                    {
                        ASexpression* arr[] = { FunctionCall() };
                        operand = new ASfuncCall(operand, arr, 1);
                    }
                    catch (int t) { break; }
                    break;
                }
				break;

			case NUMBER:
				operand = new ASsimpleExpr(t);
				accept(NUMBER);
				break;

			case STRING:
				operand = new ASsimpleExpr(t);
				accept(STRING);
				break;

			case CHARLITERAL:
				operand = new ASsimpleExpr(t);
				accept(CHARLITERAL);
				break;

			case LPAREN:
				enteringDEBUG("Primary Additional");
				accept(LPAREN);
				operand = Expression();
				exitingDEBUG("Primary Additional");
				accept(RPAREN);
				break;

			case MINUS:
				enteringDEBUG("Primary Additional");
				accept(MINUS);
				operand = new ASminus(Primary());
				exitingDEBUG("Primary Additional");
				break;

			case NOTEQUAL:
				enteringDEBUG("Primary Additional");
				accept(NOTEQUAL);
				operand = new ASnot(Primary());
				exitingDEBUG("Primary Additional");
				break;

			default:
				throw tok;
		}
		exitingDEBUG("Primary");
		return operand;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rdi, %rbx
leaq 0x100(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1aff5(%rip), %rsi     # 0x2a430
leaq 0x1aff5(%rip), %rdx     # 0x2a437
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
callq 0xfc42
movq %r14, %rdi
callq 0xbac6
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0xf477
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x8260
movq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x179ac
movl %eax, %r14d
leal -0x10(%r14), %eax
cmpl $0xe, %eax
ja 0xf87c
leaq 0x1ac32(%rip), %rcx     # 0x2a0cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x19820
movq %rbx, %rdi
movl $0x10, %esi
jmp 0xf821
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x19820
movq %rbx, %rdi
movl $0x19, %esi
jmp 0xf821
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1af57(%rip), %rsi     # 0x2a457
leaq 0x1af62(%rip), %rdx     # 0x2a469
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0xfc42
movq %r14, %rdi
callq 0xbac6
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xf53c
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x11, %esi
callq 0xc558
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rbx, %rdi
callq 0xf416
movq %r14, %rdi
movq %rax, %rsi
callq 0x281fc
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1aedb(%rip), %rsi     # 0x2a457
leaq 0x1aee6(%rip), %rdx     # 0x2a469
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc42
movq %rbx, %rdi
callq 0xbd28
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xf826
movq 0x80(%rsp), %rsi
jmp 0xf687
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x19820
movq %rbx, %rdi
movl $0x1a, %esi
jmp 0xf821
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ae6f(%rip), %rsi     # 0x2a457
leaq 0x1ae7a(%rip), %rdx     # 0x2a469
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0xfc42
movq %r14, %rdi
callq 0xbac6
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xf61b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x17, %esi
callq 0xc558
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rbx, %rdi
callq 0xf416
movq %r14, %rdi
movq %rax, %rsi
callq 0x24b18
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1adff(%rip), %rsi     # 0x2a457
leaq 0x1ae0a(%rip), %rdx     # 0x2a469
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc42
movq %rbx, %rdi
callq 0xbd28
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xf826
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8260
jmp 0xf826
movl $0x18, %edi
callq 0x8250
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x19820
movq 0x8(%rbx), %rdi
callq 0x179ac
cmpl $0x18, %eax
jne 0xf70f
leaq 0x2aeaf(%rip), %rax     # 0x3a570
movq (%rax), %r14
movq 0x8(%rbx), %rsi
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x179b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x28862
movl %eax, %ebp
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf706
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x8260
cmpl $-0x1, %ebp
je 0xf89a
movq %rbx, %rdi
movl $0x18, %esi
callq 0xc558
movq 0x8(%rbx), %rdi
callq 0x179ac
cmpl $0x1e, %eax
jne 0xf99a
movq %rbx, %rdi
callq 0xfa6e
movq %rax, 0x8(%rsp)
movl $0xfc0, %edi            # imm = 0xFC0
callq 0x8250
movq %rax, %r14
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
movq %r15, %rsi
movl $0x1, %ecx
callq 0x1aca8
jmp 0xf826
leaq 0xe0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ace2(%rip), %rsi     # 0x2a457
leaq 0x1aced(%rip), %rdx     # 0x2a469
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
callq 0xfc42
movq %r14, %rdi
callq 0xbac6
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xf7b1
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x1e, %esi
callq 0xc558
movq %rbx, %rdi
callq 0xd682
movq %rax, %r14
leaq 0xc0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1ac7a(%rip), %rsi     # 0x2a457
leaq 0x1ac85(%rip), %rdx     # 0x2a469
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
callq 0xfc42
movq %r15, %rdi
callq 0xbd28
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0xf819
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x1f, %esi
callq 0xc558
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1abfa(%rip), %rsi     # 0x2a430
leaq 0x1abfa(%rip), %rdx     # 0x2a437
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc42
movq %rbx, %rdi
callq 0xbd28
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xf869
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8260
movq %r14, %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x8130
movl %r14d, (%rax)
movq 0x2a708(%rip), %rsi     # 0x39f98
movq %rax, %rdi
xorl %edx, %edx
callq 0x83f0
movq (%rbx), %rbx
leaq 0x120(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ab88(%rip), %rsi     # 0x2a438
leaq 0x1ab9f(%rip), %rdx     # 0x2a456
leaq 0x110(%rsp), %r14
movq %r14, %rdi
callq 0xfc42
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16ebd
leaq 0x110(%rsp), %rdi
callq 0x8488
movl $0x1, %edi
callq 0x82e0
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x120(%rsp), %rsi
jmp 0xfa5d
movq %rdx, %r12
movq %rax, %rbx
movl $0xfc0, %esi            # imm = 0xFC0
movq %r14, %rdi
callq 0x8260
jmp 0xf983
movq %rax, %rbx
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfa65
movq 0x140(%rsp), %rsi
jmp 0xfa5d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x40(%rsp), %rsi
jmp 0xfa5d
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x80(%rsp), %rsi
jmp 0xfa5d
movq %rdx, %r12
movq %rax, %rbx
cmpl $0x1, %r12d
jne 0xfa65
movq %rbx, %rdi
callq 0x80e0
callq 0x83d0
movq %r15, %r14
jmp 0xf826
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0xfa65
movq 0xc0(%rsp), %rsi
jmp 0xfa5d
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0xe0(%rsp), %rsi
jmp 0xfa5d
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
jmp 0xfa60
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x60(%rsp), %rsi
jmp 0xfa5d
jmp 0xfa24
jmp 0xfa24
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0xa0(%rsp), %rsi
jmp 0xfa5d
jmp 0xfa24
jmp 0xfa24
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0xfa60
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x20(%rsp), %rsi
jmp 0xfa5d
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa65
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
callq 0x8420
nop