// File: 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
movq %rsp, %rbp
subq $0x1190, %rsp           # imm = 0x1190
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10f8(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x10f0(%rbp)
callq 0x95c0
movq -0x10f0(%rbp), %rdx
leaq 0x223ec(%rip), %rsi     # 0x33324
leaq -0x28(%rbp), %rdi
callq 0x13550
jmp 0x10f43
leaq -0x28(%rbp), %rdi
callq 0xd790
jmp 0x10f4e
leaq -0x28(%rbp), %rdi
callq 0x9658
leaq -0x29(%rbp), %rdi
callq 0x93b0
movq -0x10f8(%rbp), %rdi
movl $0x7, %esi
callq 0xe670
leaq 0x346e8(%rip), %rax     # 0x45660
movq (%rax), %rdi
movl $0x7, %esi
callq 0x11930
movq -0x10f8(%rbp), %rdi
movl $0x1e, %esi
callq 0xe670
movq -0x10f8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1be60
cmpl $0x18, %eax
jne 0x11116
movq -0x10f8(%rbp), %rax
leaq 0x346a3(%rip), %rcx     # 0x45660
movq (%rcx), %rcx
movq %rcx, -0x1110(%rbp)
movq 0x8(%rax), %rsi
leaq -0x1000(%rbp), %rdi
movq %rdi, -0x1108(%rbp)
callq 0x1be70
movq -0x1110(%rbp), %rdi
movq -0x1108(%rbp), %rsi
callq 0x31840
movl %eax, -0x10fc(%rbp)
jmp 0x10ff9
movl -0x10fc(%rbp), %eax
movl %eax, -0x40(%rbp)
leaq -0x1000(%rbp), %rdi
callq 0x9658
cmpl $-0x1, -0x40(%rbp)
jne 0x11114
movq -0x10f8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1120(%rbp)
leaq -0x1021(%rbp), %rdi
movq %rdi, -0x1118(%rbp)
callq 0x95c0
movq -0x1118(%rbp), %rdx
leaq 0x222e9(%rip), %rsi     # 0x33333
leaq -0x1020(%rbp), %rdi
callq 0x13550
jmp 0x11058
movq -0x1120(%rbp), %rdi
leaq -0x1020(%rbp), %rsi
callq 0x1b380
jmp 0x1106d
leaq -0x1020(%rbp), %rdi
callq 0x9658
leaq -0x1021(%rbp), %rdi
callq 0x93b0
movl $0x1, %edi
callq 0x9410
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x110b2
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 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1000(%rbp), %rdi
callq 0x9658
jmp 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x11103
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1020(%rbp), %rdi
callq 0x9658
leaq -0x1021(%rbp), %rdi
callq 0x93b0
jmp 0x115af
jmp 0x11116
movl $0x18, %edi
callq 0x9350
movq -0x10f8(%rbp), %rdi
movq %rax, -0x1130(%rbp)
movl $0x18, %esi
callq 0xe670
movq %rax, -0x1128(%rbp)
jmp 0x11141
movq -0x1128(%rbp), %rsi
movq -0x1130(%rbp), %rdi
callq 0x1def0
jmp 0x11156
movq -0x1130(%rbp), %rax
movq %rax, -0xfe0(%rbp)
movl $0x1, -0x1028(%rbp)
movq -0x10f8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1be60
cmpl $0x26, %eax
jne 0x114ac
leaq -0x1049(%rbp), %rdi
movq %rdi, -0x1138(%rbp)
callq 0x95c0
movq -0x1138(%rbp), %rdx
leaq 0x221a6(%rip), %rsi     # 0x3334e
leaq -0x1048(%rbp), %rdi
callq 0x13550
jmp 0x111b6
leaq -0x1048(%rbp), %rdi
callq 0xd790
jmp 0x111c4
leaq -0x1048(%rbp), %rdi
callq 0x9658
leaq -0x1049(%rbp), %rdi
callq 0x93b0
movq -0x10f8(%rbp), %rdi
movl $0x26, %esi
callq 0xe670
movq -0x10f8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1be60
cmpl $0x18, %eax
jne 0x11395
movq -0x10f8(%rbp), %rax
leaq 0x3444c(%rip), %rcx     # 0x45660
movq (%rcx), %rcx
movq %rcx, -0x1150(%rbp)
movq 0x8(%rax), %rsi
leaq -0x1070(%rbp), %rdi
movq %rdi, -0x1148(%rbp)
callq 0x1be70
movq -0x1150(%rbp), %rdi
movq -0x1148(%rbp), %rsi
callq 0x31840
movl %eax, -0x113c(%rbp)
jmp 0x11250
movl -0x113c(%rbp), %eax
movl %eax, -0x40(%rbp)
leaq -0x1070(%rbp), %rdi
callq 0x9658
cmpl $-0x1, -0x40(%rbp)
jne 0x11393
movq -0x10f8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1160(%rbp)
leaq -0x1091(%rbp), %rdi
movq %rdi, -0x1158(%rbp)
callq 0x95c0
movq -0x1158(%rbp), %rdx
leaq 0x220c7(%rip), %rsi     # 0x33368
leaq -0x1090(%rbp), %rdi
callq 0x13550
jmp 0x112af
movq -0x1160(%rbp), %rdi
leaq -0x1090(%rbp), %rsi
callq 0x1b380
jmp 0x112c4
leaq -0x1090(%rbp), %rdi
callq 0x9658
leaq -0x1091(%rbp), %rdi
callq 0x93b0
movl $0x1, %edi
callq 0x9410
movq -0x1130(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1132e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1048(%rbp), %rdi
callq 0x9658
leaq -0x1049(%rbp), %rdi
callq 0x93b0
jmp 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1070(%rbp), %rdi
callq 0x9658
jmp 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x11382
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x1090(%rbp), %rdi
callq 0x9658
leaq -0x1091(%rbp), %rdi
callq 0x93b0
jmp 0x115af
jmp 0x11395
movl $0x18, %edi
callq 0x9350
movq -0x10f8(%rbp), %rdi
movq %rax, -0x1170(%rbp)
movl $0x18, %esi
callq 0xe670
movq %rax, -0x1168(%rbp)
jmp 0x113c0
movq -0x1168(%rbp), %rsi
movq -0x1170(%rbp), %rdi
callq 0x1def0
jmp 0x113d5
movq -0x1170(%rbp), %rcx
movslq -0x1028(%rbp), %rax
movq %rcx, -0xfe0(%rbp,%rax,8)
movl -0x1028(%rbp), %eax
incl %eax
movl %eax, -0x1028(%rbp)
leaq -0x10b9(%rbp), %rdi
movq %rdi, -0x1178(%rbp)
callq 0x95c0
movq -0x1178(%rbp), %rdx
leaq 0x21f34(%rip), %rsi     # 0x3334e
leaq -0x10b8(%rbp), %rdi
callq 0x13550
jmp 0x11428
leaq -0x10b8(%rbp), %rdi
callq 0xda50
jmp 0x11436
leaq -0x10b8(%rbp), %rdi
callq 0x9658
leaq -0x10b9(%rbp), %rdi
callq 0x93b0
jmp 0x1116e
movq -0x1170(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x115af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1149b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x10b8(%rbp), %rdi
callq 0x9658
leaq -0x10b9(%rbp), %rdi
callq 0x93b0
jmp 0x115af
movq -0x10f8(%rbp), %rdi
movl $0x1f, %esi
callq 0xe670
leaq -0x10e1(%rbp), %rdi
movq %rdi, -0x1180(%rbp)
callq 0x95c0
movq -0x1180(%rbp), %rdx
leaq 0x21e46(%rip), %rsi     # 0x33324
leaq -0x10e0(%rbp), %rdi
callq 0x13550
jmp 0x114ec
leaq -0x10e0(%rbp), %rdi
callq 0xda50
jmp 0x114fa
leaq -0x10e0(%rbp), %rdi
callq 0x9658
leaq -0x10e1(%rbp), %rdi
callq 0x93b0
movq -0x10f8(%rbp), %rdi
movl $0x27, %esi
callq 0xe670
movl $0xfb8, %edi            # imm = 0xFB8
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1188(%rbp)
movl -0x1028(%rbp), %edx
leaq -0xfe0(%rbp), %rsi
callq 0x1d250
jmp 0x1154e
movq -0x1188(%rbp), %rax
addq $0x1190, %rsp           # imm = 0x1190
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x11584
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x10e0(%rbp), %rdi
callq 0x9658
leaq -0x10e1(%rbp), %rdi
callq 0x93b0
jmp 0x115af
movq -0x1188(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0xfb8, %esi            # imm = 0xFB8
callq 0x9360
movq -0x38(%rbp), %rdi
callq 0x95b0
nopl (%rax,%rax)