// File: /workspace/github_cpp_makefile_star2_O1/Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::Symbol::CompileAST(Gos::Compiler::VMCompiler&)
Compile(Symbol) { 
    compilingLine = token.line;
    if (token.str == "true" || token.str == "false") {
        int num = code.GetTmpVar();
        int tmp = code.GetTmpVar();
        GosVM::RTConstNum val;
        val.data.i32 = token.str == "true" ? 1 : 0;
        vm.WriteCommandNewNum(1, num, val);
        vm.WriteCommandNew("bool", tmp, { num });
        return tmp;
    }
    std::string errorInfo = "";
    int ret = code.currentScope->GetVarID(token.str, errorInfo);
    if (errorInfo.size() > 0) {
        int& cache = GetFieldCache(code.currentScope, token.str);
        if (cache != -1) {
            return cache;
        }
        for (std::string& s : compilingClassVars) {
            if (s == token.str) {
                int tmp = code.GetTmpVar();
                vm.WriteCommandGetField(tmp, 1, token.str);
                cache = tmp;
                return tmp;
            }
        }
        std::cerr << errorInfo << std::endl;
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movl 0x2c(%rdi), %eax
movl %eax, 0x773e4(%rip)     # 0x11f288
movq %rdi, 0x50(%rsp)
leaq 0x40(%rdi), %r14
leaq 0x29265(%rip), %rsi     # 0xd1119
movq %r14, %rdi
callq 0x282a0
testl %eax, %eax
je 0xa808e
leaq 0x29253(%rip), %rsi     # 0xd111e
movq %r14, %rdi
callq 0x282a0
testl %eax, %eax
je 0xa808e
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x286ba(%rip), %rdx     # 0xd05a6
leaq 0x10(%rsp), %rdi
movq %rdx, %rsi
callq 0x27dc8
movq 0xd0(%rbx), %rdi
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0xa798c
cmpq $0x0, 0x18(%rsp)
je 0xa8217
movl %eax, 0x44(%rsp)
movq %rbx, 0x30(%rsp)
movq 0xd0(%rbx), %r12
testq %r12, %r12
sete %bl
movq %r12, 0x38(%rsp)
je 0xa7f70
leaq 0x98(%r12), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x9bd66
movq %rax, %rbp
testq %rax, %rax
je 0xa7f5f
movq %r15, %rdi
movq %r14, %rsi
callq 0x9c09a
movq %rax, %r13
testq %rbp, %rbp
jne 0xa7f70
movq (%r12), %r12
testq %r12, %r12
sete %bl
jne 0xa7f36
testb $0x1, %bl
je 0xa7fa0
movq 0x38(%rsp), %rbx
addq $0x98, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c09a
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9c09a
movq %rax, %r13
movl (%r13), %r15d
cmpl $-0x1, %r15d
jne 0xa8208
movq 0x7728b(%rip), %rbx     # 0x11f240
movq 0x7728c(%rip), %rax     # 0x11f248
movq %rax, 0x38(%rsp)
cmpq %rax, %rbx
sete %bpl
je 0xa81be
movq 0x30(%rsp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x48(%rsp)
movq 0x8(%rbx), %rdx
movq 0x50(%rsp), %rax
cmpq 0x48(%rax), %rdx
jne 0xa8005
testq %rdx, %rdx
je 0xa800a
movq (%r14), %rsi
movq (%rbx), %rdi
callq 0x11390
testl %eax, %eax
sete %r12b
jmp 0xa800d
xorl %r12d, %r12d
jmp 0xa800d
movb $0x1, %r12b
testb %r12b, %r12b
je 0xa806d
movq 0x48(%rsp), %rax
movq (%rax), %rax
testq %rax, %rax
je 0xa8032
movb 0xc(%rax), %cl
testb %cl, %cl
jne 0xa802e
movb $0x1, 0xc(%rax)
movl 0x8(%rax), %r15d
testb %cl, %cl
jne 0xa8017
testq %rax, %rax
jne 0xa804d
movq 0x30(%rsp), %rcx
movl 0xe0(%rcx), %r15d
leal 0x1(%r15), %eax
movl %eax, 0xe0(%rcx)
movq 0x30(%rsp), %rax
movq 0xe8(%rax), %rdi
movl %r15d, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x9a296
movl %r15d, (%r13)
testb %r12b, %r12b
jne 0xa81be
addq $0x20, %rbx
cmpq 0x38(%rsp), %rbx
sete %bpl
jne 0xa7fde
jmp 0xa81be
leaq 0x100(%rbx), %rax
movq %rax, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xa80b3
movb 0xc(%rcx), %dl
testb %dl, %dl
jne 0xa80af
movb $0x1, 0xc(%rcx)
movl 0x8(%rcx), %r12d
testb %dl, %dl
jne 0xa8098
testq %rcx, %rcx
jne 0xa80ca
movl 0xe0(%rbx), %r12d
leal 0x1(%r12), %ecx
movl %ecx, 0xe0(%rbx)
movq (%rax), %rax
testq %rax, %rax
je 0xa80e5
movb 0xc(%rax), %cl
testb %cl, %cl
jne 0xa80e1
movb $0x1, 0xc(%rax)
movl 0x8(%rax), %r15d
testb %cl, %cl
jne 0xa80ca
testq %rax, %rax
jne 0xa80fb
movl 0xe0(%rbx), %r15d
leal 0x1(%r15), %eax
movl %eax, 0xe0(%rbx)
leaq 0x29017(%rip), %rsi     # 0xd1119
movq %r14, %rdi
callq 0x282a0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movq 0xe8(%rbx), %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x9a064
movq 0xe8(%rbx), %rbx
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x28fe8(%rip), %rsi     # 0xd1124
leaq 0x28fe5(%rip), %rdx     # 0xd1128
leaq 0x10(%rsp), %rdi
callq 0x27dc8
leaq 0x74(%rsp), %rsi
movl %r12d, (%rsi)
leaq 0x58(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0xace70
leaq 0x10(%rsp), %rsi
leaq 0x58(%rsp), %rcx
movq %rbx, %rdi
movl %r15d, %edx
callq 0x99e82
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa8195
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xa81ac
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, %bpl
je 0xa8208
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x75e1b(%rip), %rdi     # 0x11dff0
callq 0x113c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x11340
movsbl %al, %esi
movq %rbx, %rdi
callq 0x11040
movb $0x1, %bl
movq %rax, %rdi
callq 0x11260
jmp 0xa820a
xorl %ebx, %ebx
testb %bl, %bl
leaq 0x20(%rsp), %r12
movl 0x44(%rsp), %eax
je 0xa821a
movl %eax, %r15d
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
jne 0xa819f
jmp 0xa81ac
jmp 0xa8262
jmp 0xa825d
jmp 0xa8262
jmp 0xa8262
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0xa8251
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
jmp 0xa8251
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
jne 0xa8274
jmp 0xa8281
movq %rax, %rbx
jmp 0xa8281
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xa8281
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x11360
movq %rbx, %rdi
callq 0x11580
nop