// File: /workspace/github_cpp_makefile_star2_O3/Kei18[P]pibt/./src/problem/imapf.cpp
// Function: IMAPF::update()
void IMAPF::update() {
  ++timestep;

  for (auto a : A) {
    auto tau = a->getTask();
    if (tau) {
      tau->update(a->getNode());

      if (tau->completed()) {
        ++taskSum;
        tau->setEndTime(timestep);
        a->releaseTask();
        openToClose(tau, T_OPEN, T_CLOSE);
        allocate(a);
        a->goalUpdated(true);
      } else {
        a->goalUpdated(false);
      }
    } else {
      allocate(a);
    }
    a->updateHist();
  }

  taskSumStr += std::to_string(taskSum) + ",";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
incl 0x8(%rdi)
movq 0x18(%rdi), %r14
movq 0x20(%rdi), %r15
cmpq %r15, %r14
je 0x22048
leaq 0x48(%rbx), %rax
movq %rax, 0x20(%rsp)
movq (%r14), %r12
movq 0x18(%r12), %r13
testq %r13, %r13
je 0x21fd9
movq 0x8(%r12), %rsi
movq %r13, %rdi
callq 0x47282
movq %r13, %rdi
callq 0x47302
testb %al, %al
je 0x21fe6
incl 0x90(%rbx)
movl 0x8(%rbx), %esi
movq %r13, %rdi
callq 0x4730e
movq %r12, %rdi
callq 0x19392
movq %r13, (%rsp)
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rsi
movq %rsp, %rdx
callq 0x22864
cmpq 0x38(%rbx), %rax
je 0x22022
movq %rax, %r13
movq %rax, %rbp
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x21fee
movq (%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x50(%rbx)
jmp 0x21ffb
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21d76
jmp 0x22033
movb $0x0, 0x38(%r12)
jmp 0x22033
movq 0x20(%rsp), %rdi
movq %rbp, %rdx
callq 0x19048
addq $0x8, %r13
movq 0x38(%rbx), %rdx
cmpq %rdx, %r13
je 0x2201a
subq %r13, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x65b0
movq 0x38(%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, 0x38(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21d76
movb $0x1, 0x38(%r12)
movq %r12, %rdi
callq 0x19340
addq $0x8, %r14
cmpq %r15, %r14
jne 0x21f62
movl 0x90(%rbx), %r13d
movl %r13d, %ebp
negl %ebp
cmovsl %r13d, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x220ac
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x220a3
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x220a9
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x220ac
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x22070
addl $-0x3, %r14d
jmp 0x220ac
addl $-0x2, %r14d
jmp 0x220ac
decl %r14d
shrl $0x1f, %r13d
movl %r13d, %esi
addl %r14d, %esi
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
movl $0x2d, %edx
callq 0x6410
movq (%r15), %rdi
addq %r13, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xb7a2
leaq 0x273e7(%rip), %rsi     # 0x494d0
movq %r15, %rdi
callq 0x6690
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x22117
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x22121
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq $0xb0, %rbx
movq %rbx, %rdi
callq 0x6120
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x2215e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6380
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x22175
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6380
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x221a2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6380
jmp 0x221a2
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x221b9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620
nop