// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b00d(%rip), %rsi     # 0x2a430
leaq 0x1b00d(%rip), %rdx     # 0x2a437
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
callq 0xfc2a
movq %r14, %rdi
callq 0xbaaa
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0xf45f
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x8260
movq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x17fcc
movl %eax, %r14d
leal -0x10(%r14), %eax
cmpl $0xe, %eax
ja 0xf864
leaq 0x1ac4a(%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 0x19e48
movq %rbx, %rdi
movl $0x10, %esi
jmp 0xf809
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x19e48
movq %rbx, %rdi
movl $0x19, %esi
jmp 0xf809
leaq 0xa0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1af6f(%rip), %rsi     # 0x2a457
leaq 0x1af7a(%rip), %rdx     # 0x2a469
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0xfc2a
movq %r14, %rdi
callq 0xbaaa
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xf524
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x11, %esi
callq 0xc54c
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rbx, %rdi
callq 0xf3fe
movq %r14, %rdi
movq %rax, %rsi
callq 0x2880c
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1aef3(%rip), %rsi     # 0x2a457
leaq 0x1aefe(%rip), %rdx     # 0x2a469
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc2a
movq %rbx, %rdi
callq 0xbd0c
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xf80e
movq 0x80(%rsp), %rsi
jmp 0xf66f
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x19e48
movq %rbx, %rdi
movl $0x1a, %esi
jmp 0xf809
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ae87(%rip), %rsi     # 0x2a457
leaq 0x1ae92(%rip), %rdx     # 0x2a469
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0xfc2a
movq %r14, %rdi
callq 0xbaaa
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xf603
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x17, %esi
callq 0xc54c
movl $0x18, %edi
callq 0x8250
movq %rax, %r14
movq %rbx, %rdi
callq 0xf3fe
movq %r14, %rdi
movq %rax, %rsi
callq 0x25148
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ae17(%rip), %rsi     # 0x2a457
leaq 0x1ae22(%rip), %rdx     # 0x2a469
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc2a
movq %rbx, %rdi
callq 0xbd0c
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xf80e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8260
jmp 0xf80e
movl $0x18, %edi
callq 0x8250
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x19e48
movq 0x8(%rbx), %rdi
callq 0x17fcc
cmpl $0x18, %eax
jne 0xf6f7
leaq 0x2aec7(%rip), %rax     # 0x3a570
movq (%rax), %r14
movq 0x8(%rbx), %rsi
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x17fd0
movq %r14, %rdi
movq %r12, %rsi
callq 0x28e6e
movl %eax, %ebp
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf6ee
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x8260
cmpl $-0x1, %ebp
je 0xf882
movq %rbx, %rdi
movl $0x18, %esi
callq 0xc54c
movq 0x8(%rbx), %rdi
callq 0x17fcc
cmpl $0x1e, %eax
jne 0xf982
movq %rbx, %rdi
callq 0xfa56
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 0x1b2e0
jmp 0xf80e
leaq 0xe0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1acfa(%rip), %rsi     # 0x2a457
leaq 0x1ad05(%rip), %rdx     # 0x2a469
leaq 0xd0(%rsp), %r14
movq %r14, %rdi
callq 0xfc2a
movq %r14, %rdi
callq 0xbaaa
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xf799
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x1e, %esi
callq 0xc54c
movq %rbx, %rdi
callq 0xd66a
movq %rax, %r14
leaq 0xc0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1ac92(%rip), %rsi     # 0x2a457
leaq 0x1ac9d(%rip), %rdx     # 0x2a469
leaq 0xb0(%rsp), %r15
movq %r15, %rdi
callq 0xfc2a
movq %r15, %rdi
callq 0xbd0c
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0xf801
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
movl $0x1f, %esi
callq 0xc54c
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1ac12(%rip), %rsi     # 0x2a430
leaq 0x1ac12(%rip), %rdx     # 0x2a437
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0xfc2a
movq %rbx, %rdi
callq 0xbd0c
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xf851
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 0x2a720(%rip), %rsi     # 0x39f98
movq %rax, %rdi
xorl %edx, %edx
callq 0x83f0
movq (%rbx), %rbx
leaq 0x120(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1aba0(%rip), %rsi     # 0x2a438
leaq 0x1abb7(%rip), %rdx     # 0x2a456
leaq 0x110(%rsp), %r14
movq %r14, %rdi
callq 0xfc2a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x174db
leaq 0x110(%rsp), %rdi
callq 0x8488
movl $0x1, %edi
callq 0x82e0
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x120(%rsp), %rsi
jmp 0xfa45
movq %rdx, %r12
movq %rax, %rbx
movl $0xfc0, %esi            # imm = 0xFC0
movq %r14, %rdi
callq 0x8260
jmp 0xf96b
movq %rax, %rbx
leaq 0x140(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xfa4d
movq 0x140(%rsp), %rsi
jmp 0xfa45
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x40(%rsp), %rsi
jmp 0xfa45
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x80(%rsp), %rsi
jmp 0xfa45
movq %rdx, %r12
movq %rax, %rbx
cmpl $0x1, %r12d
jne 0xfa4d
movq %rbx, %rdi
callq 0x80e0
callq 0x83d0
movq %r15, %r14
jmp 0xf80e
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0xfa4d
movq 0xc0(%rsp), %rsi
jmp 0xfa45
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0xe0(%rsp), %rsi
jmp 0xfa45
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
jmp 0xfa48
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x60(%rsp), %rsi
jmp 0xfa45
jmp 0xfa0c
jmp 0xfa0c
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0xa0(%rsp), %rsi
jmp 0xfa45
jmp 0xfa0c
jmp 0xfa0c
movq %rax, %rbx
movl $0x18, %esi
movq %r14, %rdi
jmp 0xfa48
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x20(%rsp), %rsi
jmp 0xfa45
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r15, %rdi
je 0xfa4d
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x8260
movq %rbx, %rdi
callq 0x8420
nop