// File: /workspace/github_cpp_makefile_star2_O1/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 0x388fa
movq 0x98(%rbx), %rsi
movq 0xa0(%rbx), %rdx
subq %rsi, %rdx
je 0x37854
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 0x38984
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
subq %rsi, %rdx
je 0x37897
movq 0x28(%rsp), %rdi
callq 0x65b0
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
sete %sil
leaq 0x4(%rax), %rdx
cmpq %rcx, %rdx
sete %dil
orb %sil, %dil
je 0x378bd
movq %rax, %rsi
jmp 0x378db
movq %rax, %rdi
movss (%rdx), %xmm0
ucomiss (%rdi), %xmm0
movq %rdx, %rsi
ja 0x378cf
movq %rdi, %rsi
addq $0x4, %rdx
movq %rsi, %rdi
cmpq %rcx, %rdx
jne 0x378c0
movq 0x28(%rsp), %rdi
cmpq 0x30(%rsp), %rdi
je 0x3797c
subq %rax, %rsi
shlq $0x1e, %rsi
sarq $0x1d, %rsi
addq %rsi, %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 0x37a1e
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 0x37944
movq %rax, %rcx
jmp 0x37962
movq %rax, %rdi
movss (%rsi), %xmm0
ucomiss (%rdi), %xmm0
movq %rsi, %rcx
ja 0x37956
movq %rdi, %rcx
addq $0x4, %rsi
movq %rcx, %rdi
cmpq %rdx, %rsi
jne 0x37947
subq %rax, %rcx
shlq $0x1e, %rcx
movq 0x28(%rsp), %rdi
sarq $0x1d, %rcx
addq %rdi, %rcx
cmpq 0x30(%rsp), %rdi
jne 0x3790b
testq %rdi, %rdi
je 0x3798e
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x379a5
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x379bc
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 0x379e7
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x379e7
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x379fe
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x37a15
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620
nop