// File: /workspace/github_cpp_makefile_star2_O1/Eronana[P]strawberry/src/ast_codegen.cpp
// Function: AST_CaseClause::codeGen(Symbol*)
DEF_AST_METHOD(CaseClause,AST_CODEGEN)
{
    int nextCaluse=nextLabel();
    if(expr)
    {
        PRINTF("dup\n");
        CODEGEN(expr);
        PRINTF("eq\n");
        PRINTF("istrue\n");
        PRINTF("jmp label_%d\n",nextCaluse);
        PRINTF("label_%d:\n",nextLabel());
        CODEGEN(stmtList);
    }
    else
    {
        int defaultLabel=nextLabel();
        int lastLabel=breakStack.top();
        defaultClauseStack.top()=defaultLabel;
        if(lastLabel+1==nextCaluse)PRINTF("jmp label_%d\n",nextCaluse);
        PRINTF("; default clause\n");
        PRINTF("label_%d:\n",defaultLabel);
        CODEGEN(stmtList);
    }
    PRINTF("jmp label_%d\n",nextCaluse+3);
    PRINTF("label_%d:\n",nextCaluse);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0xdb8f
movl %eax, %ebx
cmpq $0x0, 0x8(%r15)
je 0x1ef2a
incl 0x10cae(%rip)           # 0x2fb30
leaq 0x1097f(%rip), %r12     # 0x2f808
movq (%r12), %rcx
leaq 0x2766(%rip), %rdi      # 0x215fa
movl $0x4, %esi
movl $0x1, %edx
callq 0x64b0
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x10c7a(%rip)           # 0x2fb30
movq (%r12), %rcx
leaq 0x2825(%rip), %rdi      # 0x216e6
movl $0x3, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x10c5a(%rip)           # 0x2fb30
movq (%r12), %rcx
leaq 0x27a0(%rip), %rdi      # 0x21681
movl $0x7, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x10c3a(%rip)           # 0x2fb30
movq (%r12), %rdi
leaq 0x2788(%rip), %rsi      # 0x21689
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x10c20(%rip)           # 0x2fb30
movq (%r12), %r12
callq 0xdb8f
leaq 0x27ca(%rip), %rsi      # 0x216ea
movq %r12, %rdi
movl %eax, %edx
jmp 0x1efd3
callq 0xdb8f
movl %eax, %ebp
leaq 0x107d0(%rip), %rcx     # 0x2f708
movq 0x30(%rcx), %rax
cmpq 0x38(%rcx), %rax
jne 0x1ef4f
movq 0x48(%rcx), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %eax
leaq 0x107ff(%rip), %rdx     # 0x2f758
movq 0x30(%rdx), %rcx
cmpq 0x38(%rdx), %rcx
jne 0x1ef70
movq 0x48(%rdx), %rdx
movl $0x200, %ecx            # imm = 0x200
addq -0x8(%rdx), %rcx
movl %ebp, -0x4(%rcx)
incl %eax
cmpl %ebx, %eax
jne 0x1ef99
incl 0x10bb1(%rip)           # 0x2fb30
leaq 0x10882(%rip), %rax     # 0x2f808
movq (%rax), %rdi
leaq 0x26f9(%rip), %rsi      # 0x21689
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x10b91(%rip)           # 0x2fb30
leaq 0x10862(%rip), %r12     # 0x2f808
movq (%r12), %rcx
leaq 0x280c(%rip), %rdi      # 0x217bd
movl $0x11, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x10b6a(%rip)           # 0x2fb30
movq (%r12), %rdi
leaq 0x2719(%rip), %rsi      # 0x216ea
movl %ebp, %edx
xorl %eax, %eax
callq 0x6390
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x10b43(%rip)           # 0x2fb30
leaq 0x10814(%rip), %r14     # 0x2f808
movq (%r14), %rdi
movl %ebx, %edx
addl $0x3, %edx
leaq 0x2686(%rip), %rsi      # 0x21689
xorl %eax, %eax
callq 0x6390
incl 0x10b20(%rip)           # 0x2fb30
movq (%r14), %rdi
leaq 0x26d0(%rip), %rsi      # 0x216ea
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6390
nop