// File: /workspace/github_cpp_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0xc83c
movl %eax, %ebx
cmpq $0x0, 0x8(%r15)
je 0x1b933
incl 0x142ad(%rip)           # 0x2fb40
leaq 0x13f7e(%rip), %r13     # 0x2f818
movq (%r13), %rcx
leaq 0x2d21(%rip), %rdi      # 0x1e5c6
pushq $0x4
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
callq 0x64c0
movq 0x8(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x14279(%rip)           # 0x2fb40
movq (%r13), %rcx
leaq 0x2de0(%rip), %rdi      # 0x1e6b2
pushq $0x3
popq %rsi
movq %r12, %rdx
callq 0x64c0
incl 0x1425d(%rip)           # 0x2fb40
movq (%r13), %rcx
leaq 0x2d5f(%rip), %rdi      # 0x1e64d
pushq $0x7
popq %rsi
movq %r12, %rdx
callq 0x64c0
incl 0x14241(%rip)           # 0x2fb40
movq (%r13), %rdi
leaq 0x2d4b(%rip), %rsi      # 0x1e655
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x14227(%rip)           # 0x2fb40
movq (%r13), %r12
callq 0xc83c
leaq 0x2d8d(%rip), %rsi      # 0x1e6b6
movq %r12, %rdi
movl %eax, %edx
jmp 0x1b9d8
callq 0xc83c
movl %eax, %ebp
leaq 0x13dd7(%rip), %rcx     # 0x2f718
movq 0x30(%rcx), %rax
cmpq 0x38(%rcx), %rax
jne 0x1b958
movq 0x48(%rcx), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movl -0x4(%rax), %eax
leaq 0x13e06(%rip), %rdx     # 0x2f768
movq 0x30(%rdx), %rcx
cmpq 0x38(%rdx), %rcx
jne 0x1b979
movq 0x48(%rdx), %rdx
movl $0x200, %ecx            # imm = 0x200
addq -0x8(%rdx), %rcx
movl %ebp, -0x4(%rcx)
incl %eax
cmpl %ebx, %eax
jne 0x1b9a2
incl 0x141b8(%rip)           # 0x2fb40
leaq 0x13e89(%rip), %rax     # 0x2f818
movq (%rax), %rdi
leaq 0x2cbc(%rip), %rsi      # 0x1e655
movl %ebx, %edx
xorl %eax, %eax
callq 0x6390
incl 0x14198(%rip)           # 0x2fb40
leaq 0x13e69(%rip), %r12     # 0x2f818
movq (%r12), %rcx
leaq 0x2dcf(%rip), %rdi      # 0x1e789
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x64c0
incl 0x14175(%rip)           # 0x2fb40
movq (%r12), %rdi
leaq 0x2ce0(%rip), %rsi      # 0x1e6b6
movl %ebp, %edx
xorl %eax, %eax
callq 0x6390
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
incl 0x1414e(%rip)           # 0x2fb40
leaq 0x13e1f(%rip), %r14     # 0x2f818
movq (%r14), %rdi
movl %ebx, %edx
addl $0x3, %edx
leaq 0x2c4d(%rip), %rsi      # 0x1e655
xorl %eax, %eax
callq 0x6390
incl 0x1412b(%rip)           # 0x2fb40
movq (%r14), %rdi
leaq 0x2c97(%rip), %rsi      # 0x1e6b6
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6390