// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/codon_iterator_encseq.c
// Function: gt_codon_iterator_encseq_unit_test
int gt_codon_iterator_encseq_unit_test(GtError *err)
{
  int had_err = 0,
      i, j;
  const char *testseq    = "gctgatcgactgaacatagctagcacggccgcgcgatcgtacgatg",
             *testseq_rc = "catcgtacgatcgcgcggccgtgctagctatgttcagtcgatcagc",
             *testseq_rv = "gtagcatgctagcgcgccggcacgatcgatacaagtcagctagtcg",
             *testseq_cm = "cgactagctgacttgtatcgatcgtgccggcgcgctagcatgctac";
  GtEncseq *encseq;
  GtEncseqBuilder *eb;
  GtCodonIterator *ci;
  GtAlphabet *alpha;
  char n1, n2, n3;
  unsigned int frame;
  gt_error_check(err);

  alpha = gt_alphabet_new_dna();
  gt_ensure(alpha != NULL);
  eb = gt_encseq_builder_new(alpha);
  gt_ensure(eb != NULL);
  gt_encseq_builder_add_cstr(eb, testseq, strlen(testseq), "foo");
  encseq = gt_encseq_builder_build(eb, NULL);
  gt_ensure(encseq != NULL);

  if (!had_err) {
    /* forward tests */
    had_err = gt_codon_iterator_encseq_single_test(encseq, testseq, testseq,
                                                   GT_READMODE_FORWARD, err);
  }

  if (!had_err) {
    /* complement tests */
    had_err = gt_codon_iterator_encseq_single_test(encseq, testseq, testseq_cm,
                                                   GT_READMODE_COMPL, err);
  }

  if (!had_err) {
    /* revcompl tests */
    had_err = gt_codon_iterator_encseq_single_test(encseq, testseq, testseq_rc,
                                                   GT_READMODE_REVCOMPL, err);
  }

  if (!had_err) {
    /* reverse tests */
    had_err = gt_codon_iterator_encseq_single_test(encseq, testseq, testseq_rv,
                                                   GT_READMODE_REVERSE, err);
  }

  /* lengths < 3 */
  for (j = 0; !had_err && j < 3; j++) {
    ci = gt_codon_iterator_encseq_new_with_readmode(encseq, 10, j,
                                                    GT_READMODE_REVCOMPL, NULL);
    i = 10;
    while (!(gt_codon_iterator_next(ci, &n1, &n2, &n3, &frame, NULL))) {
      gt_ensure(false);
    }
    gt_ensure(i == 10);
    gt_codon_iterator_delete(ci);
  }

  gt_encseq_delete(encseq);
  gt_encseq_builder_delete(eb);
  gt_alphabet_delete(alpha);
  return had_err;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
leaq 0x4935c3(%rip), %rax    # 0x5333cb
movq %rax, 0x58(%rsp)
leaq 0x4935e6(%rip), %rax    # 0x5333fa
movq %rax, 0x50(%rsp)
leaq 0x493609(%rip), %rax    # 0x533429
movq %rax, 0x48(%rsp)
leaq 0x49362c(%rip), %rax    # 0x533458
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x9fe81
movq 0x70(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x9fe49
jmp 0x9fe81
movq 0x59c150(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x4761b9(%rip), %rsi    # 0x516013
leaq 0x47635e(%rip), %rdx    # 0x5161bf
leaq 0x49361f(%rip), %rcx    # 0x533487
leaq 0x49353b(%rip), %r8     # 0x5333aa
movl $0xb7, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x9fe83
callq 0x7e4b0
movq %rax, 0x20(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0x9fed4
cmpq $0x0, 0x20(%rsp)
jne 0x9fed2
movq 0x70(%rsp), %rdi
leaq 0x48f752(%rip), %rsi    # 0x52f5fa
leaq 0x49a954(%rip), %rdx    # 0x53a803
leaq 0x4935d1(%rip), %rcx    # 0x533487
leaq 0x4934ed(%rip), %r8     # 0x5333aa
movl $0xba, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x9fed4
jmp 0x9fed6
movq 0x20(%rsp), %rdi
callq 0xbbec0
movq %rax, 0x30(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0x9ff2c
cmpq $0x0, 0x30(%rsp)
jne 0x9ff2a
movq 0x70(%rsp), %rdi
leaq 0x48f6fa(%rip), %rsi    # 0x52f5fa
leaq 0x4935a3(%rip), %rdx    # 0x5334aa
leaq 0x493579(%rip), %rcx    # 0x533487
leaq 0x493495(%rip), %r8     # 0x5333aa
movl $0xbc, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x9ff2c
jmp 0x9ff2e
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rdi
callq 0x192b0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
leaq 0x49df3d(%rip), %rcx    # 0x53de9d
callq 0xbc350
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xbd620
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0x9ffbf
cmpq $0x0, 0x38(%rsp)
jne 0x9ffbd
movq 0x70(%rsp), %rdi
leaq 0x48f667(%rip), %rsi    # 0x52f5fa
leaq 0x4d2448(%rip), %rdx    # 0x5723e2
leaq 0x4934e6(%rip), %rcx    # 0x533487
leaq 0x493402(%rip), %r8     # 0x5333aa
movl $0xbf, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0x9ffbf
jmp 0x9ffc1
cmpl $0x0, 0x6c(%rsp)
jne 0x9ffe7
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x70(%rsp), %r8
xorl %ecx, %ecx
callq 0xa01c0
movl %eax, 0x6c(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0xa0010
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x70(%rsp), %r8
movl $0x2, %ecx
callq 0xa01c0
movl %eax, 0x6c(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0xa0039
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x70(%rsp), %r8
movl $0x3, %ecx
callq 0xa01c0
movl %eax, 0x6c(%rsp)
cmpl $0x0, 0x6c(%rsp)
jne 0xa0062
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x48(%rsp), %rdx
movq 0x70(%rsp), %r8
movl $0x1, %ecx
callq 0xa01c0
movl %eax, 0x6c(%rsp)
movl $0x0, 0x64(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x6c(%rsp)
movb %al, 0x7(%rsp)
jne 0xa0083
cmpl $0x3, 0x64(%rsp)
setl %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xa0090
jmp 0xa0193
movq 0x38(%rsp), %rdi
movslq 0x64(%rsp), %rdx
movl $0xa, %esi
movl $0x3, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x9fc40
movq %rax, 0x28(%rsp)
movl $0xa, 0x68(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x1f(%rsp), %rsi
leaq 0x1e(%rsp), %rdx
leaq 0x1d(%rsp), %rcx
leaq 0x18(%rsp), %r8
xorl %eax, %eax
movl %eax, %r9d
callq 0x9f740
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xa00ec
jmp 0xa012f
jmp 0xa00ee
cmpl $0x0, 0x6c(%rsp)
jne 0xa012b
movq 0x70(%rsp), %rdi
leaq 0x48f4f9(%rip), %rsi    # 0x52f5fa
leaq 0x4b8c5b(%rip), %rdx    # 0x558d63
leaq 0x493378(%rip), %rcx    # 0x533487
leaq 0x493294(%rip), %r8     # 0x5333aa
movl $0xdf, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa012d
jmp 0xa00bb
jmp 0xa0131
cmpl $0x0, 0x6c(%rsp)
jne 0xa0177
cmpl $0xa, 0x68(%rsp)
je 0xa0175
movq 0x70(%rsp), %rdi
leaq 0x48f4af(%rip), %rsi    # 0x52f5fa
leaq 0x493363(%rip), %rdx    # 0x5334b5
leaq 0x49332e(%rip), %rcx    # 0x533487
leaq 0x49324a(%rip), %r8     # 0x5333aa
movl $0xe1, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x6c(%rsp) # imm = 0xFFFFFFFF
jmp 0xa0177
jmp 0xa0179
movq 0x28(%rsp), %rdi
callq 0x9f800
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xa006a
movq 0x38(%rsp), %rdi
callq 0xae070
movq 0x30(%rsp), %rdi
callq 0xc29a0
movq 0x20(%rsp), %rdi
callq 0x7e3d0
movl 0x6c(%rsp), %eax
addq $0x78, %rsp
retq
nopw (%rax,%rax)