// File: /workspace/github_cpp_makefile_star2_O3/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 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x20(%rdi), %r14
leaq 0x2bd2(%rip), %r15      # 0x7240
leaq 0x28(%rsp), %r12
movzwl 0x18(%rbx), %eax
leal -0x102(%rax), %ecx
cmpl $0x7, %ecx
ja 0x4712
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
jmpq *%rax
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x20e0
movq %rbx, %rdi
callq 0x4540
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x4596
movq %rbx, %rdi
callq 0x4aa2
movl %eax, %ebp
movq 0x10(%rbx), %r13
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3306
movsbl %bpl, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2724
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4673
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x4673
cmpl $0x7b, %eax
jne 0x47f6
movq %rbx, %rdi
callq 0x45fe
jmp 0x4673
movq %rbx, %rdi
callq 0x4540
movq 0x10(%rbx), %rdi
callq 0x2d52
movq %rbx, %rdi
callq 0x4aa2
movq 0x10(%rbx), %rdi
callq 0x2da2
movq %rbx, %rdi
callq 0x45fe
jmp 0x47df
movq %rbx, %rdi
callq 0x4540
movq %rbx, %rdi
callq 0x4aa2
movq 0x10(%rbx), %rdi
callq 0x2da2
movq %rbx, %rdi
callq 0x45fe
jmp 0x47e8
movq %rbx, %rdi
callq 0x486a
jmp 0x4673
movq %rbx, %rdi
callq 0x4540
movq %rbx, %rdi
callq 0x4aa2
movq 0x10(%rbx), %rdi
movsbl %al, %esi
callq 0x2c98
jmp 0x4673
movq %rbx, %rdi
callq 0x4540
movq 0x10(%rbx), %rdi
callq 0x2d52
movq %rbx, %rdi
callq 0x45fe
movq %rbx, %rdi
movl $0x108, %esi            # imm = 0x108
callq 0x4596
movq %rbx, %rdi
callq 0x4aa2
movq 0x10(%rbx), %rdi
callq 0x2da2
movq 0x10(%rbx), %rdi
callq 0x2d86
movq 0x10(%rbx), %rdi
callq 0x2df8
jmp 0x4673
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4812
movq 0x18(%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 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4845
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x4845
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4861
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2250
nop