// File: /workspace/github_cpp_makefile_star2_O3/Kei18[P]pibt/./src/solver/pibt.cpp
// Function: PIBT::update()
void PIBT::update() {
  updatePriority();

  std::vector<float> PL(priority.size());  // priority list
  std::copy(priority.begin(), priority.end(), PL.begin());

  Nodes CLOSE_NODE;
  Agents OPEN_AGENT(A.size());
  std::copy(A.begin(), A.end(), OPEN_AGENT.begin());

  // choose one agent with the highest priority
  auto itr = std::max_element(PL.begin(), PL.end());
  int index = std::distance(PL.begin(), itr);
  Agent* a = OPEN_AGENT[index];

  while (!OPEN_AGENT.empty()) {
    priorityInheritance(a, CLOSE_NODE, OPEN_AGENT, PL);

    itr = std::max_element(PL.begin(), PL.end());
    index = std::distance(PL.begin(), itr);
    a = OPEN_AGENT[index];
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x20(%rax)
movq 0xa0(%rbx), %rsi
subq 0x98(%rbx), %rsi
sarq $0x2, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
callq 0x3867c
movq 0x98(%rbx), %rsi
movq 0xa0(%rbx), %rdx
subq %rsi, %rdx
je 0x37678
movq 0x10(%rsp), %rdi
callq 0x65b0
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x28(%rbx), %rsi
subq 0x20(%rbx), %rsi
sarq $0x3, %rsi
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x38708
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
subq %rsi, %rdx
je 0x376bb
movq 0x28(%rsp), %rdi
callq 0x65b0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
cmpq %rdx, %rax
sete %cl
leaq 0x4(%rax), %rsi
cmpq %rdx, %rsi
sete %dil
orb %cl, %dil
je 0x376e0
movq %rax, %rcx
jmp 0x37702
movss (%rax), %xmm0
movq %rax, %rcx
movss (%rsi), %xmm1
ucomiss %xmm0, %xmm1
cmovaq %rsi, %rcx
maxss %xmm0, %xmm1
addq $0x4, %rsi
movaps %xmm1, %xmm0
cmpq %rdx, %rsi
jne 0x376e7
movq 0x28(%rsp), %rdi
cmpq 0x30(%rsp), %rdi
je 0x377a7
subq %rax, %rcx
shlq $0x1e, %rcx
sarq $0x1d, %rcx
addq %rcx, %rdi
leaq 0x40(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %rdi, %rcx
movq (%rcx), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x37848
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rdx
cmpq %rdx, %rax
sete %cl
leaq 0x4(%rax), %rsi
cmpq %rdx, %rsi
sete %dil
orb %cl, %dil
je 0x3776b
movq %rax, %rcx
jmp 0x3778d
movss (%rax), %xmm0
movq %rax, %rcx
movss (%rsi), %xmm1
ucomiss %xmm0, %xmm1
cmovaq %rsi, %rcx
maxss %xmm0, %xmm1
addq $0x4, %rsi
movaps %xmm1, %xmm0
cmpq %rdx, %rsi
jne 0x37772
subq %rax, %rcx
shlq $0x1e, %rcx
movq 0x28(%rsp), %rdi
sarq $0x1d, %rcx
addq %rdi, %rcx
cmpq 0x30(%rsp), %rdi
jne 0x37732
testq %rdi, %rdi
je 0x377b9
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x377d0
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x377e7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x37812
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x37812
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x37829
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x37840
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620