// File: /workspace/github_cpp_makefile_star2_O1/Kei18[P]pibt/./src/solver/pps.cpp
// Function: PPS::update()
void PPS::update() {
  M.clear();  // l.3

  for (auto s : swapers) {  // l.4
    H.clear();
    if (CHECK_SWAPER(s) == CHECK::VALID) {  // check valid s
      if (SWAP(s) == RES::FAIL) {  // l.5
        status = false;
        return;
      }
    }
  }

  for (auto p : A) {  // l.6, push
    H.clear();
    if (CHECK_PUSHER(p) == CHECK::VALID) {
      PUSH(p, false);  // l.8
    }
  }

  // goal check
  for (auto a : A) {
    if (inArray(a, U)) {
      if (CHECK_GOAL(a) == CHECK::INVALID) {
        auto itrU = std::find(U.begin(), U.end(), a);
        U.erase(itrU);
      }
    } else {
      if (CHECK_GOAL(a) == CHECK::VALID) {
        U.push_back(a);  //l.9
      }
    }
  }

  // change pushers & swapers
  for (auto a : pusherToSwaper) {
    auto itr = std::find(pushers.begin(), pushers.end(), a);
    if (itr != pushers.end()) pushers.erase(itr);
  }
  pusherToSwaper.clear();

  for (auto a : swaperToPusher) {
    if (!inS(a)) pushers.push_back(a);  // check other's registration
  }
  swaperToPusher.clear();

  for (auto s : doneSwapers) {
    auto itr = std::find(swapers.begin(), swapers.end(), s);
    swapers.erase(itr);
    delete s;
  }
  doneSwapers.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0xe0(%rdi), %rax
cmpq %rax, 0xe8(%rdi)
je 0x392f8
movq %rax, 0xe8(%rbx)
movq 0x80(%rbx), %r15
movq 0x88(%rbx), %r12
cmpq %r12, %r15
sete %bpl
je 0x3935f
movq (%r15), %r14
movq 0x128(%rbx), %rax
cmpq %rax, 0x130(%rbx)
je 0x39329
movq %rax, 0x130(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x39650
testl %eax, %eax
jne 0x39348
movq %rbx, %rdi
movq %r14, %rsi
callq 0x399f0
cmpl $0x1, %eax
je 0x3934e
addq $0x8, %r15
jmp 0x39306
movb $0x0, 0x140(%rbx)
testb $0x1, %bpl
je 0x39641
movq 0x20(%rbx), %r15
movq 0x28(%rbx), %r12
cmpq %r12, %r15
je 0x393a8
movq (%r15), %r14
movq 0x128(%rbx), %rax
cmpq %rax, 0x130(%rbx)
je 0x39386
movq %rax, 0x130(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x39d90
testl %eax, %eax
jne 0x393a2
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x39dea
addq $0x8, %r15
jmp 0x39367
movq 0x20(%rbx), %r13
movq 0x28(%rbx), %rbp
cmpq %rbp, %r13
je 0x39482
leaq 0xf8(%rbx), %r14
leaq 0x8(%rsp), %r15
leaq 0x10(%rsp), %r12
movq (%r13), %rax
movq %rax, 0x10(%rsp)
movq %rax, 0x8(%rsp)
movq 0xf8(%rbx), %rdi
movq 0x100(%rbx), %rsi
movq %r15, %rdx
callq 0x38b4d
movq 0x100(%rbx), %rsi
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rdx
movslq (%rcx), %rdi
cmpq %rsi, %rax
je 0x39447
movq 0x148(%rbx), %rax
cmpq (%rax,%rdi,8), %rdx
je 0x39475
movq 0xf8(%rbx), %rdi
movq %r12, %rdx
callq 0x38b4d
leaq 0x8(%rax), %rsi
movq 0x100(%rbx), %rdx
cmpq %rdx, %rsi
je 0x3943d
subq %rsi, %rdx
movq %rax, %rdi
callq 0x65b0
addq $-0x8, 0x100(%rbx)
jmp 0x39475
movq 0x148(%rbx), %rax
cmpq (%rax,%rdi,8), %rdx
jne 0x39475
cmpq 0x108(%rbx), %rsi
je 0x3946a
movq %rcx, (%rsi)
addq $0x8, 0x100(%rbx)
jmp 0x39475
movq %r14, %rdi
movq %r12, %rdx
callq 0x18edc
addq $0x8, %r13
cmpq %rbp, %r13
jne 0x393ca
movq 0x98(%rbx), %r15
movq 0xa0(%rbx), %r12
cmpq %r12, %r15
je 0x394dd
leaq 0x8(%rsp), %r14
movq (%r15), %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rbx), %rdi
movq 0x70(%rbx), %rsi
movq %r14, %rdx
callq 0x38b4d
movq 0x70(%rbx), %rdx
cmpq %rdx, %rax
je 0x394d4
leaq 0x8(%rax), %rsi
cmpq %rdx, %rsi
je 0x394cf
subq %rsi, %rdx
movq %rax, %rdi
callq 0x65b0
addq $-0x8, 0x70(%rbx)
addq $0x8, %r15
cmpq %r12, %r15
jne 0x3949a
movq 0x98(%rbx), %rax
cmpq %rax, 0xa0(%rbx)
je 0x394f4
movq %rax, 0xa0(%rbx)
movq 0xb0(%rbx), %r12
movq 0xb8(%rbx), %r13
cmpq %r13, %r12
je 0x39552
leaq 0x68(%rbx), %r14
leaq 0x8(%rsp), %r15
movq (%r12), %rsi
movq %rsi, 0x8(%rsp)
movq %rbx, %rdi
callq 0x39e60
testb %al, %al
jne 0x39549
movq 0x70(%rbx), %rsi
cmpq 0x78(%rbx), %rsi
je 0x3953e
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x70(%rbx)
jmp 0x39549
movq %r14, %rdi
movq %r15, %rdx
callq 0x18edc
addq $0x8, %r12
cmpq %r13, %r12
jne 0x39510
movq 0xb0(%rbx), %rax
cmpq %rax, 0xb8(%rbx)
je 0x39569
movq %rax, 0xb8(%rbx)
movq 0xc8(%rbx), %r12
movq 0xd0(%rbx), %r13
cmpq %r13, %r12
je 0x3962a
leaq 0x8(%rsp), %r14
movq (%r12), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rbx), %rdi
movq 0x88(%rbx), %rsi
movq %r14, %rdx
callq 0x3dd58
leaq 0x8(%rax), %rsi
movq 0x88(%rbx), %rdx
cmpq %rdx, %rsi
je 0x395bf
subq %rsi, %rdx
movq %rax, %rdi
callq 0x65b0
addq $-0x8, 0x88(%rbx)
movq 0x8(%rsp), %r15
testq %r15, %r15
je 0x3961d
movq 0x60(%r15), %rdi
testq %rdi, %rdi
je 0x395e6
movq 0x70(%r15), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x395fb
movq 0x38(%r15), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x39610
movq 0x18(%r15), %rsi
subq %rdi, %rsi
callq 0x6380
movl $0x80, %esi
movq %r15, %rdi
callq 0x6380
addq $0x8, %r12
cmpq %r13, %r12
jne 0x39585
movq 0xc8(%rbx), %rax
cmpq %rax, 0xd0(%rbx)
je 0x39641
movq %rax, 0xd0(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq