// File: /workspace/github_cpp_makefile_star2_O1/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 0x104b7(%rip), %rdi     # 0x2f688
movq %r14, %rsi
callq 0x10aac
movq (%rax), %r12
callq 0xdb8f
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 0x1058e(%rip), %rdi     # 0x2f7a8
callq 0x1f97a
leaq 0x105e2(%rip), %r13     # 0x2f808
movq (%r13), %r14
callq 0x6340
movq %rax, (%r13)
movq %rax, 0x8(%rsp)
movq 0x10901(%rip), %rsi     # 0x2fb40
cmpq 0x10902(%rip), %rsi     # 0x2fb48
je 0x1f255
movq %rax, (%rsi)
addq $0x8, 0x108ed(%rip)     # 0x2fb40
jmp 0x1f266
leaq 0x108dc(%rip), %rdi     # 0x2fb38
leaq 0x8(%rsp), %rdx
callq 0x1fbd6
incl 0x108c4(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x256c(%rip), %rdi      # 0x217e3
movl $0x16, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x108a4(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x2453(%rip), %rsi      # 0x216ea
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x6390
movl 0x3c(%r12), %edx
testl %edx, %edx
je 0x1f2c3
incl 0x1087f(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x253e(%rip), %rsi      # 0x217fa
xorl %eax, %eax
callq 0x6390
movq 0x10(%r15), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x18(%rax)
incl 0x1085a(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x2523(%rip), %rdi      # 0x21804
movl $0xa, %esi
movl $0x1, %edx
callq 0x64b0
incl 0x1083a(%rip)           # 0x2fb30
movq (%r13), %rcx
leaq 0x250e(%rip), %rdi      # 0x2180f
movl $0x4, %esi
movl $0x1, %edx
callq 0x64b0
leaq 0x10491(%rip), %rdi     # 0x2f7a8
callq 0x1fd12
leaq 0x104d9(%rip), %rax     # 0x2f7fc
incl (%rax)
movq %r14, (%r13)
incl 0x10801(%rip)           # 0x2fb30
leaq 0x226f(%rip), %rdi      # 0x215a5
movl $0xa, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x64b0
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %rbp
cmpq %rbp, %r14
je 0x1f398
leaq 0x24b6(%rip), %r15      # 0x21814
leaq 0x2257(%rip), %r12      # 0x215bc
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1d3a4
incl 0x107b7(%rip)           # 0x2fb30
movq (%r13), %rcx
movl $0xb, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x64b0
addq $0x20, %r14
cmpq %rbp, %r14
jne 0x1f365
leaq 0x40(%rsp), %rbx
incl 0x1078d(%rip)           # 0x2fb30
movq (%r13), %rdi
leaq 0x246b(%rip), %rsi      # 0x21819
movl 0x4(%rsp), %edx
xorl %eax, %eax
callq 0x6390
movq %rbx, %rdi
callq 0x19f38
leaq 0x10(%rsp), %rdi
callq 0xdc3e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1f3e0
jmp 0x1f3e0
jmp 0x1f3e0
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x19f38
leaq 0x10(%rsp), %rdi
callq 0xdc3e
movq %rbx, %rdi
callq 0x6450
nop