// File: Luthaf[P]zeopp/networkaccessibility.cc
// Function: AccessibilityClassNINF::segmentPoresBasedOnRadius(double)
void AccessibilityClassNINF::segmentPoresBasedOnRadius(double seg_r){

 if(alreadySegmentedFlag == false || seg_r<=r_probe)
   {
   cerr << "This function requires initial segmnetation (use new accessibility class(NINF))\n"
        << "the source has most likely bugs. Contact the source code provider.\n"
        << "Also segmenting r needs to be larger than one used for inital segmentation\n";
   abort();
   } else
   { // everything seems OK; proceed with segmentation

   VORONOI_NETWORK localVorNet = vornet;
   std::vector<bool> localAccessInfo;

   std::vector<PORE> segments;

   PORE::findChannelsAndPockets(&localVorNet, seg_r, &localAccessInfo, &segments);

   segmentMapping.resize(localAccessInfo.size(),-1);
   n_segments = 0; // number of segments
   for(unsigned int i = 0; i < segments.size(); i++)
      {
      for(unsigned int j = 0; j < segments[i].nodes.size(); j++)
        {
        segmentMapping[segments[i].reverseIDMappings.find(j)->second] = n_segments;
        };
      n_segments++;
     };

   segments.clear();

   }; // ends else{

 cout << "Additional segmentation: n_segments = " << n_segments << "\n";

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movb 0x18d(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0xffec9
movq -0xf8(%rbp), %rax
movsd -0x10(%rbp), %xmm1
movsd 0x138(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0xffeff
movq 0x173120(%rip), %rdi    # 0x272ff0
leaq 0xfcd51(%rip), %rsi     # 0x1fcc28
callq 0x5540
movq %rax, %rdi
leaq 0xfcd93(%rip), %rsi     # 0x1fcc79
callq 0x5540
movq %rax, %rdi
leaq 0xfcdc8(%rip), %rsi     # 0x1fccbd
callq 0x5540
callq 0x52b0
movq -0xf8(%rbp), %rsi
addq $0x18, %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x99cc0
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xf670
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x10210
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
movsd -0x10(%rbp), %xmm0
callq 0xc6740
jmp 0xfff64
movq -0xf8(%rbp), %rax
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x118(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x27d50
movq -0x118(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, -0xd8(%rbp) # imm = 0xFFFFFFFF
leaq -0xd8(%rbp), %rdx
callq 0x84b00
jmp 0xfffa6
movq -0xf8(%rbp), %rax
movl $0x0, 0x190(%rax)
movl $0x0, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
movq %rax, -0x120(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x10230
movq %rax, %rcx
movq -0x120(%rbp), %rax
cmpq %rcx, %rax
jae 0x10013e
movl $0x0, -0xe0(%rbp)
movl -0xe0(%rbp), %eax
movq %rax, -0x128(%rbp)
movl -0xdc(%rbp), %eax
movl %eax, %esi
leaq -0xc8(%rbp), %rdi
callq 0x10260
movq %rax, %rdi
addq $0x60, %rdi
callq 0x10100
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
jae 0x100114
movq -0xf8(%rbp), %rax
movl 0x190(%rax), %ecx
movl %ecx, -0x13c(%rbp)
addq $0x198, %rax            # imm = 0x198
movq %rax, -0x138(%rbp)
movl -0xdc(%rbp), %eax
movl %eax, %esi
leaq -0xc8(%rbp), %rdi
callq 0x10260
movq %rax, %rdi
addq $0x30, %rdi
movl -0xe0(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0xec(%rbp), %rsi
callq 0x102e0
movq %rax, -0x130(%rbp)
jmp 0x100093
movq -0x130(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x10350
movq -0x138(%rbp), %rdi
movslq 0x4(%rax), %rsi
callq 0xed60
movl -0x13c(%rbp), %ecx
movl %ecx, (%rax)
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0xffff7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x10520
leaq -0xb0(%rbp), %rdi
callq 0xf9b0
leaq -0x88(%rbp), %rdi
callq 0xf8a0
jmp 0x1001ae
movq -0xf8(%rbp), %rax
movl 0x190(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x190(%rax)
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0xfffc1
leaq -0xc8(%rbp), %rdi
callq 0xce2d0
leaq -0xc8(%rbp), %rdi
callq 0x10520
leaq -0xb0(%rbp), %rdi
callq 0xf9b0
leaq -0x88(%rbp), %rdi
callq 0xf8a0
movq 0x172e4b(%rip), %rdi    # 0x272fc0
leaq 0xfcb8d(%rip), %rsi     # 0x1fcd09
callq 0x5540
movq %rax, %rdi
movq -0xf8(%rbp), %rax
movl 0x190(%rax), %esi
callq 0x58d0
movq %rax, %rdi
leaq 0xf9485(%rip), %rsi     # 0x1f9625
callq 0x5540
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0xd0(%rbp), %rdi
callq 0x58f0
nopw (%rax,%rax)