// File: /workspace/github_cpp_makefile_star2_O3/Kei18[P]pibt/./src/solver/winpibt.cpp
// Function: winPIBT::solve()
bool winPIBT::solve() {
  solveStart();

  int t = 0;
  int t_sup = 0;
  int i, _w;

  while (!P->isSolved()) {
    allocate();
    updatePriority();
    std::vector<int> U(A.size());
    std::iota(U.begin(), U.end(), 0);
    std::sort(U.begin(), U.end(),
              [this] (int i, int j)
              {return this->priority[i] > this->priority[j];} );

    for (int j = 0; j < U.size(); ++j) {
      i = U[j];
      if (ell(i) <= t) {

        if (A[i]->hasTask()) {
          _w = w;
        } else {
          _w = 1;
        }

        if (j == 0) {
          winpibt(A[i], t + _w, softmode);
        } else {
          winpibt(A[i], std::min(t + _w, t_sup), softmode);
        }
      }

      if (j == 0) {
        t_sup = ell(i);
      } else {
        t_sup = std::min(t_sup, ell(i));
      }
    }

    // update path
    for (int i = 0; i < A.size(); ++i) A[i]->setNode(PATHS[i][t+1]);

    P->update();
    if (P->getTimestep() >= P->getTimestepLimit()) break;

    ++t;
  }

  solveEnd();
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
callq *(%rax)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
testb %al, %al
jne 0x4534c
movq %rbx, %rdi
callq 0x4538e
movq %rbx, %rdi
callq 0x4557e
movq 0x28(%rbx), %rsi
subq 0x20(%rbx), %rsi
sarq $0x3, %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x46fae
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r12
cmpq %r12, %r13
movdqa 0x570e(%rip), %xmm7     # 0x4a7b0
je 0x45229
movq %r12, %rbp
subq %r13, %rbp
leaq -0x4(%rbp), %rax
movq %rax, %xmm0
shrq $0x2, %rax
addq $0x4, %rax
andq $-0x4, %rax
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x2, %xmm0
pxor %xmm7, %xmm0
xorl %ecx, %ecx
movdqa 0x56b5(%rip), %xmm5     # 0x4a790
movdqa 0x56bd(%rip), %xmm6     # 0x4a7a0
pcmpeqd %xmm8, %xmm8
movq %rcx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa %xmm1, %xmm2
por %xmm6, %xmm2
pxor %xmm7, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm0, %xmm3
pcmpeqd %xmm0, %xmm2
pshufd $0xf5, %xmm2, %xmm4     # xmm4 = xmm2[1,1,3,3]
pand %xmm3, %xmm4
pshufd $0xf5, %xmm3, %xmm2     # xmm2 = xmm3[1,1,3,3]
por %xmm4, %xmm2
movd %xmm2, %edx
notl %edx
testb $0x1, %dl
je 0x4512c
movl %ecx, (%r13,%rcx,4)
pxor %xmm8, %xmm2
pextrw $0x4, %xmm2, %edx
testb $0x1, %dl
je 0x45143
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r13,%rcx,4)
por %xmm5, %xmm1
pxor %xmm7, %xmm1
movdqa %xmm1, %xmm2
pcmpgtd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
pshufd $0xf5, %xmm1, %xmm3     # xmm3 = xmm1[1,1,3,3]
pand %xmm2, %xmm3
pshufd $0xf5, %xmm2, %xmm1     # xmm1 = xmm2[1,1,3,3]
por %xmm3, %xmm1
pxor %xmm8, %xmm1
pextrw $0x0, %xmm1, %edx
testb $0x1, %dl
je 0x45180
leal 0x2(%rcx), %edx
movl %edx, 0x8(%r13,%rcx,4)
pextrw $0x4, %xmm1, %edx
testb $0x1, %dl
je 0x45192
leal 0x3(%rcx), %edx
movl %edx, 0xc(%r13,%rcx,4)
addq $0x4, %rcx
cmpq %rcx, %rax
jne 0x450e8
movq %rbp, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x46c7a
cmpq $0x41, %rbp
jl 0x4521b
leaq 0x40(%r13), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x46f16
cmpq %r12, %rbp
je 0x45229
movq 0xd0(%rbx), %rax
movslq (%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movslq -0x4(%rbp), %rdx
ucomiss (%rax,%rdx,4), %xmm0
movq %rbp, %rsi
jbe 0x4520e
movq %rbp, %rsi
movl %edx, (%rsi)
movslq -0x8(%rsi), %rdx
addq $-0x4, %rsi
ucomiss (%rax,%rdx,4), %xmm0
ja 0x451fe
movl %ecx, (%rsi)
addq $0x4, %rbp
cmpq %r12, %rbp
jne 0x451e5
jmp 0x45229
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x46f16
movq 0x10(%rsp), %rcx
cmpq %rcx, 0x18(%rsp)
je 0x452d3
movq 0x88(%rbx), %rax
xorl %r12d, %r12d
movslq (%rcx,%r12,4), %r13
movslq (%rax,%r13,4), %rcx
cmpq %rcx, %r14
jge 0x45257
testq %r12, %r12
jne 0x45295
jmp 0x452b2
movq 0x20(%rbx), %rax
movq (%rax,%r13,8), %rsi
cmpq $0x0, 0x18(%rsi)
movl $0x1, %edx
je 0x4526e
movl 0x68(%rbx), %edx
addl %r14d, %edx
testq %r12, %r12
je 0x4529e
cmpl %edx, %r15d
cmovll %r15d, %edx
movzbl 0x6c(%rbx), %ecx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x88(%rbx), %rax
movl (%rax,%r13,4), %ecx
cmpl %r15d, %ecx
cmovll %ecx, %r15d
jmp 0x452b6
movzbl 0x6c(%rbx), %ecx
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq 0x88(%rbx), %rax
movl (%rax,%r13,4), %r15d
incq %r12
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
ja 0x45243
movq 0x20(%rbx), %rax
cmpq %rax, 0x28(%rbx)
je 0x45314
xorl %r12d, %r12d
xorl %r13d, %r13d
movq (%rax,%r13,8), %rdi
movq 0x70(%rbx), %rax
movq (%rax,%r12), %rax
movq 0x8(%rax,%r14,8), %rsi
callq 0x191f2
incq %r13
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
addq $0x18, %r12
cmpq %r13, %rcx
ja 0x452e3
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x10(%rbx), %rax
movl 0x8(%rax), %ebp
movl 0xc(%rax), %r12d
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x45340
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
incq %r14
cmpl %r12d, %ebp
jl 0x45050
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4536c
jmp 0x4536c
jmp 0x4536c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x45386
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620