// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movl $0x0, 0xc(%rsp)
testq %rdi, %rdi
je 0xbe588
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0xbe7bd
leaq 0x43fe1(%rip), %rdx     # 0x102570
movl $0x1, %edi
movl $0x10, %esi
movl $0x27, %ecx
callq 0x3601f
movq %rax, %r14
cmpl $0x0, 0xc(%rsp)
jne 0xbe5f0
movq %r14, %rdi
xorl %esi, %esi
callq 0xbe365
testq %rax, %rax
je 0xbe5f0
leaq 0x24bb6(%rip), %rsi     # 0xe3179
leaq 0x44016(%rip), %rdx     # 0x1025e0
leaq 0x43ff6(%rip), %rcx     # 0x1025c7
leaq 0x43f98(%rip), %r8      # 0x102570
movq %rbx, %rdi
movl $0xd9, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0xbe63d
movl $0x64, %esi
movq %r14, %rdi
callq 0xbe365
testq %rax, %rax
je 0xbe63d
leaq 0x24b69(%rip), %rsi     # 0xe3179
leaq 0x43fe9(%rip), %rdx     # 0x102600
leaq 0x43fa9(%rip), %rcx     # 0x1025c7
leaq 0x43f4b(%rip), %r8      # 0x102570
movq %rbx, %rdi
movl $0xda, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0xbe665
movl $0x1, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0xbe2c5
movl $0x64, %esi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0xbe2c5
cmpl $0x0, 0xc(%rsp)
jne 0xbe6b0
movq %r14, %rdi
xorl %esi, %esi
callq 0xbe365
cmpq $0x1, %rax
je 0xbe6b0
leaq 0x24af6(%rip), %rsi     # 0xe3179
leaq 0x43f98(%rip), %rdx     # 0x102622
leaq 0x43f36(%rip), %rcx     # 0x1025c7
leaq 0x43ed8(%rip), %r8      # 0x102570
movq %rbx, %rdi
movl $0xdf, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
cmpl $0x0, 0xc(%rsp)
jne 0xbe700
movl $0x64, %esi
movq %r14, %rdi
callq 0xbe365
cmpq $0x100, %rax            # imm = 0x100
je 0xbe700
leaq 0x24aa6(%rip), %rsi     # 0xe3179
leaq 0x43f6b(%rip), %rdx     # 0x102645
leaq 0x43ee6(%rip), %rcx     # 0x1025c7
leaq 0x43e88(%rip), %r8      # 0x102570
movq %rbx, %rdi
movl $0xe0, %r9d
xorl %eax, %eax
callq 0x3559f
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0x2, %esi
movl $0x1, %edx
movq %r14, %rdi
callq 0xbe2c5
cmpl $0x0, 0xc(%rsp)
jne 0xbe75b
movabsq $0x100000001, %rax      # imm = 0x100000001
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x43e1d(%rip), %xmm0    # 0x102550
movaps %xmm0, (%rdx)
movl $0x100, 0x18(%rdx)      # imm = 0x100
leaq 0xc(%rsp), %rax
movq %rax, 0x20(%rdx)
movq %rbx, 0x28(%rdx)
leaq 0x71(%rip), %rsi        # 0xbe7c2
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xbe4a7
cmpl $0x0, 0xc(%rsp)
jne 0xbe7a9
movabsq $0x100000100, %rax      # imm = 0x100000100
leaq 0x10(%rsp), %rdx
movq %rax, 0x10(%rdx)
movaps 0x43de4(%rip), %xmm0    # 0x102560
movaps %xmm0, (%rdx)
movl $0x1, 0x18(%rdx)
leaq 0xc(%rsp), %rax
movq %rax, 0x20(%rdx)
movq %rbx, 0x28(%rdx)
leaq 0x28(%rip), %rsi        # 0xbe7c2
leaq -0x266(%rip), %rcx      # 0xbe53b
movq %r14, %rdi
callq 0xbe4a7
movq %r14, %rdi
callq 0xbe8ba
movl 0xc(%rsp), %eax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
callq 0x29d15