// File: /workspace/github_cpp_makefile_star2_O1/protonpopsicle[P]lang/src/compiler/Parser.cpp
// Function: Parser::stmts()
void Parser::stmts() {
    char lhs, rhs;
    std::string id;
    
    while (look.tag == '{' || look.tag == ID || look.tag == BASIC || look.tag == PRINT || 
           look.tag == IF || look.tag == WHILE || look.tag == DO) {
        switch (look.tag) {
            // stmt -> block
            case '{':
                block();
                break;
            // stmt -> decl
            case BASIC:
                decl();
                break;
            // stmt -> id = bool
            case ID:
                id = look.lexeme;
                move(); 
                match('=');
                rhs = boolean();
                byteCoder->assignVar(id, rhs);
                break;
            // stmt -> print bool
            case PRINT:
                move(); 
                rhs = boolean();
                byteCoder->print(rhs);
                break;
            // stmt -> if bool block
            case IF:
                move(); 
                boolean();
                byteCoder->jump();
                block();
                byteCoder->land();
                break;
            // stmt -> while bool block
            case WHILE:
                move();
                byteCoder->startLoop();
                boolean();
                byteCoder->jump();
                block();
                byteCoder->endLoop();
                byteCoder->land();
                break;
            // stmt -> do block while bool
            case DO:
                move();
                byteCoder->startLoop();
                block();
                match(WHILE);
                boolean();
                byteCoder->jump();
                byteCoder->endLoop();
                byteCoder->land();
                break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x10(%rdi), %r15
leaq 0x20(%rdi), %r14
leaq 0x2b9a(%rip), %r12      # 0x7240
movzwl 0x18(%rbx), %eax
leal -0x102(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4749
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x20e0
movq %rbx, %rdi
callq 0x4574
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x45ca
movq %rbx, %rdi
callq 0x4ada
movl %eax, %ebp
movq 0x10(%rbx), %r13
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x3344
movsbl %bpl, %edx
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2724
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x46a6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x46a6
cmpl $0x7b, %eax
jne 0x482e
movq %rbx, %rdi
callq 0x4632
jmp 0x46a6
movq %rbx, %rdi
callq 0x4574
movq (%r15), %rdi
callq 0x2d58
movq %rbx, %rdi
callq 0x4ada
movq (%r15), %rdi
callq 0x2da8
movq %rbx, %rdi
callq 0x4632
movq (%r15), %rdi
callq 0x2d8c
jmp 0x4821
movq %rbx, %rdi
callq 0x4574
movq %rbx, %rdi
callq 0x4ada
movq (%r15), %rdi
callq 0x2da8
movq %rbx, %rdi
callq 0x4632
jmp 0x4821
movq %rbx, %rdi
callq 0x48a2
jmp 0x46a6
movq %rbx, %rdi
callq 0x4574
movq %rbx, %rdi
callq 0x4ada
movq 0x10(%rbx), %rdi
movsbl %al, %esi
callq 0x2c9a
jmp 0x46a6
movq %rbx, %rdi
callq 0x4574
movq (%r15), %rdi
callq 0x2d58
movq %rbx, %rdi
callq 0x4632
movq %rbx, %rdi
movl $0x108, %esi            # imm = 0x108
callq 0x45ca
movq %rbx, %rdi
callq 0x4ada
movq (%r15), %rdi
callq 0x2da8
movq (%r15), %rdi
callq 0x2d8c
movq (%r15), %rdi
callq 0x2dfe
jmp 0x46a6
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x484a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x487d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x487d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4899
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2250
nop