// File: /workspace/github_cpp_makefile_star2_O1/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 0x1020a
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 0xd546
leaq 0x48(%rsp), %rsi
movq %r12, 0x70(%rsi)
leaq 0x18(%rsp), %rdi
callq 0x123c2
leaq 0x18(%rsp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x6060
incq 0x10(%r13)
cmpb $0x0, 0xa4(%rsp)
jne 0x18c17
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x18c17
callq 0x6340
movb $0x1, 0x5(%r12)
movq 0x18(%rsp), %r15
cmpq %r13, %r15
je 0x18e24
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 0xd546
movq 0x80(%r15), %rax
movq %rax, 0xb8(%rsp)
movq 0x18(%rsp), %rsi
movq %r13, %rdi
callq 0x1242c
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x20(%rax)
testb %al, %al
leaq 0xc0(%rsp), %r13
je 0x18cde
cmpb $0x0, 0xa4(%rsp)
jne 0x18cc6
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x18cc6
callq 0x6340
movq 0x18(%rsp), %r15
leaq 0x18(%rsp), %r13
cmpq %r13, %r15
jne 0x18c38
jmp 0x18e24
xorl %ebp, %ebp
movq 0x10(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x10(%rax)
cmpl %eax, %ebp
jge 0x18caa
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 0x18e14
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 0x18e14
movl %eax, %eax
imulq $0x78, %rax, %r15
xorl %ebp, %ebp
movq 0x30(%rsp), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0x1020a
movq %rax, %r12
cmpb $0x0, 0x5(%rax)
jne 0x18e07
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 0xd546
movq %r12, 0x130(%rsp)
movq %r13, %rsi
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x123c2
movq %rax, %rdi
movq %r13, %rsi
callq 0x6060
incq 0x28(%rsp)
cmpb $0x0, 0x11c(%rsp)
jne 0x18df9
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x18df9
callq 0x6340
movb $0x1, 0x5(%r12)
leaq 0xc0(%rsp), %r13
addq $0x78, %rbp
cmpq %rbp, %r15
jne 0x18d5c
movl 0xc(%rsp), %ebp
incl %ebp
leaq 0x48(%rsp), %r12
jmp 0x18ce0
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x18e3a
movq 0x78(%rax), %rcx
movb $0x0, 0x5(%rcx)
movq (%rax), %rax
jmp 0x18e28
leaq 0x30(%rsp), %rdi
callq 0xe35c
leaq 0x18(%rsp), %rdi
callq 0x124c4
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x18e92
jmp 0x18e66
jmp 0x18e66
movq %rax, %rbx
jmp 0x18eb1
jmp 0x18e92
jmp 0x18e92
jmp 0x18e92
movq %rax, %rbx
cmpb $0x0, 0x11c(%rsp)
jne 0x18e95
movq 0x120(%rsp), %rdi
testq %rdi, %rdi
je 0x18e95
callq 0x6340
jmp 0x18e95
movq %rax, %rbx
cmpb $0x0, 0xa4(%rsp)
jne 0x18eb1
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x18eb1
callq 0x6340
leaq 0x30(%rsp), %rdi
callq 0xe35c
leaq 0x18(%rsp), %rdi
callq 0x124c4
movq %rbx, %rdi
callq 0x6410
nop