// File: /workspace/github_cpp_makefile_star2_O3/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 0xdb7b
movl %eax, %ebx
cmpq $0x0, 0x8(%r15)
je 0x1e944
incl 0x11294(%rip)           # 0x2fb30
leaq 0x10f65(%rip), %r12     # 0x2f808
movq (%r12), %rcx
leaq 0x2d68(%rip), %rdi      # 0x21616
movl $0x4, %esi
movl $0x1, %edx
callq 0x64b0
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x11260(%rip)           # 0x2fb30
movq (%r12), %rcx
leaq 0x2e27(%rip), %rdi      # 0x21702
movl $0x3, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x11240(%rip)           # 0x2fb30
movq (%r12), %rcx
leaq 0x2da2(%rip), %rdi      # 0x2169d
movl $0x7, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x11220(%rip)           # 0x2fb30
movq (%r12), %rdi
leaq 0x2d8a(%rip), %rsi      # 0x216a5
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x11206(%rip)           # 0x2fb30
movq (%r12), %r12
callq 0xdb7b
leaq 0x2dcc(%rip), %rsi      # 0x21706
movq %r12, %rdi
movl %eax, %edx
jmp 0x1e9ed
callq 0xdb7b
movl %eax, %ebp
leaq 0x10db6(%rip), %rcx     # 0x2f708
movq 0x30(%rcx), %rax
cmpq 0x38(%rcx), %rax
jne 0x1e969
movq 0x48(%rcx), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %eax
leaq 0x10de5(%rip), %rdx     # 0x2f758
movq 0x30(%rdx), %rcx
cmpq 0x38(%rdx), %rcx
jne 0x1e98a
movq 0x48(%rdx), %rdx
movl $0x200, %ecx            # imm = 0x200
addq -0x8(%rdx), %rcx
movl %ebp, -0x4(%rcx)
incl %eax
cmpl %ebx, %eax
jne 0x1e9b3
incl 0x11197(%rip)           # 0x2fb30
leaq 0x10e68(%rip), %rax     # 0x2f808
movq (%rax), %rdi
leaq 0x2cfb(%rip), %rsi      # 0x216a5
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x11177(%rip)           # 0x2fb30
leaq 0x10e48(%rip), %r12     # 0x2f808
movq (%r12), %rcx
leaq 0x2e0e(%rip), %rdi      # 0x217d9
movl $0x11, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x11150(%rip)           # 0x2fb30
movq (%r12), %rdi
leaq 0x2d1b(%rip), %rsi      # 0x21706
movl %ebp, %edx
xorl %eax, %eax
callq 0x6390
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x11129(%rip)           # 0x2fb30
leaq 0x10dfa(%rip), %r14     # 0x2f808
movq (%r14), %rdi
movl %ebx, %edx
addl $0x3, %edx
leaq 0x2c88(%rip), %rsi      # 0x216a5
xorl %eax, %eax
callq 0x6390
incl 0x11106(%rip)           # 0x2fb30
movq (%r14), %rdi
leaq 0x2cd2(%rip), %rsi      # 0x21706
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6390
nop