// File: martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::Term()
ASexpression* TCparser::Term() // WIP
	{
		// Term --> Primary { MULTI Primary }
		enteringDEBUG("Term");
        TCtoken *token;
		ASexpression* operand = NULL;
		ASexpression* operand2 = NULL;
		ASoperator* operand3 = NULL;
		operand = Primary();
		while (buff->getTokenType() == MULTI || buff->getTokenType() == DIVOP)
		{
			enteringDEBUG("Term Additional");
            try
            {
                operand3 = new ASoperator(accept(MULTI));
            }
            catch (int t)
            {
                operand3 = new ASoperator(accept(DIVOP));
                token = buff;
                if (token->getLexeme() == "0")
                {
                    reportSEMANTIC_ERROR(scanner,"Cannot Divide by 0");
                    exit(EXIT_FAILURE);
                }
            }
			operand2 = Primary();
			operand = new ASexpr(operand3, operand2, operand);
			exitingDEBUG("Term Additional");
		}
		exitingDEBUG("Term");
		return operand;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x95c0
movq -0x128(%rbp), %rdx
leaq 0x20fe4(%rip), %rsi     # 0x3343c
leaq -0x28(%rbp), %rdi
callq 0x13550
jmp 0x12463
leaq -0x28(%rbp), %rdi
callq 0xd790
jmp 0x1246e
leaq -0x28(%rbp), %rdi
callq 0x9658
leaq -0x29(%rbp), %rdi
callq 0x93b0
movq -0x130(%rbp), %rdi
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
callq 0x12990
movq %rax, -0x50(%rbp)
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1be60
movl %eax, %ecx
movb $0x1, %al
cmpl $0x1d, %ecx
movb %al, -0x131(%rbp)
je 0x124e3
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1be60
cmpl $0x16, %eax
sete %al
movb %al, -0x131(%rbp)
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x124f2
jmp 0x128ea
leaq -0x81(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x95c0
movq -0x140(%rbp), %rdx
leaq 0x20f2e(%rip), %rsi     # 0x33441
leaq -0x80(%rbp), %rdi
callq 0x13550
jmp 0x1251e
leaq -0x80(%rbp), %rdi
callq 0xd790
jmp 0x12529
leaq -0x80(%rbp), %rdi
callq 0x9658
leaq -0x81(%rbp), %rdi
callq 0x93b0
movl $0x10, %edi
callq 0x9350
movq %rax, -0x148(%rbp)
jmp 0x12551
movq -0x130(%rbp), %rdi
movl $0x1d, %esi
callq 0xe670
movq %rax, -0x150(%rbp)
jmp 0x1256b
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdi
callq 0x1eb20
jmp 0x12580
movq -0x148(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x127e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x125b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x9658
leaq -0x29(%rbp), %rdi
callq 0x93b0
jmp 0x1297e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x125e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9658
leaq -0x81(%rbp), %rdi
callq 0x93b0
jmp 0x1297e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x12620
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x10, %esi
callq 0x9360
movl -0x3c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1297e
movq -0x38(%rbp), %rdi
callq 0x9140
movl (%rax), %eax
movl %eax, -0x88(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, -0x158(%rbp)
jmp 0x12654
movq -0x130(%rbp), %rdi
movl $0x16, %esi
callq 0xe670
movq %rax, -0x160(%rbp)
jmp 0x1266e
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdi
callq 0x1eb20
jmp 0x12683
movq -0x130(%rbp), %rax
movq -0x158(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x1be70
jmp 0x126af
leaq 0x20dac(%rip), %rsi     # 0x33462
leaq -0xa8(%rbp), %rdi
callq 0x13710
movb %al, -0x161(%rbp)
jmp 0x126ca
leaq -0xa8(%rbp), %rdi
callq 0x9658
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0x126e5
jmp 0x127e3
movq -0x130(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x178(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x95c0
movq -0x170(%rbp), %rdx
leaq 0x20d3a(%rip), %rsi     # 0x33451
leaq -0xc8(%rbp), %rdi
callq 0x13550
jmp 0x12725
movq -0x178(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1b380
jmp 0x1273a
leaq -0xc8(%rbp), %rdi
callq 0x9658
leaq -0xc9(%rbp), %rdi
callq 0x93b0
movl $0x1, %edi
callq 0x9410
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x12887
movq -0x158(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x12887
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x9658
jmp 0x12887
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x127d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x9658
leaq -0xc9(%rbp), %rdi
callq 0x93b0
jmp 0x12887
callq 0x9540
movq -0x130(%rbp), %rdi
callq 0x12990
movq %rax, -0x58(%rbp)
movl $0x48, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x180(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x2d6e0
jmp 0x12822
movq -0x180(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x95c0
movq -0x188(%rbp), %rdx
leaq 0x20bf3(%rip), %rsi     # 0x33441
leaq -0xf0(%rbp), %rdi
callq 0x13550
jmp 0x1285c
leaq -0xf0(%rbp), %rdi
callq 0xda50
jmp 0x1286a
leaq -0xf0(%rbp), %rdi
callq 0x9658
leaq -0xf1(%rbp), %rdi
callq 0x93b0
jmp 0x124a8
callq 0x9540
jmp 0x1297e
movq -0x180(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x48, %esi
callq 0x9360
jmp 0x1297e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x128d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x9658
leaq -0xf1(%rbp), %rdi
callq 0x93b0
jmp 0x1297e
leaq -0x119(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x95c0
movq -0x190(%rbp), %rdx
leaq 0x20b31(%rip), %rsi     # 0x3343c
leaq -0x118(%rbp), %rdi
callq 0x13550
jmp 0x12919
leaq -0x118(%rbp), %rdi
callq 0xda50
jmp 0x12927
leaq -0x118(%rbp), %rdi
callq 0x9658
leaq -0x119(%rbp), %rdi
callq 0x93b0
movq -0x50(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x12972
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x9658
leaq -0x119(%rbp), %rdi
callq 0x93b0
movq -0x38(%rbp), %rdi
callq 0x95b0
nopw (%rax,%rax)