// File: /workspace/github_cpp_makefile_star2_O2/martinda3[P]Compiler/src/TCparser.cpp
// Function: toyc::TCparser::ReadStatement()
ASstatement* TCparser::ReadStatement() // WIP
	{
		// READ LPAREN ID { COMMA ID } RPAREN SEMICOLON
		enteringDEBUG("Read Statement");
        int loc;
		ASexpression* operand[MAX_STATEMENTS];
		accept(READ);
        enter_special_id(symTable,READ);
		accept(LPAREN);
        if (buff->getTokenType() == ID)
        {
            loc = symTable->find(buff->getLexeme());
            if (loc == -1)
            {
                reportSEMANTIC_ERROR(scanner,"variable not declared Read");
                exit(EXIT_FAILURE);
            }
        }
		operand[0] = new ASsimpleExpr(accept(ID));
		int i = 1;
		while (buff->getTokenType() == COMMA)
		{
			enteringDEBUG("Read Statement Additional");
			accept(COMMA);
            if (buff->getTokenType() == ID)
            {
                loc = symTable->find(buff->getLexeme());
                if (loc == -1)
                {
                    reportSEMANTIC_ERROR(scanner,"variable not declared add read");
                    exit(EXIT_FAILURE);
                }
            }
			operand[i] = new ASsimpleExpr(accept(ID));
			i++;
			exitingDEBUG("Read Statement Additional");
		}
		accept(RPAREN);
		exitingDEBUG("Read Statement");
		accept(SEMICOLON);
		return new ASreadState(operand, i);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10b8, %rsp           # imm = 0x10B8
movq %rdi, 0x8(%rsp)
leaq 0x10e9b(%rip), %rsi     # 0x1d2c4
leaq 0x70(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0xd770
leaq 0x70(%rsp), %rdi
callq 0xa70a
leaq 0x70(%rsp), %rdi
callq 0x8478
pushq $0x7
popq %rbp
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xaeb8
leaq 0x21100(%rip), %rax     # 0x2d568
movq (%rax), %rdi
movl %ebp, %esi
callq 0xc984
pushq $0x1e
popq %rsi
movq %rbx, %rdi
callq 0xaeb8
movq 0x8(%rbx), %rdi
callq 0x119f0
cmpl $0x18, %eax
jne 0xc4d1
leaq 0x210d6(%rip), %rax     # 0x2d568
movq (%rax), %r14
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x119f4
movq %r14, %rdi
movq %r15, %rsi
callq 0x1bc3c
movl %eax, %ebp
leaq 0x90(%rsp), %rdi
callq 0x8478
cmpl $-0x1, %ebp
je 0xc6dc
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r14
pushq $0x18
popq %rsi
movq 0x8(%rsp), %rdi
callq 0xaeb8
movq %r14, %rdi
movq %rax, %rsi
callq 0x12b44
movq %r14, 0x110(%rsp)
pushq $0x1
popq %r14
leaq 0x10de7(%rip), %r15     # 0x1d2ee
leaq 0xf0(%rsp), %r12
pushq $0x18
popq %rbp
pushq $0x18
popq %r13
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x119f0
cmpl $0x26, %eax
jne 0xc626
movq %r12, %rdi
movq %r15, %rsi
leaq 0x7(%rsp), %rdx
callq 0xd770
movq %r12, %rdi
callq 0xa70a
movq %r12, %rdi
callq 0x8478
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
pushq $0x26
popq %rsi
callq 0xaeb8
movq 0x8(%rbx), %rdi
callq 0x119f0
cmpl $0x18, %eax
jne 0xc5c4
movq 0x8(%rsp), %rcx
movq %r14, %r13
movq %rbp, %r14
movq %r12, %rbp
leaq 0x20fe8(%rip), %rax     # 0x2d568
movq (%rax), %r15
movq 0x8(%rcx), %rsi
leaq 0xd0(%rsp), %r12
movq %r12, %rdi
callq 0x119f4
movq %r15, %rdi
movq %r12, %rsi
callq 0x1bc3c
movl %eax, %r15d
movq %r12, %rdi
callq 0x8478
cmpl $-0x1, %r15d
movq %rbp, %r12
movq %r14, %rbp
movq %r13, %r14
pushq $0x18
popq %r13
je 0xc69f
movq %rbp, %rdi
callq 0x8250
movq %rax, %r15
movq 0x8(%rsp), %rdi
movl %r13d, %esi
callq 0xaeb8
movq %r15, %rdi
movq %rax, %rsi
callq 0x12b44
movq %r15, 0x110(%rsp,%r14,8)
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
leaq 0x10ced(%rip), %r15     # 0x1d2ee
movq %r15, %rsi
leaq 0x7(%rsp), %rdx
callq 0xd770
movq %rbx, %rdi
callq 0xa888
movq %rbx, %rdi
callq 0x8478
incq %r14
jmp 0xc516
pushq $0x1f
popq %rsi
movq 0x8(%rsp), %rdi
callq 0xaeb8
leaq 0x10c8a(%rip), %rsi     # 0x1d2c4
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xd770
leaq 0x10(%rsp), %rdi
callq 0xa888
leaq 0x10(%rsp), %rdi
callq 0x8478
pushq $0x27
popq %rsi
movq 0x8(%rsp), %rdi
callq 0xaeb8
movl $0xfb8, %edi            # imm = 0xFB8
callq 0x8250
movq %rax, %r15
leaq 0x110(%rsp), %rsi
movq %rax, %rdi
movl %r14d, %edx
callq 0x12370
movq %r15, %rax
addq $0x10b8, %rsp           # imm = 0x10B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rax
movq (%rax), %rbx
leaq 0x10c5a(%rip), %rsi     # 0x1d308
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 0x8(%rsp), %rax
movq (%rax), %rbx
leaq 0x10be8(%rip), %rsi     # 0x1d2d3
leaq 0x50(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xd770
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x11393
leaq 0x50(%rsp), %rdi
jmp 0xc6cf
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0xc78c
jmp 0xc77c
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
jmp 0xc78c
movq %rax, %rbx
movl $0xfb8, %esi            # imm = 0xFB8
jmp 0xc799
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0xc78c
jmp 0xc77c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0xc78c
jmp 0xc77c
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r14, %rdi
jmp 0xc79c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0xc78c
jmp 0xc77c
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0xc78c
jmp 0xc77c
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0xc78c
movq %rax, %rbx
jmp 0xc7a1
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x8478
jmp 0xc7a1
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x8260
movq %rbx, %rdi
callq 0x8400
nop