// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/logic.cpp
// Function: logic::output[abi:cxx11](logic::formula_t const&, int, bool)
std::string output(formula_t const& f, int accept, bool pos) {
    switch (f.kind()) {
    case formula_kind_t::Var:
        return cast<var_formula_t>(f).name;
    case formula_kind_t::Bot:
        return "(1=2)";
    case formula_kind_t::Top:
        return "(1=1)";
    case formula_kind_t::Neg:
        return "!("  + output(*cast<neg_formula_t>(f).inner, accept, pos) + ")";
    case formula_kind_t::And:
        return "(" +
            output(*cast<and_formula_t>(f).lhs, accept, pos) + "&" +
            output(*cast<and_formula_t>(f).rhs, accept, pos) + ")";
        break;
    case formula_kind_t::Or:
        return "(" +
            output(*cast<or_formula_t>(f).lhs, accept, pos) + "|" +
            output(*cast<or_formula_t>(f).rhs, accept, pos) + ")";
    case formula_kind_t::Impl:
        return "(" +
            output(*cast<impl_formula_t>(f).lhs, accept, !pos) + "=>" +
            output(*cast<impl_formula_t>(f).rhs, accept, pos) + ")";
    case formula_kind_t::Eq:
        return "(" +
            output(*cast<eq_formula_t>(f).lhs, accept, pos) + "=" +
            output(*cast<eq_formula_t>(f).rhs, accept, pos) + ")";
    case formula_kind_t::Lt:
        return "(" +
            output(*cast<less_formula_t>(f).lhs, accept, !pos) + "<" +
            output(*cast<less_formula_t>(f).rhs, accept, pos) + ")";
    case formula_kind_t::Leq:
        return "(" +
            output(*cast<leq_formula_t>(f).lhs, accept, !pos) + "<=" +
            output(*cast<leq_formula_t>(f).rhs, accept, pos) + ")";
    case formula_kind_t::Geq:
        return "(" +
            output(*cast<geq_formula_t>(f).lhs, accept, pos) + ">=" +
            output(*cast<geq_formula_t>(f).rhs, accept, !pos) + ")";
    case formula_kind_t::Gt:
        return "(" +
            output(*cast<greater_formula_t>(f).lhs, accept, pos) + ">" +
            output(*cast<greater_formula_t>(f).rhs, accept, !pos) + ")";
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
movl %eax, %eax
leaq 0x27533(%rip), %rcx     # 0x3870c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0x1064b
leaq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x93a0
jmp 0x11743
movq %r14, %rdi
callq 0x1077d
movq 0x8(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
callq 0x10928
leaq 0x275ff(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x283af(%rip), %rdx     # 0x395e7
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x1077d
movq 0x18(%rax), %rsi
xorb $0x1, %r15b
movzbl %r15b, %ecx
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x10928
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x25109(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
movq %r14, %rdi
callq 0x1068f
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x111ae
leaq 0x27567(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27555(%rip), %rdx     # 0x38825
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x1068f
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x111ae
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x25076(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
movq %r14, %rdi
callq 0x10739
movq 0x8(%rax), %rsi
movl %r15d, %eax
xorb $0x1, %al
movzbl %al, %ecx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
callq 0x10928
leaq 0x274d3(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x274c7(%rip), %rdx     # 0x3882b
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x10739
movq 0x18(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x10928
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24fe1(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
leaq 0x2745d(%rip), %rsi     # 0x3881c
jmp 0x114b3
movq %r14, %rdi
callq 0x1066d
movq 0x8(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebp, %edx
callq 0x111ae
leaq 0x27438(%rip), %rsi     # 0x38822
movq %rsp, %rdi
movq %r14, %rdx
callq 0xb97b
leaq 0x24f8d(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
movq %rsp, %rdi
callq 0x9130
leaq 0x20(%rsp), %rdi
jmp 0x1173e
movq %r14, %rdi
callq 0x106f5
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x273de(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27d6c(%rip), %rdx     # 0x391c5
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x106f5
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24eed(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
leaq 0x27363(%rip), %rsi     # 0x38816
movq %rsp, %rdx
movq %rbx, %rdi
callq 0xeb2e
jmp 0x11743
movq %r14, %rdi
callq 0x106b1
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x111ae
leaq 0x27334(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27324(%rip), %rdx     # 0x38827
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x106b1
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x111ae
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24e43(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
movq %r14, %rdi
callq 0x106d3
movq 0x8(%rax), %rsi
movl %r15d, %eax
xorb $0x1, %al
movzbl %al, %ecx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
callq 0x111ae
leaq 0x272a0(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27c31(%rip), %rdx     # 0x391c8
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x106d3
movq 0x18(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x111ae
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24dae(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
movq %r14, %rdi
callq 0x1075b
movq 0x8(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
callq 0x10928
leaq 0x2720f(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27206(%rip), %rdx     # 0x3882e
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x1075b
movq 0x18(%rax), %rsi
xorb $0x1, %r15b
movzbl %r15b, %ecx
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x10928
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24d19(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x11710
movq %r14, %rdi
callq 0x10717
movq 0x8(%rax), %rsi
movl %r15d, %eax
xorb $0x1, %al
movzbl %al, %ecx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
callq 0x10928
leaq 0x27176(%rip), %rsi     # 0x38823
leaq 0x60(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27168(%rip), %rdx     # 0x38829
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x10717
movq 0x18(%rax), %rsi
movzbl %r15b, %ecx
leaq 0x40(%rsp), %rdi
movl %ebp, %edx
callq 0x10928
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x24c84(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
movq %rsp, %rdi
callq 0x9130
leaq 0x40(%rsp), %rdi
callq 0x9130
leaq 0x20(%rsp), %rdi
callq 0x9130
leaq 0x60(%rsp), %rdi
callq 0x9130
leaq 0x80(%rsp), %rdi
callq 0x9130
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11764
jmp 0x11764
jmp 0x11764
jmp 0x11764
jmp 0x11764
jmp 0x11764
jmp 0x11764
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9130
jmp 0x11782
jmp 0x1177f
jmp 0x1177f
jmp 0x1177f
jmp 0x1177f
jmp 0x1177f
jmp 0x1177f
jmp 0x1177f
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9130
jmp 0x117dc
jmp 0x117a9
jmp 0x117a9
jmp 0x117a9
jmp 0x117a9
jmp 0x117a9
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9130
jmp 0x117bb
jmp 0x117a9
jmp 0x117a9
movq %rax, %rbx
jmp 0x117e6
jmp 0x117c6
jmp 0x117c6
jmp 0x117c6
jmp 0x117c6
jmp 0x117c6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x117f8
jmp 0x117c6
jmp 0x117c6
movq %rax, %rbx
jmp 0x117f0
jmp 0x117d9
jmp 0x117d9
jmp 0x117d9
jmp 0x117d9
jmp 0x117d9
jmp 0x117d9
jmp 0x117d9
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9130
leaq 0x60(%rsp), %rdi
callq 0x9130
leaq 0x80(%rsp), %rdi
callq 0x9130
movq %rbx, %rdi
callq 0x94d0