// File: /workspace/github_cpp_makefile_star2_O1/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, 0x73210(%rip)     # 0x11f288
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0xac5d2
movq %rsi, %rbx
movq %rdi, %r12
xorl %r14d, %r14d
testb $0x1, 0x8(%rdi)
je 0xac0a6
movq (%rax), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movl $0x1, %r14d
movl 0x8(%r12), %eax
testb $0x2, %al
jne 0xac156
testb $0x4, %al
jne 0xac24a
testb $0x10, %al
je 0xac5d2
movq 0x10(%r12), %rax
movl %r14d, %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 0x37586
leaq 0x73149(%rip), %rdi     # 0x11f240
movq %r14, %rsi
callq 0x9b36e
leaq 0x73152(%rip), %rdi     # 0x11f258
leaq 0x8(%rsp), %rsi
callq 0x9b36e
movq 0xe8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x99dfa
decl 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
leaq 0x8(%rsp), %rsi
callq 0xaed2a
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
leaq 0x8(%rsp), %rsi
callq 0xaee22
jmp 0xac31c
movq %rbx, %rdi
callq 0xa7c10
movq 0xd0(%rbx), %rax
movq %rax, 0xd8(%rbx)
leal 0x1(%r14), %ebp
movq 0x10(%r12), %rax
movl %r14d, %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 0x37586
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 %r12, 0x48(%rsp)
je 0xac332
orl $0x2, %r14d
movq 0x10(%r12), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rbp
movq 0x18(%rax), %r13
cmpq %r13, %rbp
je 0xac32f
movq %r14, 0xb0(%rsp)
leaq 0x70(%rsp), %r15
leaq 0x90(%rsp), %r12
movq (%rbp), %r14
movq 0x10(%r14), %rax
movq (%rax), %rsi
addq $0x40, %rsi
movq %r15, %rdi
callq 0x9b36e
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
addq $0x40, %rsi
movq %r12, %rdi
callq 0x9b36e
addq $0x8, %rbp
cmpq %r13, %rbp
jne 0xac202
movq 0xb0(%rsp), %rax
movl %eax, %ebp
movq 0x48(%rsp), %r12
jmp 0xac332
movq 0x10(%r12), %rax
shll $0x3, %r14d
movq (%rax,%r14), %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 0x37586
movq 0x10(%r12), %rax
movq 0x8(%rax,%r14), %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 0x37586
leaq 0x72f9c(%rip), %rdi     # 0x11f240
leaq 0x8(%rsp), %rsi
callq 0x9b36e
leaq 0x72fa3(%rip), %rdi     # 0x11f258
leaq 0x28(%rsp), %rsi
callq 0x9b36e
movq 0xe8(%rbx), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x99876
decl 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
leaq 0x8(%rsp), %rsi
callq 0xaed2a
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
leaq 0x28(%rsp), %rsi
callq 0xaee22
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xac31c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0xac5c5
jmp 0xac5d2
movl %r14d, %ebp
movq 0x10(%r12), %rax
movl %ebp, %r14d
movq (%rax,%r14,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 0x37586
movq 0xe8(%rbx), %rsi
leaq 0xd8(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x90(%rsp), %r8
callq 0x99956
movq 0xe8(%rbx), %rsi
leaq 0xb8(%rsp), %rdi
callq 0x9ab8c
movq 0x100(%rbx), %rax
testq %rax, %rax
je 0xac3ab
movb $0x0, 0xc(%rax)
movq (%rax), %rax
jmp 0xac39d
movl $0x2, 0xe0(%rbx)
movq 0xd0(%rbx), %r15
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x24d5f(%rip), %rsi     # 0xd112c
leaq 0x24d5c(%rip), %rdx     # 0xd1130
leaq 0x50(%rsp), %rdi
callq 0x27dc8
addq $0x28, %r15
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0xaec02
movl $0x1, (%rax)
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xac40c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0xe8(%rbx), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x9a22c
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0xac4ae
movl 0xe0(%rbx), %r12d
leal 0x1(%r12), %eax
movl %eax, 0xe0(%rbx)
movq 0xd0(%rbx), %rdi
addq $0x28, %rdi
addq %rbp, %rsi
callq 0x9c09a
movl %r12d, (%rax)
movq 0x90(%rsp), %r13
movq 0xd0(%rbx), %rdi
addq $0x60, %rdi
movq 0x70(%rsp), %rsi
addq %rbp, %rsi
callq 0xad878
addq %rbp, %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x3a2e8
movq 0xe8(%rbx), %rdi
incq %r15
addq $0x20, %rbp
movl %r12d, %esi
movl %r15d, %edx
callq 0x9a22c
jmp 0xac424
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax,%r14,8), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *(%rax)
movq 0xe8(%rbx), %rdi
xorl %esi, %esi
callq 0x9a706
movq 0xe8(%rbx), %rdi
callq 0x9ab88
movl %eax, 0x50(%rsp)
cmpq $0x0, 0xe8(%rsp)
je 0xac5e6
leaq 0xd8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq *0x18(%rdi)
movl 0xe0(%rbx), %eax
movl %eax, 0x50(%rsp)
cmpq $0x0, 0xc8(%rsp)
je 0xac5e6
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 0xac564
leaq 0xb8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rsp), %rax
testq %rax, %rax
leaq 0x18(%rsp), %rbx
je 0xac588
leaq 0xd8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xac5a4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x3740c
leaq 0x90(%rsp), %rdi
callq 0x3740c
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0xac5d2
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 0xac621
jmp 0xac6f4
jmp 0xac6f4
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0xac65d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x11360
jmp 0xac65d
jmp 0xac65a
movq %rax, %rbx
jmp 0xac67c
movq %rax, %rbx
jmp 0xac69b
jmp 0xac655
movq %rax, %rbx
jmp 0xac640
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xac640
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0xac6dd
jmp 0xac6ea
jmp 0xac65a
movq %rax, %rbx
jmp 0xac6b7
movq %rax, %rbx
movq 0xc8(%rsp), %rax
testq %rax, %rax
je 0xac67c
leaq 0xb8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0xe8(%rsp), %rax
testq %rax, %rax
je 0xac69b
leaq 0xd8(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xac6b7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x11360
leaq 0x70(%rsp), %rdi
callq 0x3740c
leaq 0x90(%rsp), %rdi
callq 0x3740c
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xac6ea
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x11360
movq %rbx, %rdi
callq 0x11580
jmp 0xac6f4
movq %rax, %rdi
callq 0x2789a