// File: /workspace/github_cpp_makefile_star2_O2/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, 0x8(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movq %rdx, %rdi
callq 0xcf18
movq %rax, %r12
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0xa4d8
leaq 0x48(%rsp), %rsi
movq %r12, 0x70(%rsi)
leaq 0x30(%rsp), %rdi
callq 0xe788
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x8e90
movb $0x1, 0x5(%r12)
leaq 0xc0(%rsp), %rbp
movq 0x30(%rsp), %rsi
leaq 0x30(%rsp), %rax
cmpq %rax, %rsi
je 0x1273a
addq $0x10, %rsi
movq %r14, %rdi
callq 0xe794
leaq 0x30(%rsp), %rdi
callq 0xe7b4
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x20(%rax)
testb %al, %al
je 0x1266b
movq %r14, %rdi
callq 0x8e90
jmp 0x12623
xorl %r13d, %r13d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *0x10(%rax)
cmpl %eax, %r13d
jge 0x12661
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movl %r13d, %edx
callq *0x30(%rax)
testb %al, %al
je 0x1272d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
leaq 0x48(%rsp), %rsi
movl %r13d, %edx
leaq 0x10(%rsp), %rcx
callq *0x60(%rax)
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
cqto
pushq $0x78
popq %rcx
idivq %rcx
movl %eax, %eax
imulq $0x78, %rax, %r14
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x1272d
movq 0x10(%rsp), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0xcf18
movq %rax, %r12
cmpb $0x0, 0x5(%rax)
jne 0x12727
movq 0x10(%rsp), %rsi
addq %r15, %rsi
movq %rbp, %rdi
callq 0xa4d8
movq %r12, 0x130(%rsp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0xe788
movq %rbp, %rdi
callq 0x8e90
movb $0x1, 0x5(%r12)
addq $0x78, %r15
jmp 0x126d6
incl %r13d
leaq 0x48(%rsp), %r14
jmp 0x1266e
movq %rbx, %rdi
callq 0x127b4
leaq 0x10(%rsp), %rdi
callq 0xb53c
leaq 0x30(%rsp), %rdi
callq 0xe98e
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1278b
jmp 0x12770
jmp 0x12770
jmp 0x1278b
movq %rax, %rbx
jmp 0x12798
jmp 0x1278b
jmp 0x1278b
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x8e90
jmp 0x1278e
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8e90
leaq 0x10(%rsp), %rdi
callq 0xb53c
leaq 0x30(%rsp), %rdi
callq 0xe98e
movq %rbx, %rdi
callq 0x5410