// File: /workspace/github_cpp_makefile_star2_O3/martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::CompoundStatement()
ASstatement* TCparser::CompoundStatement() // Need statment and error handling
	{
		// CompoundStatement --> LCURLY { Type ID SEMICOLON } { Statement } RCURLY
		enteringDEBUG("Compound Statement");
        int loc;
		ASdefinition* operand[MAX_STATEMENTS];
		ASstatement* operand2[MAX_STATEMENTS];
		AStype* operand4[1];
		int i1 = 0;
		int i2 = 0;
		accept(LCURLY);
		while (buff->getTokenType() == INT || buff->getTokenType() == CHAR) // { Type ID SEMICOLON }
		{
			operand4[0] = 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 variable compound");
                    exit(EXIT_FAILURE);
                }
                symTable->getSym(loc)->setType(VAR);
                symTable->getSym(loc)->setOffset(_nextOffset);
                symTable->getSym(loc)->getNextOffset();
            }
			accept(ID);
			operand[i1] = new ASvarDef(operand4, 1);
			i1++;
			accept(SEMICOLON);
		}
		try
		{
			enteringDEBUG("Statement");
			while (buff->getTokenType() != RCURLY)
			{
				operand2[i2] = Statement();
				i2++;
			}
		}
		catch (int t) {}
		accept(RCURLY);
		exitingDEBUG("Statement");
		exitingDEBUG("Compound Statement");
		return new ASblockState(operand, i1, operand2, i2);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2038, %rsp           # imm = 0x2038
