// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/uniq_stream.c
// Function: uniq_stream_next
static int uniq_stream_next(GtNodeStream *ns, GtGenomeNode **gn, GtError *err)
{
  GtUniqStream *us;
  int had_err;
  gt_error_check(err);
  us = uniq_stream_cast(ns);

  gt_assert(!us->second_node); /* the second buffer is always empty when this
                               function is called */
  if (!us->first_node) {
    /* both buffers are empty */
    had_err = gt_node_stream_next(us->in_stream, &us->first_node, err);
    if (had_err)
      return had_err;
    if (!us->first_node) {
      *gn = NULL;
      return 0;
    }
  }

  /* uniq loop */
  for (;;) {
    gt_assert(us->first_node && !us->second_node);
    had_err = gt_node_stream_next(us->in_stream, &us->second_node, err);
    if (!had_err && us->second_node) {
      if (!uniq(&us->first_node, &us->second_node))
        break; /* no uniq possible */
    }
    else
      break;
  }

  /* serve node */
  if (!had_err) {
    gt_assert(us->first_node);
    *gn = us->first_node;
    us->first_node = us->second_node;
    us->second_node = NULL;
  }

  return had_err;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x1f6463
movq 0x18(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1f642b
jmp 0x1f6463
movq 0x445b6e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x31fbd7(%rip), %rsi    # 0x516013
leaq 0x31fd7c(%rip), %rdx    # 0x5161bf
leaq 0x378d65(%rip), %rcx    # 0x56f1af
leaq 0x378d43(%rip), %r8     # 0x56f194
movl $0x65, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f6465
callq 0x1f6370
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x1b20f0
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1f64c0
movq 0x445b11(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x31fb7a(%rip), %rsi    # 0x516013
leaq 0x378d32(%rip), %rdx    # 0x56f1d2
leaq 0x378d08(%rip), %rcx    # 0x56f1af
leaq 0x378ce6(%rip), %r8     # 0x56f194
movl $0x68, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f64c2
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1f6529
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rsp), %rsi
addq $0x18, %rsi
movq 0x18(%rsp), %rdx
callq 0x1b1d90
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
je 0x1f6502
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x1f665f
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1f6527
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movl $0x0, 0x34(%rsp)
jmp 0x1f665f
jmp 0x1f6529
jmp 0x1f652b
jmp 0x1f652d
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1f6545
movq 0x10(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1f657d
movq 0x445a54(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x31fabd(%rip), %rsi    # 0x516013
leaq 0x378c63(%rip), %rdx    # 0x56f1c0
leaq 0x378c4b(%rip), %rcx    # 0x56f1af
leaq 0x378c29(%rip), %r8     # 0x56f194
movl $0x77, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f657f
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
movq 0x18(%rsp), %rdx
callq 0x1b1d90
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jne 0x1f65d1
movq 0x10(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1f65d1
movq 0x10(%rsp), %rdi
addq $0x18, %rdi
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
callq 0x1f6720
testb $0x1, %al
jne 0x1f65cf
jmp 0x1f65d8
jmp 0x1f65d3
jmp 0x1f65d8
jmp 0x1f652b
cmpl $0x0, 0xc(%rsp)
jne 0x1f6657
jmp 0x1f65e1
movq 0x10(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1f6625
movq 0x4459ac(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x31fa15(%rip), %rsi    # 0x516013
leaq 0x378bde(%rip), %rdx    # 0x56f1e3
leaq 0x378ba3(%rip), %rcx    # 0x56f1af
leaq 0x378b81(%rip), %r8     # 0x56f194
movl $0x83, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1f6627
movq 0x10(%rsp), %rax
movq 0x18(%rax), %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x20(%rax)
movl 0xc(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopl (%rax,%rax)