// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: DoWhileStatement::parse(Tokenizer*, std::vector<std::shared_ptr<FunctionToken>, std::allocator<std::shared_ptr<FunctionToken>>> const&, std::vector<std::shared_ptr<GlobalVarToken>, std::allocator<std::shared_ptr<GlobalVarToken>>> const&, std::vector<std::shared_ptr<ParamToken>, std::allocator<std::shared_ptr<ParamToken>>> const&, std::vector<std::shared_ptr<LocalVarToken>, std::allocator<std::shared_ptr<LocalVarToken>>> const&, std::vector<std::shared_ptr<LabelStatement>, std::allocator<std::shared_ptr<LabelStatement>>>&, std::vector<std::shared_ptr<GotoStatement>, std::allocator<std::shared_ptr<GotoStatement>>>&, std::shared_ptr<FunctionToken> const&)
bool DoWhileStatement::parse(
      Tokenizer *tokenizer,
      const std::vector<std::shared_ptr<FunctionToken>>& functions,
      const std::vector<std::shared_ptr<GlobalVarToken>>& globals,
      const std::vector<std::shared_ptr<ParamToken>>& parameters,
      const std::vector<std::shared_ptr<LocalVarToken>>& localVars,
      std::vector<std::shared_ptr<LabelStatement>>& labels,
      std::vector<std::shared_ptr<GotoStatement>>& gotos,
      const std::shared_ptr<FunctionToken>& currentFunc) {
  _lineNum = tokenizer->peekNext().line();
  // Make sure the first token is the "do" keyword.
  if (!_expect(tokenizer, "do")) {
    return false;
  }
  // Make sure the body exists and is valid.
  _body = StatementToken::parse(tokenizer, functions, globals,
                                parameters, localVars, labels, gotos,
                                currentFunc, true);
  if (!_body) {
    return false;
  }
  // Next token should be the "while" keyword.
  if (!_expect(tokenizer, "while")) {
    return false;
  }
  // Next token should be an opening parenthesis.
  if (!_expect(tokenizer, "(")) {
    return false;
  }
  // Next we should be able to parse the expression.
  _condExpr = std::shared_ptr<ExprToken>(new ExprToken());
  if (!_condExpr->parse(tokenizer, functions, globals,
                        parameters, localVars)) {
    return false;
  }
  // Next two tokens should be a closing parenthesis followed by
  // a semicolon.
  if (!_expect(tokenizer, ")")) {
    return false;
  }
  if (!_expect(tokenizer, ";")) {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %rbp
movq %rsp, %r14
movq %r14, %rdi
callq 0x33270
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbp)
leaq 0x29403(%rip), %rax     # 0x46ce0
movq %rax, (%r14)
movq 0x10(%r14), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1d8fb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x194b4(%rip), %rsi     # 0x36dbf
leaq 0x194af(%rip), %rdx     # 0x36dc1
movq %rsp, %rdi
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %r14d
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1d943
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r14b, %r14b
je 0x1db6b
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
pushq $0x1
pushq 0x98(%rsp)
pushq 0x98(%rsp)
pushq 0x98(%rsp)
callq 0x1a294
addq $0x20, %rsp
movaps (%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, (%r14)
movq 0x28(%rbp), %rdi
movups %xmm0, 0x20(%rbp)
testq %rdi, %rdi
je 0x1d9a2
callq 0x81ea
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1d9b1
callq 0x81ea
cmpq $0x0, 0x20(%rbp)
je 0x1db6b
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x193f0(%rip), %rsi     # 0x36db9
leaq 0x193ee(%rip), %rdx     # 0x36dbe
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %r14d
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1d9fe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r14b, %r14b
je 0x1db6b
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x186a5(%rip), %rsi     # 0x360b9
leaq 0x1869f(%rip), %rdx     # 0x360ba
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %r14d
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1da49
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %r14b, %r14b
je 0x1db6b
movl $0x28, %edi
callq 0x72b0
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
leaq 0x295d6(%rip), %rcx     # 0x47040
movq %rcx, (%rax)
movb $0x1, 0xc(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0xe(%rax)
movups %xmm0, 0x18(%rax)
leaq 0x8(%rsp), %r14
movq %rax, -0x8(%r14)
movq %r14, %rdi
movq %rax, %rsi
callq 0x31340
movaps -0x8(%r14), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x8(%r14)
movq 0x18(%rbp), %rdi
movups %xmm0, 0x10(%rbp)
testq %rdi, %rdi
je 0x1daaf
callq 0x81ea
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1dabe
callq 0x81ea
movq 0x10(%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq 0x38(%rsp), %r8
movq 0x40(%rsp), %r9
callq 0x1160e
testb %al, %al
je 0x1db6b
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x19def(%rip), %rsi     # 0x378de
leaq 0x19de9(%rip), %rdx     # 0x378df
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %ebp
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1db23
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
testb %bpl, %bpl
je 0x1db6b
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x1908c(%rip), %rsi     # 0x36bc1
leaq 0x19086(%rip), %rdx     # 0x36bc2
callq 0xc0a4
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3494f
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1db6d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1db6d
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1db8e
jmp 0x1dba9
jmp 0x1db8e
jmp 0x1dba9
jmp 0x1db8e
jmp 0x1dba9
jmp 0x1db8e
jmp 0x1dba9
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x1dbac
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x1dbac
movq %rax, %rbx
movq %rbx, %rdi
callq 0x74f0