// File: /workspace/github_c_makefile_star2_O3/wuxb45[P]SLB/lib1.c
// Function: rgen_new_zipfian
struct rgen *
rgen_new_zipfian(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  struct rgen_zipfian * const gz = &(gi->gen.zipfian);

  const u64 items = max - min + 1;
  gz->nr_items = items;
  gz->nr_items_d = (double)items;
  gz->base = min;
  gz->base1 = min + 1lu;
  gz->theta = ZIPFIAN_CONSTANT;
  gz->quick1 = 1.0 + pow(0.5, gz->theta);
  const double zeta2theta = zeta(2, ZIPFIAN_CONSTANT);
  gz->alpha = 1.0 / (1.0 - ZIPFIAN_CONSTANT);
  const double zetan = zeta(items, ZIPFIAN_CONSTANT);
  gz->zetan = zetan;
  gz->eta = (1.0 - pow(2.0 / (double)items, 1.0 - ZIPFIAN_CONSTANT)) / (1.0 - (zeta2theta / zetan));
  gz->quick2 = 1.0 - gz->eta;
  gz->min = min;
  gz->max = max;

  gi->type = GEN_ZIPFIAN;
  gi->next_wait = gen_zipfian;
  gi->next_nowait = gen_zipfian;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rax, %r14
movq %rbx, %rax
shrq $0x20, %rax
setne 0x14(%r14)
movq %rbx, -0x38(%rbp)
movq %rbx, %rax
subq %r15, %rax
incq %rax
movq %rax, 0x18(%r14)
vcvtusi2sd %rax, %xmm0, %xmm0
vmovsd %xmm0, -0x48(%rbp)
vmovsd %xmm0, 0x38(%r14)
movq %r15, 0x20(%r14)
leaq 0x1(%r15), %rcx
movq %rcx, 0x28(%r14)
movabsq $0x3fefae147ae147ae, %rcx # imm = 0x3FEFAE147AE147AE
movq %rcx, 0x60(%r14)
movabsq $0x3ff80e3eb6202786, %rcx # imm = 0x3FF80E3EB6202786
movq %rcx, 0x30(%r14)
movabsq $0x4058fffffffffffa, %rcx # imm = 0x4058FFFFFFFFFFFA
movq %rcx, 0x48(%r14)
movq %rax, %rcx
shrq $0x28, %rcx
cmpq $0x10, %rcx
movl $0x10, %r13d
cmovbq %rcx, %r13
leaq 0xab62(%rip), %rcx      # 0x14c40
vmovsd (%rcx,%r13,8), %xmm0
vmovsd %xmm0, -0x40(%rbp)
shlq $0x28, %r13
movq %rax, %rbx
subq %r13, %rbx
cmpq $0xffff, %rbx           # imm = 0xFFFF
ja 0xa160
vxorpd %xmm0, %xmm0, %xmm0
cmpq %r13, %rax
movq -0x38(%rbp), %rbx
je 0xa1c9
orq $0x1, %r13
movq %r15, %r12
subq %rbx, %r12
vmovsd %xmm0, -0x30(%rbp)
vcvtusi2sd %r13, %xmm2, %xmm0
vmovsd 0x9f6e(%rip), %xmm1     # 0x14098
callq 0x6130
vmovsd 0x9f41(%rip), %xmm1     # 0x14078
vdivsd %xmm0, %xmm1, %xmm0
vmovsd -0x30(%rbp), %xmm1
vaddsd %xmm0, %xmm1, %xmm1
vmovsd %xmm1, -0x30(%rbp)
vmovsd -0x30(%rbp), %xmm0
leaq (%r12,%r13), %rax
incq %rax
incq %r13
cmpq $0x2, %rax
jne 0xa117
jmp 0xa1c9
callq 0x7b67
movq %rax, %r12
testq %rax, %rax
je 0xa257
xorl %eax, %eax
leaq -0xc8(%rbp), %rdi
movq %rax, -0x30(%rdi)
movq %r12, -0x28(%rdi)
movq %r13, -0x20(%rdi)
movq %rbx, -0x18(%rdi)
movabsq $0x3fefae147ae147ae, %rcx # imm = 0x3FEFAE147AE147AE
movq %rcx, -0x10(%rdi)
movq %rax, -0x8(%rdi)
movl $0x1, %esi
callq 0x62e0
leaq 0x9014(%rip), %rsi      # 0x131c1
leaq -0xf8(%rbp), %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x806e
vmovsd 0x28(%r13), %xmm0
movq -0x38(%rbp), %rbx
vaddsd -0x40(%rbp), %xmm0, %xmm0
vmovsd %xmm0, -0x30(%rbp)
vmovsd %xmm0, 0x40(%r14)
vmovsd 0x9ebf(%rip), %xmm0     # 0x140a0
vdivsd -0x48(%rbp), %xmm0, %xmm0
vmovsd 0x9eba(%rip), %xmm1     # 0x140a8
callq 0x6130
vmovsd 0x9e7d(%rip), %xmm1     # 0x14078
vsubsd %xmm0, %xmm1, %xmm0
vmovsd 0x9ea9(%rip), %xmm2     # 0x140b0
vdivsd -0x30(%rbp), %xmm2, %xmm2
vaddsd %xmm1, %xmm2, %xmm2
vdivsd %xmm2, %xmm0, %xmm0
vmovsd %xmm0, 0x58(%r14)
vsubsd %xmm0, %xmm1, %xmm0
vmovsd %xmm0, 0x50(%r14)
movq %r15, 0x68(%r14)
movq %rbx, 0x70(%r14)
movl $0x8, 0x10(%r14)
leaq 0x26(%rip), %rax        # 0xa261
movq %rax, (%r14)
movq %rax, 0x8(%r14)
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x66ef
jmp 0xa171