// File: /workspace/github_cpp_makefile_star2_O3/bonetblai[P]mdp-engine/ctp3/./graph.h
// Function: CTP::graph_t::parse(std::istream&)
bool parse(std::istream &is) {
        // read graph from file
        edge_list_.clear();
        at_.clear();

        std::string token;
        is >> token;
        if( token == "p" ) {
            int n_edges;
            is >> num_nodes_ >> n_edges;

            edges_ = new int[num_nodes_ * num_nodes_];
            for( int n1 = 0; n1 < num_nodes_; ++n1 ) {
                for( int n2 = 0; n2 < num_nodes_; ++n2 )
                    edges_[n1*num_nodes_ + n2] = -1;
            }

            at_.resize(num_nodes_);
            for( int e = 0; e < n_edges; ++e ) {
                is >> token;
                if( token == "e" ) {
                    int from, to, cost;
                    float prob;
                    is >> from >> to >> prob >> cost;
                    --from;
                    --to;
                    add_edge(edge_t(from, to, cost, prob));
                } else {
                    std::cout << "error reading input file: road doesn't start with 'e'." << std::endl;
                    return false;
                }
            }
        } else {
            std::cout << "error reading input file: file doesn't start with 'p'." << std::endl;
            return false;
        }

        // insert shortcut (s,t) edge
        if( with_shortcut_ ) {
            std::cout << "info: adding (s,t) shortcut w/ cost " << shortcut_cost_ << std::endl;
            add_edge(edge_t(0, num_nodes_ - 1, shortcut_cost_, 1.0));
        }

        std::cout << "info: #nodes=" << num_nodes_
                  << ", #edges=" << num_edges_
                  << ", degree=" << degree()
                  << std::endl;

        // compute optimistic shortest-paths to goal
        h_opt_ = new int[num_nodes_];
        in_queue_ = new int[num_nodes_];
        for( int node = 0; node < num_nodes_; ++node )
            h_opt_[node] = INT_MAX;

        std::priority_queue<std::pair<int, int>,
                            std::vector<std::pair<int, int> >,
                            open_list_cmp> queue;

        int goal = num_nodes_ - 1;
        h_opt_[goal] = 0;
        queue.push(std::make_pair(goal, 0));
        while( !queue.empty() ) {
            std::pair<int, int> p = queue.top();
            queue.pop();
            if( p.second <= h_opt_[p.first] ) {
                for( int i = 0, isz = at_[p.first].size(); i < isz; ++i ) {
                    const edge_t &e = edge_list_[at_[p.first][i]];
                    int cost = p.second + e.cost_;
                    int to = e.from_ == p.first ? e.to_ : e.from_;
                    if( cost < h_opt_[to] ) {
                        h_opt_[to] = cost;
                        queue.push(std::make_pair(to, cost));
                    }
                }
            }
        }

        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpq %rax, 0x18(%rdi)
je 0x6bd4
movq %rax, 0x18(%rbx)
leaq 0x28(%rbx), %rdi
movq %rdi, 0x10(%rsp)
callq 0x9d8c
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x58(%rsp), %rsi
movq %r14, %rdi
callq 0x5330
leaq 0x24c41(%rip), %rsi     # 0x2b84b
leaq 0x58(%rsp), %rdi
callq 0x50c0
testl %eax, %eax
je 0x6c65
movq 0x363b9(%rip), %rbx     # 0x3cfd8
leaq 0x24757(%rip), %rsi     # 0x2b37d
movl $0x36, %edx
movq %rbx, %rdi
callq 0x52e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5270
movsbl %al, %esi
movq 0x36387(%rip), %rdi     # 0x3cfd8
callq 0x5040
movq %rax, %rdi
callq 0x51e0
xorl %ebx, %ebx
jmp 0x7157
movq %r14, 0x50(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x51a0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x51a0
movl (%rbx), %r15d
movl %r15d, %edi
imull %edi, %edi
shlq $0x2, %rdi
callq 0x5030
movq %rax, %r12
movslq %r15d, %rax
movq %rax, 0x48(%rsp)
movq %r12, 0x40(%rbx)
testl %r15d, %r15d
jle 0x6cd0
leaq (,%r15,4), %r13
xorl %r14d, %r14d
movq %r15, %rbp
movl %r14d, %eax
leaq (%r12,%rax,4), %rdi
movl $0xff, %esi
movq %r13, %rdx
callq 0x5180
addl %r15d, %r14d
decq %rbp
jne 0x6cb4
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x9dce
cmpl $0x0, (%rsp)
movq 0x50(%rsp), %r15
jle 0x6d9c
xorl %r13d, %r13d
leaq 0x58(%rsp), %r12
leaq 0x1c(%rsp), %r14
leaq 0x20(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x5330
movq %r12, %rdi
leaq 0x26af2(%rip), %rsi     # 0x2d807
callq 0x50c0
testl %eax, %eax
jne 0x6eb2
movq %r15, %rdi
leaq 0xc(%rsp), %rsi
callq 0x51a0
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x51a0
movq %rax, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5470
movq %rax, %rdi
movq %r14, %rsi
callq 0x51a0
movl 0xc(%rsp), %eax
decl %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %ecx
decl %ecx
movl %ecx, 0x8(%rsp)
movl 0x1c(%rsp), %edx
movd 0x18(%rsp), %xmm0
movl %eax, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movl %edx, 0x28(%rsp)
movd %xmm0, 0x2c(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9e50
incl %r13d
cmpl (%rsp), %r13d
jl 0x6d00
cmpb $0x1, 0x8(%rbx)
jne 0x6e1a
movq 0x3622f(%rip), %rdi     # 0x3cfd8
leaq 0x24604(%rip), %rsi     # 0x2b3b4
movl $0x24, %edx
callq 0x52e0
movl 0xc(%rbx), %esi
movq 0x36214(%rip), %rdi     # 0x3cfd8
callq 0x5400
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5270
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51e0
movl (%rbx), %eax
movl 0xc(%rbx), %ecx
decl %eax
leaq 0x20(%rsp), %rsi
movl $0x0, (%rsi)
movl %eax, 0x4(%rsi)
movl %ecx, 0x8(%rsi)
movl $0x3f800000, 0xc(%rsi)  # imm = 0x3F800000
movq %rbx, %rdi
callq 0x9e50
movq 0x361b7(%rip), %rdi     # 0x3cfd8
leaq 0x245b1(%rip), %rsi     # 0x2b3d9
movl $0xd, %edx
callq 0x52e0
movl (%rbx), %esi
movq 0x3619d(%rip), %rdi     # 0x3cfd8
callq 0x5400
movq %rax, %r14
leaq 0x2459d(%rip), %rsi     # 0x2b3e7
movl $0x9, %edx
movq %rax, %rdi
callq 0x52e0
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x5400
movq %rax, %r14
leaq 0x24585(%rip), %rsi     # 0x2b3f1
movl $0x9, %edx
movq %rax, %rdi
callq 0x52e0
movslq (%rbx), %rcx
testq %rcx, %rcx
jle 0x6efd
movq 0x10(%rsp), %rax
movq (%rax), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
xorl %esi, %esi
movq 0x8(%rax,%rdx), %rdi
subq (%rax,%rdx), %rdi
shrq $0x2, %rdi
cmpl %esi, %edi
cmovgl %edi, %esi
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x6e95
jmp 0x6eff
movq 0x3611f(%rip), %rbx     # 0x3cfd8
leaq 0x24486(%rip), %rsi     # 0x2b346
movl $0x36, %edx
movq %rbx, %rdi
callq 0x52e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5270
movsbl %al, %esi
movq 0x360ed(%rip), %rdi     # 0x3cfd8
callq 0x5040
movq %rax, %rdi
callq 0x51e0
jmp 0x6c5e
xorl %esi, %esi
movq %r14, %rdi
callq 0x5400
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x5270
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x51e0
movslq (%rbx), %r12
leaq (,%r12,4), %rax
testq %r12, %r12
movq $-0x1, %r14
cmovnsq %rax, %r14
movq %r14, %rdi
callq 0x5030
movq %rax, %r15
movq %rax, 0x48(%rbx)
movq %r14, %rdi
callq 0x5030
movq %rax, 0x50(%rbx)
testl %r12d, %r12d
jle 0x706e
leal 0x3(%r12), %eax
leaq -0x1(%r12), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
shrl $0x2, %eax
shlq $0x4, %rax
movdqa 0x2409f(%rip), %xmm1    # 0x2b030
movdqa 0x240a7(%rip), %xmm2    # 0x2b040
xorl %ecx, %ecx
movdqa 0x240ad(%rip), %xmm3    # 0x2b050
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movdqa 0x240ad(%rip), %xmm5    # 0x2b060
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %edx
notl %edx
testb $0x1, %dl
je 0x6fef
movl $0x7fffffff, (%r15,%rcx) # imm = 0x7FFFFFFF
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x7006
movl $0x7fffffff, 0x4(%r15,%rcx) # imm = 0x7FFFFFFF
movdqa %xmm1, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
pxor %xmm4, %xmm6
pextrw $0x0, %xmm6, %edx
testb $0x1, %dl
je 0x7046
movl $0x7fffffff, 0x8(%r15,%rcx) # imm = 0x7FFFFFFF
pextrw $0x4, %xmm6, %edx
testb $0x1, %dl
je 0x7059
movl $0x7fffffff, 0xc(%r15,%rcx) # imm = 0x7FFFFFFF
paddq %xmm5, %xmm2
paddq %xmm5, %xmm1
addq $0x10, %rcx
cmpq %rcx, %rax
jne 0x6fb3
pxor %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movdqa %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x0, -0x4(%r15,%r12,4)
decq %r12
movl %r12d, %eax
movq %rsp, %rsi
movq %rax, (%rsi)
callq 0x9f58
movq 0x20(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0x714b
movslq (%rdi), %r14
movl 0x4(%rdi), %ebp
leaq 0x20(%rsp), %rdi
callq 0x9fde
movq 0x48(%rbx), %rax
cmpl (%rax,%r14,4), %ebp
jg 0x709d
movq 0x10(%rsp), %rax
movq (%rax), %rax
leaq (%r14,%r14,2), %r13
movq 0x8(%rax,%r13,8), %r12
subq (%rax,%r13,8), %r12
shrq $0x2, %r12
testl %r12d, %r12d
jle 0x709d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq 0x28(%rbx), %rcx
movq (%rcx,%r13,8), %rcx
movslq (%rcx,%r15,4), %rcx
shlq $0x4, %rcx
movl (%rax,%rcx), %edx
cmpl %r14d, %edx
jne 0x710f
movl 0x4(%rax,%rcx), %edx
movl 0x8(%rax,%rcx), %eax
addl %ebp, %eax
movq 0x48(%rbx), %rsi
movslq %edx, %rcx
cmpl (%rsi,%rcx,4), %eax
jge 0x713e
movl %eax, (%rsi,%rcx,4)
shlq $0x20, %rax
movl %ecx, %ecx
orq %rax, %rcx
movq %rcx, (%rsp)
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x9f58
incq %r15
cmpq %r15, %r12
jne 0x70ef
jmp 0x709d
testq %rdi, %rdi
je 0x7155
callq 0x5260
movb $0x1, %bl
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x716b
callq 0x5260
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x718c
jmp 0x7191
jmp 0x718c
jmp 0x718c
jmp 0x718c
jmp 0x718c
jmp 0x7191
jmp 0x718c
movq %rax, %rbx
jmp 0x71a3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x71a3
callq 0x5260
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x71b7
callq 0x5260
movq %rbx, %rdi
callq 0x5410
nop