// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/disc_distri.c
// Function: gt_disc_distri_unit_test
int gt_disc_distri_unit_test(GtError *err)
{
  GtDiscDistri *d;
  int had_err = 0;
  struct ForeachTesterData tdata;

  gt_error_check(err);

  d = gt_disc_distri_new();

  gt_ensure(gt_disc_distri_get(d, 0UL) == 0);
  gt_ensure(gt_disc_distri_get(d, 100UL) == 0);
  if (!had_err) {
    gt_disc_distri_add(d, 0);
    gt_disc_distri_add_multi(d, 100UL, 256ULL);
  }
  gt_ensure(gt_disc_distri_get(d, 0UL) == 1ULL);
  gt_ensure(gt_disc_distri_get(d, 100UL) == 256ULL);

  /* test foreach and foreach_in_reverse_order: */
  gt_disc_distri_add(d, 2UL);
  if (!had_err) {
    tdata.counter = -1;
    tdata.expkeys[0] = 0;
    tdata.expvalues[0] = 1;
    tdata.expkeys[1] = 2;
    tdata.expvalues[1] = 1;
    tdata.expkeys[2] = 100;
    tdata.expvalues[2] = 256;
    tdata.had_err = &had_err;
    tdata.err = err;
    gt_disc_distri_foreach(d, foreachtester, &tdata);
  }
  if (!had_err) {
    tdata.counter = -1;
    tdata.expkeys[0] = 100;
    tdata.expvalues[0] = 256;
    tdata.expkeys[1] = 2;
    tdata.expvalues[1] = 1;
    tdata.expkeys[2] = 0;
    tdata.expvalues[2] = 1;
    tdata.had_err = &had_err;
    tdata.err = err;
    gt_disc_distri_foreach_in_reverse_order(d, foreachtester, &tdata);
  }

  gt_disc_distri_delete(d);

  return had_err;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
andl $0x0, 0xc(%rsp)
testq %rdi, %rdi
je 0xa170b
movq %r14, %rdi
callq 0xc103
testb %al, %al
jne 0xa18d6
callq 0xa12bc
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0xa13c2
testq %rax, %rax
je 0xa174c
leaq 0x2aa30(%rip), %rsi     # 0xcc159
leaq 0x4a0a0(%rip), %rdx     # 0xeb7d0
leaq 0x4a080(%rip), %rcx     # 0xeb7b7
leaq 0x4a022(%rip), %r8      # 0xeb760
movq %r14, %rdi
movl $0xd9, %r9d
jmp 0xa18a9
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0xa13c2
testq %rax, %rax
je 0xa1786
leaq 0x2a9f6(%rip), %rsi     # 0xcc159
leaq 0x4a086(%rip), %rdx     # 0xeb7f0
leaq 0x4a046(%rip), %rcx     # 0xeb7b7
leaq 0x49fe8(%rip), %r8      # 0xeb760
movq %r14, %rdi
movl $0xda, %r9d
jmp 0xa18a9
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa12d1
pushq $0x64
popq %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0xa12d9
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa13c2
cmpq $0x1, %rax
jne 0xa185d
pushq $0x64
popq %rsi
movq %rbx, %rdi
callq 0xa13c2
cmpq $0x100, %rax            # imm = 0x100
jne 0xa1884
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xa12d1
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x49f50(%rip), %xmm0    # 0xeb740
movaps %xmm0, (%rdx)
movl $0x100, 0x18(%rdx)      # imm = 0x100
leaq 0xc(%rsp), %r15
movq %r15, 0x20(%rdx)
movq %r14, 0x28(%rdx)
leaq 0x100(%rip), %rsi       # 0xa190e
movq %rbx, %rdi
callq 0xa15e0
cmpl $0x0, (%r15)
jne 0xa18c0
movabsq $0x100000100, %rax      # imm = 0x100000100
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x49f16(%rip), %xmm0    # 0xeb750
movaps %xmm0, (%rdx)
movl $0x1, 0x18(%rdx)
movq %r15, 0x20(%rdx)
movq %r14, 0x28(%rdx)
leaq 0xbb(%rip), %rsi        # 0xa190e
movq %rbx, %rdi
callq 0xa16b3
jmp 0xa18c0
leaq 0x2a8f5(%rip), %rsi     # 0xcc159
leaq 0x49fa7(%rip), %rdx     # 0xeb812
leaq 0x49f45(%rip), %rcx     # 0xeb7b7
leaq 0x49ee7(%rip), %r8      # 0xeb760
movq %r14, %rdi
movl $0xdf, %r9d
jmp 0xa18a9
leaq 0x2a8ce(%rip), %rsi     # 0xcc159
leaq 0x49fa3(%rip), %rdx     # 0xeb835
leaq 0x49f1e(%rip), %rcx     # 0xeb7b7
leaq 0x49ec0(%rip), %r8      # 0xeb760
movq %r14, %rdi
movl $0xe0, %r9d
xorl %eax, %eax
callq 0xc007
orl $-0x1, 0xc(%rsp)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0xa12d1
movq %rbx, %rdi
callq 0xa19c8
movl 0xc(%rsp), %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x8c6db(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x2877f(%rip), %rsi     # 0xca066
leaq 0x28d6b(%rip), %rdx     # 0xca659
leaq 0x49ec2(%rip), %rcx     # 0xeb7b7
leaq 0x49e64(%rip), %r8      # 0xeb760
movl $0xd5, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300