// File: Heptagon196[P]Gos/GosASTCompiler.cpp
// Function: Gos::AST::Relation::CompileAST(Gos::Compiler::VMCompiler&)
Compile(Relation) {
    START();
    if (tokenList.size() == 0) {
        return SUB(0);
    }
    std::vector<int> bools;
    int tmp = code.GetTmpVar();
    GosVM::RTConstNum num;
    num.data.i64 = 1;
    vm.WriteCommandNew("bool", tmp, {});
    vm.WriteCommandNot(tmp);
    bools.push_back(SUB(0));
    for (int i = 0; i < tokenList.size(); i++) {
        bools.push_back(SUB(i + 1));
        const char* op = "__eq";
        if (tokenList[i].type == L) {
            op = "__lt";
        } else if (tokenList[i].type == LE) {
            op = "__le";
        } else if (tokenList[i].type == G) {
            op = "__gt";
        } else if (tokenList[i].type == GE) {
            op = "__ge";
        }
        vm.WriteCommandCall(bools[i], op, { bools[i + 1] });
        vm.WriteCommandAnd(tmp, 0);
    }
    return tmp;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x158(%rsp)
movq %rsi, 0x150(%rsp)
movq 0x158(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movl 0x2c(%rdi), %eax
movl %eax, 0x12b13b(%rip)    # 0x3022f8
addq $0x10, %rdi
callq 0x1d1e80
cmpq $0x0, %rax
jne 0x1d71dc
movl $0x0, 0x164(%rsp)
jmp 0x1d7712
movq 0x58(%rsp), %rdi
addq $0x60, %rdi
callq 0x1c58d0
cmpq $0x0, %rax
jne 0x1d721e
movq 0x58(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0x150(%rsp), %rsi
movq (%rdi), %rax
callq *(%rax)
movl %eax, 0x164(%rsp)
jmp 0x1d7712
leaq 0x138(%rsp), %rdi
callq 0x1dd1b0
movq 0x150(%rsp), %rdi
callq 0x1d5250
movl %eax, 0x134(%rsp)
movq $0x1, 0x128(%rsp)
movq 0x150(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x48(%rsp)
leaq 0x107(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x13570
movq 0x50(%rsp), %rdx
leaq 0x4adbe(%rip), %rsi     # 0x22203b
leaq 0x108(%rsp), %rdi
callq 0x165520
jmp 0x1d728c
movl 0x134(%rsp), %eax
movl %eax, 0x3c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movq $0x0, 0xe0(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x1dd1b0
movq 0x48(%rsp), %rdi
movl 0x3c(%rsp), %edx
movq 0x40(%rsp), %rcx
leaq 0x108(%rsp), %rsi
callq 0x1b0f40
jmp 0x1d72dd
leaq 0xd0(%rsp), %rdi
callq 0x1dd280
leaq 0x108(%rsp), %rdi
callq 0x52f50
leaq 0x107(%rsp), %rdi
callq 0x136a0
movq 0x150(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x134(%rsp), %esi
callq 0x1b15b0
jmp 0x1d7321
movq 0x58(%rsp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1d1e60
movq (%rax), %rdi
movq 0x150(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x38(%rsp)
jmp 0x1d734c
movl 0x38(%rsp), %eax
movl %eax, 0xcc(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0xcc(%rsp), %rsi
callq 0x1dd2e0
jmp 0x1d736e
movl $0x0, 0xc8(%rsp)
movq 0x58(%rsp), %rdi
movslq 0xc8(%rsp), %rax
movq %rax, 0x30(%rsp)
addq $0x60, %rdi
callq 0x1c58d0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x1d76e6
movq 0x58(%rsp), %rdi
addq $0x10, %rdi
movl 0xc8(%rsp), %eax
incl %eax
movslq %eax, %rsi
callq 0x1d1e60
movq (%rax), %rdi
movq 0x150(%rsp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movl %eax, 0x2c(%rsp)
jmp 0x1d73d8
movl 0x2c(%rsp), %eax
movl %eax, 0xc4(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0xc4(%rsp), %rsi
callq 0x1dd2e0
jmp 0x1d73fa
movq 0x58(%rsp), %rdi
leaq 0x34302(%rip), %rax     # 0x20b708
movq %rax, 0xb8(%rsp)
addq $0x60, %rdi
movslq 0xc8(%rsp), %rsi
callq 0x1c58f0
cmpl $0x23, (%rax)
jne 0x1d74ab
leaq 0x342e3(%rip), %rax     # 0x20b712
movq %rax, 0xb8(%rsp)
jmp 0x1d7533
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x1d7480
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x1dd280
leaq 0x108(%rsp), %rdi
callq 0x52f50
leaq 0x107(%rsp), %rdi
callq 0x136a0
jmp 0x1d7703
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x1d7703
movq 0x58(%rsp), %rdi
addq $0x60, %rdi
movslq 0xc8(%rsp), %rsi
callq 0x1c58f0
cmpl $0x25, (%rax)
jne 0x1d74d7
leaq 0x3424a(%rip), %rax     # 0x20b717
movq %rax, 0xb8(%rsp)
jmp 0x1d7531
movq 0x58(%rsp), %rdi
addq $0x60, %rdi
movslq 0xc8(%rsp), %rsi
callq 0x1c58f0
cmpl $0x24, (%rax)
jne 0x1d7503
leaq 0x34223(%rip), %rax     # 0x20b71c
movq %rax, 0xb8(%rsp)
jmp 0x1d752f
movq 0x58(%rsp), %rdi
addq $0x60, %rdi
movslq 0xc8(%rsp), %rsi
callq 0x1c58f0
cmpl $0x26, (%rax)
jne 0x1d752d
leaq 0x341fc(%rip), %rax     # 0x20b721
movq %rax, 0xb8(%rsp)
jmp 0x1d752f
jmp 0x1d7531
jmp 0x1d7533
movq 0x150(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x8(%rsp)
movslq 0xc8(%rsp), %rsi
leaq 0x138(%rsp), %rdi
callq 0x1b5c70
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movq 0xb8(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x97(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x13570
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x98(%rsp), %rdi
callq 0x165520
jmp 0x1d759a
movl 0xc8(%rsp), %eax
incl %eax
movslq %eax, %rsi
leaq 0x138(%rsp), %rdi
callq 0x1b5c70
movl (%rax), %eax
movl %eax, 0x64(%rsp)
leaq 0x64(%rsp), %rax
movq %rax, 0x68(%rsp)
movq $0x1, 0x70(%rsp)
leaq 0x63(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x5ae50
movq (%rsp), %rcx
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x1dd1f0
jmp 0x1d75f4
movl 0x14(%rsp), %esi
movq 0x8(%rsp), %rdi
leaq 0x98(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x1b1940
jmp 0x1d7611
leaq 0x78(%rsp), %rdi
callq 0x1dd280
leaq 0x63(%rsp), %rdi
callq 0x5ae60
leaq 0x98(%rsp), %rdi
callq 0x52f50
leaq 0x97(%rsp), %rdi
callq 0x136a0
movq 0x150(%rsp), %rax
movq 0xe8(%rax), %rdi
movl 0x134(%rsp), %esi
xorl %edx, %edx
callq 0x1b1510
jmp 0x1d765e
jmp 0x1d7660
movl 0xc8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc8(%rsp)
jmp 0x1d7379
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x1d76d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
jmp 0x1d76c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf8(%rsp)
movl %eax, 0xf4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1dd280
leaq 0x63(%rsp), %rdi
callq 0x5ae60
leaq 0x98(%rsp), %rdi
callq 0x52f50
leaq 0x97(%rsp), %rdi
callq 0x136a0
jmp 0x1d7703
movl 0x134(%rsp), %eax
movl %eax, 0x164(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x1dd280
jmp 0x1d7712
leaq 0x138(%rsp), %rdi
callq 0x1dd280
jmp 0x1d7721
movl 0x164(%rsp), %eax
addq $0x168, %rsp            # imm = 0x168
retq
movq 0xf8(%rsp), %rdi
callq 0x133f0
nop