// File: /workspace/github_cpp_makefile_star2_O3/Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::ClassDef::CompileAST(Gos::Compiler::VMCompiler&)
Compile(ClassDef) {
    START();
    int start = 0;
    if (branch & 1) {
        SUB(start++);
    }
    if (branch & 2) {
        // Func
        code.MoveToNew();
        code.funcScope = code.currentScope;
        std::string name = nodes[start++]->token.str;
        std::vector<std::string> argTypes;
        std::vector<std::string> argNames;
        if (branch & 8) {
            // DefArgList
            auto* ast = nodes[start++];
            for (auto* arg : ast->nodes) {
                argNames.push_back(arg->nodes[0]->token.str);
                argTypes.push_back(arg->nodes[1]->token.str);
            }
        }
        std::string ret = nodes[start++]->token.str;
        auto jmp = vm.WriteCommandDefFunc(name, ret, argTypes);

        auto setMemsize = vm.WriteAlloc();
        code.ClearTmp();
        pc = 1;

        int id = pc++;
        code.currentScope->varID["this"] = id;
        vm.WriteCommandArg(id, 0);

        for (int i = 0; i < argNames.size(); i++) {
            id = pc++;
            code.currentScope->varID[argNames[i]] = id;
            code.currentScope->varType[argNames[i]] = argTypes[i];
            vm.WriteCommandArg(id, i + 1);
        }

        SUB(start++);
        vm.WriteCommandRet(0);
        jmp(vm.GetProgress());
        setMemsize(pc);
        pc = 1;
        code.MoveBack();
    } else if (branch & 4) {
        // Field
        std::string varName = nodes[start++]->token.str;
        std::string typeName = nodes[start++]->token.str;
        compilingClassVars.push_back(varName);
        compilingClassVarTypes.push_back(typeName);
        vm.WriteCommandDefVar(typeName, varName);
        pc--;
        code.currentScope->varID.erase(varName);
        code.currentScope->varType.erase(typeName);
    } else if (branch & 16) {
        // using
        std::string name = nodes[start++]->token.str;
        compilingClassVars.push_back(name);
        compilingClassVarTypes.push_back(name);
        vm.WriteCommandNamespace(name);
        pc--;
        code.currentScope->varID.erase(name);
        code.currentScope->varType.erase(name);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl 0x2c(%rdi), %eax
movl %eax, 0x7306a(%rip)     # 0x11e288
movq 0x10(%rdi), %rcx
cmpq %rcx, 0x18(%rdi)
je 0xab77a
movq %rsi, %rbx
movq %rdi, %r12
movl 0x8(%rdi), %eax
xorl %r13d, %r13d
testb $0x1, %al
je 0xab252
movq (%rcx), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl 0x8(%r12), %eax
movl $0x1, %r13d
testb $0x2, %al
jne 0xab2fd
testb $0x4, %al
jne 0xab37c
testb $0x10, %al
je 0xab77a
movq 0x10(%r12), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rax
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x36954
leaq 0x72fa2(%rip), %rdi     # 0x11e240
movq %r14, %rsi
callq 0x9a724
leaq 0x72fab(%rip), %rdi     # 0x11e258
leaq 0x8(%rsp), %rsi
callq 0x9a724
movq 0xe8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x991c0
decl 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
leaq 0x8(%rsp), %rsi
callq 0xadea4
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
leaq 0x8(%rsp), %rsi
callq 0xadf8c
jmp 0xab44e
movq %rbx, %rdi
callq 0xa6f80
movq 0xd0(%rbx), %rax
movq %rax, 0xd8(%rbx)
leal 0x1(%r13), %ebp
movq 0x10(%r12), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rax
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x36954
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq %rax, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
testb $0x8, 0x8(%r12)
movq 0x10(%r12), %rax
jne 0xab461
movl %ebp, %r13d
jmp 0xab4d8
movq 0x10(%r12), %rax
shll $0x3, %r13d
movq (%rax,%r13), %rax
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x36954
movq 0x10(%r12), %rax
movq 0x8(%rax,%r13), %rax
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x36954
leaq 0x72e6a(%rip), %rdi     # 0x11e240
leaq 0x8(%rsp), %rsi
callq 0x9a724
leaq 0x72e71(%rip), %rdi     # 0x11e258
leaq 0x28(%rsp), %rsi
callq 0x9a724
movq 0xe8(%rbx), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x98c50
decl 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
leaq 0x8(%rsp), %rsi
callq 0xadea4
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
leaq 0x28(%rsp), %rsi
callq 0xadf8c
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xab44e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0xab76d
jmp 0xab77a
orl $0x2, %r13d
movl %ebp, %ecx
movq (%rax,%rcx,8), %rcx
movq 0x10(%rcx), %rbp
movq 0x18(%rcx), %r14
cmpq %r14, %rbp
je 0xab4d8
movq %r13, 0xb0(%rsp)
movq %r12, 0x48(%rsp)
leaq 0x70(%rsp), %r15
leaq 0x90(%rsp), %r12
movq (%rbp), %r13
movq 0x10(%r13), %rax
movq (%rax), %rsi
addq $0x40, %rsi
movq %r15, %rdi
callq 0x9a724
movq 0x10(%r13), %rax
movq 0x8(%rax), %rsi
addq $0x40, %rsi
movq %r12, %rdi
callq 0x9a724
addq $0x8, %rbp
cmpq %r14, %rbp
jne 0xab492
movq 0x48(%rsp), %r12
movq 0x10(%r12), %rax
movq 0xb0(%rsp), %r13
movl %r13d, %r13d
movq (%rax,%r13,8), %rax
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x36954
movq 0xe8(%rbx), %rsi
leaq 0xd8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x90(%rsp), %r8
callq 0x98d30
movq 0xe8(%rbx), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x99f3e
movq 0x100(%rbx), %rax
testq %rax, %rax
je 0xab54c
movb $0x0, 0xc(%rax)
movq (%rax), %rax
jmp 0xab53e
movl $0x2, 0xe0(%rbx)
movq 0xd0(%rbx), %r15
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x24b8f(%rip), %rsi     # 0xd00fc
leaq 0x24b8c(%rip), %rdx     # 0xd0100
leaq 0x50(%rsp), %rdi
callq 0x27370
addq $0x28, %r15
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0xadd86
movq %r13, 0x48(%rsp)
movl $0x1, (%rax)
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xab5b1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
movq %r12, %r14
movq 0xe8(%rbx), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x995f2
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0xab656
movl 0xe0(%rbx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
addq %rbp, %rsi
callq 0x9b46a
movl %r12d, (%rax)
movq 0x90(%rsp), %r13
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
movq 0x70(%rsp), %rsi
addq %rbp, %rsi
callq 0xaca12
addq %rbp, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x39678
movq 0xe8(%rbx), %rdi
incq %r15
addq $0x20, %rbp
movl %r12d, %esi
movl %r15d, %edx
callq 0x995f2
jmp 0xab5cc
movq 0x10(%r14), %rax
movq 0x48(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movq 0xe8(%rbx), %rdi
xorl %esi, %esi
callq 0x99acc
movq 0xe8(%rbx), %rdi
callq 0x99f3a
movl %eax, 0x50(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0xab78e
leaq 0xd8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq *0x18(%rdi)
movl 0xe0(%rbx), %eax
movl %eax, 0x50(%rsp)
cmpq $0x0, 0xc8(%rsp)
je 0xab78e
leaq 0xb8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq *0x18(%rdi)
movl $0x1, 0xe0(%rbx)
movq 0xd0(%rbx), %rax
movq (%rax), %rax
movq %rax, 0xd0(%rbx)
movq 0xc8(%rsp), %rax
testq %rax, %rax
je 0xab70c
leaq 0xb8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rsp), %rax
testq %rax, %rax
je 0xab72b
leaq 0xd8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xab747
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x367d6
leaq 0x90(%rsp), %rdi
callq 0x367d6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xab77a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x11150
jmp 0xab7c9
jmp 0xab89c
jmp 0xab89c
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xab805
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
jmp 0xab805
jmp 0xab802
movq %rax, %rbx
jmp 0xab824
movq %rax, %rbx
jmp 0xab843
jmp 0xab7fd
movq %rax, %rbx
jmp 0xab7e8
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xab7e8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0xab885
jmp 0xab892
jmp 0xab802
movq %rax, %rbx
jmp 0xab85f
movq %rax, %rbx
movq 0xc8(%rsp), %rax
testq %rax, %rax
je 0xab824
leaq 0xb8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rsp), %rax
testq %rax, %rax
je 0xab843
leaq 0xd8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xab85f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x367d6
leaq 0x90(%rsp), %rdi
callq 0x367d6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xab892
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
movq %rbx, %rdi
callq 0x11580
jmp 0xab89c
movq %rax, %rdi
callq 0x26e38