// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/feature.cc
// Function: FEATURE::segment_identify_connections_recurr(std::vector<int, std::allocator<int>>*, std::vector<int, std::allocator<int>>*, int*, int, int, std::vector<SEGCONN, std::allocator<SEGCONN>>*, int)
void FEATURE::segment_identify_connections_recurr(vector <int> *nodeid,vector <int> *edgeinface,int *nodes_togo,int curr_face,int curr_neigh_seg, vector <SEGCONN> *edges,int curr_edge)
{
int i;
// check node at current edge, if not assigned to face, assign, consider its neighbors


for(i=0;i<(int)edges->size();i++)
   {
   if(i!=curr_edge&&edgeinface->at(i)==-1) // only consider if not yet assigned to face
     {
     //only consider pairs of edges that connect to the same segment 
     if(curr_neigh_seg==edges->at(i).to_seg&&edges->at(curr_edge).deltaPos.equals(edges->at(i).deltaPos))
       {
       // for two edges connecting to another segment, two edges are on the same face
       // only if starting nodes of this face overlap
//       int node1id=nodeid->at(edges->at(curr_edge).from);
//       int node2id=nodeid->at(edges->at(i).from);

//       int node1id=(edges->at(curr_edge).from);
//       int node2id=(edges->at(i).from);

//       if(nodes[node1id].max_radius+nodes[node2id].max_radius>calcEuclideanDistance(nodes[node1id].x,nodes[node1id].y,nodes[node1id].z,nodes[node2id].x,nodes[node2id].y,nodes[node2id].z))
          { // starting nodes of edges overlap, assign edge to the current face
          edgeinface->at(i)=curr_face;
          *nodes_togo=(*nodes_togo)--;
          segment_identify_connections_recurr(nodeid,edgeinface,nodes_togo,curr_face,curr_neigh_seg,edges,i);
          };


       }; // end of if - overlapping nodes

     }; // end of if - the same segments
   }; // end of loop over all edges



}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdx, %r15
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movq 0x70(%rsp), %r13
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdi, %rdx
testl %edx, %edx
jle 0x7c2bf
movl 0x78(%rsp), %eax
cltq
movl %eax, %r12d
movl $0xb, %ebx
xorl %r14d, %r14d
movq %rax, 0x10(%rsp)
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq %rax, 0x30(%rsp)
cmpq %r14, %r12
je 0x7c299
movq (%r15), %rsi
movq 0x8(%r15), %rax
subq %rsi, %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x7c2ce
cmpl $-0x1, (%rsi,%r14,4)
jne 0x7c299
cmpq %r14, %rdx
jbe 0x7c2dd
cmpl %r9d, -0x20(%rcx,%rbx,4)
jne 0x7c299
cmpq 0x10(%rsp), %rdx
jbe 0x7c2e9
movl %r9d, %ebp
movq 0x30(%rsp), %rax
leaq (%rcx,%rax), %rdi
addq $0x24, %rdi
movq -0x8(%rcx,%rbx,4), %rsi
movl (%rcx,%rbx,4), %edx
callq 0x506ba
testb %al, %al
movl %ebp, %r9d
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
je 0x7c299
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r14, %rdx
jbe 0x7c2dd
movl 0xc(%rsp), %r8d
movl %r8d, (%rax,%r14,4)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
movq 0x28(%rsp), %rcx
movl %ebp, %r9d
pushq %r14
pushq %r13
callq 0x7c164
movl %ebp, %r9d
addq $0x10, %rsp
movabsq $-0x5555555555555555, %rdi # imm = 0xAAAAAAAAAAAAAAAB
incq %r14
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
sarq $0x4, %rdx
imulq %rdi, %rdx
movslq %edx, %rax
addq $0xc, %rbx
cmpq %rax, %r14
jl 0x7c1d6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd1420(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
movq %rax, %rdx
jmp 0x7c2f5
leaq 0xd1411(%rip), %rdi     # 0x14d6f5
movq %r14, %rsi
jmp 0x7c2f5
leaq 0xd1405(%rip), %rdi     # 0x14d6f5
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x4630