// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/extended/select_visitor.c
// Function: select_visitor_feature_node
static int select_visitor_feature_node(GtNodeVisitor *nv,
                                       GtFeatureNode *fn,
                                       GtError *err)
{
  GtSelectVisitor *fv;
  bool select_node = false;
  int had_err = 0;
  gt_error_check(err);
  fv = select_visitor_cast(nv);
  fv->current_feature++;
  if ((!gt_str_length(fv->seqid) || /* no seqid was specified or seqids are
                                       equal */
       !gt_str_cmp(fv->seqid, gt_genome_node_get_seqid((GtGenomeNode*) fn))) &&
      (!gt_str_length(fv->source) || /* no source was specified or sources are
                                        equal */
       !strcmp(gt_str_get(fv->source), gt_feature_node_get_source(fn)))) {
    GtRange range = gt_genome_node_get_range((GtGenomeNode*) fn);
    /* enforce maximum gene length */
    /* XXX: we (spuriously) assume that genes are always root nodes */
    if (fn && gt_feature_node_has_type(fn, gt_ft_gene)) {
      if (fv->max_gene_length != GT_UNDEF_UWORD &&
          gt_range_length(&range) > fv->max_gene_length) {
        select_node = true;
      }
      else if (fv->max_gene_num != GT_UNDEF_UWORD &&
               fv->gene_num >= fv->max_gene_num) {
        select_node = true;
      }
      else if (fv->min_gene_score != GT_UNDEF_DOUBLE &&
               gt_feature_node_get_score(fn) < fv->min_gene_score) {
        select_node = true;
      }
      else if (fv->max_gene_score != GT_UNDEF_DOUBLE &&
               gt_feature_node_get_score(fn) > fv->max_gene_score) {
        select_node = true;
      }
      else if (fv->feature_num != GT_UNDEF_UWORD &&
               fv->feature_num != fv->current_feature) {
        select_node = true;
      }
      if (!select_node)
        fv->gene_num++; /* gene passed filter */
    }
  }
  else
    select_node = true;

  if (!select_node)
    select_node = filter_contain_range(fn, fv->contain_range);

  if (!select_node)
    select_node = filter_overlap_range(fn, fv->overlap_range);

  if (!select_node)
    select_node = filter_strand(fn, fv->strand);

  if (!select_node)
    select_node = filter_targetstrand(fn, fv->targetstrand);

  if (!select_node)
    select_node = filter_has_CDS(fn, fv->has_CDS);

  if (!select_node) {
    select_node = filter_min_average_ssp(fn, fv->min_average_splice_site_prob,
                                         fv->single_intron_factor);
  }

  if (fv->is_lua && !select_node)
    had_err = filter_lua(fv->script_filters, fn, fv->select_logic,
                         &select_node, err);

  if (select_node && !had_err)
    fv->drophandler((GtGenomeNode*) fn, fv->data, err);

  if (select_node)
    gt_genome_node_delete((GtGenomeNode*) fn);
  else
    gt_queue_add(fv->node_buffer, fn);

  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r14
testq %rdx, %rdx
je 0x17a677
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0x17ab00
callq 0x17a508
movq %rax, %rdi
movq %r14, %rsi
callq 0x16af21
movq %rax, %rbx
incq 0x70(%rax)
movq 0x18(%rax), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x17a6be
movq 0x18(%rbx), %r14
movq %r15, %rdi
callq 0x14b89b
movq %r14, %rdi
movq %rax, %rsi
callq 0x120dc8
movb $0x1, %r14b
testl %eax, %eax
jne 0x17a7de
movq 0x20(%rbx), %rdi
callq 0x120d4c
testq %rax, %rax
je 0x17a6f6
movq 0x20(%rbx), %rdi
callq 0x120d23
movq %rax, %r14
movq %r15, %rdi
callq 0x149ce1
movq %r14, %rdi
movq %rax, %rsi
callq 0x17a40
movb $0x1, %r14b
testl %eax, %eax
jne 0x17a7de
movq %r15, %rdi
callq 0x14b8df
movq %rax, (%rsp)
movq %rdx, 0x8(%rsp)
testq %r15, %r15
je 0x17a7db
leaq 0x26c734(%rip), %rsi    # 0x3e6e4b
movq %r15, %rdi
callq 0x149d45
testb %al, %al
je 0x17a7db
cmpq $-0x1, 0x58(%rbx)
je 0x17a743
movq %rsp, %rdi
callq 0x117813
movb $0x1, %r14b
cmpq 0x58(%rbx), %rax
ja 0x17aaee
movq 0x68(%rbx), %rax
cmpq $-0x1, %rax
je 0x17a75a
movb $0x1, %r14b
cmpq %rax, 0x60(%rbx)
jae 0x17aaee
movsd 0x80(%rbx), %xmm0
ucomisd 0x1d65a6(%rip), %xmm0   # 0x350d10
jne 0x17a76e
jnp 0x17a78f
movq %r15, %rdi
callq 0x149ef0
cvtss2sd %xmm0, %xmm0
movsd 0x80(%rbx), %xmm1
movb $0x1, %r14b
ucomisd %xmm0, %xmm1
ja 0x17aaee
movsd 0x88(%rbx), %xmm0
ucomisd 0x1d6571(%rip), %xmm0   # 0x350d10
jne 0x17a7a3
jnp 0x17a7c0
movq %r15, %rdi
callq 0x149ef0
cvtss2sd %xmm0, %xmm0
movb $0x1, %r14b
ucomisd 0x88(%rbx), %xmm0
ja 0x17aaee
movq 0x78(%rbx), %rax
cmpq $-0x1, %rax
je 0x17aaeb
cmpq 0x70(%rbx), %rax
setne %r14b
jmp 0x17aaee
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a824
movups 0x28(%rbx), %xmm0
movaps %xmm0, (%rsp)
testq %r15, %r15
je 0x17ab05
movq %r15, %rdi
callq 0x14b8df
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmpq $-0x1, (%rsp)
je 0x17a821
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x1178d5
movb $0x1, %r14b
testb %al, %al
je 0x17a824
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a86a
movups 0x38(%rbx), %xmm0
movaps %xmm0, (%rsp)
testq %r15, %r15
je 0x17ab0a
movq %r15, %rdi
callq 0x14b8df
movq %rax, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
cmpq $-0x1, (%rsp)
je 0x17a867
movq %rsp, %rdi
leaq 0x18(%rsp), %rsi
callq 0x117826
movb $0x1, %r14b
testb %al, %al
je 0x17a86a
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a892
testq %r15, %r15
je 0x17ab0f
movl 0x48(%rbx), %ebp
cmpl $0x4, %ebp
je 0x17a88f
movq %r15, %rdi
callq 0x14970e
movb $0x1, %r14b
cmpl %ebp, %eax
jne 0x17a892
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a90a
testq %r15, %r15
je 0x17ab14
movl 0x4c(%rbx), %ebp
cmpl $0x4, %ebp
je 0x17a907
leaq 0x1db096(%rip), %rsi    # 0x355945
movq %r15, %rdi
callq 0x14918c
testq %rax, %rax
je 0x17a907
leaq 0x258fcd(%rip), %r9     # 0x3d3890
movq %rsp, %rsi
leaq 0x18(%rsp), %r8
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
pushq $0x0
pushq $0x0
callq 0x14e5b7
addq $0x10, %rsp
testl %eax, %eax
jne 0x17ab28
cmpq $0x1, (%rsp)
sete %al
movl 0x18(%rsp), %ecx
cmpl $0x4, %ecx
setne %dl
cmpl %ebp, %ecx
setne %r14b
andb %dl, %r14b
andb %al, %r14b
jmp 0x17a90a
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a930
testq %r15, %r15
je 0x17ab19
cmpb $0x1, 0x50(%rbx)
jne 0x17a92d
movq %r15, %rdi
callq 0x14a625
movb $0x1, %r14b
testb %al, %al
je 0x17a930
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a9b1
testq %r15, %r15
je 0x17ab1e
movsd 0x90(%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
ucomisd 0x1d63bc(%rip), %xmm0   # 0x350d10
jne 0x17a958
jnp 0x17a9ae
movsd 0x98(%rbx), %xmm0
movsd %xmm0, 0x30(%rsp)
movq %r15, %rdi
callq 0x14a6c1
testb %al, %al
je 0x17a9ae
movq %rsp, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x14a6cd
cmpq $0x3, (%r14)
setae %al
movsd 0x10(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
mulsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
setbe %cl
orb %al, %cl
movb $0x1, %r14b
cmpb $0x1, %cl
jne 0x17a9b1
ucomisd %xmm0, %xmm1
ja 0x17a9b1
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpb $0x1, 0xac(%rbx)
movq %rbx, 0x28(%rsp)
jne 0x17a9c6
testb %r14b, %r14b
je 0x17aa1f
movq %r15, %rbx
movq %r13, %r15
testl %ebp, %ebp
movq 0x28(%rsp), %r12
jne 0x17a9f1
testb $0x1, %r14b
je 0x17a9f1
movq 0xc0(%r12), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq *0xb8(%r12)
testb $0x1, %r14b
je 0x17aa01
movq %rbx, %rdi
callq 0x14c43a
jmp 0x17aa0e
movq 0x10(%r12), %rdi
movq %rbx, %rsi
callq 0x112923
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
movq 0x28(%rsp), %rax
je 0x17ab23
movq 0xb0(%rax), %r12
testq %r12, %r12
je 0x17ab23
movq %r15, %rbx
movl 0xa8(%rax), %eax
movl %eax, 0x10(%rsp)
testq %r13, %r13
je 0x17aa5f
movq %r13, %rdi
callq 0x101a9a
testb %al, %al
jne 0x17ab2d
movq %r13, %r15
xorl %r13d, %r13d
movq %r12, %rdi
callq 0xd4a9a
cmpq %rax, %r13
jae 0x17aae4
movq %r12, %rdi
movq %r13, %rsi
callq 0xd47ba
movq (%rax), %rdi
movq %rbx, %rsi
movq %rsp, %rdx
movq %r15, %rcx
callq 0x17a0f3
movl %eax, %ebp
testl %eax, %eax
sete %al
testq %r13, %r13
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x17aaa8
movb (%rsp), %r14b
jmp 0x17aad8
movl %ebp, %eax
movl 0x10(%rsp), %ecx
orl %ecx, %eax
je 0x17aaca
cmpl $0x1, %ecx
jne 0x17aad8
testl %ebp, %ebp
jne 0x17aad8
andb (%rsp), %r14b
andb $0x1, %r14b
jne 0x17aad8
jmp 0x17a9cc
orb (%rsp), %r14b
andb $0x1, %r14b
jne 0x17a9cc
incq %r13
testl %ebp, %ebp
je 0x17aa65
jmp 0x17a9cc
xorl %ebp, %ebp
jmp 0x17a9cc
xorl %r14d, %r14d
testb %r14b, %r14b
jne 0x17a7de
incq 0x60(%rbx)
jmp 0x17a7de
callq 0x549a1
callq 0x549da
callq 0x54a11
callq 0x54a48
callq 0x54aba
callq 0x54af3
callq 0x54b2c
callq 0x54b65
callq 0x54a81
callq 0x54b9e