// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4606b(%rip), %r15     # 0x606f0
leaq 0x460ec(%rip), %r12     # 0x60778
movq (%r14), %rax
movq %r14, %rdi
callq *(%rax)
cmpl $0x5, %eax
jne 0x1a70b
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
cmpl $0x8, 0x28(%rax)
je 0x1abb7
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movl 0x28(%rax), %esi
movq %rbx, %rdi
callq 0x1a5b8
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x18(%rax), %r14
jmp 0x1a68c
cmpl $0xd, %eax
ja 0x1ac59
movl %eax, %eax
leaq 0x2d74f(%rip), %rcx     # 0x47e6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x45fc3(%rip), %rsi     # 0x606f0
leaq 0x45fcc(%rip), %rdx     # 0x60700
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x94c0
jmp 0x1ac59
leaq 0x2d772(%rip), %rsi     # 0x47ed0
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45f7e(%rip), %rsi     # 0x606f0
leaq 0x460bf(%rip), %rdx     # 0x60838
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2ca02(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x45f40(%rip), %rsi     # 0x606f0
leaq 0x46081(%rip), %rdx     # 0x60838
jmp 0x1ac2a
leaq 0x2cd40(%rip), %rsi     # 0x47503
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45f19(%rip), %rsi     # 0x606f0
leaq 0x45fb2(%rip), %rdx     # 0x60790
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2d6a7(%rip), %rsi     # 0x47eab
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45ed8(%rip), %rsi     # 0x606f0
leaq 0x45f71(%rip), %rdx     # 0x60790
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x18(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2d668(%rip), %rsi     # 0x47ead
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45e97(%rip), %rsi     # 0x606f0
leaq 0x45f30(%rip), %rdx     # 0x60790
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x28(%rax), %rsi
jmp 0x1ac3d
leaq 0x2d636(%rip), %rsi     # 0x47eb9
movl $0x6, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45e59(%rip), %rsi     # 0x606f0
leaq 0x45f3a(%rip), %rdx     # 0x607d8
jmp 0x1ab9b
leaq 0x45e46(%rip), %rsi     # 0x606f0
leaq 0x45e97(%rip), %rdx     # 0x60748
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
jmp 0x1ac51
leaq 0x45e18(%rip), %rsi     # 0x606f0
leaq 0x45ec9(%rip), %rdx     # 0x607a8
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq %rax, %r14
leaq 0x2d5b3(%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 0x1ac45
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x2c862(%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 0x1a93d
jmp 0x1ac45
leaq 0x2d545(%rip), %rsi     # 0x47ec6
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45d5b(%rip), %rsi     # 0x606f0
leaq 0x45e6c(%rip), %rdx     # 0x60808
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2c7df(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x45d1d(%rip), %rsi     # 0x606f0
leaq 0x45e2e(%rip), %rdx     # 0x60808
jmp 0x1ac2a
leaq 0x45d0a(%rip), %rsi     # 0x606f0
leaq 0x45d2b(%rip), %rdx     # 0x60718
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movsd 0x8(%rax), %xmm0
movq %rbx, %rdi
callq 0x9460
jmp 0x1ac59
leaq 0x2d4a7(%rip), %rsi     # 0x47ec0
movl $0x5, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45cc3(%rip), %rsi     # 0x606f0
leaq 0x45dbc(%rip), %rdx     # 0x607f0
jmp 0x1ab9b
leaq 0x45cb0(%rip), %rsi     # 0x606f0
leaq 0x45d79(%rip), %rdx     # 0x607c0
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq %rax, %r14
leaq 0x2d450(%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 0x1ac45
movl $0x1, %r12d
movl $0x10, %r13d
leaq 0x2c6fa(%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 0x1aaa5
jmp 0x1ac45
leaq 0x45c07(%rip), %rsi     # 0x606f0
leaq 0x45c40(%rip), %rdx     # 0x60730
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movzbl 0x8(%rax), %esi
movq %rbx, %rdi
callq 0x9490
jmp 0x1ac59
leaq 0x2d3b0(%rip), %rsi     # 0x47ecb
movl $0x4, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45bc1(%rip), %rsi     # 0x606f0
leaq 0x45cea(%rip), %rdx     # 0x60820
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2c645(%rip), %rsi     # 0x471a1
movq %rbx, %rdi
xorl %edx, %edx
callq 0x9350
leaq 0x45b83(%rip), %rsi     # 0x606f0
leaq 0x45cac(%rip), %rdx     # 0x60820
jmp 0x1ac2a
leaq 0x2c982(%rip), %rsi     # 0x47502
movl $0x2, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45b5c(%rip), %rsi     # 0x606f0
leaq 0x45bc5(%rip), %rdx     # 0x60760
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
jmp 0x1ac3d
leaq 0x2c945(%rip), %rsi     # 0x47503
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
leaq 0x45b1e(%rip), %rsi     # 0x606f0
leaq 0x45b9f(%rip), %rdx     # 0x60778
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x45af5(%rip), %rsi     # 0x606f0
leaq 0x45b76(%rip), %rdx     # 0x60778
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movl 0x28(%rax), %esi
movq %rbx, %rdi
callq 0x1a5b8
leaq 0x45acd(%rip), %rsi     # 0x606f0
leaq 0x45b4e(%rip), %rdx     # 0x60778
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x9340
testq %rax, %rax
je 0x1ac66
movq 0x18(%rax), %rsi
movq %rbx, %rdi
callq 0x1a66f
leaq 0x2a771(%rip), %rsi     # 0x453bd
movl $0x1, %edx
movq %rbx, %rdi
callq 0x9350
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x9530