// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/extended/huffcode.c
// Function: gt_huffman_unit_test
static int test_bitwise(GtError *err)
{
  int had_err = 0,
      stat;
  GtUword i, j,
                symbol;
  unsigned length1 = 0,
           length2 = 0;
  GtHuffman *huffman;
  GtHuffmanBitwiseDecoder *hbwd;
  GtBitsequence bitseq;
  GtUint64 distr[6] = {45ULL, 16ULL, 13ULL, 12ULL, 9ULL, 5ULL};

  huffman = gt_huffman_new(&distr, unit_test_distr_func, 6UL);

  hbwd = gt_huffman_bitwise_decoder_new(huffman, err);
  gt_ensure(hbwd);
  for (i = 0; !had_err && i < 6UL; i++) {
    gt_huffman_encode(huffman, i, &bitseq, &length2);
    if (i > 0) {
      gt_ensure(length1 <= length2);
    }
    j = 1UL;
    while (1 == (stat = gt_huffman_bitwise_decoder_next(hbwd,
                                           ((bitseq >> (length2 - j)) & 1) != 0,
                                           &symbol, err))) {
      j++;
    }
    gt_ensure(stat == 0);
    gt_ensure(j == (GtUword) length2);
    gt_ensure(symbol == i);
    length1 = length2;
  }

  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);

  gt_ensure(stat == 0);
  gt_ensure(symbol == 0);

  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 0);
  gt_ensure(symbol == 1UL);

  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 0);
  gt_ensure(symbol == 2UL);

  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 0);
  gt_ensure(symbol == 3UL);

  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 0);
  gt_ensure(symbol == 4UL);

  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, false, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 1);
  stat = gt_huffman_bitwise_decoder_next(hbwd, true, &symbol, err);
  gt_ensure(stat == 0);
  gt_ensure(symbol == 5UL);

  gt_huffman_delete(huffman);
  gt_huffman_bitwise_decoder_delete(hbwd);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
