// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movl $0x0, 0x34(%rsp)
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x81370
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x38(%rsp)
je 0x1d8959
movq 0x38(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1d8921
jmp 0x1d8959
movq 0x463678(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33d6e1(%rip), %rsi    # 0x516013
leaq 0x33d886(%rip), %rdx    # 0x5161bf
leaq 0x38d284(%rip), %rcx    # 0x565bc4
leaq 0x38d215(%rip), %r8     # 0x565b5c
movl $0x41, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d895b
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0xfd4d0
cmpq $0x0, %rax
jbe 0x1d8b32
jmp 0x1d8975
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rdi
callq 0xfd4d0
cmpq $0x0, %rax
je 0x1d89c1
movq 0x463610(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33d679(%rip), %rsi    # 0x516013
leaq 0x38d201(%rip), %rdx    # 0x565ba2
leaq 0x38d21c(%rip), %rcx    # 0x565bc4
leaq 0x38d1ad(%rip), %r8     # 0x565b5c
movl $0x45, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d89c3
movq $0x0, 0x28(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x34(%rsp)
movb %al, 0x7(%rsp)
jne 0x1d89ea
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x1d89f7
jmp 0x1d8b30
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x80b60
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x38(%rsp), %rcx
callq 0x1d94c0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x1d8a48
movl $0xffffffff, 0x34(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x34(%rsp)
jne 0x1d8b13
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x1d8a8b
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rdi
movq 0x18(%rsp), %rdx
movq 0x38(%rsp), %rcx
leaq 0x180(%rip), %rsi       # 0x1d8c00
callq 0xfda90
movl %eax, 0x34(%rsp)
jmp 0x1d8b09
jmp 0x1d8a8d
xorl %eax, %eax
cmpl $0x0, 0x34(%rsp)
movb %al, 0x6(%rsp)
jne 0x1d8ab3
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0xfd4d0
cmpq $0x0, %rax
seta %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x1d8abd
jmp 0x1d8b07
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0xfd3f0
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x171f90
movl %eax, 0x34(%rsp)
movq 0x40(%rsp), %rax
movq 0x50(%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0xfd170
movq 0x8(%rsp), %rdi
callq 0x173180
jmp 0x1d8a8d
jmp 0x1d8b09
movq 0x18(%rsp), %rdi
callq 0x1b29d0
movq 0x10(%rsp), %rdi
callq 0x173180
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1d89cc
jmp 0x1d8b90
movq $0x0, 0x28(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x34(%rsp)
movb %al, 0x5(%rsp)
jne 0x1d8b59
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
setb %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x1d8b63
jmp 0x1d8b8e
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x80b60
movq (%rax), %rdi
callq 0x173180
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x1d8b3b
jmp 0x1d8b90
jmp 0x1d8b92
movq 0x40(%rsp), %rax
movq 0x48(%rax), %rdi
callq 0xfd4d0
cmpq $0x0, %rax
je 0x1d8bde
movq 0x4633f3(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x33d45c(%rip), %rsi    # 0x516013
leaq 0x38d030(%rip), %rdx    # 0x565bee
leaq 0x38cfff(%rip), %rcx    # 0x565bc4
leaq 0x38cf90(%rip), %r8     # 0x565b5c
movl $0x66, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1d8be0
movq 0x40(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0x814a0
movl 0x34(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)