// File: 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:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0x2b8(%rsp)
movq %rsi, 0x2b0(%rsp)
movq 0x2b8(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
movl 0x2c(%rdi), %eax
movl %eax, 0x12c5a8(%rip)    # 0x3022f8
addq $0x10, %rdi
callq 0x1d1e80
cmpq $0x0, %rax
jne 0x1d5d6f
movl $0x0, 0x2c4(%rsp)
jmp 0x1d67a1
movq 0xc8(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0x2b0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movl %eax, 0x2ac(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x1dd1b0
movl $0x1, 0x28c(%rsp)
movq 0xc8(%rsp), %rdi
movslq 0x28c(%rsp), %rax
movq %rax, 0xc0(%rsp)
addq $0x10, %rdi
callq 0x1d1e80
movq %rax, %rcx
movq 0xc0(%rsp), %rax
cmpq %rcx, %rax
jae 0x1d6775
movq 0xc8(%rsp), %rdi
addq $0x10, %rdi
movslq 0x28c(%rsp), %rsi
callq 0x1d1e60
movq (%rax), %rax
movq %rax, 0x280(%rsp)
movq 0x2b0(%rsp), %rdi
callq 0x1d5250
movl %eax, 0x27c(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x1dd310
movq 0x280(%rsp), %rax
movl 0x8(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0xb8(%rsp)
subl $0x5, %eax
ja 0x1d6751
movq 0xb8(%rsp), %rax
leaq 0x4beb0(%rip), %rcx     # 0x221d0c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0xa0(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0xac(%rsp)
leaq 0x257(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x13570
movq 0xb0(%rsp), %rdx
leaq 0x3587e(%rip), %rsi     # 0x20b72c
leaq 0x258(%rsp), %rdi
callq 0x165520
jmp 0x1d5ebd
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0x2b0(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x9c(%rsp)
jmp 0x1d5eee
movl 0x9c(%rsp), %eax
movl %eax, 0x214(%rsp)
leaq 0x214(%rsp), %rax
movq %rax, 0x218(%rsp)
movq $0x1, 0x220(%rsp)
leaq 0x213(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x5ae50
movq 0x90(%rsp), %rcx
movq 0x218(%rsp), %rsi
movq 0x220(%rsp), %rdx
leaq 0x228(%rsp), %rdi
callq 0x1dd1f0
jmp 0x1d5f54
movl 0xac(%rsp), %esi
movq 0xa0(%rsp), %rdi
leaq 0x258(%rsp), %rdx
leaq 0x228(%rsp), %rcx
callq 0x1b1940
jmp 0x1d5f7a
leaq 0x228(%rsp), %rdi
callq 0x1dd280
leaq 0x213(%rsp), %rdi
callq 0x5ae60
leaq 0x258(%rsp), %rdi
callq 0x52f50
leaq 0x257(%rsp), %rdi
callq 0x136a0
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x27c(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
jmp 0x1d5fcd
jmp 0x1d6751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d604f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d6042
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d6035
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0x228(%rsp), %rdi
callq 0x1dd280
leaq 0x213(%rsp), %rdi
callq 0x5ae60
leaq 0x258(%rsp), %rdi
callq 0x52f50
leaq 0x257(%rsp), %rdi
callq 0x136a0
jmp 0x1d6792
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d6792
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
callq 0x1d1e80
cmpq $0x0, %rax
jbe 0x1d6184
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rax
movq %rax, 0x208(%rsp)
movq 0x208(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x200(%rsp)
movq 0x200(%rsp), %rdi
callq 0x1d1b70
movq %rax, 0x1f8(%rsp)
movq 0x200(%rsp), %rdi
callq 0x1d1ba0
movq %rax, 0x1f0(%rsp)
leaq 0x1f8(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x1d1bd0
xorb $-0x1, %al
testb $0x1, %al
jne 0x1d6110
jmp 0x1d6182
leaq 0x1f8(%rsp), %rdi
callq 0x1d1c10
movq (%rax), %rax
movq %rax, 0x1e8(%rsp)
movq 0x1e8(%rsp), %rdi
movq 0x2b0(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x8c(%rsp)
jmp 0x1d6149
movl 0x8c(%rsp), %eax
movl %eax, 0x1e4(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x1e4(%rsp), %rsi
callq 0x1dd2e0
jmp 0x1d616e
jmp 0x1d6170
leaq 0x1f8(%rsp), %rdi
callq 0x1d1c20
jmp 0x1d60f3
jmp 0x1d6184
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x70(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0x7c(%rsp)
leaq 0x1bf(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x13570
movq 0x80(%rsp), %rdx
leaq 0x3556d(%rip), %rsi     # 0x20b734
leaq 0x1c0(%rsp), %rdi
callq 0x165520
jmp 0x1d61d6
leaq 0x1a0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x1dd330
jmp 0x1d61ed
movl 0x7c(%rsp), %esi
movq 0x70(%rsp), %rdi
leaq 0x1c0(%rsp), %rdx
leaq 0x1a0(%rsp), %rcx
callq 0x1b1940
jmp 0x1d620d
leaq 0x1a0(%rsp), %rdi
callq 0x1dd280
leaq 0x1c0(%rsp), %rdi
callq 0x52f50
leaq 0x1bf(%rsp), %rdi
callq 0x136a0
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x27c(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
jmp 0x1d6253
jmp 0x1d6751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d62b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d62a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x1dd280
leaq 0x1c0(%rsp), %rdi
callq 0x52f50
leaq 0x1bf(%rsp), %rdi
callq 0x136a0
jmp 0x1d6792
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x60(%rsp)
movl 0x27c(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0x6c(%rsp)
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq 0x60(%rsp), %rdi
movl 0x68(%rsp), %esi
movl 0x6c(%rsp), %edx
movq (%rax), %rcx
addq $0x40, %rcx
callq 0x1b1290
jmp 0x1d631e
jmp 0x1d6751
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
callq 0x1d1e80
cmpq $0x1, %rax
jbe 0x1d6428
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x1d1e60
movq (%rax), %rax
movq %rax, 0x198(%rsp)
movq 0x198(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x190(%rsp)
movq 0x190(%rsp), %rdi
callq 0x1d1b70
movq %rax, 0x188(%rsp)
movq 0x190(%rsp), %rdi
callq 0x1d1ba0
movq %rax, 0x180(%rsp)
leaq 0x188(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x1d1bd0
xorb $-0x1, %al
testb $0x1, %al
jne 0x1d63ba
jmp 0x1d6426
leaq 0x188(%rsp), %rdi
callq 0x1d1c10
movq (%rax), %rax
movq %rax, 0x178(%rsp)
movq 0x178(%rsp), %rdi
movq 0x2b0(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x5c(%rsp)
jmp 0x1d63f0
movl 0x5c(%rsp), %eax
movl %eax, 0x174(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x174(%rsp), %rsi
callq 0x1dd2e0
jmp 0x1d6412
jmp 0x1d6414
leaq 0x188(%rsp), %rdi
callq 0x1d1c20
jmp 0x1d639d
jmp 0x1d6428
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x40(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0x4c(%rsp)
movq 0x280(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rax
addq $0x40, %rax
movq %rax, 0x50(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0x1dd330
jmp 0x1d647f
movq 0x50(%rsp), %rdx
movl 0x4c(%rsp), %esi
movq 0x40(%rsp), %rdi
leaq 0x158(%rsp), %rcx
callq 0x1b1940
jmp 0x1d649c
leaq 0x158(%rsp), %rdi
callq 0x1dd280
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x27c(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
jmp 0x1d64c8
jmp 0x1d6751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x1dd280
jmp 0x1d6792
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x28(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0x34(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x13570
movq 0x38(%rsp), %rdx
leaq 0x35238(%rip), %rsi     # 0x20b768
leaq 0x138(%rsp), %rdi
callq 0x165520
jmp 0x1d653f
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movq $0x0, 0x120(%rsp)
leaq 0x110(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x1dd1b0
movq 0x28(%rsp), %rdi
movl 0x34(%rsp), %esi
movq 0x20(%rsp), %rcx
leaq 0x138(%rsp), %rdx
callq 0x1b1940
jmp 0x1d6585
leaq 0x110(%rsp), %rdi
callq 0x1dd280
leaq 0x138(%rsp), %rdi
callq 0x52f50
leaq 0x137(%rsp), %rdi
callq 0x136a0
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x27c(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
jmp 0x1d65cb
jmp 0x1d6751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d6614
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x1dd280
leaq 0x138(%rsp), %rdi
callq 0x52f50
leaq 0x137(%rsp), %rdi
callq 0x136a0
jmp 0x1d6792
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x2ac(%rsp), %eax
movl %eax, 0x14(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x13570
movq 0x18(%rsp), %rdx
leaq 0x350ff(%rip), %rsi     # 0x20b762
leaq 0xf0(%rsp), %rdi
callq 0x165520
jmp 0x1d6672
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movq $0x0, 0xe0(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x1dd1b0
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movq (%rsp), %rcx
leaq 0xf0(%rsp), %rdx
callq 0x1b1940
jmp 0x1d66b6
leaq 0xd0(%rsp), %rdi
callq 0x1dd280
leaq 0xf0(%rsp), %rdi
callq 0x52f50
leaq 0xef(%rsp), %rdi
callq 0x136a0
movq 0x2b0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x27c(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
jmp 0x1d66fc
jmp 0x1d6751
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
jmp 0x1d6742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x248(%rsp)
movl %eax, 0x244(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x1dd280
leaq 0xf0(%rsp), %rdi
callq 0x52f50
leaq 0xef(%rsp), %rdi
callq 0x136a0
jmp 0x1d6792
movl 0x27c(%rsp), %eax
movl %eax, 0x2ac(%rsp)
movl 0x28c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28c(%rsp)
jmp 0x1d5db3
movl 0x2ac(%rsp), %eax
movl %eax, 0x2c4(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x1dd280
jmp 0x1d67a1
leaq 0x290(%rsp), %rdi
callq 0x1dd280
jmp 0x1d67b0
movl 0x2c4(%rsp), %eax
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq 0x248(%rsp), %rdi
callq 0x133f0
nopl (%rax)