// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/mdp_expr.cpp
// Function: mdp::operator<<(std::ostream&, mdp::expr_t const&)
std::ostream& operator<<(std::ostream& os, expr_t const& e) {
    switch (e.kind()) {
    case expr_kind_t::Int:
        os << cast<int_expr_t>(e).n; break;
    case expr_kind_t::Real:
        os << cast<real_expr_t>(e).d; break;
    case expr_kind_t::Bool:
        os << cast<bool_expr_t>(e).b; break;
    case expr_kind_t::Var:
        os << cast<var_expr_t>(e).name; break;
    case expr_kind_t::Neg:
        os << "!(" << *cast<neg_expr_t>(e).inner << ")";
        break;
    case expr_kind_t::BinOp:
        if (cast<binop_expr_t>(e).binop_kind != binop_kind_t::Eq) {
            os <<
                *cast<binop_expr_t>(e).lhs <<
                cast<binop_expr_t>(e).binop_kind <<
                *cast<binop_expr_t>(e).rhs;
        } else {
            os << "(" <<
                *cast<binop_expr_t>(e).lhs <<
                cast<binop_expr_t>(e).binop_kind <<
                *cast<binop_expr_t>(e).rhs << ")";
        }
        break;
    case expr_kind_t::If:
        os << "(" <<
            *cast<if_expr_t>(e).cond << "?" <<
            *cast<if_expr_t>(e).true_branch << ":" <<
            *cast<if_expr_t>(e).false_branch << ")";
        break;
    case expr_kind_t::Min: {
        auto const& args = cast<min_expr_t>(e).elems;
        os << "min(" << args[0];
        for (size_t i=1; i<args.size(); ++i)
            os << ", " << args[i];
        os << ")";
        break;
        }
    case expr_kind_t::Max: {
        auto const& args = cast<max_expr_t>(e).elems;
        os << "max(" << args[0];
        for (size_t i=1; i<args.size(); ++i)
            os << ", " << args[i];
        os << ")";
        break;
        }
    case expr_kind_t::Floor:
        os << "floor(" << *cast<floor_expr_t>(e).inner << ")";
        break;
    case expr_kind_t::Ceil:
        os << "ceil(" << *cast<ceil_expr_t>(e).inner << ")";
        break;
    case expr_kind_t::Pow:
        os << "pow(" <<
            *cast<pow_expr_t>(e).x << "" <<
            *cast<pow_expr_t>(e).y << ")";
        break;
    case expr_kind_t::Mod:
        os << "mod(" <<
            *cast<mod_expr_t>(e).i << "" <<
            *cast<mod_expr_t>(e).n << ")";
        break;
    case expr_kind_t::Log:
        os << "log(" <<
            *cast<log_expr_t>(e).x << "" <<
            *cast<log_expr_t>(e).b << ")";
        break;
    }
    return os;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x46df3(%rip), %r15     # 0x616c8
leaq 0x46e74(%rip), %r12     # 0x61750
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
cmpl $0x5, %eax
jne 0x1a96d
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
cmpl $0x8, 0x28(%rax)
je 0x1ae35
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movl 0x28(%rax), %esi
movq %rbx, %rdi
callq 0x1a804
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x18(%rax), %r14
testb $0x1, %bpl
cmoveq %rbx, %r13
movb $0x1, %bpl
jmp 0x1a8dc
cmpl $0xd, %eax
ja 0x1aedb
movl %eax, %eax
leaq 0x2d4ed(%rip), %rcx     # 0x47e6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x46d39(%rip), %rsi     # 0x616c8
leaq 0x46d42(%rip), %rdx     # 0x616d8
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x94c0
jmp 0x1aedb
leaq 0x2d510(%rip), %rsi     # 0x47ed0
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46cf4(%rip), %rsi     # 0x616c8
leaq 0x46e35(%rip), %rdx     # 0x61810
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2c7a0(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x46cb6(%rip), %rsi     # 0x616c8
leaq 0x46df7(%rip), %rdx     # 0x61810
jmp 0x1aeac
leaq 0x2cade(%rip), %rsi     # 0x47503
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46c8f(%rip), %rsi     # 0x616c8
leaq 0x46d28(%rip), %rdx     # 0x61768
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2d445(%rip), %rsi     # 0x47eab
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46c4e(%rip), %rsi     # 0x616c8
leaq 0x46ce7(%rip), %rdx     # 0x61768
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x18(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2d406(%rip), %rsi     # 0x47ead
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46c0d(%rip), %rsi     # 0x616c8
leaq 0x46ca6(%rip), %rdx     # 0x61768
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x28(%rax), %rsi
jmp 0x1aebf
leaq 0x2d3d4(%rip), %rsi     # 0x47eb9
movl $0x6, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46bcf(%rip), %rsi     # 0x616c8
leaq 0x46cb0(%rip), %rdx     # 0x617b0
jmp 0x1ae19
leaq 0x46bbc(%rip), %rsi     # 0x616c8
leaq 0x46c0d(%rip), %rdx     # 0x61720
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
jmp 0x1aed3
movq %r13, (%rsp)
leaq 0x46b8a(%rip), %rsi     # 0x616c8
leaq 0x46c3b(%rip), %rdx     # 0x61780
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq %rax, %r14
leaq 0x2d34d(%rip), %rsi     # 0x47eaf
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
movq 0x8(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x9220
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cmpq $0x11, %rax
jb 0x1ad43
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x2c5fc(%rip), %r15     # 0x4719f
movl $0x2, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9350
movq 0x8(%r14), %rax
movq (%rax,%r13), %rsi
movq %rbx, %rdi
callq 0x9220
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
incq %r12
sarq $0x4, %rax
addq $0x10, %r13
cmpq %rax, %r12
jb 0x1aba3
jmp 0x1ad43
leaq 0x2d2df(%rip), %rsi     # 0x47ec6
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46acd(%rip), %rsi     # 0x616c8
leaq 0x46bde(%rip), %rdx     # 0x617e0
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2c579(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x46a8f(%rip), %rsi     # 0x616c8
leaq 0x46ba0(%rip), %rdx     # 0x617e0
jmp 0x1aeac
leaq 0x46a7c(%rip), %rsi     # 0x616c8
leaq 0x46a9d(%rip), %rdx     # 0x616f0
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x9460
jmp 0x1aedb
leaq 0x2d241(%rip), %rsi     # 0x47ec0
movl $0x5, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46a35(%rip), %rsi     # 0x616c8
leaq 0x46b2e(%rip), %rdx     # 0x617c8
jmp 0x1ae19
movq %r13, (%rsp)
leaq 0x46a1e(%rip), %rsi     # 0x616c8
leaq 0x46ae7(%rip), %rdx     # 0x61798
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq %rax, %r14
leaq 0x2d1e6(%rip), %rsi     # 0x47eb4
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
movq 0x8(%r14), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x9220
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cmpq $0x11, %rax
jb 0x1ad43
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x2c494(%rip), %r15     # 0x4719f
movl $0x2, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9350
movq 0x8(%r14), %rax
movq (%rax,%r13), %rsi
movq %rbx, %rdi
callq 0x9220
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
incq %r12
sarq $0x4, %rax
addq $0x10, %r13
cmpq %rax, %r12
jb 0x1ad0b
leaq 0x2a673(%rip), %rsi     # 0x453bd
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
movq (%rsp), %r13
jmp 0x1aedb
leaq 0x46961(%rip), %rsi     # 0x616c8
leaq 0x4699a(%rip), %rdx     # 0x61708
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movzbl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x9490
jmp 0x1aedb
leaq 0x2d132(%rip), %rsi     # 0x47ecb
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x4691b(%rip), %rsi     # 0x616c8
leaq 0x46a44(%rip), %rdx     # 0x617f8
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2c3c7(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x468dd(%rip), %rsi     # 0x616c8
leaq 0x46a06(%rip), %rdx     # 0x617f8
jmp 0x1aeac
leaq 0x2c704(%rip), %rsi     # 0x47502
movl $0x2, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x468b6(%rip), %rsi     # 0x616c8
leaq 0x4691f(%rip), %rdx     # 0x61738
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
jmp 0x1aebf
leaq 0x2c6c7(%rip), %rsi     # 0x47503
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x46878(%rip), %rsi     # 0x616c8
leaq 0x468f9(%rip), %rdx     # 0x61750
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x4684b(%rip), %rsi     # 0x616c8
leaq 0x468cc(%rip), %rdx     # 0x61750
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movl 0x28(%rax), %esi
movq %rbx, %rdi
callq 0x1a804
leaq 0x46823(%rip), %rsi     # 0x616c8
leaq 0x468a4(%rip), %rdx     # 0x61750
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1aef5
movq 0x18(%rax), %rsi
movq %rbx, %rdi
callq 0x1a8bb
leaq 0x2a4ef(%rip), %rsi     # 0x453bd
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
testb $0x1, %bpl
cmovneq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9530