// File: 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 %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x128(%rbp)
movq (%rdi), %rax
movq 0x20(%rax), %rax
callq *%rax
movq -0x128(%rbp), %rdi
addq $0x98, %rdi
callq 0x8bb40
movq %rax, -0x120(%rbp)
leaq -0x21(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x8bb60
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0x20(%rbp), %rdi
callq 0x8bb80
jmp 0x89736
leaq -0x21(%rbp), %rdi
callq 0x8bbf0
movq -0x128(%rbp), %rdi
addq $0x98, %rdi
movq %rdi, -0x138(%rbp)
callq 0x8bc80
movq -0x138(%rbp), %rdi
movq %rax, -0x40(%rbp)
callq 0x8bcb0
movq %rax, -0x48(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8bc80
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x8bc10
movq %rax, -0x130(%rbp)
jmp 0x89794
movq -0x130(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3e880
movq -0x128(%rbp), %rdi
addq $0x20, %rdi
callq 0x383b0
movq %rax, -0x148(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xe6e0
movq -0x148(%rbp), %rsi
movq -0x140(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x8bce0
jmp 0x897ee
leaq -0x89(%rbp), %rdi
callq 0x38470
movq -0x128(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x158(%rbp)
callq 0x39b60
movq -0x158(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x399f0
movq %rax, -0xa0(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x39b60
movq %rax, -0xa8(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
callq 0x67ee0
movq %rax, -0x150(%rbp)
jmp 0x89861
movq -0x150(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x20(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x8bc80
movq -0x168(%rbp), %rdi
movq %rax, -0xc0(%rbp)
callq 0x8bcb0
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rdi
movq -0xc8(%rbp), %rsi
callq 0x8bd50
movq %rax, -0x160(%rbp)
jmp 0x898b5
movq -0x160(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8bc80
movq %rax, -0xd8(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x8bd90
movq %rax, -0x170(%rbp)
jmp 0x898fd
movq -0x170(%rbp), %rax
movl %eax, -0xcc(%rbp)
movslq -0xcc(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x53720
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8bdd0
xorb $-0x1, %al
testb $0x1, %al
jne 0x8993e
jmp 0x89a86
movq -0x128(%rbp), %rdi
movq -0xe8(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0x88(%rbp), %rcx
leaq -0x20(%rbp), %r8
callq 0x89ad0
jmp 0x89962
leaq -0x20(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x8bc80
movq -0x180(%rbp), %rdi
movq %rax, -0xf8(%rbp)
callq 0x8bcb0
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0x8bd50
movq %rax, -0x178(%rbp)
jmp 0x899a8
movq -0x178(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x8bc80
movq %rax, -0x108(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x8bd90
movq %rax, -0x188(%rbp)
jmp 0x899fe
movq -0x188(%rbp), %rax
movl %eax, -0xcc(%rbp)
movslq -0xcc(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x53720
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
jmp 0x89927
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x21(%rbp), %rdi
callq 0x8bbf0
jmp 0x89abf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x89ab6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x38470
jmp 0x89aad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xddf0
jmp 0x89aad
leaq -0x88(%rbp), %rdi
callq 0xddf0
leaq -0x70(%rbp), %rdi
callq 0xd7d0
leaq -0x20(%rbp), %rdi
callq 0x8ba60
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0xd7d0
leaq -0x20(%rbp), %rdi
callq 0x8ba60
movq -0x30(%rbp), %rdi
callq 0x8880
nopl (%rax,%rax)