// File: /workspace/github_cpp_makefile_star2_O2/martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::Definition()
ASdefinition* TCparser::Definition()
	{
		// Definition --> Type ID ( FunctionDefinition | SEMICOLON )
		enteringDEBUG("Definition");
        int loc;
		AStype* operand2 = NULL;
		ASdefinition* operand3[MAX_STATEMENTS];
		int operand4 = 0;
		int* num = new int;
		*num = 0;
		ASstatement* operand5 = NULL;
		operand2 = Type();
        if (buff->getTokenType() == ID)
        {
            loc = symTable->find(buff->getLexeme());
            if (loc == -1) loc = symTable->add(new TCsymbol(buff->getLexeme(),NO_TYPE));
            else if (loc > -1)
            {
                reportSEMANTIC_ERROR(scanner,"Cannot redeclare a function");
                exit(EXIT_FAILURE);
            }
        }
		accept(ID);
		if (buff->getTokenType() == SEMICOLON)
		{
			operand5 = new ASstatement();
            symTable->getSym(loc)->setType(VAR);
            symTable->getSym(loc)->setOffset(_nextOffset);
            symTable->getSym(loc)->getNextOffset();
		}
		else if (buff->getTokenType() == LPAREN)
		{
			operand5 = FunctionDefinition(operand3, num);
			operand4 = *num;
            symTable->getSym(loc)->setType(FUNC);
		}
		exitingDEBUG("Definition");
		return new ASfuncDef(operand2, operand3, operand4, operand5);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1058, %rsp           # imm = 0x1058
movq %rdi, %r14
leaq 0x1272d(%rip), %rsi     # 0x1d154
leaq 0x70(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0xd770
leaq 0x70(%rsp), %rdi
callq 0xa70a
leaq 0x70(%rsp), %rdi
callq 0x8478
pushq $0x4
popq %rdi
callq 0x8250
movq %rax, %r15
andl $0x0, (%rax)
movq %r14, %rdi
callq 0xacee
movq %rax, %r13
movq 0x8(%r14), %rdi
callq 0x119f0
cmpl $0x18, %eax
jne 0xab4d
movq %r13, 0x8(%rsp)
leaq 0x22ae4(%rip), %rbx     # 0x2d568
movq (%rbx), %r12
movq 0x8(%r14), %rsi
leaq 0x90(%rsp), %r13
movq %r13, %rdi
callq 0x119f4
movq %r12, %rdi
movq %r13, %rsi
callq 0x1bc3c
movl %eax, %ebp
leaq 0x90(%rsp), %rdi
callq 0x8478
cmpl $-0x1, %ebp
je 0xaaff
testl %ebp, %ebp
movq 0x8(%rsp), %r13
js 0xab4d
movq (%r14), %rbx
leaq 0x1264b(%rip), %rsi     # 0x1d11c
leaq 0x30(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xd770
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x11393
leaq 0x30(%rsp), %rdi
callq 0x8478
pushq $0x1
popq %rdi
callq 0x82c0
movq (%rbx), %rbp
pushq $0x48
popq %rdi
callq 0x8250
movq %rax, %r12
movq 0x8(%r14), %rsi
leaq 0x50(%rsp), %rdi
callq 0x119f4
movb $0x1, %r13b
leaq 0x50(%rsp), %rsi
pushq $0x3
popq %rdx
movq %r12, %rdi
callq 0x13aa4
xorl %r13d, %r13d
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1bbfc
movl %eax, %ebp
leaq 0x50(%rsp), %rdi
callq 0x8478
movq 0x8(%rsp), %r13
pushq $0x18
popq %rsi
movq %r14, %rdi
callq 0xaeb8
movq 0x8(%r14), %rdi
callq 0x119f0
cmpl $0x27, %eax
jne 0xabc6
pushq $0x10
popq %rdi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
callq 0x13250
leaq 0x229e8(%rip), %rbx     # 0x2d568
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x1bcc6
xorl %r15d, %r15d
movq %rax, %rdi
xorl %esi, %esi
callq 0x13b1c
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x1bcc6
leaq 0x226b4(%rip), %rcx     # 0x2d25c
movl (%rcx), %esi
movq %rax, %rdi
callq 0x13b54
movq (%rbx), %rdi
movl %ebp, %esi
callq 0x1bcc6
movq %rax, %rdi
callq 0x13b58
jmp 0xac11
movq 0x8(%r14), %rdi
callq 0x119f0
cmpl $0x1e, %eax
jne 0xac0b
leaq 0xb0(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xaf66
movq %rax, %r14
movl (%r15), %r15d
leaq 0x22974(%rip), %rax     # 0x2d568
movq (%rax), %rdi
movl %ebp, %esi
callq 0x1bcc6
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x13b1c
jmp 0xac11
xorl %r15d, %r15d
xorl %r14d, %r14d
leaq 0x1253c(%rip), %rsi     # 0x1d154
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xd770
leaq 0x10(%rsp), %rdi
callq 0xa888
leaq 0x10(%rsp), %rdi
callq 0x8478
movl $0xfc8, %edi            # imm = 0xFC8
callq 0x8250
movq %rax, %r12
leaq 0xb0(%rsp), %rdx
movq %rax, %rdi
movq %r13, %rsi
movl %r15d, %ecx
movq %r14, %r8
callq 0xd8c4
movq %r12, %rax
addq $0x1058, %rsp           # imm = 0x1058
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0xacdc
jmp 0xace3
movq %rax, %rbx
jmp 0xac99
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x8478
testb %r13b, %r13b
je 0xace6
pushq $0x48
popq %rsi
jmp 0xacbe
movq %rax, %rbx
pushq $0x10
popq %rsi
movq %r14, %rdi
jmp 0xacc1
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0xacdc
movq %rax, %rbx
movl $0xfc8, %esi            # imm = 0xFC8
movq %r12, %rdi
callq 0x8260
jmp 0xace6
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xacdc
jmp 0xace3
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x8478
jmp 0xace6
movq %rax, %rbx
movq %rbx, %rdi
callq 0x8400