// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, 0xc(%rsp)
testq %rdi, %rdi
je 0xbf61c
movq %r14, %rdi
callq 0x34fea
testb %al, %al
jne 0xbf822
leaq 0x42ebd(%rip), %rdx     # 0x1024e0
movl $0x1, %edi
movl $0x10, %esi
movl $0x27, %ecx
callq 0x359a6
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0xbf3f7
testq %rax, %rax
je 0xbf673
leaq 0x23b09(%rip), %rsi     # 0xe3159
leaq 0x42ef9(%rip), %rdx     # 0x102550
leaq 0x42ed9(%rip), %rcx     # 0x102537
leaq 0x42e7b(%rip), %r8      # 0x1024e0
movq %r14, %rdi
movl $0xd9, %r9d
jmp 0xbf7eb
movl $0x64, %esi
movq %rbx, %rdi
callq 0xbf3f7
testq %rax, %rax
je 0xbf6af
leaq 0x23acd(%rip), %rsi     # 0xe3159
leaq 0x42edd(%rip), %rdx     # 0x102570
leaq 0x42e9d(%rip), %rcx     # 0x102537
leaq 0x42e3f(%rip), %r8      # 0x1024e0
movq %r14, %rdi
movl $0xda, %r9d
jmp 0xbf7eb
movl $0x1, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xbf355
movl $0x64, %esi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0xbf355
movq %rbx, %rdi
xorl %esi, %esi
callq 0xbf3f7
cmpq $0x1, %rax
jne 0xbf79f
movl $0x64, %esi
movq %rbx, %rdi
callq 0xbf3f7
cmpq $0x100, %rax            # imm = 0x100
jne 0xbf7c6
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0xbf355
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x42d97(%rip), %xmm0    # 0x1024c0
movaps %xmm0, (%rdx)
movl $0x100, 0x18(%rdx)      # imm = 0x100
leaq 0xc(%rsp), %r15
movq %r15, 0x20(%rdx)
movq %r14, 0x28(%rdx)
leaq 0xe0(%rip), %rsi        # 0xbf827
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0xbf539
cmpl $0x0, (%r15)
jne 0xbf80c
movabsq $0x100000100, %rax      # imm = 0x100000100
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x42d5b(%rip), %xmm0    # 0x1024d0
movaps %xmm0, (%rdx)
movl $0x1, 0x18(%rdx)
movq %r15, 0x20(%rdx)
movq %r14, 0x28(%rdx)
leaq 0x99(%rip), %rsi        # 0xbf827
leaq -0x1c8(%rip), %rcx      # 0xbf5cd
movq %rbx, %rdi
callq 0xbf539
jmp 0xbf80c
leaq 0x239b3(%rip), %rsi     # 0xe3159
leaq 0x42de5(%rip), %rdx     # 0x102592
leaq 0x42d83(%rip), %rcx     # 0x102537
leaq 0x42d25(%rip), %r8      # 0x1024e0
movq %r14, %rdi
movl $0xdf, %r9d
jmp 0xbf7eb
leaq 0x2398c(%rip), %rsi     # 0xe3159
leaq 0x42de1(%rip), %rdx     # 0x1025b5
leaq 0x42d5c(%rip), %rcx     # 0x102537
leaq 0x42cfe(%rip), %r8      # 0x1024e0
movq %r14, %rdi
movl $0xe0, %r9d
xorl %eax, %eax
callq 0x34f1f
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rdi
callq 0xbf355
movq %rbx, %rdi
callq 0xbf8e3
movl 0xc(%rsp), %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
callq 0x29b1a