// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
testq %rdx, %rdx
je 0x12bae2
movq %r12, %rdi
callq 0x89eb7
testb %al, %al
jne 0x12bd5b
callq 0x12ba48
movq %rax, %rdi
movq %rbx, %rsi
callq 0x102c81
cmpq $0x0, 0x20(%rax)
jne 0x12bd31
movq %rax, %rbx
leaq 0x18(%rax), %r15
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x12bca1
movq %r13, 0x10(%rsp)
movq %rbx, %r13
addq $0x20, %r13
movq %r15, 0x20(%rsp)
movq %rbx, 0x18(%rsp)
testq %rax, %rax
je 0x12bcd1
cmpq $0x0, (%r13)
jne 0x12bcd1
movq 0x10(%rbx), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x102a22
testl %eax, %eax
jne 0x12bcb4
movq (%r13), %rbx
testq %rbx, %rbx
je 0x12bc7d
movq (%r15), %rbp
testq %rbp, %rbp
je 0x12bcfb
movq %rbp, %rdi
callq 0xdc2f0
movq %rax, %r14
movq %rbx, %rdi
callq 0xdc2f0
testq %r14, %r14
je 0x12bc7d
testq %rax, %rax
je 0x12bc7d
movq %r12, %r15
movq %rbp, %rdi
callq 0xdc6f0
movq %rax, %rbp
movq %rbx, %rdi
callq 0xdc6f0
movq %rax, %rbx
movq %rbp, %rdi
callq 0xdc92e
movq %rax, %r14
movq %rbx, %rdi
callq 0xdc92e
testq %r14, %r14
setne %r12b
je 0x12bbdc
testq %rax, %rax
je 0x12bbdc
movq %r14, %rdi
movq %rax, %rsi
callq 0xdb835
testb %al, %al
jne 0x12bba9
movb $0x1, %r12b
movq %rbx, %rdi
callq 0xdc92e
movq %rax, %r14
movq %rbp, %rdi
callq 0xdc9f1
movq %rbx, %rdi
callq 0xdc9f1
testb %r12b, %r12b
movq %r15, %r12
movq 0x20(%rsp), %r15
jne 0x12bc7d
testq %r14, %r14
jne 0x12bc7d
movq (%r15), %rdi
callq 0xda3de
movl %eax, %ebx
xorps %xmm0, %xmm0
testb %al, %al
je 0x12bc22
movq (%r15), %rdi
callq 0xdaa3e
movss %xmm0, 0xc(%rsp)
movq (%r13), %rdi
callq 0xda3de
testb %al, %al
je 0x12bc51
movq (%r13), %rdi
callq 0xdaa3e
movss 0xc(%rsp), %xmm1
ucomiss %xmm0, %xmm1
setae %al
andb %al, %bl
cmpb $0x1, %bl
jne 0x12bc5f
movq (%r13), %rdi
callq 0xde013
movq (%r15), %rax
jmp 0x12bc6e
movq (%r15), %rdi
callq 0xde013
movq (%r13), %rax
movq %rax, (%r15)
andq $0x0, (%r13)
movq 0x18(%rsp), %rbx
jmp 0x12bb27
movq (%r15), %rax
testq %rax, %rax
je 0x12bd85
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq (%r13), %rax
movq %rax, (%r15)
andq $0x0, (%r13)
xorl %eax, %eax
jmp 0x12bcb4
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x102a22
testl %eax, %eax
je 0x12bcc3
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rax
testq %rax, %rax
jne 0x12bb11
jmp 0x12bc98
movq 0x30c290(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9331(%rip), %rsi    # 0x2e5013
leaq 0x210e27(%rip), %rdx    # 0x33cb10
leaq 0x210e0f(%rip), %rcx    # 0x33caff
leaq 0x210ded(%rip), %r8     # 0x33cae4
pushq $0x77
jmp 0x12bd23
movq 0x30c266(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b9307(%rip), %rsi    # 0x2e5013
leaq 0x201100(%rip), %rdx    # 0x32ce13
leaq 0x1e3caa(%rip), %rcx    # 0x30f9c4
leaq 0x210dc3(%rip), %r8     # 0x33cae4
pushq $0x45
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x30c230(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b92d1(%rip), %rsi    # 0x2e5013
leaq 0x210dd9(%rip), %rdx    # 0x33cb22
leaq 0x210daf(%rip), %rcx    # 0x33caff
leaq 0x210d8d(%rip), %r8     # 0x33cae4
pushq $0x68
jmp 0x12bd23
movq 0x30c206(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b92a7(%rip), %rsi    # 0x2e5013
leaq 0x1b944c(%rip), %rdx    # 0x2e51bf
leaq 0x210d85(%rip), %rcx    # 0x33caff
leaq 0x210d63(%rip), %r8     # 0x33cae4
pushq $0x65
jmp 0x12bd23
movq 0x30c1dc(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1b927d(%rip), %rsi    # 0x2e5013
leaq 0x210d96(%rip), %rdx    # 0x33cb33
leaq 0x210d5b(%rip), %rcx    # 0x33caff
leaq 0x210d39(%rip), %r8     # 0x33cae4
movl $0x83, %r9d
jmp 0x12bd25