LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: xlog_create
struct xlog *
xlog_create(const u64 nr_init, const u64 unit_size)
{
  struct xlog * const xlog = (typeof(xlog))xalloc(64, sizeof(*xlog));
  debug_assert(xlog);
  xlog->nr_rec = 0;
  xlog->nr_cap = nr_init ? nr_init : 4096;
  debug_assert(unit_size);
  xlog->unit_size = unit_size;

  xlog->ptr = malloc(xlog->unit_size * xlog->nr_cap);
  debug_assert(xlog->ptr);
  return xlog;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x20(%rbp), %rdi
movl $0x40, %esi
movl $0x20, %edx
callq 0x6570
testl %eax, %eax
jne 0x931b
movq -0x20(%rbp), %r14
jmp 0x931e
xorl %r14d, %r14d
testq %r14, %r14
je 0x9367
movq $0x0, (%r14)
testq %r15, %r15
movl $0x1000, %eax           # imm = 0x1000
cmovneq %r15, %rax
movq %rax, 0x8(%r14)
testq %rbx, %rbx
je 0x936e
movq %rbx, 0x10(%r14)
imulq 0x8(%r14), %rbx
movq %rbx, %rdi
callq 0x63a0
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x9375
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x66ef
jmp 0x9323
callq 0x66ef
jmp 0x933f
callq 0x66ef
jmp 0x9359
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: xlog_append
inline void
xlog_append(struct xlog * const xlog, const void * const rec)
{
  if (xlog->nr_rec == xlog->nr_cap) {
    xlog_enlarge(xlog);
  }
  u8 * const ptr = xlog->ptr + (xlog->nr_rec * xlog->unit_size);
  memcpy(ptr, rec, xlog->unit_size);
  xlog->nr_rec++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rax
cmpq %rax, (%rdi)
jne 0x93cb
leaq (%rax,%rax), %rcx
movl $0x100000, %edx         # imm = 0x100000
leaq (%rax,%rdx), %r12
cmpq %rdx, %rax
cmovbq %rcx, %r12
movq 0x18(%rbx), %rdi
movq 0x10(%rbx), %rsi
imulq %r12, %rsi
callq 0x63f0
movq %rax, %r15
testq %rax, %rax
je 0x93ee
movq %r15, 0x18(%rbx)
movq %r12, 0x8(%rbx)
movq 0x10(%rbx), %rdx
movq (%rbx), %rdi
imulq %rdx, %rdi
addq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x6340
incq (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x66ef
jmp 0x93c3
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: xlog_iter_create
inline struct xlog_iter *
xlog_iter_create(const struct xlog * const xlog)
{
  struct xlog_iter * const iter = (typeof(iter))malloc(sizeof(*iter));
  iter->xlog = xlog;
  iter->next_id = 0;
  return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x10, %edi
callq 0x63a0
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: xlog_iter_next
inline bool
xlog_iter_next(struct xlog_iter * const iter, void * const out)
{
  const struct xlog * const xlog = iter->xlog;
  if (iter->next_id < xlog->nr_rec) {
    void * const ptr = xlog->ptr + (xlog->unit_size * iter->next_id);
    memcpy(out, ptr, xlog->unit_size);
    iter->next_id++;
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rcx
movq 0x8(%rdi), %r14
movq (%rcx), %r15
cmpq %r15, %r14
jae 0x9539
movq %rdi, %rbx
movq 0x10(%rcx), %rdx
movq %rdx, %rax
imulq %r14, %rax
addq 0x18(%rcx), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x6340
incq 0x8(%rbx)
cmpq %r15, %r14
setb %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: string_tokens
char **
string_tokens(const char * const str, const char * const delim)
{
  if (str == NULL) return NULL;
  size_t aptr = 32;
  char ** tokens = (typeof(tokens))malloc(sizeof(tokens[0]) * aptr);
  if (tokens == NULL) return NULL;
  size_t i = 0;
  char * const dup = strdup(str);
  char * internal = NULL;
  const size_t bufsize = strlen(dup) + 1;
  char * tok = strtok_r(dup, delim, &internal);
  while (tok) {
    if (i >= aptr) {
      char ** const r = (typeof(tokens))realloc(tokens, sizeof(tokens[0]) * (aptr + 32));
      if (r == NULL) {
        free(tokens);
        free(dup);
        return NULL;
      }
      tokens = r;
      aptr += 32;
    }
    tokens[i] = tok;
    i++;
    tok = strtok_r(NULL, delim, &internal);
  }
  tokens[i] = tok;
  const size_t nptr = i + 1;
  const size_t rsize = (sizeof(tokens[0]) * nptr) + bufsize;
  char ** const r = (typeof(tokens))realloc(tokens, rsize);
  if (r == NULL) {
    free(tokens);
    free(dup);
    return NULL;
  }
  tokens = r;
  char * const content = (char *)(&(tokens[nptr]));
  memcpy(content, dup, bufsize);
  for (u64 j = 0; j < i; j++) {
    tokens[j] += (content - dup);
  }
  free(dup);
  return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x974f
movq %rsi, %r15
movq %rdi, %rbx
movl $0x100, %edi            # imm = 0x100
callq 0x63a0
testq %rax, %rax
je 0x974f
movq %rax, %r12
movq %rbx, %rdi
callq 0x65b0
movq %rax, %r14
leaq -0x48(%rbp), %rbx
movq $0x0, (%rbx)
movq %rax, %rdi
callq 0x6170
movq %rax, -0x38(%rbp)
movq %r14, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6290
testq %rax, %rax
je 0x9754
movq %rax, %rbx
movl $0x20, %r13d
xorl %r14d, %r14d
movq %r15, -0x40(%rbp)
cmpq %r13, %r14
movq %r12, %rax
jb 0x972d
leaq 0x100(,%r13,8), %rsi
movq %rax, %r12
movq %rax, %rdi
callq 0x63f0
movq %rax, %r15
testq %rax, %rax
je 0x9710
addq $0x20, %r13
movq %r15, %rax
jmp 0x9724
movq %r12, %rdi
callq 0x6060
movq -0x30(%rbp), %rdi
callq 0x6060
movq %r12, %rax
testq %r15, %r15
movq -0x40(%rbp), %r15
je 0x974f
movq %rax, %r12
movq %rbx, (%rax,%r14,8)
incq %r14
xorl %edi, %edi
movq %r15, %rsi
leaq -0x48(%rbp), %rdx
callq 0x6290
movq %rax, %rbx
testq %rax, %rax
jne 0x96e4
jmp 0x9757
xorl %r13d, %r13d
jmp 0x97d2
xorl %r14d, %r14d
movq -0x38(%rbp), %rbx
incq %rbx
movq %r12, %r15
movq $0x0, (%r12,%r14,8)
leaq (%rbx,%r14,8), %rsi
addq $0x8, %rsi
movq %r12, %rdi
callq 0x63f0
testq %rax, %rax
je 0x97bb
movq %rax, %r13
leaq 0x1(%r14), %rax
movq %rbx, %rdx
leaq (,%rax,8), %rbx
addq %r13, %rbx
movq %rbx, %rdi
movq -0x30(%rbp), %r15
movq %r15, %rsi
callq 0x6340
testq %r14, %r14
je 0x97ca
subq %r15, %rbx
xorl %eax, %eax
addq %rbx, (%r13,%rax,8)
incq %rax
cmpq %rax, %r14
jne 0x97ac
jmp 0x97ca
movq %r15, %rdi
callq 0x6060
xorl %r13d, %r13d
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x6060
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: damp_create
struct damp *
damp_create(const u64 cap, const double dshort, const double dlong)
{
  struct damp * const d = malloc(sizeof(*d) + (sizeof(d->hist[0]) * cap));
  d->cap = cap;
  d->used = 0;
  d->next = 0;
  d->events = 0;
  d->dshort = dshort;
  d->dlong = dlong;
  return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
vmovsd %xmm1, -0x18(%rbp)
vmovsd %xmm0, -0x10(%rbp)
movq %rdi, %rbx
leaq 0x30(,%rdi,8), %rdi
callq 0x63a0
movq %rbx, (%rax)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
vmovsd -0x10(%rbp), %xmm0
vmovsd %xmm0, 0x20(%rax)
vmovsd -0x18(%rbp), %xmm0
vmovsd %xmm0, 0x28(%rax)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: damp_average
double
damp_average(const struct damp * const d)
{
  if (d->used == 0) return 0.0;
  const u64 start = d->next - d->used;
  double sum = 0.0;
  for (u64 i = 0; i < d->used; i++) {
    const u64 idx = (start + i) % d->cap;
    sum += d->hist[idx];
  }
  const double avg = sum / ((double)d->used);
  return avg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x9874
movq (%rdi), %rsi
movq 0x10(%rdi), %r8
movq %rcx, %r9
negq %r9
vxorpd %xmm0, %xmm0, %xmm0
leaq (%r8,%r9), %rax
xorl %edx, %edx
divq %rsi
vaddsd 0x30(%rdi,%rdx,8), %xmm0, %xmm0
incq %r9
jne 0x9854
vcvtusi2sd %rcx, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
jmp 0x9878
vxorpd %xmm0, %xmm0, %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: damp_min
double
damp_min(const struct damp * const d)
{
  if (d->used == 0) return 0.0;
  const u64 start = d->next - d->used;
  double min = d->hist[start % d->cap];
  for (u64 i = 1; i < d->used; i++) {
    const u64 idx = (start + i) % d->cap;
    const double v = d->hist[idx];
    if (v < min) min = v;
  }
  return min;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x98c8
movq (%rdi), %rcx
movq 0x10(%rdi), %rsi
movq %rsi, %rax
subq %r9, %rax
xorl %edx, %edx
divq %rcx
vmovsd 0x30(%rdi,%rdx,8), %xmm0
cmpq $0x1, %r9
je 0x98cc
movl $0x1, %r8d
subq %r9, %r8
leaq (%rsi,%r8), %rax
xorl %edx, %edx
divq %rcx
vmovsd 0x30(%rdi,%rdx,8), %xmm1
vminsd %xmm0, %xmm1, %xmm0
incq %r8
jne 0x98ae
jmp 0x98cc
vxorpd %xmm0, %xmm0, %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: damp_max
double
damp_max(const struct damp * const d)
{
  if (d->used == 0) return 0.0;
  const u64 start = d->next - d->used;
  double max = d->hist[start % d->cap];
  for (u64 i = 1; i < d->used; i++) {
    const u64 idx = (start + i) % d->cap;
    const double v = d->hist[idx];
    if (v > max) max = v;
  }
  return max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x991c
movq (%rdi), %rcx
movq 0x10(%rdi), %rsi
movq %rsi, %rax
subq %r9, %rax
xorl %edx, %edx
divq %rcx
vmovsd 0x30(%rdi,%rdx,8), %xmm0
cmpq $0x1, %r9
je 0x9920
movl $0x1, %r8d
subq %r9, %r8
leaq (%rsi,%r8), %rax
xorl %edx, %edx
divq %rcx
vmovsd 0x30(%rdi,%rdx,8), %xmm1
vmaxsd %xmm0, %xmm1, %xmm0
incq %r8
jne 0x9902
jmp 0x9920
vxorpd %xmm0, %xmm0, %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: damp_add_test
bool
damp_add_test(struct damp * const d, const double v)
{
  d->hist[d->next] = v;
  d->next = (d->next + 1) % d->cap;
  if (d->used < d->cap) d->used++;
  d->events++;

  // short-distance history
  const u64 end = d->next - 1;
  if (d->used >= 3) {
    const double v0 = d->hist[(end - 0) % d->cap];
    const double v1 = d->hist[(end - 1) % d->cap];
    const double v2 = d->hist[(end - 2) % d->cap];
    const double dd = v0 * d->dshort;
    const double d01 = fabs(v1 - v0);
    const double d02 = fabs(v2 - v0);
    if (d01 < dd && d02 < dd) {
      return true;
    }
  }

  // full-distance history
  const double avg = damp_average(d);
  const double dev = avg * d->dlong;
  if (d->used == d->cap) {
    double min = d->hist[0];
    double max = min;
    for (u64 i = 1; i < d->cap; i++) {
      if (d->hist[i] < min) min = d->hist[i];
      if (d->hist[i] > max) max = d->hist[i];
    }
    if (fabs(max - min) < dev) {
      return true;
    }
  }

  if (d->events >= (d->cap * 2)) {
    return true;
  }
  return false;
}

// Assembly:
movq 0x10(%rdi), %rax
vmovsd %xmm0, 0x30(%rdi,%rax,8)
incq %rax
movq (%rdi), %rsi
movq 0x8(%rdi), %r8
xorl %edx, %edx
divq %rsi
movq %rdx, %rcx
movq %rdx, 0x10(%rdi)
cmpq %rsi, %r8
jae 0x994e
incq %r8
movq %r8, 0x8(%rdi)
movq 0x8(%rdi), %r9
movq 0x18(%rdi), %r8
incq %r8
movq %r8, 0x18(%rdi)
cmpq $0x3, %r9
jb 0x99c3
leaq -0x1(%rcx), %rax
xorl %edx, %edx
divq %rsi
vmovsd 0x30(%rdi,%rdx,8), %xmm0
leaq -0x2(%rcx), %rax
xorl %edx, %edx
divq %rsi
vmovsd 0x30(%rdi,%rdx,8), %xmm2
vmulsd 0x20(%rdi), %xmm0, %xmm1
vsubsd %xmm0, %xmm2, %xmm2
vandpd 0xb6dc(%rip){1to2}, %xmm2, %xmm2 # 0x15070
vucomisd %xmm2, %xmm1
jbe 0x99c3
leaq -0x3(%rcx), %rax
xorl %edx, %edx
divq %rsi
vmovsd 0x30(%rdi,%rdx,8), %xmm2
vsubsd %xmm0, %xmm2, %xmm0
vandpd 0xb6b9(%rip){1to2}, %xmm0, %xmm0 # 0x15070
movb $0x1, %al
vucomisd %xmm0, %xmm1
ja 0x9a5b
testq %r9, %r9
je 0x99f8
subq %r9, %rcx
vxorpd %xmm0, %xmm0, %xmm0
xorl %r10d, %r10d
movq %r9, %r11
leaq (%rcx,%r10), %rax
xorl %edx, %edx
divq %rsi
vaddsd 0x30(%rdi,%rdx,8), %xmm0, %xmm0
incq %r10
decq %r11
jne 0x99d5
vcvtusi2sd %r9, %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
jmp 0x99fc
vxorpd %xmm0, %xmm0, %xmm0
cmpq %rsi, %r9
jne 0x9a52
vmulsd 0x28(%rdi), %xmm0, %xmm0
vmovsd 0x30(%rdi), %xmm1
cmpq $0x2, %rsi
jb 0x9a33
leaq -0x1(%rsi), %rax
xorl %ecx, %ecx
vmovapd %xmm1, %xmm2
vmovsd 0x38(%rdi,%rcx,8), %xmm3
vminsd %xmm2, %xmm3, %xmm2
vmaxsd %xmm1, %xmm3, %xmm1
incq %rcx
cmpq %rcx, %rax
jne 0x9a1b
jmp 0x9a37
vmovapd %xmm1, %xmm2
pushq %rbp
movq %rsp, %rbp
vsubsd %xmm2, %xmm1, %xmm1
vandpd 0xb627(%rip){1to2}, %xmm1, %xmm1 # 0x15070
movb $0x1, %al
vucomisd %xmm1, %xmm0
popq %rbp
ja 0x9a5b
addq %rsi, %rsi
cmpq %rsi, %r8
setae %al
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: xorshift
inline u64
xorshift(const u64 seed)
{
  u64 x = seed ? seed : time_nsec();
  x ^= x >> 12; // a
  x ^= x << 25; // b
  x ^= x >> 27; // c
  return x * UINT64_C(2685821657736338717);
}

// Assembly:
testq %rdi, %rdi
jne 0x9b96
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x18(%rbp), %rbx
movl $0x4, %edi
movq %rbx, %rsi
callq 0x6110
imulq $0x3b9aca00, (%rbx), %rdi # imm = 0x3B9ACA00
addq 0x8(%rbx), %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
movq %rdi, %rax
shrq $0xc, %rax
xorq %rdi, %rax
movq %rax, %rcx
shlq $0x19, %rcx
xorq %rax, %rcx
movq %rcx, %rdx
shrq $0x1b, %rdx
xorq %rcx, %rdx
movabsq $0x2545f4914f6cdd1d, %rax # imm = 0x2545F4914F6CDD1D
imulq %rdx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_exponential
struct rgen *
rgen_new_exponential(const double percentile, const double range)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = true;
  gi->gen.exponential.gamma = - log(1.0 - (percentile/100.0)) / range;

  gi->type = GEN_EXPONENTIAL;
  gi->next_wait = gen_exponential;
  gi->next_nowait = gen_exponential;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
vmovsd %xmm1, -0x18(%rbp)
vmovsd %xmm0, -0x10(%rbp)
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rax, %rbx
movb $0x1, 0x14(%rax)
vmovsd -0x10(%rbp), %xmm0
vdivsd 0xb3ac(%rip), %xmm0, %xmm0 # 0x15088
vaddsd 0xb394(%rip), %xmm0, %xmm0 # 0x15078
callq 0x6240
vxorpd 0xb39d(%rip){1to2}, %xmm0, %xmm0 # 0x15090
vdivsd -0x18(%rbp), %xmm0, %xmm0
vmovsd %xmm0, 0x18(%rbx)
movl $0x7, 0x10(%rbx)
leaq 0x11(%rip), %rax        # 0x9d1c
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_constant
struct rgen *
rgen_new_constant(const u64 constant)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = constant > UINT32_MAX ? true : false;
  gi->gen.constant.constant = constant;

  gi->type = GEN_CONSTANT;
  gi->next_wait = gen_constant;
  gi->next_nowait = gen_constant;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq %rbx, 0x18(%rax)
movl $0x0, 0x10(%rax)
leaq 0xe(%rip), %rcx         # 0x9dfd
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_counter
struct rgen *
rgen_new_counter(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.counter.counter = 0;
  gi->gen.counter.base = min;
  gi->gen.counter.modulus = max - min + 1;

  gi->type = GEN_COUNTER;
  gi->next_wait = gen_counter;
  gi->next_nowait = gen_counter;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
xorl %ecx, %ecx
xchgq %rcx, 0x18(%rax)
movq %r14, 0x20(%rax)
subq %r14, %rbx
incq %rbx
movq %rbx, 0x28(%rax)
movl $0x1, 0x10(%rax)
leaq 0xc(%rip), %rcx         # 0x9e5c
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_counter_unsafe
struct rgen *
rgen_new_counter_unsafe(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.counter.counter_unsafe = 0;
  gi->gen.counter.base = min;
  gi->gen.counter.modulus = max - min + 1;

  gi->type = GEN_COUNTER_UNSAFE;
  gi->next_wait = gen_counter_unsafe;
  gi->next_nowait = gen_counter_unsafe;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq $0x0, 0x18(%rax)
movq %r14, 0x20(%rax)
subq %r14, %rbx
incq %rbx
movq %rbx, 0x28(%rax)
movl $0x2, 0x10(%rax)
leaq 0xc(%rip), %rcx         # 0x9ed1
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_skipinc
struct rgen *
rgen_new_skipinc(const u64 min, const u64 max, const u64 inc)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.skipinc.counter = 0;
  gi->gen.skipinc.base = min;
  gi->gen.skipinc.modulus = max - min + 1;
  gi->gen.skipinc.inc = inc;

  gi->type = GEN_SKIPINC;
  gi->next_wait = gen_skipinc;
  gi->next_nowait = gen_skipinc;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %r14, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
xorl %ecx, %ecx
xchgq %rcx, 0x18(%rax)
movq %r15, 0x20(%rax)
subq %r15, %r14
incq %r14
movq %r14, 0x28(%rax)
movq %rbx, 0x30(%rax)
movl $0x3, 0x10(%rax)
leaq 0x12(%rip), %rcx        # 0x9f52
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_skipinc_unsafe
struct rgen *
rgen_new_skipinc_unsafe(const u64 min, const u64 max, const u64 inc)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.skipinc.counter_unsafe = 0;
  gi->gen.skipinc.base = min;
  gi->gen.skipinc.modulus = max - min + 1;
  gi->gen.skipinc.inc = inc;

  gi->type = GEN_SKIPINC_UNSAFE;
  gi->next_wait = gen_skipinc_unsafe;
  gi->next_nowait = gen_skipinc_unsafe;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %r14, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq $0x0, 0x18(%rax)
movq %r15, 0x20(%rax)
subq %r15, %r14
incq %r14
movq %r14, 0x28(%rax)
movq %rbx, 0x30(%rax)
movl $0x4, 0x10(%rax)
leaq 0x12(%rip), %rcx        # 0x9fd6
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_reducer
struct rgen *
rgen_new_reducer(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.reducer.counter = 0;
  gi->gen.reducer.base = max;
  gi->gen.reducer.modulus = max - min + 1;

  gi->type = GEN_REDUCER;
  gi->next_wait = gen_reducer;
  gi->next_nowait = gen_reducer;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
xorl %ecx, %ecx
xchgq %rcx, 0x18(%rax)
movq %rbx, 0x20(%rax)
subq %r14, %rbx
incq %rbx
movq %rbx, 0x28(%rax)
movl $0x5, 0x10(%rax)
leaq 0xc(%rip), %rcx         # 0xa04d
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_reducer_unsafe
struct rgen *
rgen_new_reducer_unsafe(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.reducer.counter_unsafe = 0;
  gi->gen.reducer.base = max;
  gi->gen.reducer.modulus = max - min + 1;

  gi->type = GEN_REDUCER_UNSAFE;
  gi->next_wait = gen_reducer_unsafe;
  gi->next_nowait = gen_reducer_unsafe;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq $0x0, 0x18(%rax)
movq %rbx, 0x20(%rax)
subq %r14, %rbx
incq %rbx
movq %rbx, 0x28(%rax)
movl $0x6, 0x10(%rax)
leaq 0xc(%rip), %rcx         # 0xa0c5
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gen_zipfian
static u64
gen_zipfian(struct rgen * const gi)
{
  // simplified: no increamental update
  const struct rgen_zipfian * const gz = &(gi->gen.zipfian);
  const double u = random_double();
  const double uz = u * gz->zetan;
  if (uz < 1.0) {
    return gz->base;
  } else if (uz < gz->quick1) {
    return gz->base1;
  }
  //const double x = gz->nr_items_d * pow(gz->eta * (u - 1.0) + 1.0, gz->alpha);
  const double x = gz->nr_items_d * pow((gz->eta * u) + gz->quick2, gz->alpha);
  const u64 ret = gz->base + (u64)x;
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0xa39f
leaq -0x28(%rbp), %r14
movl $0x4, %edi
movq %r14, %rsi
callq 0x6110
imulq $0x3b9aca00, (%r14), %rax # imm = 0x3B9ACA00
addq 0x8(%r14), %rax
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0x19, %rax
xorq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $0x2545f4914f6cdd1d, %rax # imm = 0x2545F4914F6CDD1D
imulq %rcx, %rax
vcvtusi2sd %rax, %xmm0, %xmm0
vmulsd 0xaca7(%rip), %xmm0, %xmm0 # 0x15080
movq %rax, %fs:-0x8
vmulsd 0x40(%rbx), %xmm0, %xmm1
vmovsd 0xac89(%rip), %xmm2     # 0x15078
vucomisd %xmm1, %xmm2
jbe 0xa3fb
movq 0x20(%rbx), %rax
jmp 0xa43a
vmovsd 0x30(%rbx), %xmm2
vucomisd %xmm1, %xmm2
jbe 0xa40c
movq 0x28(%rbx), %rax
jmp 0xa43a
vmovsd 0x58(%rbx), %xmm1
vfmadd213sd 0x50(%rbx), %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + mem
vmovsd 0x38(%rbx), %xmm1
vmovsd %xmm1, -0x18(%rbp)
vmovsd 0x48(%rbx), %xmm1
callq 0x6130
vmulsd -0x18(%rbp), %xmm0, %xmm0
vcvttsd2usi %xmm0, %rax
addq 0x20(%rbx), %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_xzipfian
struct rgen *
rgen_new_xzipfian(const u64 min, const u64 max)
{
  struct rgen * gi = rgen_new_zipfian(min, max);
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->type = GEN_XZIPFIAN;
  gi->next_wait = gen_xzipfian;
  gi->next_nowait = gen_xzipfian;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0xa0e7
shrq $0x20, %rbx
setne 0x14(%rax)
movl $0x9, 0x10(%rax)
leaq 0xe(%rip), %rcx         # 0xa475
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_unizipf
struct rgen *
rgen_new_unizipf(const u64 min, const u64 max, const u64 ufactor)
{
  const u64 nr = max - min + 1;
  if (ufactor == 1lu) { // covers both special gens
    return rgen_new_zipfian(min, max);
  } else if ((ufactor == 0) || ((nr / ufactor) <= 1lu)) {
    return rgen_new_uniform(min, max);
  }
  const u64 znr = nr / ufactor;
  struct rgen * gi = rgen_new_zipfian(0, znr - 1);
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.unizipf.ufactor = ufactor;
  gi->gen.unizipf.min = min;
  gi->gen.unizipf.max = max;
  gi->next_wait = gen_unizipf;
  gi->next_nowait = gen_unizipf;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %r12
subq %rdi, %r12
testq %rdx, %rdx
je 0xa555
movq %rdx, %r15
cmpq $0x1, %rdx
jne 0xa545
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa0e7
leaq 0x1(%r12), %rax
xorl %edx, %edx
divq %r15
cmpq $0x1, %rax
ja 0xa592
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
vcvtusi2sd %r12, %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rax)
movl $0xb, 0x10(%rax)
leaq 0x13d(%rip), %rcx       # 0xa6cd
jmp 0xa5c3
decq %rax
xorl %edi, %edi
movq %rax, %rsi
callq 0xa0e7
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq %r15, 0x78(%rax)
movq %r14, 0x80(%rax)
movq %rbx, 0x88(%rax)
leaq 0x67(%rip), %rcx        # 0xa62a
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_uniform
struct rgen *
rgen_new_uniform(const u64 min, const u64 max)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->unit_u64 = max > UINT32_MAX ? true : false;
  gi->gen.uniform.min = min;
  gi->gen.uniform.max = max;
  gi->gen.uniform.interval = (double)(max - min);

  gi->type = GEN_UNIFORM;
  gi->next_wait = gen_uniform;
  gi->next_nowait = gen_uniform;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rbx, %rcx
shrq $0x20, %rcx
setne 0x14(%rax)
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
subq %r14, %rbx
vcvtusi2sd %rbx, %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rax)
movl $0xb, 0x10(%rax)
leaq 0xaf(%rip), %rcx        # 0xa6cd
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_new_trace32
struct rgen *
rgen_new_trace32(const char * const filename)
{
  struct rgen * const gi = (typeof(gi))calloc(1, sizeof(*gi));
  gi->gen.trace32.fin = fopen(filename, "rb");
  if (gi->gen.trace32.fin == NULL) {
    free(gi);
    return NULL;
  }
  gi->gen.trace32.idx = 0;
  gi->gen.trace32.max = fread(gi->gen.trace32.buf, sizeof(u32), 32, gi->gen.trace32.fin);
  if (gi->gen.trace32.max == 0) {
    free(gi);
    return NULL;
  }
  posix_fadvise(fileno(gi->gen.trace32.fin), 0, 0, POSIX_FADV_SEQUENTIAL);
  gi->type = GEN_TRACE32;
  gi->next_wait = gen_trace32;
  gi->next_nowait = gen_trace32;
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x220, %esi            # imm = 0x220
callq 0x62d0
movq %rax, %rbx
leaq 0xaaf2(%rip), %rsi      # 0x15275
movq %r14, %rdi
callq 0x6480
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xa7ee
movq $0x0, 0x20(%rbx)
movq %rbx, %rdi
addq $0x30, %rdi
movl $0x4, %esi
movl $0x20, %edx
movq %rax, %rcx
callq 0x60f0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0xa7ee
movq 0x18(%rbx), %rdi
callq 0x6370
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
movl $0x2, %ecx
callq 0x6260
movl $0xc, 0x10(%rbx)
leaq 0x1b(%rip), %rax        # 0xa800
movq %rax, (%rbx)
movq %rax, 0x8(%rbx)
jmp 0xa7f8
movq %rbx, %rdi
callq 0x6060
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gen_trace32
static u64
gen_trace32(struct rgen * const gi)
{
  if (gi->gen.trace32.idx >= gi->gen.trace32.max) {
    if (feof(gi->gen.trace32.fin)) rewind(gi->gen.trace32.fin);
    gi->gen.trace32.idx = 0;
    gi->gen.trace32.max = fread(gi->gen.trace32.buf, sizeof(u32), 32, gi->gen.trace32.fin);
  }
  const u64 r = gi->gen.trace32.buf[gi->gen.trace32.idx];
  gi->gen.trace32.idx++;
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
cmpq 0x28(%rdi), %rax
jb 0xa84c
movq 0x18(%rbx), %rdi
callq 0x6330
testl %eax, %eax
je 0xa829
movq 0x18(%rbx), %rdi
callq 0x61c0
movq $0x0, 0x20(%rbx)
leaq 0x30(%rbx), %rdi
movq 0x18(%rbx), %rcx
movl $0x4, %esi
movl $0x20, %edx
callq 0x60f0
movq %rax, 0x28(%rbx)
movq 0x20(%rbx), %rcx
movl 0x30(%rbx,%rcx,4), %eax
incq %rcx
movq %rcx, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_destroy
void
rgen_destroy(struct rgen * const gen)
{
  if (gen == NULL) return;
  if (gen->async_worker) {
    struct rgen_worker_info * const info = &(gen->wi);
    atomic_store(&(info->running), false);
    pthread_join(info->thread, NULL);
    rgen_clean_async_buffers(info);
  }
  if (gen->type == GEN_TRACE32) {
    fclose(gen->gen.trace32.fin);
  }
  free(gen);
}

// Assembly:
testq %rdi, %rdi
je 0xa8ed
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0x15(%rdi)
jne 0xa8ca
xorl %eax, %eax
xchgb %al, 0x1c8(%rbx)
movq 0x1c0(%rbx), %rdi
xorl %esi, %esi
callq 0x65a0
movq 0x110(%rbx), %rdi
testq %rdi, %rdi
je 0xa8ca
movq 0x118(%rbx), %rsi
callq 0x6410
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, 0xf0(%rbx)
movq $0x0, 0x110(%rbx)
cmpl $0xc, 0x10(%rbx)
jne 0xa8dc
movq 0x18(%rbx), %rdi
vzeroupper
callq 0x6140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
vzeroupper
jmp 0x6060
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_dup
struct rgen *
rgen_dup(struct rgen * const gen0)
{
  if (gen0->async_worker) {
    return NULL;
  }
  struct rgen * const gen = (typeof(gen))malloc(sizeof(*gen));
  memcpy(gen, gen0, sizeof(*gen));
  struct rgen_worker_info * const info = &(gen->wi);
  memset(info, 0, sizeof(*info));
  if (gen->type == GEN_TRACE32) {
    FILE * const f2 = fdopen(dup(fileno(gen0->gen.trace32.fin)), "rb");
    posix_fadvise(fileno(f2), 0, 0, POSIX_FADV_SEQUENTIAL);
    gen->gen.trace32.fin = f2;
    gen->gen.trace32.idx = 0;
    gen->gen.trace32.max = 0;
  }
  return gen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x15(%rdi)
je 0xac77
xorl %ebx, %ebx
jmp 0xacf6
movq %rdi, %r14
movl $0x220, %edi            # imm = 0x220
callq 0x63a0
movq %rax, %rbx
movl $0x220, %edx            # imm = 0x220
movq %rax, %rdi
movq %r14, %rsi
callq 0x6340
leaq 0xf0(%rbx), %rdi
movl $0x130, %edx            # imm = 0x130
xorl %esi, %esi
callq 0x6210
cmpl $0xc, 0x10(%rbx)
jne 0xacf6
movq 0x18(%r14), %rdi
callq 0x6370
movl %eax, %edi
callq 0x61f0
leaq 0xa5ae(%rip), %rsi      # 0x15275
movl %eax, %edi
callq 0x6400
movq %rax, %r14
movq %rax, %rdi
callq 0x6370
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
movl $0x2, %ecx
callq 0x6260
movq %r14, 0x18(%rbx)
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_async_convert
bool
rgen_async_convert(struct rgen * const gen, const u64 cpu)
{
  if (gen->async_worker) {
    return false; // already converted
  }
  struct rgen_worker_info * const info = &(gen->wi);
  memset(info, 0, sizeof(*info));
  info->real_next = gen->next_wait;
  const u64 g = UINT64_C(1) << 30;
  const u64 usize = gen->unit_u64 ? sizeof(u64) : sizeof(u32);
  info->mem = pages_alloc_best(g, true, &(info->alloc_size));
  info->buffer_nr = g / (RGEN_ASYNC_BUFFER_NR * usize);
  info->cpu = cpu;
  atomic_store(&(info->running), true);
  for (u64 j = 0; j < RGEN_ASYNC_BUFFER_NR; j++) {
    info->buffers_u64[j] = (u64 *)(&(info->mem[j * info->buffer_nr * usize]));
    atomic_store(&(info->avail[j]), false);
  }
  gen->next_wait = rgen_async_next_wait;
  gen->next_nowait = rgen_async_next_nowait;
  if (thread_create_at(cpu, &(info->thread), rgen_worker, gen) == 0) {
    char thname[32];
    sprintf(thname, "rgen_async_%"PRIu64, cpu);
    pthread_setname_np(info->thread, thname);
    info->reader_id = 0;
    info->i = 0;
    gen->async_worker = true;
    return true;
  } else {
    rgen_clean_async_buffers(info);
    return false;
  }
}

// Assembly:
cmpb $0x0, 0x15(%rdi)
je 0xad07
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xf0(%rdi), %r14
movl $0x130, %edx            # imm = 0x130
movq %r14, %rdi
xorl %esi, %esi
callq 0x6210
movq (%rbx), %rax
movq %rax, 0x1a8(%rbx)
movzbl 0x14(%rbx), %r12d
leaq 0x118(%rbx), %rdx
movl $0x40000000, %edi       # imm = 0x40000000
movl $0x1, %esi
callq 0x831a
movq %rax, 0x110(%rbx)
movl %r12d, %eax
xorb $0x1, %al
movzbl %al, %eax
shll $0x19, %eax
addq $0x2000000, %rax        # imm = 0x2000000
movq %rax, 0x1b0(%rbx)
movq %r15, 0x1b8(%rbx)
movb $0x1, %al
xchgb %al, 0x1c8(%rbx)
orq $0x2, %r12
xorl %eax, %eax
movq 0x1b0(%rbx), %rcx
imulq %rax, %rcx
shlxq %r12, %rcx, %rcx
addq 0x110(%rbx), %rcx
movq %rcx, 0xf0(%rbx,%rax,8)
xorl %ecx, %ecx
xchgb %cl, 0x160(%rbx,%rax)
incq %rax
cmpq $0x4, %rax
jne 0xad8b
leaq 0xa1(%rip), %rax        # 0xae64
movq %rax, (%rbx)
leaq 0x12a(%rip), %rax       # 0xaef7
movq %rax, 0x8(%rbx)
leaq 0x1c0(%rbx), %rsi
leaq 0x164(%rip), %rdx       # 0xaf43
movq %r15, %rdi
movq %rbx, %rcx
callq 0x814e
testl %eax, %eax
je 0xae1b
movq 0x110(%rbx), %rdi
testq %rdi, %rdi
je 0xae17
movq 0x118(%rbx), %rsi
callq 0x6410
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, (%r14)
movq $0x0, 0x20(%r14)
xorl %eax, %eax
jmp 0xae54
leaq 0xa5db(%rip), %rsi      # 0x153fd
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6520
movq 0x1c0(%rbx), %rdi
movq %r14, %rsi
callq 0x61d0
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, 0x210(%rbx)
movb $0x1, 0x15(%rbx)
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_async_next_wait
static u64
rgen_async_next_wait(struct rgen * const gen)
{
  struct rgen_worker_info * const info = &(gen->wi);
  u64 i = info->i;
  if (i == 0) rgen_async_wait(gen);

  const u64 id0 = info->reader_id;
  const u64 r = gen->unit_u64 ? info->buffers_u64[id0][i] : info->buffers_u32[id0][i];
  i++;
  if (i >= info->buffer_nr) {
    atomic_store(&(info->avail[id0]), false);
    info->reader_id = (id0 + 1) % RGEN_ASYNC_BUFFER_NR;
    i = 0;
  }
  info->i = i;
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x218(%rdi), %r14
testq %r14, %r14
je 0xaed2
movq 0x210(%rbx), %rcx
movq 0xf0(%rbx,%rcx,8), %rax
cmpb $0x1, 0x14(%rbx)
jne 0xae98
movq (%rax,%r14,8), %rax
jmp 0xae9c
movl (%rax,%r14,4), %eax
incq %r14
cmpq 0x1b0(%rbx), %r14
jb 0xaec0
xorl %edx, %edx
xchgb %dl, 0x160(%rbx,%rcx)
xorl %r14d, %r14d
incl %ecx
andl $0x3, %ecx
movq %rcx, 0x210(%rbx)
movq %r14, 0x218(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x15(%rbx)
je 0xae7d
movq 0x210(%rbx), %r15
movb 0x160(%rbx,%r15), %al
testb $0x1, %al
jne 0xae7d
movl $0x1, %edi
callq 0x6600
jmp 0xaedf
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_async_next_nowait
static u64
rgen_async_next_nowait(struct rgen * const gen)
{
  struct rgen_worker_info * const info = &(gen->wi);
  u64 i = info->i;

  const u64 id0 = info->reader_id;
  const u64 r = gen->unit_u64 ? info->buffers_u64[id0][i] : info->buffers_u32[id0][i];
  i++;
  if (i >= info->buffer_nr) {
    info->reader_id = (id0 + 1) % RGEN_ASYNC_BUFFER_NR;
    i = 0;
  }
  info->i = i;
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x218(%rdi), %rdx
movq 0x210(%rdi), %rcx
movq 0xf0(%rdi,%rcx,8), %rax
cmpb $0x1, 0x14(%rdi)
jne 0xaf1d
movq (%rax,%rdx,8), %rax
jmp 0xaf20
movl (%rax,%rdx,4), %eax
incq %rdx
cmpq 0x1b0(%rdi), %rdx
jb 0xaf3a
incl %ecx
andl $0x3, %ecx
movq %rcx, 0x210(%rdi)
xorl %edx, %edx
movq %rdx, 0x218(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rgen_worker
static void *
rgen_worker(void * const ptr)
{
  struct rgen * const gen = (typeof(gen))ptr;
  struct rgen_worker_info * const info = &(gen->wi);
  const u64 cpu = info->cpu;
  srandom_u64((cpu + 3) * 97);
  const u64 nr = info->buffer_nr;
  while (true) {
    for (u64 i = 0; i < RGEN_ASYNC_BUFFER_NR; i++) {
      while (atomic_load(&(info->avail[i])) == true) {
        usleep(10);
        if (atomic_load(&(info->running)) == false) {
          return NULL;
        }
      }
      if (gen->unit_u64) {
        u64 * const buf64 = info->buffers_u64[i];
        for (u64 j = 0; j < nr; j++) {
          buf64[j] = info->real_next(gen);
        }
      } else {
        u32 * const buf32 = info->buffers_u32[i];
        for (u64 j = 0; j < nr; j++) {
          buf32[j] = (u32)(info->real_next(gen));
        }
      }
      atomic_thread_fence(memory_order_seq_cst);
      atomic_store(&(info->avail[i]), true);
    }
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
imulq $0x61, 0x1b8(%rdi), %rax
addq $0x123, %rax            # imm = 0x123
jne 0xaf83
leaq -0x38(%rbp), %r14
movl $0x4, %edi
movq %r14, %rsi
callq 0x6110
imulq $0x3b9aca00, (%r14), %rax # imm = 0x3B9ACA00
addq 0x8(%r14), %rax
movq %rax, %rcx
shrq $0xc, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shlq $0x19, %rax
xorq %rcx, %rax
movq %rax, %rcx
shrq $0x1b, %rcx
xorq %rax, %rcx
movabsq $0x2545f4914f6cdd1d, %rax # imm = 0x2545F4914F6CDD1D
imulq %rcx, %rax
movq %rax, %fs:-0x8
movq 0x1b0(%rbx), %r14
xorl %r12d, %r12d
xorl %r15d, %r15d
movb 0x160(%rbx,%r15), %al
testb $0x1, %al
je 0xafe7
movl $0xa, %edi
callq 0x6600
movb 0x1c8(%rbx), %al
testb $0x1, %al
jne 0xafc5
jmp 0xb05c
movq 0xf0(%rbx,%r15,8), %r12
cmpb $0x1, 0x14(%rbx)
jne 0xb014
testq %r14, %r14
je 0xb031
xorl %r13d, %r13d
movq %rbx, %rdi
callq *0x1a8(%rbx)
movq %rax, (%r12,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0xaffd
jmp 0xb031
testq %r14, %r14
je 0xb031
xorl %r13d, %r13d
movq %rbx, %rdi
callq *0x1a8(%rbx)
movl %eax, (%r12,%r13,4)
incq %r13
cmpq %r13, %r14
jne 0xb01c
mfence
movb $0x1, %al
xchgb %al, 0x160(%rbx,%r15)
cmpq $0x3, %r15
leaq 0x1(%r15), %rax
setae %r12b
movq %rax, %r15
cmpq $0x4, %rax
jne 0xafc5
jmp 0xafbf
testb $0x1, %r12b
jne 0xafbf
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rcu_read_ref
void *
rcu_read_ref(struct rcu_node * const node)
{
  do {
    for (u64 i = 0; i < 2; i++) {
      u64 x = node->x[i];
      if (x & RCU_VALID_MASK) {
        const bool r = atomic_compare_exchange_strong(&(node->x[i]), &x, x + 1);
        if (r == true) {
          return (void *)(x >> RCU_VALUE_SHIFT);
        }
      }
    }
  } while (true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edx, %edx
xorl %esi, %esi
movq (%rdi,%rsi,8), %rax
movb $0x1, %r8b
testw %ax, %ax
jns 0xb0e4
leaq 0x1(%rax), %r8
lock
cmpxchgq %r8, (%rdi,%rsi,8)
sete %r9b
setne %r8b
shrq $0x10, %rax
testb %r9b, %r9b
cmovneq %rax, %rcx
testb %r8b, %r8b
je 0xb0f8
leaq 0x1(%rsi), %rax
testq %rsi, %rsi
setne %dl
movq %rax, %rsi
je 0xb0bb
xorl %esi, %esi
testb $0x1, %dl
movl $0x0, %edx
jne 0xb0bb
movq %rcx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rcu_read_unref
void
rcu_read_unref(struct rcu_node * const node, void * ptr)
{
  for (u64 i = 0; i < 2; i++) {
    const u64 x = node->x[i];
    if ((x >> RCU_VALUE_SHIFT) == ((u64)ptr)) {
      bool r = false;
      do {
        u64 xx = node->x[i];
        debug_assert(xx & RCU_COUNT_MASK);
        r = atomic_compare_exchange_strong(&(node->x[i]), &xx, xx - 1);
      } while (r == false);
      return;
    }
  }
  debug_assert(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rsi, -0x30(%rbp)
movq (%r14,%r13,8), %rbx
shrq $0x10, %rbx
cmpq %rsi, %rbx
jne 0xb15f
movq (%r14,%r13,8), %r15
testl $0x7fff, %r15d          # imm = 0x7FFF
je 0xb14f
leaq -0x1(%r15), %rcx
movq %r15, %rax
lock
cmpxchgq %rcx, (%r14,%r13,8)
jne 0xb131
jmp 0xb156
callq 0x66ef
jmp 0xb13e
movq -0x30(%rbp), %rsi
cmpq %rsi, %rbx
je 0xb171
leaq 0x1(%r13), %rax
testq %r13, %r13
setne %r12b
movq %rax, %r13
je 0xb124
jmp 0xb186
testb $0x1, %r12b
jne 0xb186
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66ef
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rcu_update
void
rcu_update(struct rcu_node * const node, void * ptr)
{
  for (u64 i = 0; i < 2; i++) {
    const u64 x = node->x[i];
    if ((x & RCU_VALID_MASK) == 0) {
      debug_assert((node->x[1-i] >> RCU_VALUE_SHIFT) != ((u64)ptr));
      const u64 xx = (((u64)ptr) << RCU_VALUE_SHIFT) | RCU_VALID_MASK;
      atomic_store(&(node->x[i]), xx);
      atomic_thread_fence(memory_order_seq_cst);
      __rcu_gc(&(node->x[1-i]));
      return;
    }
  }
  debug_assert(false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
testw %ax, %ax
js 0xb1bd
xorl %r15d, %r15d
xorl %r13d, %r13d
jmp 0xb1d7
xorl %eax, %eax
testb $0x1, %al
jne 0xb235
movl %eax, %r15d
movq 0x8(%rbx), %rcx
movb $0x1, %al
testw %cx, %cx
js 0xb1bf
movl $0x1, %r13d
movq %r13, %r12
xorq $0x1, %r12
movq (%rbx,%r12,8), %rax
shrq $0x10, %rax
cmpq %r14, %rax
je 0xb248
shlq $0x10, %r14
orq $0x8000, %r14           # imm = 0x8000
xchgq %r14, (%rbx,%r13,8)
mfence
movq (%rbx,%r12,8), %rax
movq %rax, %rcx
andq $-0x8001, %rcx          # imm = 0xFFFF7FFF
lock
cmpxchgq %rcx, (%rbx,%r12,8)
jne 0xb1fd
mfence
movq (%rbx,%r12,8), %rax
shlq $0x31, %rax
jne 0xb216
testb $0x1, %r15b
jne 0xb235
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66ef
callq 0x66ef
jmp 0xb1eb
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: server_create
struct server *
server_create(const char * const host, const int port, void*(*worker)(void*), void * const priv)
{
  char portstr[6];
  snprintf(portstr, 6, "%d", port);
  struct addrinfo info0 = {.ai_family = AF_INET, .ai_socktype = SOCK_STREAM};
  struct addrinfo *info = NULL;
  if (getaddrinfo(host, portstr, &info0, &info) != 0) return NULL;
  int fd = -1;

  for (struct addrinfo * p = info; p != NULL; p = p->ai_next) {
    fd = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
    if (fd < 0) continue;
    int one = 1;
    (void)setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
    if (bind(fd, p->ai_addr, p->ai_addrlen) != 0) break;
    if (listen(fd, 64) != 0) break;
    struct server * const server = malloc(sizeof(*server));
    server->running = true;
    server->fd = fd;
    server->worker = worker;
    server->priv = priv;
    if (pthread_create(&(server->pt), NULL, __server_master, server) != 0) {
      free(server);
      break;
    }
    freeaddrinfo(info);
    return server;
  }
  if (fd >= 0) {
    close(fd);
  }
  if (info) {
    freeaddrinfo(info);
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x9f6c(%rip), %rdx      # 0x151de
xorl %r12d, %r12d
leaq -0x3a(%rbp), %r13
movl $0x6, %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x61e0
vxorps %xmm0, %xmm0, %xmm0
leaq -0x70(%rbp), %rdx
vmovups %ymm0, (%rdx)
vmovups %ymm0, 0x10(%rdx)
movabsq $0x100000002, %rax      # imm = 0x100000002
movq %rax, 0x4(%rdx)
leaq -0x30(%rbp), %rcx
movq $0x0, (%rcx)
movq %rbx, %rdi
movq %r13, %rsi
vzeroupper
callq 0x6590
testl %eax, %eax
jne 0xb36b
movq -0x30(%rbp), %r12
movb $0x1, %r13b
testq %r12, %r12
je 0xb2fa
movl 0x4(%r12), %edi
movl 0x8(%r12), %esi
movl 0xc(%r12), %edx
callq 0x6620
movl %eax, %ebx
testl %eax, %eax
jns 0xb301
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0xb2d4
jmp 0xb34a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xb34a
leaq -0x34(%rbp), %rcx
movl $0x1, (%rcx)
movl %ebx, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x6100
movq 0x18(%r12), %rsi
movl 0x10(%r12), %edx
movl %ebx, %edi
callq 0x6420
movb $0x1, %r13b
testl %eax, %eax
jne 0xb34a
movl %ebx, %edi
movl $0x40, %esi
callq 0x63c0
testl %eax, %eax
je 0xb37d
testb %r13b, %r13b
je 0xb36b
testl %ebx, %ebx
js 0xb35a
movl %ebx, %edi
callq 0x6220
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0xb368
callq 0x6610
xorl %r12d, %r12d
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x63a0
movq %rax, %r12
movb $0x1, 0x4(%rax)
movl %ebx, (%rax)
movq %r15, 0x10(%rax)
movq %r14, 0x18(%rax)
leaq 0x8(%rax), %rdi
leaq 0x26(%rip), %rdx        # 0xb3c9
xorl %esi, %esi
movq %rax, %rcx
callq 0x6430
testl %eax, %eax
je 0xb3bb
movq %r12, %rdi
callq 0x6060
jmp 0xb34a
movq -0x30(%rbp), %rdi
callq 0x6610
xorl %r13d, %r13d
jmp 0xb34a
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: _server_master
static void *
__server_master(void * const ptr)
{
  const u64 nr_cores = process_affinity_core_count();
  u64 * const cores = (typeof(cores))calloc(nr_cores, sizeof(cores[0]));
  const u64 nr_cores1 = process_affinity_core_list(nr_cores, cores);
  u64 next_core_id = 0;

  struct server * const server = (typeof(server))ptr;
  while (server->running) {
    const int cli = accept(server->fd, NULL, NULL);
    if (cli < 0) {
      if (errno == EINTR) continue;
      break;
    }
    pthread_t worker;
    struct server_wi * const wi = (typeof(wi))malloc(sizeof(*wi));
    wi->server = server;
    wi->s2.r = fdopen(dup(cli), "rb");
    wi->s2.w = fdopen(cli, "wb");
    wi->priv = server->priv;
    const int r = thread_create_at(cores[next_core_id], &worker, server->worker, wi);
    if (r != 0) {
      fclose(wi->s2.r);
      fclose(wi->s2.w);
      free(wi);
    } else {
      next_core_id = (next_core_id + 1) % nr_cores1;
    }
  }
  close(server->fd);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x7bee
movq %rax, %r15
movl $0x8, %esi
movq %rax, %rdi
callq 0x62d0
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x7c66
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
cmpb $0x1, 0x4(%rbx)
jne 0xb4c2
movl (%rbx), %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x64b0
testl %eax, %eax
js 0xb49c
movl %eax, %r13d
movl $0x20, %edi
callq 0x63a0
movq %rax, %r15
movq %rbx, (%rax)
movl %r13d, %edi
callq 0x61f0
movl %eax, %edi
leaq 0x9e31(%rip), %rsi      # 0x15275
callq 0x6400
movq %rax, 0x10(%r15)
movl %r13d, %edi
leaq 0x9fb5(%rip), %rsi      # 0x1540c
callq 0x6400
movq %rax, 0x8(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x18(%r15)
movq (%r14,%r12,8), %rdi
movq 0x10(%rbx), %rdx
leaq -0x38(%rbp), %rsi
movq %r15, %rcx
callq 0x814e
testl %eax, %eax
je 0xb4a9
movq 0x10(%r15), %rdi
callq 0x6140
movq 0x8(%r15), %rdi
callq 0x6140
movq %r15, %rdi
callq 0x6060
jmp 0xb4b8
callq 0x6090
cmpl $0x4, (%rax)
setne %al
jmp 0xb4ba
incq %r12
movq %r12, %rax
xorl %edx, %edx
divq -0x30(%rbp)
movq %rdx, %r12
xorl %eax, %eax
testb %al, %al
je 0xb407
movl (%rbx), %edi
callq 0x6220
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: server_destroy
void
server_destroy(struct server * const server)
{
  server->running = false;
  shutdown(server->fd, SHUT_RDWR);
  pthread_join(server->pt, NULL);
  free(server);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb $0x0, 0x4(%rdi)
movl (%rdi), %edi
movl $0x2, %esi
callq 0x6160
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x65a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6060