// File: Kei18[P]pibt/./src/solver/pps.cpp
// Function: PPS::FINISH_SWAP(S*)
void PPS::FINISH_SWAP(S* s) {
  // error check
  if (s->agents.size() != 2) {
    std::cout << "error@PPS::FINISH_SWAP, the number of agetns is not two" << "\n";
    std::exit(1);
  }

  // clear L
  auto itrL = std::find(L.begin(), L.end(), s->target);
  L.erase(itrL);
  itrL = std::find(L.begin(), L.end(), s->origin);
  L.erase(itrL);
  itrL = std::find(L.begin(), L.end(), s->evacH);
  L.erase(itrL);
  itrL = std::find(L.begin(), L.end(), s->evacL);
  L.erase(itrL);

  swaperToPusher.push_back(s->agents[0]);
  swaperToPusher.push_back(s->agents[1]);
  doneSwapers.push_back(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x383b0
cmpq $0x2, %rax
je 0x937ad
movq 0x6d810(%rip), %rdi     # 0x100f98
leaq 0x235b0(%rip), %rsi     # 0xb6d3f
callq 0x84d0
movq %rax, %rdi
leaq 0x1fe19(%rip), %rsi     # 0xb35b7
callq 0x84d0
movl $0x1, %edi
callq 0x85d0
movq -0xb8(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x3b730
movq -0xb8(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b760
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdx
addq $0x40, %rdx
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x3b6e0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x18(%rbp)
addq $0x110, %rax            # imm = 0x110
movq %rax, -0xe8(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3f680
movq -0xe8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3f610
movq -0xb8(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b730
movq -0xb8(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b760
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdx
addq $0x48, %rdx
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3b6e0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq %rcx, -0x18(%rbp)
addq $0x110, %rax            # imm = 0x110
movq %rax, -0xe0(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3f680
movq -0xe0(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x3f610
movq -0xb8(%rbp), %rdi
movq %rax, -0x60(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b730
movq -0xb8(%rbp), %rdi
movq %rax, -0x70(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b760
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdx
addq $0x50, %rdx
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x3b6e0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x68(%rbp)
movq -0x68(%rbp), %rcx
movq %rcx, -0x18(%rbp)
addq $0x110, %rax            # imm = 0x110
movq %rax, -0xd8(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3f680
movq -0xd8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x3f610
movq -0xb8(%rbp), %rdi
movq %rax, -0x88(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b730
movq -0xb8(%rbp), %rdi
movq %rax, -0x98(%rbp)
addq $0x110, %rdi            # imm = 0x110
callq 0x3b760
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdx
addq $0x58, %rdx
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x3b6e0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x90(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0x18(%rbp)
addq $0x110, %rax            # imm = 0x110
movq %rax, -0xd0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3f680
movq -0xd0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0x3f610
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0xb0(%rbp)
addq $0xb0, %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x53720
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0xdab0
movq -0xb8(%rbp), %rax
addq $0xb0, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl $0x1, %esi
callq 0x53720
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0xdab0
movq -0xb8(%rbp), %rdi
addq $0xc8, %rdi
leaq -0x10(%rbp), %rsi
callq 0x97000
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)