// File: /workspace/github_cpp_makefile_star2_O1/pfnet-research[P]pml/src/translate_to_mdp.cpp
// Function: create_binop_case(ast::expr_t const&, ast::expr_t const&, ast::expr_kind_t, environment_t<value_info_t> const&)
mdp_with_info_t create_binop_case(
        ast::expr_t const& lhs_expr,
        ast::expr_t const& rhs_expr,
        ast::expr_kind_t op,
        var_env_t const& var_env) {
    auto lhs_ = trans_impl(lhs_expr, var_env);
    auto const& lhs = lhs_.value;
    auto rhs_ = trans_impl(rhs_expr, var_env);
    auto const& rhs = rhs_.value;

    auto result_mdp = mdp::mdp_t::merge(
            std::move(lhs_.mdp),
            std::move(rhs_.mdp));

    auto result_bound = calc_binop_bound(lhs, rhs, op);

    return mdp_with_info_t {
        result_mdp, lhs_.init, rhs_.accept,
        result_bound
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %r8, %r14
movl %ecx, %ebp
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x138(%rsp), %rdi
movq %r8, %rdx
callq 0x3e126
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3e126
leaq 0x30(%rsp), %rdi
leaq 0x138(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x9b9c
leaq 0x1a8(%rsp), %rsi
leaq 0x108(%rsp), %rdx
movq %rsp, %rdi
movl %ebp, %ecx
callq 0x3ef5c
leaq 0x10(%rbx), %r14
movq %r14, (%rbx)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0xad30
leaq 0x20(%rbx), %r13
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
callq 0x40eda
leaq 0x38(%rbx), %rbp
leaq 0x68(%rsp), %r15
movq %rbp, %rdi
movq %r15, %rsi
callq 0x40f76
leaq 0x50(%rbx), %rdi
leaq 0x80(%rsp), %r12
movq %r12, %rsi
callq 0x41010
movl 0x1a0(%rsp), %eax
movl %eax, 0x68(%rbx)
movl 0x104(%rsp), %eax
movl %eax, 0x6c(%rbx)
leaq 0x70(%rbx), %rdi
leaq 0x80(%rbx), %rax
movq %rax, 0x70(%rbx)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
callq 0xad30
movb $0x0, 0x98(%rbx)
cmpb $0x1, 0x28(%rsp)
jne 0x3fbd5
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rbx)
movb $0x1, 0x98(%rbx)
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fbf0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %r12, %rdi
callq 0xa8d4
movq %r15, %rdi
callq 0xa904
leaq 0x50(%rsp), %rdi
callq 0xa934
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fc25
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fc46
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0xe8(%rsp), %rdi
callq 0xa8d4
leaq 0xd0(%rsp), %rdi
callq 0xa904
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0xa934
movq -0x20(%r14), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x3fc91
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x1b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fcb2
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x188(%rsp), %rdi
callq 0xa8d4
leaq 0x170(%rsp), %rdi
callq 0xa904
leaq 0x158(%rsp), %r14
movq %r14, %rdi
callq 0xa934
movq -0x20(%r14), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x3fcfd
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %rbx, %rax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq %rbx, %rdi
callq 0xa890
jmp 0x3fd54
movq %rax, %r15
movq %rbp, %rdi
callq 0xa904
jmp 0x3fd2f
movq %rax, %r15
movq %r13, %rdi
callq 0xa934
jmp 0x3fd3c
movq %rax, %r15
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x3fd54
movq (%r14), %rsi
incq %rsi
callq 0x92e0
jmp 0x3fd54
movq %rax, %r15
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fd74
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x92e0
jmp 0x3fd74
movq %rax, %r15
leaq 0x30(%rsp), %rdi
callq 0xa890
leaq 0x98(%rsp), %rdi
callq 0x382e4
leaq 0x138(%rsp), %rdi
callq 0x382e4
movq %r15, %rdi
callq 0x94e0
movq %rax, %r15
jmp 0x3fd7e
movq %rax, %r15
jmp 0x3fd8b