// File: smallsimple[P]CoreInterpreter-CSE5341/Stmt.cpp
// Function: Stmt::ParseStmt()
void Stmt::ParseStmt(){
  Tokenizer *tokensStmt;
  tokensStmt = Tokenizer::getInstance();
  int tokenType = tokensStmt->getTokenType();
  if (tokenType == tokensStmt->idNum){
    assign = new Assign();
    assign->ParseAssign();
  }
  else if (tokenType == 5){//5 for 'ifc'
    ifc = new Ifc(infile);
    ifc->ParseIfc();
  }
  else if (tokenType == 8){// 8 for 'while'
    loop = new Loop(infile);
    loop->ParseLoop();
  }
  else if (tokenType == 10){//10 for 'read'
    input = new Input(infile);
    input->ParseInput();
  }
  else if (tokenType == 11){//11 for 'write'
    output = new Output();
    output->ParseOutput();
  }
  else{
    cout << "Error: Stmt" << endl;
    cout << "program stopped" << endl;
    exit(0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x48d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4ba0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
leaq 0x4179(%rip), %rcx      # 0xc30c
cmpl (%rcx), %eax
jne 0x81eb
movl $0x10, %edi
callq 0x21e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x83d0
jmp 0x81b2
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
callq 0x84d0
jmp 0x83b5
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x21f0
jmp 0x83bb
cmpl $0x5, -0x14(%rbp)
jne 0x824c
movl $0x20, %edi
callq 0x21e0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x40(%rbp)
movq (%rax), %rsi
callq 0x9d00
jmp 0x8213
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rax), %rdi
callq 0x9f30
jmp 0x83b3
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x20, %esi
callq 0x21f0
jmp 0x83bb
cmpl $0x8, -0x14(%rbp)
jne 0x82ad
movl $0x18, %edi
callq 0x21e0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x48(%rbp)
movq (%rax), %rsi
callq 0x9250
jmp 0x8274
movq -0x30(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rax), %rdi
callq 0x93b0
jmp 0x83b1
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x21f0
jmp 0x83bb
cmpl $0xa, -0x14(%rbp)
jne 0x830e
movl $0x10, %edi
callq 0x21e0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x50(%rbp)
movq (%rax), %rsi
callq 0x9770
jmp 0x82d5
movq -0x30(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq 0x20(%rax), %rdi
callq 0x9860
jmp 0x83af
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x21f0
jmp 0x83bb
cmpl $0xb, -0x14(%rbp)
jne 0x8362
movl $0x8, %edi
callq 0x21e0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
callq 0x9a40
jmp 0x832f
movq -0x30(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq 0x28(%rax), %rdi
callq 0x9b10
jmp 0x83ad
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x8, %esi
callq 0x21f0
jmp 0x83bb
movq 0x8c6f(%rip), %rdi      # 0x10fd8
leaq 0x41fe(%rip), %rsi      # 0xc56e
callq 0x21d0
movq %rax, %rdi
movq 0x8c49(%rip), %rsi      # 0x10fc8
callq 0x2210
movq 0x8c4d(%rip), %rdi      # 0x10fd8
leaq 0x41e8(%rip), %rsi      # 0xc57a
callq 0x21d0
movq %rax, %rdi
movq 0x8c27(%rip), %rsi      # 0x10fc8
callq 0x2210
xorl %edi, %edi
callq 0x2280
jmp 0x83af
jmp 0x83b1
jmp 0x83b3
jmp 0x83b5
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2370
nopw %cs:(%rax,%rax)
nop