// File: /workspace/github_cpp_makefile_star2_O3/Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::DefVar::CompileAST(Gos::Compiler::VMCompiler&)
Compile(DefVar) {
    START();
    std::string symbol = nodes[0]->token.str;
    std::string type = "unknown";
    int assign;
    int id = pc++;
    code.currentScope->varID[symbol] = id;
    if (branch == 1) {
        type = nodes[1]->token.str;
    } else if (branch == 2) {
        assign = SUB(1);
    } else if (branch == 3) {
        type = nodes[1]->token.str;
        assign = SUB(2);
    }
    code.currentScope->varType[symbol] = type;
    if (branch <= 1) {
        vm.WriteCommandNew(type, id, {});
    } else if (branch == 2) {
        vm.WriteCommandRef(id, assign);
    } else if (branch == 3) {
        vm.WriteCommandNew(type, id, {});
        vm.WriteCommandMov(id, assign);
    }
    return id;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl 0x2c(%rdi), %eax
movl %eax, 0x75357(%rip)     # 0x11e288
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0xa8fdb
movq %rsi, %r14
movq %rdi, %r15
movq (%rax), %rax
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x36954
leaq 0x28(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x2716a(%rip), %rsi     # 0xd00e1
leaq 0x2716a(%rip), %rdx     # 0xd00e8
leaq 0x18(%rsp), %rdi
callq 0x27370
movl 0xe0(%r14), %ebx
leal 0x1(%rbx), %eax
movl %eax, 0xe0(%r14)
movq 0xd0(%r14), %rdi
addq $0x28, %rdi
leaq 0x38(%rsp), %rsi
callq 0x9b46a
movl %ebx, (%rax)
movl 0x8(%r15), %eax
cmpl $0x3, %eax
je 0xa8fe9
cmpl $0x2, %eax
je 0xa8fe2
cmpl $0x1, %eax
jne 0xa9016
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
addq $0x40, %rsi
leaq 0x18(%rsp), %rdi
callq 0x39678
jmp 0xa9016
xorl %ebx, %ebx
jmp 0xa9111
movl $0x8, %ebp
jmp 0xa9004
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
addq $0x40, %rsi
movl $0x10, %ebp
leaq 0x18(%rsp), %rdi
callq 0x39678
movq 0x10(%r15), %rax
movq (%rax,%rbp), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
movl %eax, %ebp
movq 0xd0(%r14), %rdi
addq $0x60, %rdi
leaq 0x38(%rsp), %rsi
callq 0xaca12
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x39678
movl 0x8(%r15), %eax
cmpl $0x1, %eax
jg 0xa907d
movq 0xe8(%r14), %rdi
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
leaq 0x18(%rsp), %rsi
movl %ebx, %edx
callq 0x99248
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa90e3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
jmp 0xa90e3
cmpl $0x3, %eax
je 0xa9099
cmpl $0x2, %eax
jne 0xa90e3
movq 0xe8(%r14), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x9951e
jmp 0xa90e3
movq 0xe8(%r14), %rdi
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
leaq 0x18(%rsp), %rsi
movl %ebx, %edx
callq 0x99248
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa90d3
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
movq 0xe8(%r14), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x994b4
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0xa90fa
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xa9111
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x11360
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa9124
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0xa9147
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x11360
jmp 0xa9147
movq %rax, %rbx
jmp 0xa915e
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0xa915e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x11360
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0xa9175
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x11360
movq %rbx, %rdi
callq 0x11580
nop