// File: Kei18[P]pibt/./src/solver/tp.cpp
// Function: TP::update()
void TP::update() {
  Agent* a;
  Node* v;
  Task* tau;
  std::vector<Task*> tasks;

  for (int i = 0; i < A.size(); ++i) {
    a = A[i];

    if (paths[i].size() <= timestep) {
      v = a->getNode();
      tasks = getExecutableTask(a, timestep);  // l.7

      if (!tasks.empty()) {  // l.8
        tau = getNearestTask(a, tasks);  // l.9

        a->setTask(tau);  // l.10
        P->assign(tau);   // l.11
        if (tau->getG()[0] == a->getNode()) {  // when current place is pickup node
          tau->update(a->getNode());
        }

        updatePath1(a, timestep);  // l.12
      } else if (!shouldAvoid(a, timestep)) {  // l.13
        paths[i].push_back(v);  // l.14
      } else {
        updatePath2(a, timestep);  // l.16
      }
    }

    a->setNode(paths[i][timestep]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xdb20
movl $0x0, -0x3c(%rbp)
movq -0x88(%rbp), %rdi
movslq -0x3c(%rbp), %rax
movq %rax, -0x90(%rbp)
addq $0x20, %rdi
callq 0x383b0
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0xa0e59
movq -0x88(%rbp), %rdi
addq $0x20, %rdi
movslq -0x3c(%rbp), %rsi
callq 0x53720
movq -0x88(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x10(%rbp)
addq $0x88, %rdi
movslq -0x3c(%rbp), %rsi
callq 0xda70
movq %rax, %rdi
callq 0x3b0e0
movq -0x88(%rbp), %rcx
movslq 0x68(%rcx), %rcx
cmpq %rcx, %rax
ja 0xa0e03
movq -0x10(%rbp), %rdi
callq 0x51cb0
movq %rax, -0x98(%rbp)
jmp 0xa0c38
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdx
movl 0x68(%rsi), %ecx
leaq -0x68(%rbp), %rdi
callq 0xa0e80
jmp 0xa0c5c
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa5470
leaq -0x68(%rbp), %rdi
callq 0xdd90
leaq -0x38(%rbp), %rdi
callq 0x55570
testb $0x1, %al
jne 0xa0d9a
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa1210
movq %rax, -0xa0(%rbp)
jmp 0xa0ca0
movq -0xa0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x51cf0
jmp 0xa0cba
movq -0x88(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x57630
jmp 0xa0cd0
movq -0x20(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x51d30
jmp 0xa0cdf
xorl %eax, %eax
movl %eax, %esi
leaq -0x80(%rbp), %rdi
callq 0xda90
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x51cb0
movq %rax, -0xa8(%rbp)
jmp 0xa0d08
leaq -0x80(%rbp), %rdi
callq 0xd7d0
movq -0xa8(%rbp), %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jne 0xa0d83
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x51cb0
movq %rax, -0xb8(%rbp)
jmp 0xa0d41
movq -0xb8(%rbp), %rsi
movq -0xc0(%rbp), %rdi
callq 0xb1a70
jmp 0xa0d56
jmp 0xa0d83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xa0e6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xd7d0
jmp 0xa0e6b
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl 0x68(%rdi), %edx
callq 0xa12e0
jmp 0xa0d98
jmp 0xa0e01
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl 0x68(%rdi), %edx
callq 0xa1750
movb %al, -0xc1(%rbp)
jmp 0xa0db5
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0xa0de8
jmp 0xa0dc1
movq -0x88(%rbp), %rdi
addq $0x88, %rdi
movslq -0x3c(%rbp), %rsi
callq 0xda70
movq %rax, %rdi
leaq -0x18(%rbp), %rsi
callq 0x3f490
jmp 0xa0de6
jmp 0xa0dff
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl 0x68(%rdi), %edx
callq 0xa18e0
jmp 0xa0dfd
jmp 0xa0dff
jmp 0xa0e01
jmp 0xa0e03
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
addq $0x88, %rdi
movslq -0x3c(%rbp), %rsi
callq 0xda70
movq %rax, %rdi
movq -0x88(%rbp), %rax
movslq 0x68(%rax), %rsi
callq 0xda90
movq -0xd0(%rbp), %rdi
movq (%rax), %rsi
callq 0x3a480
jmp 0xa0e49
jmp 0xa0e4b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xa0baa
leaq -0x38(%rbp), %rdi
callq 0xdd90
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0xdd90
movq -0x48(%rbp), %rdi
callq 0x8880
nopl (%rax)