// File: /workspace/github_cpp_makefile_star2_O1/Kei18[P]pibt/./src/solver/pps.cpp
// Function: PPS::SETUP_SWAP(Agent*, Agent*)
void PPS::SETUP_SWAP(Agent* c, Agent* a) {
  // error check
  if (deg3nodes.size() == 0) {
    std::cout << "error@PPS::SETUP_SWAP, graph does not have esv" << "\n";
    std::exit(1);
  }

  Nodes sorted_esv = getSortedEsv(c);  // l.14
  Node* v = sorted_esv[0];
  Agents agents;
  if (pathDist(c->getNode(), v) <= pathDist(a->getNode(), v)) {
    agents = {c, a};
  } else {
    agents = {a, c};
  }

  S* s = new S { s_uuid,
                 agents,  // [near (high), far (low)]
                 a->getNode(),  // [low] original pos
                 sorted_esv,
                 nullptr,  // target
                 nullptr,  // origin
                 nullptr,  // evacH
                 nullptr,  // evacL
                 {},       // area
                 SWAPPHASE::GO_TARGET };
  ++s_uuid;

  pusherToSwaper.push_back(c);
  pusherToSwaper.push_back(a);
  swapers.push_back(s);

  SWAP(s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, 0x8(%rsp)
movq %rdx, (%rsp)
movq 0x190(%rdi), %rcx
cmpq 0x188(%rdi), %rcx
je 0x3b8f5
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3d036
movq (%r14), %rax
movq (%rax), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3f248
movl %eax, %ebp
movq (%rsp), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x3f248
cmpl %eax, %ebp
jle 0x3b78f
movq (%rsp), %rax
leaq 0x20(%rsp), %rdx
movq %rax, -0x10(%rdx)
movq 0x8(%rsp), %rax
movq %rax, -0x8(%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3ddf8
jmp 0x3b7b4
movq 0x8(%rsp), %rax
leaq 0x20(%rsp), %rdx
movq %rax, -0x10(%rdx)
movq (%rsp), %rax
movq %rax, -0x8(%rdx)
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3ddf8
movl $0x80, %edi
callq 0x6370
movq %rax, %r14
movl 0x27029(%rip), %eax     # 0x627f0
movl %eax, (%r14)
leaq 0x8(%r14), %r15
leaq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0xb51c
movq (%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%r14)
movq %r14, %rdi
addq $0x28, %rdi
leaq 0x40(%rsp), %rsi
callq 0x19a68
xorps %xmm0, %xmm0
movups %xmm0, 0x6c(%r14)
movaps %xmm0, 0x60(%r14)
movaps %xmm0, 0x50(%r14)
movaps %xmm0, 0x40(%r14)
movq %r14, 0x10(%rsp)
incl 0x26fd6(%rip)           # 0x627f0
leaq 0x98(%rbx), %r14
movq 0xa0(%rbx), %rsi
cmpq 0xa8(%rbx), %rsi
je 0x3b843
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0xa0(%rbx)
jmp 0x3b850
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x18edc
movq 0xa0(%rbx), %rsi
cmpq 0xa8(%rbx), %rsi
je 0x3b871
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0xa0(%rbx)
jmp 0x3b87c
movq %rsp, %rdx
movq %r14, %rdi
callq 0x18edc
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x3b89e
movq 0x10(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, 0x88(%rbx)
jmp 0x3b8af
leaq 0x80(%rbx), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3def0
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x399f0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3b8d3
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x3b8ea
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x266ac(%rip), %rdi     # 0x61fa8
leaq 0xfcd3(%rip), %rsi      # 0x4b5d6
callq 0x6360
leaq 0xcc54(%rip), %rsi      # 0x48563
movq %rax, %rdi
callq 0x6360
movl $0x1, %edi
callq 0x6440
jmp 0x3b952
jmp 0x3b952
movq %rax, %rbx
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3b941
movq 0x18(%r14), %rsi
subq %rdi, %rsi
callq 0x6380
jmp 0x3b941
movq %rax, %rbx
movl $0x80, %esi
movq %r14, %rdi
callq 0x6380
jmp 0x3b955
jmp 0x3b952
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x3b96c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x3b983
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq %rbx, %rdi
callq 0x6620
nop