// File: /workspace/github_cpp_makefile_star2_O3/Eronana[P]strawberry/src/ast_codegen.cpp
// Function: AST_FunctionExpression::codeGen(Symbol*)
DEF_AST_METHOD(FunctionExpression,AST_CODEGEN)
{
    auto symbol_bak=symbol;
    GET_SCOPE();
    int funcLabel=nextLabel();
    FunctionInfo func;
    functionStack.push(&func);
    FILE *bak=AST::fp;
    FILE *tmp_fp=AST::fp=tmpfile();
    func_tmpfile.push_back(tmp_fp);
    PRINTF("; function expression\n");
    PRINTF("label_%d:\n",funcLabel);
    auto localCount=symbol->localCount;
    if(localCount)PRINTF("addsp %d\n",symbol->localCount);
    CODEGEN(block);
    PRINTF("push null\n");
    PRINTF("ret\n");
    // if(localCount)PRINTF("subsp %d\n",symbol->localCount);
    functionStack.pop();
    AST::fp=bak;
    this_count++;
    PRINTF("new_array\n");
    for(auto &x:func.ext_list)
    {
        variantMethod(symbol_bak,x,"load");
        PRINTF("array_push\n");
    }
    PRINTF("create_function label_%d\n",funcLabel);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x10(%rsp), %r14
movq %rdi, (%r14)
leaq 0x10a9d(%rip), %rdi     # 0x2f688
movq %r14, %rsi
callq 0x10a90
movq (%rax), %r12
callq 0xdb7b
movl %eax, 0x4(%rsp)
leaq 0x18(%rsp), %rax
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
leaq 0x8(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x10b74(%rip), %rdi     # 0x2f7a8
callq 0x1f394
leaq 0x10bc8(%rip), %r13     # 0x2f808
movq (%r13), %r14
callq 0x6340
movq %rax, (%r13)
movq %rax, 0x8(%rsp)
movq 0x10ee7(%rip), %rsi     # 0x2fb40
cmpq 0x10ee8(%rip), %rsi     # 0x2fb48
je 0x1ec6f
movq %rax, (%rsi)
addq $0x8, 0x10ed3(%rip)     # 0x2fb40
jmp 0x1ec80
leaq 0x10ec2(%rip), %rdi     # 0x2fb38
leaq 0x8(%rsp), %rdx
callq 0x1f5f6
incl 0x10eaa(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x2b6e(%rip), %rdi      # 0x217ff
movl $0x16, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x10e8a(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x2a55(%rip), %rsi      # 0x21706
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x6390
movl 0x3c(%r12), %edx
testl %edx, %edx
je 0x1ecdd
incl 0x10e65(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x2b40(%rip), %rsi      # 0x21816
xorl %eax, %eax
callq 0x6390
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x18(%rax)
incl 0x10e40(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x2b25(%rip), %rdi      # 0x21820
movl $0xa, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x10e20(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x2b10(%rip), %rdi      # 0x2182b
movl $0x4, %esi
movl $0x1, %edx
callq 0x64b0
leaq 0x10a77(%rip), %rdi     # 0x2f7a8
callq 0x1f732
leaq 0x10abf(%rip), %rax     # 0x2f7fc
incl (%rax)
movq %r14, (%r13)
incl 0x10de7(%rip)           # 0x2fb30
leaq 0x2871(%rip), %rdi      # 0x215c1
movl $0xa, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x64b0
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %rbp
cmpq %rbp, %r14
je 0x1edb2
leaq 0x2ab8(%rip), %r15      # 0x21830
leaq 0x2859(%rip), %r12      # 0x215d8
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1cdd8
incl 0x10d9d(%rip)           # 0x2fb30
movq (%r13), %rcx
movl $0xb, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x64b0
addq $0x20, %r14
cmpq %rbp, %r14
jne 0x1ed7f
leaq 0x40(%rsp), %rbx
incl 0x10d73(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x2a6d(%rip), %rsi      # 0x21835
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x6390
movq %rbx, %rdi
callq 0x19976
leaq 0x10(%rsp), %rdi
callq 0xdc2a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1edfa
jmp 0x1edfa
jmp 0x1edfa
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x19976
leaq 0x10(%rsp), %rdi
callq 0xdc2a
movq %rbx, %rdi
callq 0x6450
nop