// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/csa_visitor.c
// Function: csa_visitor_feature_node
static int csa_visitor_feature_node(GtNodeVisitor *nv, GtFeatureNode *fn,
                                    GT_UNUSED GtError *err)
{
  CSAVisitor *csa_visitor;
  gt_error_check(err);
  csa_visitor = csa_visitor_cast(nv);

  /* determine the first range if necessary */
  if (csa_visitor->buffered_feature) {
    csa_visitor->first_range =
      gt_genome_node_get_range((GtGenomeNode*) csa_visitor->buffered_feature);
    csa_visitor->first_str =
      gt_genome_node_get_seqid((GtGenomeNode*) csa_visitor->buffered_feature);
    gt_assert(!gt_array_size(csa_visitor->cluster));
    gt_array_add(csa_visitor->cluster, csa_visitor->buffered_feature);
    csa_visitor->buffered_feature = NULL;
  }
  else if (!gt_array_size(csa_visitor->cluster)) {
    csa_visitor->first_range = gt_genome_node_get_range((GtGenomeNode*) fn);
    csa_visitor->first_str = gt_genome_node_get_seqid((GtGenomeNode*) fn);
    gt_array_add(csa_visitor->cluster, fn);
    return 0;
  }

  gt_assert(!csa_visitor->buffered_feature);
  csa_visitor->second_range = gt_genome_node_get_range((GtGenomeNode*) fn);
  csa_visitor->second_str = gt_genome_node_get_seqid((GtGenomeNode*) fn);

  if ((gt_str_cmp(csa_visitor->first_str, csa_visitor->second_str) == 0) &&
      (csa_visitor->first_range.end + csa_visitor->join_length >=
       csa_visitor->second_range.start)) {
      /* we are still in the cluster */
      gt_array_add(csa_visitor->cluster, fn);
      /* update first range */
      gt_assert(csa_visitor->second_range.start >=
                csa_visitor->first_range.start);
      if (csa_visitor->second_range.end > csa_visitor->first_range.end)
        csa_visitor->first_range.end = csa_visitor->second_range.end;
  }
  else {
    /* end of cluster -> process it */
    gt_log_log("process cluster");
    csa_visitor->buffered_feature = fn;
    gt_csa_visitor_process_cluster(nv, false);
    csa_visitor->first_range = csa_visitor->second_range;
    csa_visitor->first_str = csa_visitor->second_str;
  }
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, (%rsp)
testq %rdx, %rdx
je 0xc261e
movq %rdx, %rdi
callq 0xc103
testb %al, %al
jne 0xc2773
callq 0xc2550
movq %rax, %rdi
movq %r15, %rsi
callq 0x2603e
movq %rax, %rbx
leaq 0x28(%rax), %r12
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0xc2680
callq 0x1c3c4
movq %rax, 0x30(%rbx)
movq %rdx, 0x38(%rbx)
movq 0x28(%rbx), %rdi
callq 0x1c31a
movq %rax, 0x50(%rbx)
movq 0x20(%rbx), %rdi
callq 0x4b988
testq %rax, %rax
jne 0xc279d
movq 0x20(%rbx), %rdi
pushq $0x8
popq %rdx
movq %r12, %rsi
callq 0x4b801
andq $0x0, 0x28(%rbx)
jmp 0xc269d
movq 0x20(%rbx), %rdi
callq 0x4b988
testq %rax, %rax
je 0xc2746
cmpq $0x0, (%r12)
jne 0xc27c7
movq %r14, %rdi
callq 0x1c3c4
movq %rax, 0x40(%rbx)
movq %rdx, 0x48(%rbx)
movq %r14, %rdi
callq 0x1c31a
movq %rax, 0x58(%rbx)
movq 0x50(%rbx), %rdi
movq %rax, %rsi
callq 0x14573
testl %eax, %eax
jne 0xc26d7
movq 0x18(%rbx), %rax
addq 0x38(%rbx), %rax
cmpq 0x40(%rbx), %rax
jae 0xc2719
movq %rbx, %r12
addq $0x40, %r12
leaq 0x31fbe(%rip), %rdi     # 0xf46a3
xorl %eax, %eax
callq 0xc5d2
movq %r14, 0x28(%rbx)
movq %r15, %rdi
xorl %esi, %esi
callq 0xc2931
movups (%r12), %xmm0
movups %xmm0, 0x30(%rbx)
movq 0x58(%rbx), %rax
movq %rax, 0x50(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x20(%rbx), %rdi
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x4b801
movq 0x40(%rbx), %rax
cmpq 0x30(%rbx), %rax
jb 0xc27f1
movq 0x48(%rbx), %rax
cmpq 0x38(%rbx), %rax
jbe 0xc270b
movq %rax, 0x38(%rbx)
jmp 0xc270b
movq %r14, %rdi
callq 0x1c3c4
movq %rax, 0x30(%rbx)
movq %rdx, 0x38(%rbx)
movq %r14, %rdi
callq 0x1c31a
movq %rax, 0x50(%rbx)
movq 0x20(%rbx), %rdi
movq %rsp, %rsi
pushq $0x8
popq %rdx
callq 0x4b801
jmp 0xc270b
movq 0x6b83e(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x78e2(%rip), %rsi      # 0xca066
leaq 0x7ece(%rip), %rdx      # 0xca659
leaq 0x31e91(%rip), %rcx     # 0xf4623
leaq 0x31e48(%rip), %r8      # 0xf45e1
pushq $0x3d
jmp 0xc2819
movq 0x6b814(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x78b8(%rip), %rsi      # 0xca066
leaq 0x31e87(%rip), %rdx     # 0xf463c
leaq 0x31e67(%rip), %rcx     # 0xf4623
leaq 0x31e1e(%rip), %r8      # 0xf45e1
pushq $0x46
jmp 0xc2819
movq 0x6b7ea(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x788e(%rip), %rsi      # 0xca066
leaq 0x31dc4(%rip), %rdx     # 0xf45a3
leaq 0x31e3d(%rip), %rcx     # 0xf4623
leaq 0x31df4(%rip), %r8      # 0xf45e1
pushq $0x51
jmp 0xc2819
movq 0x6b7c0(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x7864(%rip), %rsi      # 0xca066
leaq 0x31e58(%rip), %rdx     # 0xf4661
leaq 0x31e13(%rip), %rcx     # 0xf4623
leaq 0x31dca(%rip), %r8      # 0xf45e1
pushq $0x5c
popq %r9
xorl %eax, %eax
callq 0xb8c0
callq 0xb300