// File: redpony[P]cpyp/./cpyp/msparse_vector.h
// Function: cpyp::SparseVector<unsigned int, 15u>::swap_local_rbmap()
void swap_local_rbmap() {
    if (is_remote_) { // data is in rbmap, move to local
      assert(data_.rbmap->size() < LOCAL_MAX);
      const std::unordered_map<unsigned, T>* m = data_.rbmap;
      local_size_ = m->size();
      int i = 0;
      for (typename std::unordered_map<unsigned, T>::const_iterator it = m->begin();
           it != m->end(); ++it) {
        data_.local[i] = *it;
        ++i;
      }
      is_remote_ = false;
    } else { // data is local, move to rbmap
      std::unordered_map<unsigned, T>* m = new std::unordered_map<unsigned, T>(
         reinterpret_cast<std::pair<unsigned, T>*>(&data_.local[0]),
         reinterpret_cast<std::pair<unsigned, T>*>(&data_.local[local_size_]), local_size_ * 1.5 + 1);
      data_.rbmap = m;
      is_remote_ = true;
    }
  }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x38(%rsp)
testb $0x1, 0x79(%rax)
je 0xe15f
movq 0x38(%rsp), %rax
movq (%rax), %rdi
callq 0xee40
cmpq $0xf, %rax
jae 0xe09b
jmp 0xe0ba
leaq 0x7875(%rip), %rdi      # 0x15917
leaq 0x77ee(%rip), %rsi      # 0x15897
movl $0x1b9, %edx            # imm = 0x1B9
leaq 0x7882(%rip), %rcx      # 0x15937
callq 0x20e0
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0xee40
movq %rax, %rcx
movq 0x38(%rsp), %rax
movb %cl, 0x78(%rax)
movl $0x0, 0x74(%rsp)
movq 0x78(%rsp), %rdi
callq 0xee50
movq %rax, 0x68(%rsp)
movq 0x78(%rsp), %rdi
callq 0xeea0
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xee80
testb $0x1, %al
jne 0xe117
jmp 0xe151
leaq 0x68(%rsp), %rdi
callq 0xb1c0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movslq 0x74(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rdi
callq 0xeed0
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xb1e0
jmp 0xe0f3
movq 0x38(%rsp), %rax
movb $0x0, 0x79(%rax)
jmp 0xe26b
movl $0x38, %edi
callq 0x2190
movq 0x38(%rsp), %rcx
movq %rax, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movb $0x1, 0x43(%rsp)
movzbl 0x78(%rcx), %eax
movl %eax, %edx
leaq (%rcx,%rdx,8), %rcx
movq %rcx, 0x28(%rsp)
cvtsi2sd %eax, %xmm0
movsd 0x6ed0(%rip), %xmm1     # 0x15068
mulsd %xmm1, %xmm0
movsd 0x6e6c(%rip), %xmm1     # 0x15010
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x6eb1(%rip), %xmm1     # 0x15070
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x30(%rsp)
leaq 0x55(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xeef0
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rcx
movq %rsp, %rax
movq %r8, (%rax)
leaq 0x57(%rsp), %r8
leaq 0x56(%rsp), %r9
callq 0xef00
jmp 0xe212
movb $0x0, 0x43(%rsp)
leaq 0x55(%rsp), %rdi
callq 0xef60
movq 0x10(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq 0x58(%rsp), %rcx
movq %rcx, (%rax)
movb $0x1, 0x79(%rax)
jmp 0xe26b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x55(%rsp), %rdi
callq 0xef60
testb $0x1, 0x43(%rsp)
jne 0xe25f
jmp 0xe269
movq 0x10(%rsp), %rdi
callq 0x2170
jmp 0xe273
addq $0x88, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x2260
nopl (%rax)