// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/extended/snp_annotator_stream.c
// Function: snp_annotator_stream_process_current_gene
static int snp_annotator_stream_process_current_gene(GtSNPAnnotatorStream *sas,
                                                     GtError *err)
{
  int had_err = 0;
  GtUword i;
  GtUword nof_genes = gt_array_size(sas->cur_gene_set);
  gt_error_check(err);

  if (gt_queue_size(sas->snps) > 0) {
    /* we need to process SNPs for a gene cluster*/
    gt_assert(gt_queue_size(sas->outqueue) == 0);

    for (i = 0; !had_err && i < nof_genes; i++) {
      GtNodeVisitor *sav;
      GtFeatureNode *gene;
      gene = *(GtFeatureNode**) gt_array_get(sas->cur_gene_set, i);
      sav = gt_snp_annotator_visitor_new(gene, sas->tt, sas->rmap, err);
      if (!sav)
        had_err = -1;
      if (!had_err) {
        if (i < nof_genes-1) {
          had_err = gt_queue_iterate(sas->snps,
                                     snp_annotator_stream_process_snp,
                                     sav, err);
        } else {
          while (!had_err && gt_queue_size(sas->snps) > 0) {
            GtFeatureNode *snp = (GtFeatureNode*) gt_queue_get(sas->snps);
            had_err = gt_genome_node_accept((GtGenomeNode*) snp, sav, err);
            gt_queue_add(sas->outqueue, snp);
            gt_genome_node_delete((GtGenomeNode*) snp);
          }
        }
        gt_node_visitor_delete(sav);
      }
      gt_genome_node_delete((GtGenomeNode*) gene);
    }
  } else {
    /* no SNPs for this gene cluster, delete it */
    for (i = 0; !had_err && i < nof_genes; i++) {
      gt_genome_node_delete(*(GtGenomeNode**) gt_array_get(sas->cur_gene_set,
                                                           i));
    }
  }
  gt_assert(gt_queue_size(sas->snps) == 0);
  gt_array_reset(sas->cur_gene_set);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0xd24e0
movq %rax, %r13
testq %r15, %r15
je 0x174e97
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x174fed
movq 0x48(%rbx), %rdi
callq 0x10d7ac
testq %rax, %rax
je 0x174f96
movq 0x50(%rbx), %rdi
callq 0x10d7ac
testq %rax, %rax
jne 0x174ff2
testq %r13, %r13
je 0x174fbe
leaq -0x1(%r13), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
movq %r13, (%rsp)
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0xd2207
movq (%rax), %rdi
movq 0x18(%rbx), %rsi
movq 0x40(%rbx), %rdx
movq %rdi, 0x10(%rsp)
movq %r15, %rcx
callq 0x175744
testq %rax, %rax
je 0x174f65
movq %rax, %r14
cmpq 0x8(%rsp), %r12
jae 0x174f21
movq 0x48(%rbx), %rdi
leaq 0xe5(%rip), %rsi        # 0x174ff7
movq %r14, %rdx
movq %r15, %rcx
callq 0x10d9da
movl %eax, %ebp
jmp 0x174f6e
movq 0x48(%rbx), %rdi
callq 0x10d7ac
testq %rax, %rax
je 0x174f6c
movq 0x48(%rbx), %rdi
callq 0x10d74a
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x14472c
movl %eax, %ebp
movq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x10d65b
movq %r13, %rdi
callq 0x1451a0
testl %ebp, %ebp
je 0x174f21
jmp 0x174f6e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x174f7a
xorl %ebp, %ebp
movq (%rsp), %r13
movq %r14, %rdi
callq 0x1632f2
movq 0x10(%rsp), %rdi
callq 0x1451a0
testl %ebp, %ebp
jne 0x174fc0
incq %r12
cmpq %r13, %r12
jb 0x174ed4
jmp 0x174fc0
testq %r13, %r13
je 0x174fbe
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0xd2207
movq (%rax), %rdi
callq 0x1451a0
incq %r14
cmpq %r14, %r13
jne 0x174fa0
jmp 0x174fc0
xorl %ebp, %ebp
movq 0x48(%rbx), %rdi
callq 0x10d7ac
testq %rax, %rax
jne 0x174fe8
movq 0x20(%rbx), %rdi
callq 0xd2519
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x54b3e
callq 0x54ad0
callq 0x54b07