// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/logic.cpp
// Function: logic::output[abi:cxx11](logic::term_t const&, int, bool)
std::string output(term_t const& term, int accept, bool pos) {
    switch (term.kind()) {
    case term_kind_t::Var:
        return cast<var_term_t>(term).name;
    case term_kind_t::Int:
        return std::to_string(cast<int_term_t>(term).n);
    case term_kind_t::Add:
        return "(" +
            output(*cast<add_term_t>(term).lhs, accept, pos) + "+" +
            output(*cast<add_term_t>(term).rhs, accept, pos) + ")";
    case term_kind_t::Sub:
        return "(" +
            output(*cast<sub_term_t>(term).lhs, accept, pos) + "-" +
            output(*cast<sub_term_t>(term).rhs, accept, pos) + ")";
    case term_kind_t::Mul:
        return "(" +
            output(*cast<mul_term_t>(term).lhs, accept, pos) + "*" +
            output(*cast<mul_term_t>(term).rhs, accept, pos) + ")";
    case term_kind_t::Div:
        return "(" +
            output(*cast<div_term_t>(term).lhs, accept, pos) + "/" +
            output(*cast<div_term_t>(term).rhs, accept, pos) + ")";
    case term_kind_t::Prob: {
        std::string pmin =
            format("Pmin=? [F location={} & {}]",
                accept,
                output(*cast<prob_term_t>(term).inner, accept, pos));
        std::string pmax =
            format("Pmax=? [F location={} & {}]",
                accept,
                output(*cast<prob_term_t>(term).inner, accept, pos));
        if (pos)
            return pmin;
        else
            return pmax;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, 0x4c(%rsp)
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
movl %eax, %eax
leaq 0x27d99(%rip), %rcx     # 0x386f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r14, %rdi
callq 0xff91
leaq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x93a0
jmp 0x10c1d
movq %r14, %rdi
callq 0x10019
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x27e7e(%rip), %rsi     # 0x38823
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27e23(%rip), %rdx     # 0x387dc
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x10019
movq 0x18(%rax), %rsi
leaq 0x70(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0xeb88
leaq 0x2598b(%rip), %rdx     # 0x36389
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x10be8
movq %r14, %rdi
callq 0xffd5
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x27de7(%rip), %rsi     # 0x38823
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x25701(%rip), %rdx     # 0x36151
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0xffd5
movq 0x18(%rax), %rsi
leaq 0x70(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0xeb88
leaq 0x258f4(%rip), %rdx     # 0x36389
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x10be8
movq %r14, %rdi
callq 0xfff7
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x27d50(%rip), %rsi     # 0x38823
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x27cf3(%rip), %rdx     # 0x387da
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0xfff7
movq 0x18(%rax), %rsi
leaq 0x70(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0xeb88
leaq 0x2585d(%rip), %rdx     # 0x36389
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0x10be8
movq %r14, %rdi
callq 0xffb3
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0xec65
jmp 0x10c1d
movq %r14, %rdi
callq 0x1003b
movq 0x8(%rax), %rsi
movzbl %r15b, %r15d
leaq 0x90(%rsp), %r12
movq %r12, %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x27ca1(%rip), %rsi     # 0x38823
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0xb97b
leaq 0x28a54(%rip), %rdx     # 0x395ea
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x1003b
movq 0x18(%rax), %rsi
leaq 0x70(%rsp), %rdi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x10928
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0xeb88
leaq 0x257ae(%rip), %rdx     # 0x36389
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0xeb69
leaq 0x50(%rsp), %rdi
callq 0x9130
leaq 0x70(%rsp), %rdi
callq 0x9130
leaq 0x8(%rsp), %rdi
callq 0x9130
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x9130
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27ba7(%rip), %rsi     # 0x387de
leaq 0x8(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0xeb2e
movq %r14, %rdi
callq 0x10629
movq 0x8(%rax), %rsi
movzbl %r15b, %r12d
leaq 0x28(%rsp), %rdi
movl %ebp, %edx
movl %r12d, %ecx
callq 0x111ae
leaq 0x50(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x4c(%rsp), %rdx
leaq 0x28(%rsp), %rcx
callq 0x10e39
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x8(%rsp), %rdi
callq 0x9130
leaq 0x27b5e(%rip), %rsi     # 0x387fa
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0xeb2e
movq %r14, %rdi
callq 0x10629
movq 0x8(%rax), %rsi
leaq 0x90(%rsp), %rdi
movl %ebp, %edx
movl %r12d, %ecx
callq 0x111ae
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x4c(%rsp), %rdx
leaq 0x90(%rsp), %rcx
callq 0x10e39
leaq 0x90(%rsp), %rdi
callq 0x9130
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
testb %r15b, %r15b
je 0x10d24
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x10d40
movq %rdx, (%rbx)
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x10d46
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x10d4d
movq %rdx, (%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x10d53
movups (%rax), %xmm0
movups %xmm0, (%rcx)
leaq 0x58(%rsp), %rcx
jmp 0x10d58
movups (%rax), %xmm0
movups %xmm0, (%rcx)
leaq 0x10(%rsp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x8(%rbx)
movq %rax, -0x8(%rcx)
andq $0x0, (%rcx)
movb $0x0, (%rax)
leaq 0x8(%rsp), %rdi
callq 0x9130
leaq 0x50(%rsp), %rdi
jmp 0x10c18
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x9130
jmp 0x10dec
jmp 0x10d96
jmp 0x10d96
jmp 0x10d96
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x9130
jmp 0x10db3
movq %rax, %rbx
jmp 0x10df6
jmp 0x10db0
jmp 0x10db0
jmp 0x10db0
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9130
jmp 0x10e06
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x9130
jmp 0x10e32
jmp 0x10dd4
jmp 0x10dd4
jmp 0x10dd4
movq %rax, %rbx
jmp 0x10e10
movq %rax, %rbx
jmp 0x10e27
jmp 0x10de4
jmp 0x10de4
jmp 0x10de4
movq %rax, %rbx
jmp 0x10e1a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x50(%rsp), %rdi
jmp 0x10e22
jmp 0x10e03
jmp 0x10e03
jmp 0x10e03
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x9130
leaq 0x28(%rsp), %rdi
callq 0x9130
leaq 0x90(%rsp), %rdi
callq 0x9130
movq %rbx, %rdi
callq 0x94d0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x10e22