// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/ctp3/../engine/value_iteration.h
// Function: Algorithm::state_space_t<state_t>::generate_space(state_t const&, Problem::hash_t<state_t>&)
void generate_space(const T &s, Problem::hash_t<T> &hash) {
        std::list<std::pair<T, Hash::data_t*> > open;

        std::vector<std::pair<T, float> > outcomes;
        Hash::data_t *dptr = hash.data_ptr(s);
        open.push_back(std::make_pair(s, dptr));
        dptr->mark();

#ifdef DEBUG
        std::cout << "debug: generate-space(): marking " << s << std::endl;
#endif

        while( !open.empty() ) {
            std::pair<T, Hash::data_t*> n = open.front();
            open.pop_front();
            if( problem_.terminal(n.first) ) continue;

            for( Problem::action_t a = 0; a < problem_.number_actions(n.first); ++a ) {
                if( problem_.applicable(n.first, a) ) {
                    problem_.next(n.first, a, outcomes);
                    unsigned osize = outcomes.size();
                    for( unsigned i = 0; i < osize; ++i ) {
                        Hash::data_t *ptr = hash.data_ptr(outcomes[i].first);
                        if( !ptr->marked() ) {
                            open.push_back(std::make_pair(outcomes[i].first, ptr));
                            ptr->mark();
#ifdef DEBUG
                            std::cout << "debug: generate-space(): marking " << outcomes[i].first << std::endl;
#endif
                        }
                    }
                }
            }
        }
        hash.unmark_all();
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, 0x10(%rsp)
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
movq %rcx, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rdx, %rdi
callq 0xefb2
movq %rax, %r12
leaq 0x48(%rsp), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x34(%rdi)
movups %xmm0, 0x24(%rdi)
movups %xmm0, 0x14(%rdi)
movups %xmm0, 0x4(%rdi)
xorl %eax, %eax
movq %rax, 0x44(%rdi)
movb $0x1, 0x5c(%rdi)
movq %rax, 0x60(%rdi)
movq %r15, %rsi
callq 0xc30a
leaq 0x48(%rsp), %rsi
movq %r12, 0x70(%rsi)
leaq 0x18(%rsp), %rdi
callq 0x11116
leaq 0x18(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x5060
incq 0x10(%r13)
cmpb $0x0, 0xa4(%rsp)
jne 0x177b9
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x177b9
callq 0x5340
movb $0x1, 0x5(%r12)
movq 0x18(%rsp), %r15
cmpq %r13, %r15
je 0x179c6
leaq 0xc4(%rsp), %r14
leaq 0x48(%rsp), %r12
leaq 0x10(%r15), %rsi
leaq 0x4c(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x40(%rax)
movb $0x1, 0xa4(%rsp)
movq %rcx, 0xa8(%rsp)
movq %r12, %rdi
callq 0xc30a
movq 0x80(%r15), %rax
movq %rax, 0xb8(%rsp)
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x11180
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x20(%rax)
testb %al, %al
leaq 0xc0(%rsp), %r13
je 0x17880
cmpb $0x0, 0xa4(%rsp)
jne 0x17868
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x17868
callq 0x5340
movq 0x18(%rsp), %r15
leaq 0x18(%rsp), %r13
cmpq %r13, %r15
jne 0x177da
jmp 0x179c6
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x10(%rax)
cmpl %eax, %ebp
jge 0x1784c
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
movl %ebp, %edx
callq *0x30(%rax)
movl %ebp, 0xc(%rsp)
testb %al, %al
je 0x179b6
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
movl 0xc(%rsp), %edx
leaq 0x30(%rsp), %rcx
callq *0x60(%rax)
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x3, %rax
movabsq $-0x1111111111111111, %rcx # imm = 0xEEEEEEEEEEEEEEEF
imulq %rcx, %rax
testl %eax, %eax
je 0x179b6
movl %eax, %eax
imulq $0x78, %rax, %r15
xorl %ebp, %ebp
movq 0x30(%rsp), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0xefb2
movq %rax, %r12
cmpb $0x0, 0x5(%rax)
jne 0x179a9
movq 0x30(%rsp), %rsi
addq %rbp, %rsi
xorl %eax, %eax
movq %rax, 0x40(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movb $0x1, 0x11c(%rsp)
movq %rax, 0x120(%rsp)
movq %r13, %rdi
callq 0xc30a
movq %r12, 0x130(%rsp)
movq %r13, %rsi
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x11116
movq %rax, %rdi
movq %r13, %rsi
callq 0x5060
incq 0x28(%rsp)
cmpb $0x0, 0x11c(%rsp)
jne 0x1799b
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x1799b
callq 0x5340
movb $0x1, 0x5(%r12)
leaq 0xc0(%rsp), %r13
addq $0x78, %rbp
cmpq %rbp, %r15
jne 0x178fe
movl 0xc(%rsp), %ebp
incl %ebp
leaq 0x48(%rsp), %r12
jmp 0x17882
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x179dc
movq 0x78(%rax), %rcx
movb $0x0, 0x5(%rcx)
movq (%rax), %rax
jmp 0x179ca
leaq 0x30(%rsp), %rdi
callq 0xd12e
leaq 0x18(%rsp), %rdi
callq 0x11218
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17a34
jmp 0x17a08
jmp 0x17a08
movq %rax, %rbx
jmp 0x17a53
jmp 0x17a34
jmp 0x17a34
jmp 0x17a34
movq %rax, %rbx
cmpb $0x0, 0x11c(%rsp)
jne 0x17a37
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x17a37
callq 0x5340
jmp 0x17a37
movq %rax, %rbx
cmpb $0x0, 0xa4(%rsp)
jne 0x17a53
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x17a53
callq 0x5340
leaq 0x30(%rsp), %rdi
callq 0xd12e
leaq 0x18(%rsp), %rdi
callq 0x11218
movq %rbx, %rdi
callq 0x5410
nop