// File: /workspace/github_cpp_makefile_star2_O2/Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::PostFix::CompileAST(Gos::Compiler::VMCompiler&)
Compile(PostFix) {
    START();
    int prv = SUB(0);
    std::vector<int> params;
    for (int i = 1; i < nodes.size(); i++) {
        GosAST* rt = nodes[i];
        int tmp = code.GetTmpVar();
        params.clear();
        switch (rt->branch) {
            case 1:
                vm.WriteCommandCall(prv, "__index", { rt->SUB(0) });
                vm.WriteCommandRef(tmp, 0);
                break;
            case 2:
                if (rt->nodes.size() > 0) {
                    GosAST* argsList = rt->nodes[0];
                    for (auto* expr : argsList->nodes) {
                        params.push_back(expr->CompileAST(code));
                    }
                }
                vm.WriteCommandCall(prv, "__call", params);
                vm.WriteCommandRef(tmp, 0);
                break;
            case 3:
                vm.WriteCommandGetField(tmp, prv, rt->nodes[0]->token.str);
                break;
            case 4:
                if (rt->nodes.size() > 1) {
                    GosAST* argsList = rt->nodes[1];
                    for (auto* expr : argsList->nodes) {
                        params.push_back(expr->CompileAST(code));
                    }
                }
                vm.WriteCommandCall(prv, rt->nodes[0]->token.str, params);
                vm.WriteCommandRef(tmp, 0);
                break;
            case 5:
                vm.WriteCommandCall(prv, "__dec", {});
                vm.WriteCommandRef(tmp, 0);
                break;
            case 6:
                vm.WriteCommandCall(prv, "__inc", {});
                vm.WriteCommandRef(tmp, 0);
                break;
        }
        prv = tmp;
    }
    return prv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl 0x2c(%rdi), %eax
movl %eax, 0x81d80(%rip)     # 0x107278
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x857f8
movq %rsi, %rbx
movq %rdi, %r13
movq (%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movl %eax, %r14d
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
pushq $0x1
popq %r15
leaq 0x30(%rsp), %rbp
movq %r13, 0x28(%rsp)
movq 0x10(%r13), %rax
movq 0x18(%r13), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0x857ec
movl %r14d, (%rsp)
movq (%rax,%r15,8), %r12
movq %rbx, %rdi
callq 0x85044
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x85572
movq %rax, 0x18(%rsp)
movl 0x8(%r12), %eax
decl %eax
cmpl $0x5, %eax
ja 0x85792
leaq 0x25273(%rip), %rcx     # 0xaa7fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xe8(%rbx), %r14
movq %rbp, %rdi
leaq 0x10829(%rip), %rsi     # 0x95dcc
leaq 0xf(%rsp), %rdx
callq 0x664f4
movq 0x10(%r12), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl %eax, 0x4(%rsp)
leaq 0xc0(%rsp), %r12
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x88976
movq %r14, %rdi
movl (%rsp), %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x791c0
jmp 0x85770
movq 0xe8(%rbx), %r14
movq %rbp, %rdi
leaq 0x10803(%rip), %rsi     # 0x95e08
leaq 0x4(%rsp), %rdx
callq 0x664f4
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
andq $0x0, 0x80(%rsp)
movq %r14, %rdi
movl (%rsp), %esi
movq %rbp, %rdx
leaq 0x70(%rsp), %r14
movq %r14, %rcx
callq 0x791c0
jmp 0x8572a
movq 0xe8(%rbx), %rdi
movq 0x10(%r12), %rax
movq (%rax), %rcx
addq $0x40, %rcx
movl 0x8(%rsp), %esi
movl (%rsp), %edx
callq 0x78e68
jmp 0x85792
movq 0x10(%r12), %rax
movq 0x18(%r12), %rcx
subq %rax, %rcx
cmpq $0x9, %rcx
jb 0x857a9
movq 0x8(%rax), %rax
movq 0x10(%rax), %r14
movq 0x18(%rax), %r13
cmpq %r13, %r14
je 0x8579f
movq (%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl %eax, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x89a6c
addq $0x8, %r14
jmp 0x85682
movq 0x10(%r12), %rax
cmpq %rax, 0x18(%r12)
je 0x8572f
movq (%rax), %rax
movq 0x10(%rax), %r14
movq 0x18(%rax), %r12
cmpq %r12, %r14
je 0x8572f
movq (%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl %eax, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x89a6c
addq $0x8, %r14
jmp 0x856c4
movq 0xe8(%rbx), %r14
movq %rbp, %rdi
leaq 0x10706(%rip), %rsi     # 0x95e02
leaq 0x4(%rsp), %rdx
callq 0x664f4
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %r14, %rdi
movl (%rsp), %esi
movq %rbp, %rdx
leaq 0x50(%rsp), %r14
movq %r14, %rcx
callq 0x791c0
movq %r14, %rdi
jmp 0x85773
movq 0xe8(%rbx), %r14
movq %rbp, %rdi
leaq 0x10694(%rip), %rsi     # 0x95dd4
leaq 0x4(%rsp), %rdx
callq 0x664f4
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x889ac
movq %r14, %rdi
movl (%rsp), %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x791c0
movq %r12, %rdi
callq 0x89956
movq %rbp, %rdi
callq 0x209be
movq 0xe8(%rbx), %rdi
movl 0x8(%rsp), %esi
xorl %edx, %edx
callq 0x78dd8
incq %r15
movl 0x8(%rsp), %r14d
jmp 0x85535
movq 0x10(%r12), %rax
movq 0x28(%rsp), %r13
movq 0xe8(%rbx), %r12
movq (%rax), %r14
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x889ac
addq $0x40, %r14
movq %r12, %rdi
movl (%rsp), %esi
movq %r14, %rdx
leaq 0x90(%rsp), %r14
movq %r14, %rcx
callq 0x791c0
movq %r14, %rdi
callq 0x89956
jmp 0x85780
leaq 0x10(%rsp), %rdi
callq 0x89956
jmp 0x857fb
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x8585f
jmp 0x85874
jmp 0x8583c
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x8585f
jmp 0x85874
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
jmp 0x8585f
jmp 0x8583c
movq %rax, %rbx
jmp 0x85864
jmp 0x85874
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x89956
jmp 0x85877
jmp 0x85874
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x89956
leaq 0x30(%rsp), %rdi
callq 0x209be
jmp 0x85877
jmp 0x85874
jmp 0x85874
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x89956
movq %rbx, %rdi
callq 0x11570
nop