// File: /workspace/github_cpp_makefile_star2_O2/pfnet-research[P]pml/src/logic.cpp
// Function: logic::to_debug_string[abi:cxx11](logic::term_t const&)
std::string to_debug_string(term_t const& term) {
    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 "Add(" +
            to_debug_string(*cast<add_term_t>(term).lhs) + ", " +
            to_debug_string(*cast<add_term_t>(term).rhs) + ")";
    case term_kind_t::Sub:
        return "Sub(" +
            to_debug_string(*cast<sub_term_t>(term).lhs) + ", " +
            to_debug_string(*cast<sub_term_t>(term).rhs) + ")";
    case term_kind_t::Mul:
        return "Mul(" +
            to_debug_string(*cast<mul_term_t>(term).lhs) + ", " +
            to_debug_string(*cast<mul_term_t>(term).rhs) + ")";
    case term_kind_t::Div:
        return "Div(" +
            to_debug_string(*cast<div_term_t>(term).lhs) + ", " +
            to_debug_string(*cast<div_term_t>(term).rhs) + ")";
    case term_kind_t::Prob:
        return "Prob(" + to_debug_string(*cast<prob_term_t>(term).inner) + ")";
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
movl %eax, %eax
leaq 0x28a72(%rip), %rcx     # 0x386a4
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 0xfefa
movq %r14, %rdi
callq 0x10019
movq 0x8(%rax), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0xfc0f
leaq 0x28b1b(%rip), %rsi     # 0x38792
leaq 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0xb97b
leaq 0x2880c(%rip), %rdx     # 0x38497
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x10019
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0xfc0f
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x266c0(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0xfe7b
movq %r14, %rdi
callq 0xffd5
movq 0x8(%rax), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0xfc0f
leaq 0x28a8c(%rip), %rsi     # 0x38788
leaq 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0xb97b
leaq 0x28787(%rip), %rdx     # 0x38497
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0xffd5
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0xfc0f
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x2663b(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0xfe7b
movq %r14, %rdi
callq 0xfff7
movq 0x8(%rax), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0xfc0f
leaq 0x28a0c(%rip), %rsi     # 0x3878d
leaq 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0xb97b
leaq 0x28702(%rip), %rdx     # 0x38497
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0xfff7
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0xfc0f
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x265b6(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
jmp 0xfe7b
movq %r14, %rdi
callq 0xffb3
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0xec65
jmp 0xfefa
movq %r14, %rdi
callq 0x1003b
movq 0x8(%rax), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
callq 0xfc0f
leaq 0x28979(%rip), %rsi     # 0x38797
leaq 0x60(%rsp), %rdi
movq %r15, %rdx
callq 0xb97b
leaq 0x28665(%rip), %rdx     # 0x38497
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xeb69
movq %r14, %rdi
callq 0x1003b
movq 0x18(%rax), %rsi
leaq 0x40(%rsp), %rdi
callq 0xfc0f
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xeb88
leaq 0x26519(%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
jmp 0xfef5
movq %r14, %rdi
callq 0x10629
movq 0x8(%rax), %rsi
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x1005d
leaq 0x288d1(%rip), %rsi     # 0x3879c
movq %rsp, %rdi
movq %r14, %rdx
callq 0xb97b
leaq 0x264ac(%rip), %rdx     # 0x36389
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xeb69
movq %rsp, %rdi
callq 0x9130
leaq 0x20(%rsp), %rdi
callq 0x9130
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0xff10
jmp 0xff10
jmp 0xff10
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9130
jmp 0xff26
jmp 0xff23
jmp 0xff23
jmp 0xff23
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9130
jmp 0xff68
movq %rax, %rbx
movq %rsp, %rdi
callq 0x9130
jmp 0xff4d
jmp 0xff45
jmp 0xff45
jmp 0xff45
movq %rax, %rbx
jmp 0xff72
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0xff84
jmp 0xff5a
jmp 0xff5a
jmp 0xff5a
movq %rax, %rbx
jmp 0xff7c
jmp 0xff65
jmp 0xff65
jmp 0xff65
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