// File: 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:
subq $0x218, %rsp            # imm = 0x218
movq %rdi, 0x210(%rsp)
movq %rsi, 0x208(%rsp)
movq %rdx, 0x200(%rsp)
movq 0x210(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x24840
leaq 0x1d0(%rsp), %rdi
callq 0x1a4a0
movq 0x200(%rsp), %rdi
movq 0x208(%rsp), %rsi
callq 0x20ca0
movq %rax, 0x30(%rsp)
jmp 0x31912
movq 0x30(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x208(%rsp), %rsi
leaq 0x140(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x21f90
jmp 0x3193e
leaq 0x1e8(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x26270
jmp 0x31955
leaq 0x140(%rsp), %rdi
callq 0x21fd0
movq 0x1c8(%rsp), %rdi
callq 0x23090
leaq 0x1e8(%rsp), %rdi
callq 0x24f20
xorb $-0x1, %al
testb $0x1, %al
jne 0x31987
jmp 0x31c58
leaq 0x1e8(%rsp), %rdi
callq 0x26310
movq %rax, %rsi
leaq 0xc8(%rsp), %rdi
callq 0x26340
jmp 0x319a6
leaq 0x1e8(%rsp), %rdi
callq 0x26380
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x20(%rax), %rax
leaq 0xc8(%rsp), %rsi
callq *%rax
movb %al, 0x27(%rsp)
jmp 0x319d2
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x319dc
jmp 0x31a44
movl $0x2, 0xc4(%rsp)
jmp 0x31c25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x31c89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x21fd0
jmp 0x31c89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x31c49
movl $0x0, 0xc0(%rsp)
movq 0x28(%rsp), %rax
movl 0xc0(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq 0xc8(%rsp), %rsi
callq *%rax
movl %eax, 0x20(%rsp)
jmp 0x31a79
movl 0x1c(%rsp), %eax
movl 0x20(%rsp), %ecx
cmpl %ecx, %eax
jge 0x31c1a
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movl 0xc0(%rsp), %edx
movq (%rdi), %rax
movq 0x30(%rax), %rax
leaq 0xc8(%rsp), %rsi
callq *%rax
movb %al, 0x1b(%rsp)
jmp 0x31aaf
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0x31abc
jmp 0x31c02
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movl 0xc0(%rsp), %edx
movq (%rdi), %rax
movq 0x60(%rax), %rax
leaq 0xc8(%rsp), %rsi
leaq 0x1d0(%rsp), %rcx
callq *%rax
jmp 0x31ae6
leaq 0x1d0(%rsp), %rdi
callq 0x17030
movl %eax, 0xbc(%rsp)
movl $0x0, 0xb8(%rsp)
movl 0xb8(%rsp), %eax
cmpl 0xbc(%rsp), %eax
jae 0x31c00
movq 0x200(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0xb8(%rsp), %eax
movl %eax, %esi
leaq 0x1d0(%rsp), %rdi
callq 0x1a4b0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x20ca0
movq %rax, 0x10(%rsp)
jmp 0x31b50
movq 0x10(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x22ea0
testb $0x1, %al
jne 0x31be8
movl 0xb8(%rsp), %eax
movl %eax, %esi
leaq 0x1d0(%rsp), %rdi
callq 0x1a4b0
movq %rax, %rsi
leaq 0x38(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0x262b0
jmp 0x31b9b
leaq 0x1e8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x26270
jmp 0x31baf
leaq 0x38(%rsp), %rdi
callq 0x21fd0
movq 0xb0(%rsp), %rdi
callq 0x23090
jmp 0x31be8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x21fd0
jmp 0x31c49
jmp 0x31bea
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
jmp 0x31b05
jmp 0x31c02
jmp 0x31c04
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
jmp 0x31a4f
movl $0x0, 0xc4(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x21fd0
movl 0xc4(%rsp), %eax
testl %eax, %eax
je 0x31c44
jmp 0x31c3f
jmp 0x3196f
jmp 0x3196f
leaq 0xc8(%rsp), %rdi
callq 0x21fd0
jmp 0x31c89
movq 0x200(%rsp), %rdi
callq 0x31d30
jmp 0x31c67
leaq 0x1d0(%rsp), %rdi
callq 0x1a510
leaq 0x1e8(%rsp), %rdi
callq 0x25630
addq $0x218, %rsp            # imm = 0x218
retq
leaq 0x1d0(%rsp), %rdi
callq 0x1a510
leaq 0x1e8(%rsp), %rdi
callq 0x25630
movq 0x1c0(%rsp), %rdi
callq 0x6520