movq %rdi, %r14
leaq 0xa0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1d1e8(%rip), %rsi     # 0x2a253
leaq 0x1d1f3(%rip), %rdx     # 0x2a265
leaq 0x90(%rsp), %rdi
callq 0xfc2a
leaq 0x90(%rsp), %rdi
callq 0xbaaa
movq 0x90(%rsp), %rdi
cmpq %rbx, %rdi
je 0xd0a9
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8260
movq %r14, %rdi
movl $0x22, %esi
callq 0xc54c
leaq 0xe0(%rsp), %r13
xorl %ebx, %ebx
leaq 0x2d4a9(%rip), %r15     # 0x3a570
leaq 0x8(%rsp), %rbp
movq 0x8(%r14), %rdi
callq 0x17fcc
cmpl $0x3, %eax
je 0xd0ec
movq 0x8(%r14), %rdi
callq 0x17fcc
cmpl $0x5, %eax
jne 0xd269
movq %r14, %rdi
callq 0xc2ea
movq %rax, 0x8(%rsp)
movq 0x8(%r14), %rdi
callq 0x17fcc
cmpl $0x18, %eax
jne 0xd222
movq (%r15), %r12
movq 0x8(%r14), %rsi
leaq 0xd0(%rsp), %rbp
movq %rbp, %rdi
callq 0x17fd0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x28e6e
movl %eax, %ebp
movq 0xd0(%rsp), %rdi
cmpq %r13, %rdi
je 0xd14c
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8260
cmpl $-0x1, %ebp
je 0xd15e
testl %ebp, %ebp
js 0xd1dc
jmp 0xd2d5
movq %rbx, (%rsp)
movq %r15, %rax
movq %r13, %r15
movq (%rax), %rbp
movl $0x48, %edi
callq 0x8250
movq %rax, %r12
movq 0x8(%r14), %rsi
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x17fd0
movb $0x1, %r13b
movq %r12, %rdi
movq %rbx, %rsi
movl $0x3, %edx
callq 0x1bdd6
xorl %r13d, %r13d
movq %rbp, %rdi
movq %r12, %rsi
callq 0x28e2c
movl %eax, %ebp
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xd1ce
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x8260
movq %r15, %r13
leaq 0x2d398(%rip), %r15     # 0x3a570
movq (%rsp), %rbx
movq (%r15), %rdi
movl %ebp, %esi
callq 0x28f44
movq %rax, %rdi
xorl %esi, %esi
callq 0x1be6a
movq (%r15), %rdi
movl %ebp, %esi
callq 0x28f44
leaq 0x2d063(%rip), %rcx     # 0x3a264
movl (%rcx), %esi
movq %rax, %rdi
callq 0x1bec0
movq (%r15), %rdi
movl %ebp, %esi
callq 0x28f44
movq %rax, %rdi
callq 0x1bec4
leaq 0x8(%rsp), %rbp
movq %r14, %rdi
movl $0x18, %esi
callq 0xc54c
movl $0xfc0, %edi            # imm = 0xFC0
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x1aed8
movq %r12, 0x1090(%rsp,%rbx,8)
incq %rbx
movq %r14, %rdi
movl $0x27, %esi
callq 0xc54c
jmp 0xd0cc
leaq 0x60(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1d07c(%rip), %rsi     # 0x2a2f5
leaq 0x1d07e(%rip), %rdx     # 0x2a2fe
leaq 0x50(%rsp), %rdi
callq 0xfc2a
leaq 0x50(%rsp), %rdi
callq 0xbaaa
movq 0x50(%rsp), %rdi
cmpq %rbp, %rdi
je 0xd2ab
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8260
xorl %r12d, %r12d
movq 0x8(%r14), %rdi
callq 0x17fcc
cmpl $0x23, %eax
je 0xd424
movq %r14, %rdi
callq 0xd92e
movq %rax, 0xf0(%rsp,%r12,8)
incq %r12
jmp 0xd2ae
movq (%r14), %rbx
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cf7b(%rip), %rsi     # 0x2a266
leaq 0x1cf98(%rip), %rdx     # 0x2a28a
leaq 0xb0(%rsp), %rdi
callq 0xfc2a
leaq 0xb0(%rsp), %rsi
movq %rbx, %rdi
callq 0x174db
leaq 0xb0(%rsp), %rdi
callq 0x8488
movl $0x1, %edi
callq 0x82e0
movq %rdx, %r13
movq %rax, %r15
movq 0x50(%rsp), %rdi
xorl %r12d, %r12d
cmpq %rbp, %rdi
je 0xd40d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8260
jmp 0xd40d
movq %rdx, %r13
movq %rax, %r15
xorl %r12d, %r12d
jmp 0xd40d
movq %rax, %r15
movq 0x90(%rsp), %rdi
cmpq %rbx, %rdi
je 0xd549
movq 0xa0(%rsp), %rsi
jmp 0xd3ff
jmp 0xd39e
movq %rax, %r15
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0xd549
movq 0xc0(%rsp), %rsi
jmp 0xd3ff
movq %rax, %r15
jmp 0xd549
movq %rax, %r15
jmp 0xd3d9
movq %rax, %r15
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xd3d0
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x8260
testb %r13b, %r13b
je 0xd549
movl $0x48, %esi
jmp 0xd541
movq %rax, %r15
movq 0xd0(%rsp), %rdi
cmpq %r13, %rdi
je 0xd549
movq 0xe0(%rsp), %rsi
incq %rsi
jmp 0xd544
movq %rdx, %r13
movq %rax, %r15
cmpl $0x1, %r13d
jne 0xd549
movq %r15, %rdi
callq 0x80e0
callq 0x83d0
movq %r14, %rdi
movl $0x23, %esi
callq 0xc54c
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ceb4(%rip), %rsi     # 0x2a2f5
leaq 0x1ceb6(%rip), %rdx     # 0x2a2fe
leaq 0x30(%rsp), %rdi
callq 0xfc2a
leaq 0x30(%rsp), %rdi
callq 0xbd0c
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xd473
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8260
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1cdd0(%rip), %rsi     # 0x2a253
leaq 0x1cddb(%rip), %rdx     # 0x2a265
leaq 0x10(%rsp), %rdi
callq 0xfc2a
leaq 0x10(%rsp), %rdi
callq 0xbd0c
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xd4b5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x8260
movl $0x1f60, %edi           # imm = 0x1F60
callq 0x8250
movq %rax, %r14
leaq 0x1090(%rsp), %rsi
leaq 0xf0(%rsp), %rcx
movq %rax, %rdi
movl %ebx, %edx
movl %r12d, %r8d
callq 0x25bac
movq %r14, %rax
addq $0x2038, %rsp           # imm = 0x2038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x1f60, %esi           # imm = 0x1F60
movq %r14, %rdi
jmp 0xd544
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xd549
movq 0x20(%rsp), %rsi
jmp 0xd3ff
jmp 0xd39e
movq %rax, %r15
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0xd549
movq 0x40(%rsp), %rsi
jmp 0xd3ff
jmp 0xd39e
movq %rax, %r15
movl $0xfc0, %esi            # imm = 0xFC0
movq %r12, %rdi
callq 0x8260
movq %r15, %rdi
callq 0x8420
nop