// File: Kei18[P]pibt/./src/solver/tp.cpp
// Function: TP::updatePath1(Agent*, int)
void TP::updatePath1(Agent* a, int startTime) {
  auto itr = std::find(A.begin(), A.end(), a);
  int i = std::distance(A.begin(), itr);

  Nodes gs = a->getTask()->getG();
  a->setGoal(gs[gs.size() - 1]);  // delivery point

  Nodes p;
  Nodes path = { a->getNode() };

  if (gs.size() == 2) {
    path = getPickDelivPath(a, a->getNode(), gs[0], gs[1], startTime, true);
  } else if (gs.size() == 1) {
    path = getPath(a, a->getNode(), gs[0], startTime, gs[0]);
  }

  paths[i].insert(paths[i].end(), path.begin() + 1, path.end());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
addq $0x20, %rdi
movq %rdi, -0x138(%rbp)
callq 0x39b60
movq -0x138(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x399f0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0x8be30
movq -0x138(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x39b60
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x62750
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
callq 0x51c90
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x51d30
movq -0x130(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
callq 0x3b0e0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0xda90
movq -0x128(%rbp), %rdi
movq (%rax), %rsi
callq 0x51d10
jmp 0xa13b8
leaq -0x88(%rbp), %rdi
callq 0x3e880
movq -0x10(%rbp), %rdi
callq 0x51cb0
movq %rax, -0x148(%rbp)
jmp 0xa13d6
movq -0x148(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0x1, -0xa8(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xd730
movq -0x150(%rbp), %rcx
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xd750
jmp 0xa1433
leaq -0xb9(%rbp), %rdi
callq 0xd830
leaq -0x60(%rbp), %rdi
callq 0x3b0e0
cmpq $0x2, %rax
jne 0xa1556
movq -0x10(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x51cb0
movq %rax, -0x158(%rbp)
jmp 0xa146b
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xda90
movq -0x170(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x168(%rbp)
movl $0x1, %esi
callq 0xda90
movq -0x140(%rbp), %rsi
movq -0x160(%rbp), %rdx
movq -0x158(%rbp), %rcx
movq -0x168(%rbp), %r8
movq (%rax), %r9
movl -0x14(%rbp), %edi
movq %rsp, %rax
movl %edi, (%rax)
movl $0x1, 0x8(%rax)
leaq -0xd8(%rbp), %rdi
callq 0xa1e90
jmp 0xa14d6
leaq -0xa0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x3f230
leaq -0xd8(%rbp), %rdi
callq 0xd7d0
jmp 0xa1626
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xa1730
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xa1724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0xd830
jmp 0xa1724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xd7d0
jmp 0xa1724
leaq -0x60(%rbp), %rdi
callq 0x3b0e0
cmpq $0x1, %rax
jne 0xa1624
movq -0x10(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x51cb0
movq %rax, -0x178(%rbp)
jmp 0xa1582
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0x198(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xda90
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rsi
movq (%rax), %rax
movq %rax, -0x190(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x184(%rbp)
callq 0xda90
movq -0x140(%rbp), %rsi
movq -0x180(%rbp), %rdx
movq -0x178(%rbp), %rcx
movq -0x190(%rbp), %r8
movl -0x184(%rbp), %r9d
movq (%rax), %rax
testq %rax, %rax
setne %al
movzbl %al, %edi
movq %rsp, %rax
movl %edi, (%rax)
leaq -0xf0(%rbp), %rdi
callq 0xa2d60
jmp 0xa1605
leaq -0xa0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x3f230
leaq -0xf0(%rbp), %rdi
callq 0xd7d0
jmp 0xa1626
movq -0x140(%rbp), %rdi
addq $0x88, %rdi
movq %rdi, -0x1c0(%rbp)
movslq -0x34(%rbp), %rsi
callq 0xda70
movq -0x1c0(%rbp), %rdi
movq %rax, -0x1b0(%rbp)
movslq -0x34(%rbp), %rsi
callq 0xda70
movq %rax, %rdi
callq 0x3b760
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x3f680
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x3b730
movq %rax, -0x110(%rbp)
leaq -0x110(%rbp), %rdi
movl $0x1, %esi
callq 0x413f0
movq -0x1b8(%rbp), %rdi
movq %rax, -0x108(%rbp)
callq 0x3b760
movq -0x1b0(%rbp), %rdi
movq %rax, -0x118(%rbp)
movq -0xf8(%rbp), %rsi
movq -0x108(%rbp), %rdx
movq -0x118(%rbp), %rcx
callq 0xa54a0
movq %rax, -0x1a8(%rbp)
jmp 0xa16ec
movq -0x1a8(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xd7d0
leaq -0x88(%rbp), %rdi
callq 0xd7d0
leaq -0x60(%rbp), %rdi
callq 0xd7d0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x88(%rbp), %rdi
callq 0xd7d0
leaq -0x60(%rbp), %rdi
callq 0xd7d0
movq -0x68(%rbp), %rdi
callq 0x8880
nopw %cs:(%rax,%rax)