// File: Luthaf[P]zeopp/segment.cc
// Function: segmentChannels_forHolograms(ATOM_NETWORK*, std::vector<FEATURE, std::allocator<FEATURE>>*, std::vector<int, std::allocator<int>>*, std::vector<double, std::allocator<double>>*, int)
void segmentChannels_forHolograms(ATOM_NETWORK *uc,vector<FEATURE>  *channel_list,vector <int> *seg_ids,vector <double> *segmaxr,int featflag) {
  int i;
  int current_segment=1;
  vector <double> segment_list;

  if(channel_list->size()>0) {
    for(i=0; i<(int)channel_list->size();i++){
      channel_list->at(i).segmentChannel(uc);
      channel_list->at(i).update_node_segmentinfo(seg_ids,&current_segment,featflag);
      
      if(featflag == 0)
        segmaxr->insert(segmaxr->end(),channel_list->at(i).segment_max_r.begin(),channel_list->at(i).segment_max_r.end());
      else
        segmaxr->insert(segmaxr->end(),channel_list->at(i).feature_max_r.begin(),channel_list->at(i).feature_max_r.end());
      
//      segment_list.insert(segment_list.begin(),channel_list->at(i).segment_max_r.begin(),channel_list->at(i).segment_max_r.end());
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x1, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xf650
movq -0x10(%rbp), %rdi
callq 0x899b0
cmpq $0x0, %rax
jbe 0x89477
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x10(%rbp), %rdi
callq 0x899b0
movq %rax, %rcx
movl -0xac(%rbp), %eax
cmpl %ecx, %eax
jge 0x89475
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xb8(%rbp)
jmp 0x89292
movq -0xb8(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xd8840
jmp 0x892a4
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xc0(%rbp)
jmp 0x892ba
movq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %ecx
leaq -0x2c(%rbp), %rdx
callq 0xdd1a0
jmp 0x892d3
cmpl $0x0, -0x24(%rbp)
jne 0x893a3
movq -0x20(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x269f0
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x89ad0
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xc8(%rbp)
jmp 0x89314
movq -0xc8(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x26bb0
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xd8(%rbp)
jmp 0x89341
movq -0xd8(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x269f0
movq -0xd0(%rbp), %rdi
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rcx
callq 0x89a20
movq %rax, -0xe0(%rbp)
jmp 0x89379
movq -0xe0(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x89465
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xf9d0
jmp 0x89489
movq -0x20(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x269f0
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x89ad0
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xe8(%rbp)
jmp 0x893e3
movq -0xe8(%rbp), %rdi
addq $0x250, %rdi            # imm = 0x250
callq 0x26bb0
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x899e0
movq %rax, -0xf8(%rbp)
jmp 0x89413
movq -0xf8(%rbp), %rdi
addq $0x250, %rdi            # imm = 0x250
callq 0x269f0
movq -0xf0(%rbp), %rdi
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
callq 0x89a20
movq %rax, -0x100(%rbp)
jmp 0x89457
movq -0x100(%rbp), %rax
movq %rax, -0xa8(%rbp)
jmp 0x89467
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x89259
jmp 0x89477
leaq -0x48(%rbp), %rdi
callq 0xf9d0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x58f0
nopw %cs:(%rax,%rax)