// File: /workspace/github_c_makefile_star2_O2/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 0x586a4
movq %rax, (%rsp)
testq %r15, %r15
je 0x1194a5
movq %r15, %rdi
callq 0x89eb7
testb %al, %al
jne 0x119616
movq 0x48(%rbx), %rdi
callq 0x9e48b
testq %rax, %rax
je 0x1195a0
movq 0x50(%rbx), %rdi
callq 0x9e48b
testq %rax, %rax
jne 0x119640
movq (%rsp), %rax
decq %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x1195c4
cmpq (%rsp), %r12
jae 0x1195c4
movq 0x20(%rbx), %rdi
movq %r12, %rsi
callq 0x581aa
movq (%rax), %rdi
movq 0x18(%rbx), %rsi
movq 0x40(%rbx), %rdx
movq %rdi, 0x10(%rsp)
movq %r15, %rcx
callq 0x119f4e
movq %rax, %r14
pushq $-0x1
popq %rax
movl %eax, %ebp
testq %r14, %r14
je 0x11958e
cmpq 0x8(%rsp), %r12
jae 0x11953e
movq 0x48(%rbx), %rdi
leaq 0x147(%rip), %rsi       # 0x119676
movq %r14, %rdx
movq %r15, %rcx
callq 0x9e710
movl %eax, %ebp
jmp 0x119586
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x119586
movq 0x48(%rbx), %rdi
callq 0x9e48b
testq %rax, %rax
je 0x119584
movq 0x48(%rbx), %rdi
callq 0x9e411
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xdd39c
movl %eax, %ebp
movq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x9e2d1
movq %r13, %rdi
callq 0xde013
jmp 0x119540
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x10327a
movq 0x10(%rsp), %rdi
callq 0xde013
incq %r12
jmp 0x1194da
xorl %ebp, %ebp
xorl %r14d, %r14d
cmpq %r14, (%rsp)
je 0x1195c4
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x581aa
movq (%rax), %rdi
callq 0xde013
incq %r14
jmp 0x1195a5
movq 0x48(%rbx), %rdi
callq 0x9e48b
testq %rax, %rax
jne 0x1195ec
movq 0x20(%rbx), %rdi
callq 0x5876c
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x31e975(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1cba16(%rip), %rsi    # 0x2e5013
leaq 0x21a046(%rip), %rdx    # 0x33364a
leaq 0x21a015(%rip), %rcx    # 0x333620
leaq 0x219fa6(%rip), %r8     # 0x3335b8
pushq $0x66
jmp 0x119668
movq 0x31e94b(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1cb9ec(%rip), %rsi    # 0x2e5013
leaq 0x1cbb91(%rip), %rdx    # 0x2e51bf
leaq 0x219feb(%rip), %rcx    # 0x333620
leaq 0x219f7c(%rip), %r8     # 0x3335b8
pushq $0x41
jmp 0x119668
movq 0x31e921(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1cb9c2(%rip), %rsi    # 0x2e5013
leaq 0x219fa6(%rip), %rdx    # 0x3335fe
leaq 0x219fc1(%rip), %rcx    # 0x333620
leaq 0x219f52(%rip), %r8     # 0x3335b8
pushq $0x45
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390