andl $0x0, 0x1c(%rsp)
movq %rdi, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
movq $0x2d, (%rdi)
movq $0x10, 0x8(%rdi)
movq $0xd, 0x10(%rdi)
movq $0xc, 0x18(%rdi)
movq $0x9, 0x20(%rdi)
movq $0x5, 0x28(%rdi)
leaq -0xb47(%rip), %rsi      # 0xf1344
pushq $0x6
popq %rdx
callq 0xf04b4
movq %rax, 0x28(%rsp)
movq %rax, %rdi
callq 0xf121e
movl $0x0, %r13d
movq %rax, 0x20(%rsp)
testq %rax, %rax
jne 0xf1ee2
leaq 0x20c53b(%rip), %rsi    # 0x2fe3f2
leaq 0x232dbc(%rip), %rdx    # 0x324c7a
leaq 0x232dba(%rip), %rcx    # 0x324c7f
leaq 0x232826(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x29b, %r9d            # imm = 0x29B
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rbp
xorl %ebx, %ebx
xorl %r15d, %r15d
testl %r13d, %r13d
jne 0xf2010
cmpq $0x5, %rbx
ja 0xf2010
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
leaq 0x38(%rsp), %rdx
leaq 0x1c(%rsp), %rcx
callq 0xf0b83
movq %rbx, 0x30(%rsp)
testq %rbx, %rbx
sete %al
movl 0x1c(%rsp), %r14d
cmpl %r14d, %r15d
setbe %r12b
orb %al, %r12b
jne 0xf1f60
movq 0x8(%rsp), %rdi
leaq 0x20c4b4(%rip), %rsi    # 0x2fe3f2
leaq 0x232d47(%rip), %rdx    # 0x324c8c
leaq 0x232d33(%rip), %rcx    # 0x324c7f
leaq 0x23279f(%rip), %r8     # 0x3246f2
movl $0x29f, %r9d            # imm = 0x29F
xorl %eax, %eax
callq 0x89dbb
movl %r14d, %r15d
movl %r14d, %r14d
movq 0x38(%rsp), %r13
decq %r14
movq 0x20(%rsp), %rbx
xorl %esi, %esi
btq %r14, %r13
setb %sil
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xf1283
decq %r14
testl %eax, %eax
jne 0xf1f73
pushq $-0x1
popq %r13
testb %r12b, %r12b
movq 0x30(%rsp), %rbx
je 0xf2008
cmpq $-0x1, %r14
je 0xf1fcc
movq 0x8(%rsp), %rdi
leaq 0x20c443(%rip), %rsi    # 0x2fe3f2
leaq 0x232ce9(%rip), %rdx    # 0x324c9f
leaq 0x232cc2(%rip), %rcx    # 0x324c7f
leaq 0x23272e(%rip), %r8     # 0x3246f2
movl $0x2a8, %r9d            # imm = 0x2A8
jmp 0xf1ffd
xorl %r13d, %r13d
cmpq %rbx, 0x10(%rsp)
je 0xf2008
movq 0x8(%rsp), %rdi
leaq 0x20c410(%rip), %rsi    # 0x2fe3f2
leaq 0x232ccd(%rip), %rdx    # 0x324cb6
leaq 0x232c8f(%rip), %rcx    # 0x324c7f
leaq 0x2326fb(%rip), %r8     # 0x3246f2
movl $0x2a9, %r9d            # imm = 0x2A9
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
incq %rbx
jmp 0xf1eec
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xf1283
testl %r13d, %r13d
jne 0xf2060
testl %eax, %eax
je 0xf2060
leaq 0x20c3bd(%rip), %rsi    # 0x2fe3f2
leaq 0x232ab9(%rip), %rdx    # 0x324af5
leaq 0x232c3c(%rip), %rcx    # 0x324c7f
leaq 0x2326a8(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2af, %r9d            # imm = 0x2AF
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf209f
cmpq $0x0, 0x10(%rsp)
je 0xf209f
leaq 0x20c37e(%rip), %rsi    # 0x2fe3f2
leaq 0x232c47(%rip), %rdx    # 0x324cc2
leaq 0x232bfd(%rip), %rcx    # 0x324c7f
leaq 0x232669(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2b0, %r9d            # imm = 0x2B0
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf20e5
leaq 0x20c338(%rip), %rsi    # 0x2fe3f2
leaq 0x23277a(%rip), %rdx    # 0x32483b
leaq 0x232bb7(%rip), %rcx    # 0x324c7f
leaq 0x232623(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2b3, %r9d            # imm = 0x2B3
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf212b
leaq 0x20c2f2(%rip), %rsi    # 0x2fe3f2
leaq 0x232734(%rip), %rdx    # 0x32483b
leaq 0x232b71(%rip), %rcx    # 0x324c7f
leaq 0x2325dd(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2b5, %r9d            # imm = 0x2B5
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
testl %r13d, %r13d
jne 0xf2175
testl %eax, %eax
je 0xf2175
leaq 0x20c2a8(%rip), %rsi    # 0x2fe3f2
leaq 0x2329a4(%rip), %rdx    # 0x324af5
leaq 0x232b27(%rip), %rcx    # 0x324c7f
leaq 0x232593(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2b7, %r9d            # imm = 0x2B7
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf21b4
cmpq $0x1, 0x10(%rsp)
je 0xf21b4
leaq 0x20c269(%rip), %rsi    # 0x2fe3f2
leaq 0x232b3e(%rip), %rdx    # 0x324cce
leaq 0x232ae8(%rip), %rcx    # 0x324c7f
leaq 0x232554(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2b8, %r9d            # imm = 0x2B8
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf21fa
leaq 0x20c223(%rip), %rsi    # 0x2fe3f2
leaq 0x232665(%rip), %rdx    # 0x32483b
leaq 0x232aa2(%rip), %rcx    # 0x324c7f
leaq 0x23250e(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2bb, %r9d            # imm = 0x2BB
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
orl %r13d, %eax
jne 0xf2241
leaq 0x20c1dc(%rip), %rsi    # 0x2fe3f2
leaq 0x23261e(%rip), %rdx    # 0x32483b
leaq 0x232a5b(%rip), %rcx    # 0x324c7f
leaq 0x2324c7(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2bd, %r9d            # imm = 0x2BD
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
testl %r13d, %r13d
jne 0xf228b
testl %eax, %eax
je 0xf228b
leaq 0x20c192(%rip), %rsi    # 0x2fe3f2
leaq 0x23288e(%rip), %rdx    # 0x324af5
leaq 0x232a11(%rip), %rcx    # 0x324c7f
leaq 0x23247d(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2bf, %r9d            # imm = 0x2BF
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf22ca
cmpq $0x2, 0x10(%rsp)
je 0xf22ca
leaq 0x20c153(%rip), %rsi    # 0x2fe3f2
leaq 0x232a36(%rip), %rdx    # 0x324cdc
leaq 0x2329d2(%rip), %rcx    # 0x324c7f
leaq 0x23243e(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2c0, %r9d            # imm = 0x2C0
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf2310
leaq 0x20c10d(%rip), %rsi    # 0x2fe3f2
leaq 0x23254f(%rip), %rdx    # 0x32483b
leaq 0x23298c(%rip), %rcx    # 0x324c7f
leaq 0x2323f8(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2c3, %r9d            # imm = 0x2C3
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
orl %r13d, %eax
jne 0xf2357
leaq 0x20c0c6(%rip), %rsi    # 0x2fe3f2
leaq 0x232508(%rip), %rdx    # 0x32483b
leaq 0x232945(%rip), %rcx    # 0x324c7f
leaq 0x2323b1(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2c5, %r9d            # imm = 0x2C5
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
testl %r13d, %r13d
jne 0xf23a2
testl %eax, %eax
je 0xf23a2
leaq 0x20c07b(%rip), %rsi    # 0x2fe3f2
leaq 0x232777(%rip), %rdx    # 0x324af5
leaq 0x2328fa(%rip), %rcx    # 0x324c7f
leaq 0x232366(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2c7, %r9d            # imm = 0x2C7
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf23e1
cmpq $0x3, 0x10(%rsp)
je 0xf23e1
leaq 0x20c03c(%rip), %rsi    # 0x2fe3f2
leaq 0x23292d(%rip), %rdx    # 0x324cea
leaq 0x2328bb(%rip), %rcx    # 0x324c7f
leaq 0x232327(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2c8, %r9d            # imm = 0x2C8
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf2427
leaq 0x20bff6(%rip), %rsi    # 0x2fe3f2
leaq 0x232438(%rip), %rdx    # 0x32483b
leaq 0x232875(%rip), %rcx    # 0x324c7f
leaq 0x2322e1(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2cb, %r9d            # imm = 0x2CB
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf246d
leaq 0x20bfb0(%rip), %rsi    # 0x2fe3f2
leaq 0x2323f2(%rip), %rdx    # 0x32483b
leaq 0x23282f(%rip), %rcx    # 0x324c7f
leaq 0x23229b(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2cd, %r9d            # imm = 0x2CD
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
orl %r13d, %eax
jne 0xf24b4
leaq 0x20bf69(%rip), %rsi    # 0x2fe3f2
leaq 0x2323ab(%rip), %rdx    # 0x32483b
leaq 0x2327e8(%rip), %rcx    # 0x324c7f
leaq 0x232254(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2cf, %r9d            # imm = 0x2CF
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
testl %r13d, %r13d
jne 0xf24fe
testl %eax, %eax
je 0xf24fe
leaq 0x20bf1f(%rip), %rsi    # 0x2fe3f2
leaq 0x23261b(%rip), %rdx    # 0x324af5
leaq 0x23279e(%rip), %rcx    # 0x324c7f
leaq 0x23220a(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2d1, %r9d            # imm = 0x2D1
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf253d
cmpq $0x4, 0x10(%rsp)
je 0xf253d
leaq 0x20bee0(%rip), %rsi    # 0x2fe3f2
leaq 0x2327df(%rip), %rdx    # 0x324cf8
leaq 0x23275f(%rip), %rcx    # 0x324c7f
leaq 0x2321cb(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2d2, %r9d            # imm = 0x2D2
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf2583
leaq 0x20be9a(%rip), %rsi    # 0x2fe3f2
leaq 0x2322dc(%rip), %rdx    # 0x32483b
leaq 0x232719(%rip), %rcx    # 0x324c7f
leaq 0x232185(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2d5, %r9d            # imm = 0x2D5
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xf1283
orl %r13d, %eax
jne 0xf25c9
leaq 0x20be54(%rip), %rsi    # 0x2fe3f2
leaq 0x232296(%rip), %rdx    # 0x32483b
leaq 0x2326d3(%rip), %rcx    # 0x324c7f
leaq 0x23213f(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2d7, %r9d            # imm = 0x2D7
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
orl %r13d, %eax
jne 0xf2610
leaq 0x20be0d(%rip), %rsi    # 0x2fe3f2
leaq 0x23224f(%rip), %rdx    # 0x32483b
leaq 0x23268c(%rip), %rcx    # 0x324c7f
leaq 0x2320f8(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2d9, %r9d            # imm = 0x2D9
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0xf1283
testl %r13d, %r13d
jne 0xf265b
testl %eax, %eax
je 0xf265b
leaq 0x20bdc2(%rip), %rsi    # 0x2fe3f2
leaq 0x2324be(%rip), %rdx    # 0x324af5
leaq 0x232641(%rip), %rcx    # 0x324c7f
leaq 0x2320ad(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2db, %r9d            # imm = 0x2DB
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
testl %r13d, %r13d
jne 0xf269a
cmpq $0x5, 0x10(%rsp)
je 0xf269a
leaq 0x20bd83(%rip), %rsi    # 0x2fe3f2
leaq 0x232690(%rip), %rdx    # 0x324d06
leaq 0x232602(%rip), %rcx    # 0x324c7f
leaq 0x23206e(%rip), %r8     # 0x3246f2
movq 0x8(%rsp), %rdi
movl $0x2dc, %r9d            # imm = 0x2DC
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
movq 0x28(%rsp), %rdi
callq 0xf09fc
movq %rbx, %rdi
callq 0xf1333
testl %r13d, %r13d
je 0xf26b6
pushq $-0x1
popq %rax
jmp 0xf26c0
movq 0x8(%rsp), %rdi
callq 0xf1349
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq