// File: /workspace/github_cpp_makefile_star2_O3/pfnet-research[P]pml/src/translate_to_mdp.cpp
// Function: create_rand_case(int, int)
mdp_with_info_t create_rand_case(int start, int end) {
    int from = translation_data::fresh_location();
    int to = translation_data::fresh_location();
    auto rand_var = translation_data::fresh_var();

    mdp::command_t command {
        make<mdp::binop_expr_t>(
                make<mdp::var_expr_t>("location"),
                make<mdp::int_expr_t>(from),
                mdp::binop_kind_t::Eq),
        {}
    };

    auto prob = make<mdp::binop_expr_t>(
            make<mdp::int_expr_t>(1),
            make<mdp::int_expr_t>(end - start + 1),
            mdp::binop_kind_t::Div);
    auto next = make<mdp::binop_expr_t>(
            make<mdp::var_expr_t>("location'"),
            make<mdp::int_expr_t>(to),
            mdp::binop_kind_t::Eq);
    for (int i=start; i<=end; ++i) {
        auto branch = make<mdp::binop_expr_t>(
                next,
                make<mdp::binop_expr_t>(
                    make<mdp::var_expr_t>(rand_var + "'"),
                    make<mdp::int_expr_t>(i),
                    mdp::binop_kind_t::Eq),
                mdp::binop_kind_t::And);
        command.branches.push_back(mdp::branch_t {prob, branch});
    }

    mdp::mdp_t mdp {
        "default",
        {
            mdp::variable_t {
                "location",
                bound_t{from, to}, from
            },
            mdp::variable_t {
                rand_var,
                bound_t{start, end}, start
            }
        },
        {}, // constants
        {command}
    };

    return mdp_with_info_t {
        mdp, from, to,
        value_info_t {
            rand_var, {bound_t{start, end}}
        }
    };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movl 0x2656c(%rip), %r14d    # 0x622c8
leal 0x2(%r14), %eax
movl %eax, 0x26562(%rip)     # 0x622c8
leaq 0x110(%rsp), %rdi
callq 0x4017c
leaq 0x148(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x93c6(%rip), %rcx      # 0x45150
leaq 0x140(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x38192
movq %rbx, 0xe0(%rsp)
movl $0x20, %edi
callq 0x92d0
movabsq $0x100000001, %r12      # imm = 0x100000001
movq %r12, 0x8(%rax)
leaq 0x25b72(%rip), %r13     # 0x61938
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x25bb1(%rip), %rdx     # 0x61988
movq %rdx, 0x10(%rax)
movl %r14d, 0x18(%rax)
leaq 0xa8(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x80(%rsp), %r9
movl $0x8, (%r9)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
leaq 0x140(%rsp), %rcx
callq 0x37f76
movaps 0x10(%rsp), %xmm0
movaps %xmm0, 0x1a0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x1b0(%rsp)
movq $0x0, 0x1c0(%rsp)
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3be5f
callq 0xa946
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3be71
callq 0xa946
movl $0x20, %edi
callq 0x92d0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x25af8(%rip), %rbx     # 0x61988
movq %rbx, 0x10(%rax)
movl $0x1, 0x18(%rax)
movq %rax, 0x18(%rsp)
movq %rcx, 0x10(%rsp)
movl $0x20, %edi
callq 0x92d0
movl %r15d, %ecx
subl %ebp, %ecx
incl %ecx
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %rbx, 0x10(%rax)
movl %ecx, 0x18(%rax)
leaq 0x140(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rdx, (%r8)
leaq 0xa8(%rsp), %r9
movl $0x1, (%r9)
leaq 0xd8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0xd0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x383e6
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3bf25
callq 0xa946
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3bf34
callq 0xa946
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0xeed7(%rip), %rcx      # 0x4ae1f
leaq 0x10(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x385c2
movl $0x20, %edi
callq 0x92d0
leal 0x1(%r14), %edx
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x25a0b(%rip), %rsi     # 0x61988
movq %rsi, 0x10(%rax)
movq %rdx, 0xf0(%rsp)
movl %edx, 0x18(%rax)
leaq 0x140(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0xa8(%rsp), %r9
movl $0x8, (%r9)
leaq 0x138(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x130(%rsp), %rsi
leaq 0x80(%rsp), %rdx
leaq 0x10(%rsp), %rcx
callq 0x37f76
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3bfe6
callq 0xa946
movq %r14, 0xf8(%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3bffd
callq 0xa946
movl %ebp, 0x8(%rsp)
movq %r15, 0xe8(%rsp)
cmpl %ebp, %r15d
jl 0x3c267
movq 0xe8(%rsp), %rax
incl %eax
movl %eax, 0xa0(%rsp)
leaq 0x10(%rsp), %r14
leaq 0x80(%rsp), %rbx
leaq 0x100(%rsp), %r12
leaq 0xa8(%rsp), %r13
leaq 0xa4(%rsp), %rbp
movl 0x8(%rsp), %r15d
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xac68
movq %r14, %rdi
leaq 0xedaf(%rip), %rsi      # 0x4ae2b
callq 0x9540
movq $0x0, 0x80(%rsp)
leaq 0x88(%rsp), %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x40566
movl $0x20, %edi
callq 0x92d0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x25876(%rip), %rcx     # 0x61938
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x258b5(%rip), %rdx     # 0x61988
movq %rdx, 0x10(%rax)
movl %r15d, 0x18(%rax)
movq %rax, 0x108(%rsp)
movq %rcx, 0x100(%rsp)
movl $0x8, 0xc(%rsp)
movq $0x0, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq %r12, %r8
leaq 0xc(%rsp), %r9
callq 0x37f76
movl $0xa, 0xa4(%rsp)
movq $0x0, 0x140(%rsp)
leaq 0x148(%rsp), %rdi
leaq 0x140(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x130(%rsp), %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x4045a
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3c16e
callq 0xa946
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x3c180
callq 0xa946
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3c192
callq 0xa946
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3c1ae
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0xd0(%rsp), %rcx
movq 0xd8(%rsp), %rax
movq %rcx, 0x10(%rsp)
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0x3c1e2
movq 0x25ddc(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x3c1de
incl 0x8(%rax)
jmp 0x3c1e2
lock
incl 0x8(%rax)
movq 0x140(%rsp), %rcx
movq 0x148(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x3c216
movq 0x25da8(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x3c212
incl 0x8(%rax)
jmp 0x3c216
lock
incl 0x8(%rax)
leaq 0x1b0(%rsp), %rdi
movq %r14, %rsi
callq 0x410fa
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3c235
callq 0xa946
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3c244
callq 0xa946
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3c256
callq 0xa946
incl %r15d
cmpl %r15d, 0xa0(%rsp)
jne 0x3c04d
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xeb6f(%rip), %rsi      # 0x4ade6
leaq 0xeb6f(%rip), %rdx      # 0x4aded
leaq 0x10(%rsp), %rdi
callq 0x116f8
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8eb4(%rip), %rsi      # 0x45150
leaq 0x8eb5(%rip), %rdx      # 0x45158
leaq 0x80(%rsp), %rdi
callq 0x116f8
movq 0xf8(%rsp), %rbx
leaq 0x150(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %r13
movq %r13, %rdi
callq 0xac68
movq 0xf0(%rsp), %rax
shlq $0x20, %rax
orq %rbx, %rax
leaq 0x170(%rsp), %r13
movq %rax, -0xc(%r13)
movl %ebx, -0x4(%r13)
movl $0x0, -0x10(%r13)
leaq 0x180(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xac68
leaq 0x30(%rsp), %rdi
movq 0xe8(%rsp), %rcx
shlq $0x20, %rcx
movl 0x8(%rsp), %eax
movl %eax, %ebp
orq %rcx, %rbp
leaq 0x140(%rsp), %rsi
movq %rbp, 0x54(%rsi)
movl %eax, 0x5c(%rsi)
movl $0x0, 0x50(%rsi)
leaq 0x100(%rsp), %rcx
movl $0x2, %edx
callq 0x37dd2
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x1a0(%rsp), %rcx
movq 0x1a8(%rsp), %rax
movq %rcx, 0xa8(%rsp)
movq %rax, 0xb0(%rsp)
testq %rax, %rax
je 0x3c3c2
movq 0x25bfc(%rip), %rcx     # 0x61fb0
cmpb $0x0, (%rcx)
je 0x3c3be
incl 0x8(%rax)
jmp 0x3c3c2
lock
incl 0x8(%rax)
leaq 0xb8(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x38a30
leaq 0x60(%rsp), %r14
leaq 0xa8(%rsp), %rsi
leaq 0xc(%rsp), %rcx
movl $0x1, %edx
movq %r14, %rdi
callq 0x37e66
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
callq 0xa8da
movq -0x8(%r15), %rdi
testq %rdi, %rdi
je 0x3c414
callq 0xa946
movq $-0x60, %rbx
leaq 0x190(%rsp), %r15
movq 0xe0(%rsp), %r13
movq %r15, %rdi
callq 0xaa94
movq -0x20(%r15), %rdi
leaq -0x10(%r15), %rax
cmpq %rdi, %rax
je 0x3c44b
movq (%rax), %rsi
incq %rsi
callq 0x92e0
addq $-0x30, %r15
addq $0x30, %rbx
jne 0x3c42b
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x3c472
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x10(%r13), %rbx
movq %rbx, (%r13)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xac68
leaq 0x20(%r13), %r15
movq %r15, %rdi
leaq 0x30(%rsp), %rsi
callq 0x405f6
leaq 0x38(%r13), %r12
movq %r12, %rdi
leaq 0x48(%rsp), %rsi
callq 0x40692
leaq 0x50(%r13), %rdi
movq %r14, %rsi
callq 0x4072c
movq 0xf8(%rsp), %rax
movl %eax, 0x68(%r13)
movq 0xf0(%rsp), %rax
movl %eax, 0x6c(%r13)
leaq 0x70(%r13), %rdi
leaq 0x80(%r13), %rax
movq %rax, 0x70(%r13)
movq 0x110(%rsp), %rsi
movq 0x118(%rsp), %rdx
addq %rsi, %rdx
callq 0xac68
movq %rbp, 0x90(%r13)
movb $0x1, 0x98(%r13)
movq %r14, %rdi
callq 0xa808
leaq 0x48(%rsp), %rdi
callq 0xa838
leaq 0x30(%rsp), %rdi
callq 0xa868
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3c543
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x3c555
callq 0xa946
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x3c567
callq 0xa946
leaq 0x1b0(%rsp), %rdi
callq 0xa8da
movq 0x1a8(%rsp), %rdi
testq %rdi, %rdi
je 0x3c586
callq 0xa946
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c5a7
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %r13, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r13, %rdi
callq 0xa7c4
jmp 0x3c606
movq %rax, %r14
movq %r12, %rdi
callq 0xa838
jmp 0x3c5d9
movq %rax, %r14
movq %r15, %rdi
callq 0xa868
jmp 0x3c5e6
movq %rax, %r14
movq 0xe0(%rsp), %rax
movq (%rax), %rdi
cmpq %rbx, %rdi
je 0x3c606
movq (%rbx), %rsi
incq %rsi
callq 0x92e0
jmp 0x3c606
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0xa7c4
jmp 0x3c7eb
movq %r15, %rbp
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x37d68
jmp 0x3c642
movq %r15, %rbp
movq %rax, %r14
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3c642
callq 0xa946
leaq 0x48(%rsp), %rdi
callq 0xa838
leaq 0x30(%rsp), %rdi
callq 0xa868
jmp 0x3c65e
movq %r15, %rbp
movq %rax, %r14
movl $0x30, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x37daa
addq $-0x30, %rbx
cmpq $-0x30, %rbx
jne 0x3c663
movb $0x1, %bl
jmp 0x3c68b
jmp 0x3c683
movq %r15, %rbp
movq %rax, %r14
xorl %ebx, %ebx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x3c6a8
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x92e0
leaq 0x140(%rsp), %r15
cmpq %r13, %r15
sete %al
orb %al, %bl
jne 0x3c6d3
addq $-0x30, %r13
movq %r13, %rdi
callq 0x37daa
cmpq %r15, %r13
jne 0x3c6ba
jmp 0x3c6d3
movq %r15, %rbp
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x3c7de
jmp 0x3c7eb
jmp 0x3c780
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3c705
callq 0xa946
jmp 0x3c705
movq %rax, %r14
movq 0x18(%rsp), %rdi
jmp 0x3c7f3
movq %rax, %r14
jmp 0x3c7fd
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3c731
callq 0xa946
jmp 0x3c731
movq %rax, %r14
movq 0x18(%rsp), %rdi
jmp 0x3c805
movq %rax, %r14
jmp 0x3c80f
movq %rax, %r14
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3c75d
callq 0xa946
jmp 0x3c75d
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3c81c
callq 0xa946
jmp 0x3c81c
movq %rax, %r14
jmp 0x3c81c
movq %rax, %r14
jmp 0x3c7eb
jmp 0x3c787
movq %rax, %r14
jmp 0x3c7cf
movq %rax, %r14
jmp 0x3c7bd
movq %rax, %r14
jmp 0x3c7ab
movq %rax, %r14
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x3c7ab
callq 0xa946
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x3c7bd
callq 0xa946
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3c7cf
callq 0xa946
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3c7eb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x92e0
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x3c7fd
callq 0xa946
movq 0xd8(%rsp), %rdi
testq %rdi, %rdi
je 0x3c80f
callq 0xa946
leaq 0x1a0(%rsp), %rdi
callq 0x37d68
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c83d
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x92e0
movq %r14, %rdi
callq 0x94e0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x37d86
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x3c7eb
callq 0xa946
jmp 0x3c7eb