// File: Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::Unary::CompileAST(Gos::Compiler::VMCompiler&)
Compile(Unary) {
    START();
    if (branch == 1) {
        if (token.type == ADD) {
            return SUB(0);
        } else if (token.type == SUB) {
            int tmp = code.GetTmpVar();
            vm.WriteCommandCall(SUB(0), "__unm", {});
            vm.WriteCommandRef(tmp, 0);
            return tmp;
        } else if (token.type == NOT) {
            int tmp = code.GetTmpVar();
            vm.WriteCommandClone(tmp, SUB(0));
            vm.WriteCommandNot(tmp);
            return tmp;
        } else if (token.type == MUL) {
            // unbox
            int tmp = code.GetTmpVar();
            vm.WriteCommandUnbox(tmp, SUB(0));
            return tmp;
        } else if (token.type == ADDR) {
            // box
            int tmp = code.GetTmpVar();
            vm.WriteCommandBox(tmp, SUB(0));
            return tmp;
        }
    }
    return SUB(0);
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movl 0x2c(%rdi), %eax
movl %eax, 0x12bb0b(%rip)    # 0x3022f8
addq $0x10, %rdi
callq 0x1d1e80
cmpq $0x0, %rax
jne 0x1d680c
movl $0x0, 0xe4(%rsp)
jmp 0x1d6b82
movq 0x58(%rsp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x1d6b59
movq 0x58(%rsp), %rax
cmpl $0x1a, 0x28(%rax)
jne 0x1d6854
movq 0x58(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movl %eax, 0xe4(%rsp)
jmp 0x1d6b82
movq 0x58(%rsp), %rax
cmpl $0x1b, 0x28(%rax)
jne 0x1d69c8
movq 0xd0(%rsp), %rdi
callq 0x1d5250
movq 0x58(%rsp), %rdi
movl %eax, 0xcc(%rsp)
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x40(%rsp)
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x4c(%rsp)
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x13570
movq 0x50(%rsp), %rdx
leaq 0x34e54(%rip), %rsi     # 0x20b726
leaq 0xa8(%rsp), %rdi
callq 0x165520
jmp 0x1d68e1
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x70(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x1dd1b0
movq 0x40(%rsp), %rdi
movl 0x4c(%rsp), %esi
movq 0x38(%rsp), %rcx
leaq 0xa8(%rsp), %rdx
callq 0x1b1940
jmp 0x1d6921
leaq 0x70(%rsp), %rdi
callq 0x1dd280
leaq 0xa8(%rsp), %rdi
callq 0x52f50
leaq 0xa7(%rsp), %rdi
callq 0x136a0
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0xcc(%rsp), %esi
xorl %edx, %edx
callq 0x1b11a0
movl 0xcc(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x1d6b82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1d69b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x1dd280
leaq 0xa8(%rsp), %rdi
callq 0x52f50
leaq 0xa7(%rsp), %rdi
callq 0x136a0
jmp 0x1d6b91
movq 0x58(%rsp), %rax
cmpl $0x27, 0x28(%rax)
jne 0x1d6a5e
movq 0xd0(%rsp), %rdi
callq 0x1d5250
movq 0x58(%rsp), %rdi
movl %eax, 0x6c(%rsp)
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x28(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0x34(%rsp)
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movq 0x28(%rsp), %rdi
movl 0x34(%rsp), %esi
movl %eax, %edx
callq 0x1b11f0
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x6c(%rsp), %esi
callq 0x1b15b0
movl 0x6c(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x1d6b82
movq 0x58(%rsp), %rax
cmpl $0x1c, 0x28(%rax)
jne 0x1d6ad8
movq 0xd0(%rsp), %rdi
callq 0x1d5250
movq 0x58(%rsp), %rdi
movl %eax, 0x68(%rsp)
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x18(%rsp)
movl 0x68(%rsp), %eax
movl %eax, 0x24(%rsp)
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movl %eax, %edx
callq 0x1b18f0
movl 0x68(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x1d6b82
movq 0x58(%rsp), %rax
cmpl $0x1d, 0x28(%rax)
jne 0x1d6b4f
movq 0xd0(%rsp), %rdi
callq 0x1d5250
movq 0x58(%rsp), %rdi
movl %eax, 0x64(%rsp)
movq 0xd0(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x14(%rsp)
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movl %eax, %edx
callq 0x1b18a0
movl 0x64(%rsp), %eax
movl %eax, 0xe4(%rsp)
jmp 0x1d6b82
jmp 0x1d6b51
jmp 0x1d6b53
jmp 0x1d6b55
jmp 0x1d6b57
jmp 0x1d6b59
movq 0x58(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0xd0(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movl %eax, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
addq $0xe8, %rsp
retq
movq 0x98(%rsp), %rdi
callq 0x133f0
nop