LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sasairc[P]yasuna/src/libbenly/src/spinner.c
// Function: do_animation
static
void do_animation(SPINNER* spinner)
{
    int     size    = 0;

    char*   symbl   = NULL;

    setlocale(LC_CTYPE, "");
    mblen(NULL, 0);
    while (1) {
        symbl = spinner->symbl;
        while (*symbl) {
            size = mblen(symbl, MB_CUR_MAX);
            fprintf(stdout, "%.*s %s",
                    size, symbl, spinner->msg);
            fflush(stdout);
            usleep(spinner->delay);
            fprintf(stdout, "\r");
            symbl += size;
        }
    }

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0xb90(%rip), %rsi       # 0x200d
xorl %edi, %edi
callq 0x10d0
xorl %edi, %edi
xorl %esi, %esi
callq 0x1040
movq 0x2b4c(%rip), %r12      # 0x3fe0
leaq 0xb65(%rip), %r14       # 0x2000
movq 0x10(%rbx), %r15
cmpb $0x0, (%r15)
je 0x149b
callq 0x1050
movq %r15, %rdi
movq %rax, %rsi
callq 0x1040
movl %eax, %ebp
movq (%r12), %rdi
movq 0x8(%rbx), %r8
movq %r14, %rsi
movl %eax, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x1080
movq (%r12), %rdi
callq 0x10c0
movl 0x4(%rbx), %edi
callq 0x1110
movq (%r12), %rsi
movl $0xd, %edi
callq 0x1070
movslq %ebp, %rax
cmpb $0x0, (%r15,%rax)
leaq (%r15,%rax), %r15
jne 0x14a5
jmp 0x149b
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: debug_wait_gdb
void
debug_wait_gdb(void)
{
  debug_backtrace();
  bool wait = true;
  volatile bool * const v = &wait;
  *v = true;

  time_t now;
  time(&now);
  struct tm nowtm;
  localtime_r(&now, &nowtm);
  char timestamp[64] = {};
  strftime(timestamp, 64, "%F %T %Z (%z)", &nowtm);

  char hostname[256] = {};
  gethostname(hostname, 256);
  char threadname[256];
  pthread_getname_np(pthread_self(), threadname, 256);

  const char * const pattern = "[Waiting GDB] %s %s @ %s\n    Attach me:   sudo -Hi gdb -p %d\n";
  fprintf(stderr, pattern, timestamp, threadname, hostname, getpid());
  fflush(stderr);
  // to continue: gdb> set var *v = 0
  while (*v) {
    sleep(1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
callq 0x7523
movb $0x1, %al
movb %al, -0x29(%rbp)
movb %al, -0x29(%rbp)
leaq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x6360
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x60a0
vxorps %xmm0, %xmm0, %xmm0
leaq -0xb0(%rbp), %rbx
vmovups %ymm0, 0x20(%rbx)
vmovups %ymm0, (%rbx)
leaq 0xe9f3(%rip), %rdx      # 0x15139
pushq $0x40
popq %rsi
movq %rbx, %rdi
movq %r14, %rcx
vzeroupper
callq 0x6440
leaq -0x2b0(%rbp), %r14
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, 0xe0(%r14)
vmovups %ymm0, 0xc0(%r14)
vmovups %ymm0, 0xa0(%r14)
vmovups %ymm0, 0x80(%r14)
vmovups %ymm0, 0x60(%r14)
vmovups %ymm0, 0x40(%r14)
vmovups %ymm0, 0x20(%r14)
vmovups %ymm0, (%r14)
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
vzeroupper
callq 0x6500
callq 0x6460
leaq -0x1b0(%rbp), %r15
movl $0x100, %edx            # imm = 0x100
movq %rax, %rdi
movq %r15, %rsi
callq 0x6040
movq 0x15828(%rip), %r13     # 0x1bff8
movq (%r13), %r12
callq 0x6120
leaq 0xe967(%rip), %rsi      # 0x15147
movq %r12, %rdi
movq %rbx, %rdx
movq %r15, %rcx
movq %r14, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0x6300
movq (%r13), %rdi
callq 0x63b0
movb -0x29(%rbp), %al
movb $0x1, %cl
cmpb %cl, %al
jne 0x6818
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x65c0
cmpb $0x0, -0x29(%rbp)
jne 0x680b
addq $0x288, %rsp            # imm = 0x288
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: rgen_helper_message
void
rgen_helper_message(void)
{
  fprintf(stderr, "%s Usage: rgen <type> ...\n", __func__);
  fprintf(stderr, "%s example: rgen unizipf <min> <max> <ufactor>\n", __func__);
  fprintf(stderr, "%s example: rgen uniform <min> <max>\n", __func__);
  fprintf(stderr, "%s example: rgen zipfian <min> <max>\n", __func__);
  fprintf(stderr, "%s example: rgen counter <min> <max>\n", __func__);
  fprintf(stderr, "%s example: rgen reducer <min> <max>\n", __func__);
  fprintf(stderr, "%s example: rgen skipinc <min> <max> <inc>\n", __func__);
  fprintf(stderr, "%s example: rgen trace32 <filename>\n", __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x157a0(%rip), %r14     # 0x1bff8
movq (%r14), %rdi
leaq 0xea16(%rip), %rsi      # 0x15278
leaq 0xea2a(%rip), %rbx      # 0x15293
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea2a(%rip), %rsi      # 0x152a7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea46(%rip), %rsi      # 0x152d7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea58(%rip), %rsi      # 0x152fd
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea6a(%rip), %rsi      # 0x15323
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea7c(%rip), %rsi      # 0x15349
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xea8e(%rip), %rsi      # 0x1536f
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeaa6(%rip), %rsi      # 0x1539b
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x6300
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: kvmap_api_helper_message
void
kvmap_api_helper_message(void)
{
  fprintf(stderr, "%s Usage: api <cache-mb> <map-type> <param1> ...\n", __func__);
  fprintf(stderr, "%s example: api 0 kvmap2\n", __func__);
  fprintf(stderr, "%s example: api 0 cuckoo\n", __func__);
  fprintf(stderr, "%s example: api 0 skiplist\n", __func__);
  fprintf(stderr, "%s example: api 0 chainmap\n", __func__);
  fprintf(stderr, "%s example: api 0 bptree\n", __func__);
  fprintf(stderr, "%s example: api 0 tcpmap <host> <port>\n", __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x156e7(%rip), %r14     # 0x1bff8
movq (%r14), %rdi
leaq 0xeaf4(%rip), %rsi      # 0x1540f
leaq 0xeb1f(%rip), %rbx      # 0x15441
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb24(%rip), %rsi      # 0x1545a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb2a(%rip), %rsi      # 0x15474
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb30(%rip), %rsi      # 0x1548e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb38(%rip), %rsi      # 0x154aa
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb40(%rip), %rsi      # 0x154c6
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xeb46(%rip), %rsi      # 0x154e0
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x6300
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: maptest_passes_message
void
maptest_passes_message(void)
{
  fprintf(stderr, "%s Usage: {rgen ... {pass ...}}\n", __func__);
  rgen_helper_message();
  fprintf(stderr, "%s Usage: pass <nth> <magic-type> <magic> <repeat> <vlen> <S%%> <D%%> <G%%> <rgen-opt>\n", __func__);
  fprintf(stderr, "%s magic-type: 0:time, 1:count\n", __func__);
  fprintf(stderr, "%s repeat: 0:damp\n", __func__);
  fprintf(stderr, "%s rgen-opt: 0:sync, 1:wait, 2:nowait\n", __func__);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x15642(%rip), %r14     # 0x1bff8
movq (%r14), %rdi
leaq 0xec17(%rip), %rsi      # 0x155d7
leaq 0xec31(%rip), %rbx      # 0x155f8
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
callq 0x684a
movq (%r14), %rdi
leaq 0xec2f(%rip), %rsi      # 0x1560f
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xec73(%rip), %rsi      # 0x15667
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xec7f(%rip), %rsi      # 0x15687
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6300
movq (%r14), %rdi
leaq 0xec7e(%rip), %rsi      # 0x1569a
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x6300
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/kvserver.c
// Function: main
int
main(int argc, char ** argv)
{
  if (argc < 4) {
    fprintf(stderr, "Usage: %s <host> <port> api ...\n", argv[0]);
    kvmap_api_helper_message();
    exit(0);
  }

  const char * const host = argv[1];
  const int pn = atoi(argv[2]);
  struct kvmap_api * api = NULL;
  struct kvmap_mm mm = {};
  mm.af = kv_alloc_malloc;
  mm.rf = kv_retire_free;
  argc -= 3;
  argv += 3;
  const int n1 = kvmap_api_helper(argc, argv, &api, &mm, false);
  if (n1 < 0 || api == NULL) {
    fprintf(stderr, "kvmap_api_helper() failed\n");
    exit(0);
  }
  struct server * const ser = server_create(host, pn, kv_worker, api);
  if (ser == NULL) {
    fprintf(stderr, "server_create() failed\n");
    exit(0);
  }
  //fclose(stdin);
  //fclose(stdout);
  //fclose(stderr);
  server_wait(ser);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r15
cmpl $0x3, %edi
jle 0x6f34
movl %edi, %r12d
movq 0x8(%r15), %rbx
movq 0x10(%r15), %rdi
callq 0x64e0
movl %eax, %r14d
leaq -0x28(%rbp), %rdx
movq $0x0, (%rdx)
vxorps %xmm0, %xmm0, %xmm0
leaq -0x80(%rbp), %rcx
vmovups %ymm0, (%rcx)
vmovups %ymm0, 0x30(%rcx)
vmovups %ymm0, 0x20(%rcx)
leaq 0x4be8(%rip), %rax      # 0xbaba
movq %rax, (%rcx)
leaq 0x4be8(%rip), %rax      # 0xbac4
movq %rax, 0x10(%rcx)
addl $-0x3, %r12d
addq $0x18, %r15
movl %r12d, %edi
movq %r15, %rsi
xorl %r8d, %r8d
vzeroupper
callq 0xbc40
testl %eax, %eax
js 0x6f3c
movq -0x28(%rbp), %rcx
testq %rcx, %rcx
je 0x6f3c
leaq 0x39(%rip), %rdx        # 0x6f46
movq %rbx, %rdi
movl %r14d, %esi
callq 0xb24f
testq %rax, %rax
je 0x6f41
movq %rax, %rdi
callq 0xb4da
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x668e
callq 0x6667
callq 0x6640
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/kvserver.c
// Function: _read_kv
static struct kv *
__read_kv(struct stream2 * const s2, const bool read_kv)
{
  struct kv head;
  if (fread(&head, sizeof(head), 1, s2->r) != 1) {
    return NULL;
  }

  const size_t size = read_kv ? kv_size(&head) : key_size(&head);
  struct kv * const ret = (typeof(ret))malloc(size);
  memcpy(ret, &head, sizeof(head));
  if (fread(ret->kv, size - sizeof(head), 1, s2->r) != 1) {
    free(ret);
    return NULL;
  }
  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
leaq -0x28(%rbp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x60f0
cmpq $0x1, %rax
jne 0x725f
leaq -0x28(%rbp), %rdi
testb %r14b, %r14b
je 0x721c
callq 0xb6eb
jmp 0x7221
callq 0xb73c
movq %rax, %r15
movq %rax, %rdi
callq 0x63a0
vmovups -0x28(%rbp), %xmm0
movq %rax, %r14
vmovups %xmm0, (%rax)
leaq 0x10(%rax), %rdi
addq $-0x10, %r15
movq 0x8(%rbx), %rcx
movl $0x1, %edx
movq %r15, %rsi
callq 0x60f0
cmpq $0x1, %rax
je 0x7262
movq %r14, %rdi
callq 0x6060
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rwlock_trylock_read
inline bool
rwlock_trylock_read(rwlock * const lock)
{
  au64 * const pvar = (typeof(pvar))(&(lock->var));
  u64 v0 = *pvar;
  if ((v0 & RWLOCK_WBIT) == UINT64_C(0)) {
    const u64 v1 = v0 + 1;
    const bool r = atomic_compare_exchange_strong(pvar, &v0, v1);
    return r;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
testq %rax, %rax
js 0x7384
leaq 0x1(%rax), %rcx
lock
cmpxchgq %rcx, (%rdi)
sete %al
jmp 0x7386
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: rwlock_trylock_write
inline bool
rwlock_trylock_write(rwlock * const lock)
{
  au64 * const pvar = (typeof(pvar))(&(lock->var));
  u64 v0 = *pvar;
  if ((v0 & RWLOCK_WBIT) == UINT64_C(0)) {
    const u64 v1 = v0 | RWLOCK_WBIT;
    const bool r = atomic_compare_exchange_strong(pvar, &v0, v1);
    if (r) {
      while (atomic_load(pvar) != RWLOCK_WBIT);
    }
    return r;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
testq %rax, %rax
js 0x73e7
movq %rax, %rcx
btsq $0x3f, %rcx
lock
cmpxchgq %rcx, (%rdi)
sete %al
jne 0x73e9
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq (%rdi), %rdx
cmpq %rcx, %rdx
jne 0x73dd
jmp 0x73e9
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: watch_u64_usr1
void
watch_u64_usr1(u64 * const ptr)
{
  __ptr_watch_u64 = ptr;
  struct sigaction sa = {};
  sa.sa_handler = __signal_handler_watch_u64;
  sigemptyset(&(sa.sa_mask));
  sa.sa_flags = SA_RESTART;
  if (sigaction(SIGUSR1, &sa, NULL) == -1) {
    fprintf(stderr, "Failed to set signal handler for SIGUSR1\n");
  } else {
    fprintf(stderr, "to watch> kill -s SIGUSR1 %d\n", getpid());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, 0x14db4(%rip)     # 0x1c340
vxorps %xmm0, %xmm0, %xmm0
leaq -0x98(%rbp), %rbx
vmovups %ymm0, -0x8(%rbx)
vmovups %ymm0, 0x70(%rbx)
vmovups %ymm0, 0x58(%rbx)
vmovups %ymm0, 0x38(%rbx)
vmovups %ymm0, 0x18(%rbx)
leaq -0xefb(%rip), %rax      # 0x66bc
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
vzeroupper
callq 0x6310
movl $0x10000000, 0x80(%rbx) # imm = 0x10000000
leaq -0xa0(%rbp), %rsi
movl $0xa, %edi
xorl %edx, %edx
callq 0x60e0
movq 0x14a0e(%rip), %rcx     # 0x1bff8
movq (%rcx), %rbx
cmpl $-0x1, %eax
jne 0x75fc
movq %rbx, %rdi
callq 0x6a2a
jmp 0x7614
callq 0x6120
leaq 0xdb13(%rip), %rsi      # 0x1511b
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x6300
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: debug_catch_fatals
__attribute__((constructor))
  static void
debug_catch_fatals(void)
{
  struct sigaction sa = {};
  sa.sa_sigaction = __signal_handler_wait_gdb;
  sigemptyset(&(sa.sa_mask));
  sa.sa_flags = SA_SIGINFO;
  const int fatals[] = {SIGSEGV, SIGFPE, SIGILL, SIGBUS, 0};
  for (int i = 0; fatals[i]; i++) {
    if (sigaction(fatals[i], &sa, NULL) == -1) {
      fprintf(stderr, "Failed to set signal handler for %s\n", strsignal(fatals[i]));
      fflush(stderr);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
vxorps %xmm0, %xmm0, %xmm0
leaq -0xb8(%rbp), %rbx
vmovups %ymm0, -0x8(%rbx)
vmovups %ymm0, 0x70(%rbx)
vmovups %ymm0, 0x58(%rbx)
vmovups %ymm0, 0x38(%rbx)
vmovups %ymm0, 0x18(%rbx)
leaq -0xe41(%rip), %rax      # 0x682a
movq %rax, -0x8(%rbx)
movq %rbx, %rdi
vzeroupper
callq 0x6310
movl $0x4, 0x80(%rbx)
xorl %r15d, %r15d
leaq 0xe182(%rip), %r12      # 0x15810
leaq -0xc0(%rbp), %rbx
movl (%r15,%r12), %r14d
movl %r14d, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60e0
cmpl $-0x1, %eax
je 0x76b7
addq $0x4, %r15
cmpq $0x10, %r15
jne 0x7695
jmp 0x76c1
movl %r14d, %edi
callq 0x6a45
jmp 0x76ab
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: debug_dump_maps
void
debug_dump_maps(FILE * const out)
{
  FILE * const in = fopen("/proc/self/smaps", "r");
  char * line0 = malloc(1024);
  size_t size0 = 1024;
  while (!feof(in)) {
    const ssize_t r1 = getline(&line0, &size0, in);
    if (r1 < 0) break;
    fprintf(out, "%s", line0);
  }
  fflush(out);
  fclose(in);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xdac0(%rip), %rdi      # 0x151aa
leaq 0xdb0b(%rip), %rsi      # 0x151fc
callq 0x6480
movq %rax, %r14
movl $0x400, %edi            # imm = 0x400
callq 0x63a0
movq %rax, -0x28(%rbp)
movq $0x400, -0x30(%rbp)     # imm = 0x400
movq %r14, %rdi
callq 0x6330
testl %eax, %eax
jne 0x774e
leaq -0x28(%rbp), %r15
leaq -0x30(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x64f0
testq %rax, %rax
js 0x774e
movq -0x28(%rbp), %rdi
movq %rbx, %rsi
callq 0x6200
movq %r14, %rdi
callq 0x6330
testl %eax, %eax
je 0x7723
movq %rbx, %rdi
callq 0x63b0
movq %r14, %rdi
callq 0x6140
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: bitmap_create
inline struct bitmap *
bitmap_create(const u64 bits)
{
  struct bitmap * const bm = (typeof(bm))calloc(1, sizeof(*bm) + (sizeof(u64) * ((bits + 63) >> 6)));
  bm->bits = bits;
  atomic_store(&(bm->ones), 0);
  return bm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3f(%rdi), %rax
shrq $0x6, %rax
leaq 0x10(,%rax,8), %rsi
movl $0x1, %edi
callq 0x62d0
movq %rbx, (%rax)
xorl %ecx, %ecx
xchgq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: bf_create
inline struct bloomfilter *
bf_create(const u64 bpk, const u64 capacity)
{
  struct bitmap * const bm = bitmap_create(bpk * capacity);
  if (bm) {
    struct bloomfilter * const bf = malloc(sizeof(*bf));
    bf->nr_probe = log(2.0) * (double)bpk;
    bf->bm = bm;
    return bf;
  }
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
imulq %rdi, %rbx
leaq 0x3f(%rbx), %rax
shrq $0x6, %rax
leaq 0x10(,%rax,8), %rsi
movl $0x1, %edi
callq 0x62d0
movq %rax, %r15
movq %rbx, (%rax)
xorl %eax, %eax
xchgq %rax, 0x8(%r15)
movl $0x10, %edi
callq 0x63a0
vcvtusi2sd %r14, %xmm0, %xmm0
vmulsd 0xd5ec(%rip), %xmm0, %xmm0 # 0x15060
vcvttsd2usi %xmm0, %rcx
movq %rcx, (%rax)
movq %r15, 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: bf_mark
inline void
bf_mark(struct bloomfilter * const bf, u64 hash64)
{
  u64 t = hash64;
  const u64 inc = bits_rotl_u64(hash64, 31);
  struct bitmap * const bm = bf->bm;
  for (u64 i = 0; i < bf->nr_probe; i++) {
    bitmap_set1(bm, t % bm->bits);
    t += inc;
  }
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x7ae1
pushq %rbp
movq %rsp, %rbp
rorxq $0x21, %rsi, %rcx
movq 0x8(%rdi), %r8
xorl %r9d, %r9d
movl $0x1, %r10d
movq %rsi, %rax
xorl %edx, %edx
divq (%r8)
movq %rdx, %rax
shrq $0x6, %rax
movq 0x10(%r8,%rax,8), %r11
btq %rdx, %r11
jb 0x7ad5
shlxq %rdx, %r10, %rdx
orq %r11, %rdx
movq %rdx, 0x10(%r8,%rax,8)
lock
incq 0x8(%r8)
addq %rcx, %rsi
incq %r9
cmpq (%rdi), %r9
jb 0x7aa9
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: bf_test
inline bool
bf_test(const struct bloomfilter * const bf, u64 hash64)
{
  u64 t = hash64;
  const u64 inc = bits_rotl_u64(hash64, 31);
  const struct bitmap * const bm = bf->bm;
  for (u64 i = 0; i < bf->nr_probe; i++) {
    if (bitmap_test(bm, t % bm->bits) == false) return false;
    t += inc;
  }
  return true;
}

// Assembly:
movq (%rdi), %r8
testq %r8, %r8
sete %cl
je 0x7b50
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rdi
movq (%rdi), %r9
movq %rsi, %rax
xorl %edx, %edx
divq %r9
movq %rdx, %rax
shrq $0x6, %rax
movq 0x10(%rdi,%rax,8), %rax
btq %rdx, %rax
jae 0x7b4f
rorxq $0x21, %rsi, %rcx
addq %rcx, %rsi
movl $0x1, %eax
movq %rax, %r10
cmpq %rax, %r8
je 0x7b49
movq %rsi, %rax
xorl %edx, %edx
divq %r9
movq %rdx, %rax
shrq $0x6, %rax
movq 0x10(%rdi,%rax,8), %r11
addq %rcx, %rsi
leaq 0x1(%r10), %rax
btq %rdx, %r11
jb 0x7b20
cmpq %r8, %r10
setae %cl
popq %rbp
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: process_get_rss
u64
process_get_rss(void)
{
  u64 size;
  u64 rss;
  FILE * const fp = fopen("/proc/self/statm", "r");
  if (fp == NULL) return 0;
  if (fscanf(fp, "%" PRIu64 "%" PRIu64, &size, &rss) != 2) {
    fclose(fp);
    return 0;
  }
  fclose(fp);
  return rss * (u64)sysconf(_SC_PAGESIZE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xd6a1(%rip), %rdi      # 0x15228
leaq 0xd66e(%rip), %rsi      # 0x151fc
callq 0x6480
testq %rax, %rax
je 0x7bde
movq %rax, %r14
leaq 0xd697(%rip), %rsi      # 0x15239
xorl %ebx, %ebx
leaq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rcx
movq %rax, %rdi
xorl %eax, %eax
callq 0x60b0
movl %eax, %r15d
movq %r14, %rdi
callq 0x6140
cmpl $0x2, %r15d
jne 0x7be0
movq -0x20(%rbp), %r14
movl $0x1e, %edi
callq 0x64a0
movq %rax, %rbx
imulq %r14, %rbx
jmp 0x7be0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: process_affinity_core_count
u64
process_affinity_core_count(void)
{
  size_t xsize = 0;
  cpu_set_t * const set = __cpu_set_alloc(&xsize);
  if (sched_getaffinity(0, xsize, set) != 0) {
    return sysconf(_SC_NPROCESSORS_CONF);
  }
  const int nr = CPU_COUNT_S(xsize, set);
  free(set);
  return (nr > 0) ? nr : sysconf(_SC_NPROCESSORS_CONF);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x53, %edi
callq 0x64a0
cltq
addq $0x3f, %rax
shrq $0x3, %rax
andq $-0x8, %rax
cmpq $0x81, %rax
movl $0x80, %ebx
cmovaeq %rax, %rbx
movq %rbx, %rdi
callq 0x63a0
movq %rax, %r14
xorl %edi, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x6580
testl %eax, %eax
je 0x7c46
movl $0x53, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x64a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6150
movl %eax, %ebx
movq %r14, %rdi
callq 0x6060
testl %ebx, %ebx
jle 0x7c38
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: process_affinity_core_list
u64
process_affinity_core_list(const u64 max, u64 * const cores)
{
  memset(cores, 0, max * sizeof(cores[0]));
  size_t xsize = 0;
  cpu_set_t * const set = __cpu_set_alloc(&xsize);
  if (sched_getaffinity(0, xsize, set) != 0) return 0;

  const u64 ncpu = sysconf(_SC_NPROCESSORS_CONF);
  const u64 nr_affinity = CPU_COUNT_S(xsize, set);
  const u64 nr = nr_affinity < max ? nr_affinity : max;
  u64 j = 0;
  for (u64 i = 0; i < ncpu; i++) {
    if (CPU_ISSET_S((int)i, xsize, set)) {
      cores[j++] = i;
    }
    if (j >= nr) break;
  }
  free(set);
  return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rdi,8), %rdx
xorl %r15d, %r15d
movq %rsi, %rdi
xorl %esi, %esi
callq 0x6210
movl $0x53, %edi
callq 0x64a0
cltq
addq $0x3f, %rax
shrq $0x3, %rax
andq $-0x8, %rax
cmpq $0x81, %rax
movl $0x80, %r13d
cmovaeq %rax, %r13
movq %r13, %rdi
callq 0x63a0
movq %rax, %r12
xorl %edi, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x6580
testl %eax, %eax
jne 0x7d62
movq %rbx, -0x30(%rbp)
movl $0x53, %edi
callq 0x64a0
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6150
cltq
cmpq %r14, %rax
cmovbq %rax, %r14
testq %rbx, %rbx
je 0x7d57
decq %rbx
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %edx, %edx
xorl %r15d, %r15d
movq -0x30(%rbp), %r8
movq %rax, %rsi
sarq $0x20, %rsi
movq %rsi, %rdi
shrq $0x3, %rdi
cmpq %r13, %rdi
jae 0x7d41
shrq $0x6, %rsi
movq (%r12,%rsi,8), %rsi
btq %rdx, %rsi
jae 0x7d41
movq %rdx, (%r8,%r15,8)
incq %r15
cmpq %r14, %r15
jae 0x7d5a
leaq 0x1(%rdx), %rsi
addq %rcx, %rax
cmpq %rdx, %rbx
movq %rsi, %rdx
jne 0x7d19
jmp 0x7d5a
xorl %r15d, %r15d
movq %r12, %rdi
callq 0x6060
movq %r15, %rax
addq $0x8, %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: process_cpu_time_usec
u64
process_cpu_time_usec(void)
{
  struct rusage r;
  getrusage(RUSAGE_SELF, &r);
  const u64 usr = (r.ru_utime.tv_sec * UINT64_C(1000000)) + r.ru_utime.tv_usec;
  const u64 sys = (r.ru_stime.tv_sec * UINT64_C(1000000)) + r.ru_stime.tv_usec;
  return usr + sys;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
leaq -0x98(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x6490
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rax
addq (%rbx), %rcx
imulq $0xf4240, %rcx, %rcx    # imm = 0xF4240
addq 0x8(%rbx), %rax
addq %rcx, %rax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: thread_set_affinity
void
thread_set_affinity(const u64 cpu)
{
  const u64 ncpu = sysconf(_SC_NPROCESSORS_CONF);
  size_t xsize = 0;
  cpu_set_t * const set = __cpu_set_alloc(&xsize);

  CPU_ZERO_S(xsize, set);
  CPU_SET_S(cpu % ncpu, xsize, set);
  sched_setaffinity(0, xsize, set);
  free(set);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x53, %edi
callq 0x64a0
movq %rax, %r12
movl $0x53, %edi
callq 0x64a0
cltq
addq $0x3f, %rax
shrq $0x3, %rax
andq $-0x8, %rax
cmpq $0x81, %rax
movl $0x80, %ebx
cmovaeq %rax, %rbx
movq %rbx, %rdi
callq 0x63a0
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x6210
movq %r14, %rax
xorl %edx, %edx
divq %r12
movq %rdx, %rax
shrq $0x3, %rax
cmpq %rbx, %rax
jae 0x7e34
movl $0x1, %eax
shlxq %rdx, %rax, %rax
shrq $0x6, %rdx
orq %rax, (%r15,%rdx,8)
xorl %edi, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6250
movq %r15, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6060
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: thread_fork_join
inline double
thread_fork_join(const u64 nr, void *(*func) (void *), void * const arg)
{
  const u64 nthreads = nr ? nr : process_affinity_core_count();
  void * argv[nthreads];
  for (u64 i = 0; i < nthreads; i++) {
    argv[i] = arg;
  }
  return thread_fork_join_private(nthreads, func, argv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
testq %rdi, %rdi
jne 0x8115
callq 0x7bee
movq %rax, %rdi
movq %rsp, %rdx
leaq 0xf(,%rdi,8), %rax
andq $-0x10, %rax
subq %rax, %rdx
movq %rdx, %rsp
testq %rdi, %rdi
je 0x813d
xorl %eax, %eax
movq %r14, (%rdx,%rax,8)
incq %rax
cmpq %rax, %rdi
jne 0x8131
movq %rbx, %rsi
callq 0x7e51
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: thread_create_at
inline int
thread_create_at(const u64 cpu, pthread_t * const thread, void *(*start_routine) (void *), void * const arg)
{
  const u64 ncpu = sysconf(_SC_NPROCESSORS_CONF);
  const u64 cpu_id = cpu % ncpu;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
  size_t xsize = 0;
  cpu_set_t * const set = __cpu_set_alloc(&xsize);

  CPU_ZERO_S(xsize, set);
  CPU_SET_S(cpu_id, xsize, set);
  pthread_attr_setaffinity_np(&attr, xsize, set);
  const int r = pthread_create(thread, &attr, start_routine, arg);
  pthread_attr_destroy(&attr);
  free(set);
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, -0x30(%rbp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movl $0x53, %edi
callq 0x64a0
movq %rax, %rcx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %r12
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
callq 0x62b0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6380
movl $0x53, %edi
callq 0x64a0
cltq
addq $0x3f, %rax
shrq $0x3, %rax
andq $-0x8, %rax
cmpq $0x81, %rax
movl $0x80, %ebx
cmovaeq %rax, %rbx
movq %rbx, %rdi
callq 0x63a0
movq %rax, %r13
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x6210
movq %r12, %rax
shrq $0x3, %rax
cmpq %rbx, %rax
jae 0x81f8
movl $0x1, %eax
shlxq %r12, %rax, %rax
shrq $0x6, %r12
orq %rax, (%r13,%r12,8)
leaq -0x68(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x6080
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq -0x30(%rbp), %rcx
callq 0x6430
movl %eax, %ebx
movq %r12, %rdi
callq 0x64c0
movq %r13, %rdi
callq 0x6060
movl %ebx, %eax
addq $0x48, %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: pages_alloc_1gb
inline void *
pages_alloc_1gb(const size_t nr_1gb)
{
  const u64 sz = nr_1gb << 30;
#ifndef HEAPCHECKING
  return __pages_alloc(sz, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | (30 << MAP_HUGE_SHIFT));
#else
  void * const p = xalloc(UINT64_C(1) << 30, sz);
  if (p) memset(p, 0, sz);
  return p;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rsi
shlq $0x1e, %rsi
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x3, %edx
movl $0x78042022, %ecx       # imm = 0x78042022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
cmpq $-0x1, %rax
cmoveq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: pages_alloc_2mb
inline void *
pages_alloc_2mb(const size_t nr_2mb)
{
  const u64 sz = nr_2mb << 21;
#ifndef HEAPCHECKING
  return __pages_alloc(sz, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB | (21 << MAP_HUGE_SHIFT));
#else
  void * const p = xalloc(UINT64_C(1) << 21, sz);
  if (p) memset(p, 0, sz);
  return p;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rsi
shlq $0x15, %rsi
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x3, %edx
movl $0x54042022, %ecx       # imm = 0x54042022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
cmpq $-0x1, %rax
cmoveq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: pages_alloc_4kb
inline void *
pages_alloc_4kb(const size_t nr_4kb)
{
  const size_t sz = nr_4kb << 12;
#ifndef HEAPCHECKING
  return __pages_alloc(sz, MAP_PRIVATE | MAP_ANONYMOUS);
#else
  void * const p = xalloc(UINT64_C(1) << 12, sz);
  if (p) memset(p, 0, sz);
  return p;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rsi
shlq $0xc, %rsi
xorl %ebx, %ebx
xorl %edi, %edi
movl $0x3, %edx
movl $0x2022, %ecx           # imm = 0x2022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
cmpq $-0x1, %rax
cmoveq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: pages_alloc_best
void *
pages_alloc_best(const size_t size, const bool try_1gb, u64 * const size_out)
{
  if (try_1gb) {
    const size_t nr_1gb = (size + ((UINT64_C(1) << 30) - UINT64_C(1))) >> 30;
    // 1gb super huge page: waste < 1/16 or 6.25%
    if (((nr_1gb << 30) - size) < (size >> 4)) {
      void * const p1 = pages_alloc_1gb(nr_1gb);
      if (p1) {
        *size_out = nr_1gb << 30;
        return p1;
      }
    }
  }

  // 2mb huge page: at least 1MB
  if (size >= (UINT64_C(1) << 20)) {
    const size_t nr_2mb = (size + ((UINT64_C(1) << 21) - UINT64_C(1))) >> 21;
    void * const p2 = pages_alloc_2mb(nr_2mb);
    if (p2) {
      *size_out = nr_2mb << 21;
      return p2;
    }
  }

  const size_t nr_4kb = (size + ((UINT64_C(1) << 12) - UINT64_C(1))) >> 12;
  void * const p3 = pages_alloc_4kb(nr_4kb);
  if (p3) {
    *size_out = nr_4kb << 12;
  }
  return p3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testl %esi, %esi
je 0x8398
leaq 0x3fffffff(%r14), %r12
andq $-0x40000000, %r12      # imm = 0xC0000000
movq %r12, %rax
subq %r14, %rax
movq %r14, %rcx
shrq $0x4, %rcx
movb $0x1, %r13b
cmpq %rcx, %rax
jae 0x838f
xorl %edi, %edi
movq %r12, %rsi
movl $0x3, %edx
movl $0x78042022, %ecx       # imm = 0x78042022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
movq %rax, %r15
cmpq $-0x1, %rax
movl $0x0, %eax
cmoveq %rax, %r15
testq %r15, %r15
je 0x838f
movq %r12, (%rbx)
xorl %r13d, %r13d
jmp 0x838f
testb %r13b, %r13b
je 0x8428
cmpq $0x100000, %r14         # imm = 0x100000
jb 0x83e7
leaq 0x1fffff(%r14), %r12
andq $-0x200000, %r12        # imm = 0xFFE00000
xorl %r13d, %r13d
xorl %edi, %edi
movq %r12, %rsi
movl $0x3, %edx
movl $0x54042022, %ecx       # imm = 0x54042022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
cmpq $-0x1, %rax
cmoveq %r13, %rax
testq %rax, %rax
je 0x83e2
movq %r12, (%rbx)
movq %rax, %r15
testq %rax, %rax
jne 0x8428
addq $0xfff, %r14            # imm = 0xFFF
andq $-0x1000, %r14          # imm = 0xF000
xorl %r12d, %r12d
xorl %edi, %edi
movq %r14, %rsi
movl $0x3, %edx
movl $0x2022, %ecx           # imm = 0x2022
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r9d, %r9d
callq 0x6190
movq %rax, %r15
cmpq $-0x1, %rax
cmoveq %r12, %r15
testq %r15, %r15
je 0x8428
movq %r14, (%rbx)
movq %r15, %rax
addq $0x8, %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: oalloc_create
struct oalloc *
oalloc_create(void)
{
  struct oalloc * const oa = (typeof(oa))calloc(1, sizeof(*oa));
  spinlock_init(&(oa->lp.lock));
  for (u64 i = 0; i < OALLOC_NR_SHARDS; i++) {
    spinlock_init(&(oa->sps[i].lock));
  }
  return oa;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x1, %edi
movl $0x15f90, %esi          # imm = 0x15F90
callq 0x62d0
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x62e0
movl $0x1f90, %r14d          # imm = 0x1F90
leaq (%rbx,%r14), %rdi
movl $0x1, %esi
callq 0x62e0
addq $0x50, %r14
cmpq $0x15f90, %r14          # imm = 0x15F90
jne 0x8466
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: oalloc_alloc
void *
oalloc_alloc(const u64 size, struct oalloc * const oa)
{
  const u64 s = random_u64() % OALLOC_NR_SHARDS;
  struct oalloc_sp * const sp = &(oa->sps[s]);
  const u64 asize = (size + 7) & (~ UINT64_C(7));
  spinlock_lock(&(sp->lock));
  if (sp->unit == NULL || ((sp->offset + asize) > OALLOC_UNIT_SIZE)) {
    sp->unit = oalloc_lp_alloc(&(oa->lp));
    sp->offset = 0;
    if (sp->unit == NULL) {
      spinlock_unlock(&(sp->lock));
      return NULL;
    }
  }
  void * const ptr = &(sp->unit[sp->offset]);
  sp->offset += asize;
  spinlock_unlock(&(sp->lock));
  return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0x84ca
leaq -0x38(%rbp), %r15
movl $0x4, %edi
movq %r15, %rsi
callq 0x6110
imulq $0x3b9aca00, (%r15), %rax # imm = 0x3B9ACA00
addq 0x8(%r15), %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
andl $0x3ff, %eax            # imm = 0x3FF
leaq (%rax,%rax,4), %rax
shll $0x4, %eax
leaq (%r14,%rax), %r15
addq $0x1f90, %r15           # imm = 0x1F90
movq %r15, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0x8618
addq $0x7, %rbx
andq $-0x8, %rbx
cmpq $0x0, 0x40(%r15)
je 0x8549
movq 0x48(%r15), %rax
addq %rbx, %rax
cmpq $0x40001, %rax          # imm = 0x40001
jb 0x85e0
movq %r14, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0x8618
cmpq $0x1000, 0x48(%r14)     # imm = 0x1000
jb 0x8570
incq 0x40(%r14)
movq $0x0, 0x48(%r14)
movq 0x40(%r14), %r12
cmpq $0x3e7, %r12            # imm = 0x3E7
jbe 0x8582
xorl %r13d, %r13d
jmp 0x85c7
movq 0x48(%r14), %r13
cmpq $0x0, 0x50(%r14,%r12,8)
jne 0x85ba
leaq -0x38(%rbp), %rdx
movq $0x0, (%rdx)
movl $0x40000000, %edi       # imm = 0x40000000
movl $0x1, %esi
callq 0x831a
movq %rax, 0x50(%r14,%r12,8)
leaq -0x38(%rbp), %rax
cmpq $0x40000000, (%rax)     # imm = 0x40000000
jne 0x8611
shlq $0x12, %r13
addq 0x50(%r14,%r12,8), %r13
incq 0x48(%r14)
movq %r14, %rdi
callq 0x6320
movq %r13, 0x40(%r15)
movq $0x0, 0x48(%r15)
testq %r13, %r13
je 0x85f4
movq 0x48(%r15), %rax
movq 0x40(%r15), %r14
addq %rax, %r14
addq %rax, %rbx
movq %rbx, 0x48(%r15)
jmp 0x85f7
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x6320
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x66ef
jmp 0x85ba
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: oalloc_destroy
void
oalloc_destroy(struct oalloc * const oa)
{
  for (u64 i = 0; i < OALLOC_NR_PAGE; i++) {
    if (oa->lp.pages[i]) {
      pages_unmap(oa->lp.pages[i], OALLOC_PAGE_SIZE);
    }
  }
  free(oa);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xa, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x86b1
movl $0x40000000, %esi       # imm = 0x40000000
callq 0x6410
incq %r14
cmpq $0x3f2, %r14            # imm = 0x3F2
jne 0x869e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6060
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gcache_create
struct gcache *
gcache_create(const u64 nr_classes, const u64 inc)
{
  struct gcache * const g = (typeof(g))calloc(1, sizeof(*g) + (nr_classes * sizeof(g->cs[0])));
  for (u64 i = 0; i < GALLOC_SHARDS; i++) {
    spinlock_init(&(g->locks[i]));
  }
  g->nr = nr_classes;
  g->inc = inc;
  return g;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, %rsi
shlq $0x8, %rsi
addq $0x810, %rsi            # imm = 0x810
movl $0x1, %edi
callq 0x62d0
movq %rax, %r15
xorl %r12d, %r12d
leaq (%r15,%r12), %rdi
movl $0x1, %esi
callq 0x62e0
addq $0x40, %r12
cmpq $0x800, %r12            # imm = 0x800
jne 0x86f8
movq %r14, 0x800(%r15)
movq %rbx, 0x808(%r15)
movq %r15, %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: gcache_pull
void *
gcache_pull(struct gcache * const g, const u64 size)
{
  const u64 idx = (size + g->inc - 1) / g->inc;
  if (idx >= g->nr || idx == 0) return NULL;
  struct gcache_class * const gc = &(g->cs[idx]);
  return gcache_pull_gc(g, gc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x808(%rdi), %rcx
decq %rsi
leaq (%rsi,%rcx), %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r15
xorl %eax, %eax
addq %rcx, %rsi
jb 0x885e
cmpq 0x800(%rdi), %r15
jae 0x885e
shlq $0x8, %r15
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0x87a0
leaq -0x50(%rbp), %r14
movq %rdi, %rbx
movl $0x4, %edi
movq %r14, %rsi
callq 0x6110
movq %rbx, %rdi
imulq $0x3b9aca00, (%r14), %rax # imm = 0x3B9ACA00
addq 0x8(%r14), %rax
leaq (%rdi,%r15), %r13
addq $0x810, %r13            # imm = 0x810
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, -0x40(%rbp)
movq %rax, %fs:-0x8
xorl %r14d, %r14d
movq %r13, -0x38(%rbp)
movq -0x40(%rbp), %rax
leal (%rax,%r14), %ebx
andl $0x1f, %ebx
cmpq $0x0, (%r13,%rbx,8)
je 0x8841
movl %ebx, %r15d
shll $0x6, %r15d
movq %rdi, %r12
addq %rdi, %r15
movq %r15, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0x886d
movq (%r13,%rbx,8), %rax
testq %rax, %rax
movq %r13, %rdx
sete %r13b
je 0x8834
movq (%rax), %rcx
movq %rcx, (%rdx,%rbx,8)
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x6320
movq %r12, %rdi
jmp 0x8844
movb $0x1, %r13b
testb %r13b, %r13b
je 0x885a
incq %r14
cmpq $0x20, %r14
movq -0x38(%rbp), %r13
jne 0x87eb
xorl %eax, %eax
jmp 0x885e
movq -0x30(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gcache_push
bool
gcache_push(struct gcache * const g, const u64 size, void * ptr)
{
  struct gcache_object * const go = (typeof(go))ptr;
  const u64 idx = (size + g->inc - 1) / g->inc;
  if (idx >= g->nr || idx == 0) return false;
  struct gcache_class * const gc = &(g->cs[idx]);
  gcache_push_gc(g, gc, go);
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r8
movq %rdi, %r14
movq 0x808(%rdi), %rdi
leaq (%rsi,%rdi), %rcx
decq %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %rdi
movq %rax, %r12
cmpq 0x800(%r14), %rax
setb %al
cmpq %rcx, %rdi
setbe %r15b
andb %al, %r15b
cmpb $0x1, %r15b
jne 0x8965
movq %r8, -0x30(%rbp)
movq %fs:-0x8, %rax
testq %rax, %rax
jne 0x88f1
leaq -0x40(%rbp), %r13
movl $0x4, %edi
movq %r13, %rsi
callq 0x6110
imulq $0x3b9aca00, (%r13), %rax # imm = 0x3B9ACA00
addq 0x8(%r13), %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, %r13 # imm = 0x2545F4914F6CDD1D
imulq %rcx, %r13
movq %r13, %fs:-0x8
andl $0x1f, %r13d
movl %r13d, %ebx
shll $0x6, %ebx
addq %r14, %rbx
movq %rbx, %rdi
callq 0x6050
cmpl $0x23, %eax
je 0x8977
shlq $0x8, %r12
leaq (%r14,%r12), %rax
addq $0x810, %rax            # imm = 0x810
movq (%rax,%r13,8), %rcx
movq -0x30(%rbp), %rdx
movq %rcx, (%rdx)
movq %rdx, (%rax,%r13,8)
movq %rbx, %rdi
callq 0x6320
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gcache_clean
void
gcache_clean(struct gcache * const g)
{
  for (u64 i = 0; i < GALLOC_SHARDS; i++) {
    spinlock_lock(&(g->locks[i]));
  }
  for (u64 i = 1; i < g->nr; i++) {
    memset(&(g->cs[i]), 0, sizeof(g->cs[i]));
  }
  for (u64 i = 0; i < GALLOC_SHARDS; i++) {
    spinlock_unlock(&(g->locks[i]));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
leaq (%rbx,%r14), %rdi
callq 0x6050
cmpl $0x23, %eax
je 0x8a2a
addq $0x40, %r14
cmpq $0x800, %r14            # imm = 0x800
jne 0x898b
cmpq $0x1, 0x800(%rbx)
jbe 0x8a09
leaq 0x910(%rbx), %rax
movl $0x1, %ecx
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, 0xe0(%rax)
vmovups %ymm0, 0xc0(%rax)
vmovups %ymm0, 0xa0(%rax)
vmovups %ymm0, 0x80(%rax)
vmovups %ymm0, 0x60(%rax)
vmovups %ymm0, 0x40(%rax)
vmovups %ymm0, 0x20(%rax)
vmovups %ymm0, (%rax)
incq %rcx
addq $0x100, %rax            # imm = 0x100
cmpq 0x800(%rbx), %rcx
jb 0x89c4
xorl %r14d, %r14d
leaq (%rbx,%r14), %rdi
vzeroupper
callq 0x6320
addq $0x40, %r14
cmpq $0x800, %r14            # imm = 0x800
jne 0x8a0c
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
callq 0x6530
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gcache_iter_create
struct gcache_iter *
gcache_iter_create(struct gcache * const g)
{
  struct gcache_iter * const gi = calloc(1, sizeof(*gi));
  gi->g = g;
  gi->cid = 1;
  gi->curr = g->cs[1].heads[0];
  return gi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %edi
movl $0x20, %esi
callq 0x62d0
movq %rbx, (%rax)
movq $0x1, 0x8(%rax)
movq 0x910(%rbx), %rcx
movq %rcx, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: gcache_iter_next
void *
gcache_iter_next(struct gcache_iter * const gi)
{
  if (gi->cid >= gi->g->nr) return NULL;
  while (gi->curr == NULL) {
    gi->sid++;
    if (gi->sid >= GALLOC_SHARDS) {
      gi->cid++;
      gi->sid = 0;
    }
    if (gi->cid >= gi->g->nr) return NULL;
    gi->curr = gi->g->cs[gi->cid].heads[gi->sid];
  }
  struct gcache_object * const curr = gi->curr;
  gi->curr = curr->next;
  return curr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
cmpq 0x800(%rcx), %rax
jae 0x8adf
movq 0x18(%rdi), %rax
testq %rax, %rax
jne 0x8ad6
leaq 0x810(%rcx), %rdx
movq 0x10(%rdi), %rax
incq %rax
movq %rax, 0x10(%rdi)
cmpq $0x20, %rax
jb 0x8ab1
incq 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rdi), %rax
cmpq 0x800(%rcx), %rax
jae 0x8adf
shlq $0x8, %rax
addq %rdx, %rax
movq 0x10(%rdi), %rsi
movq (%rax,%rsi,8), %rax
movq %rax, 0x18(%rdi)
testq %rax, %rax
je 0x8a94
movq (%rax), %rcx
movq %rcx, 0x18(%rdi)
jmp 0x8ae1
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: cpu_clflush
inline void
cpu_clflush(void * const ptr, const size_t size)
{
  u8 * first = (typeof(first))(((u64)ptr) & (~ UINT64_C(0x3f)));
  u8 * const last  = (typeof(last))(((u64)(((u8*)ptr) + (size - 1u))) & (~ UINT64_C(0x3f)));
  while ((last - first) >= 256) {
    __builtin_ia32_clflush(first);
    __builtin_ia32_clflush(first + 64);
    __builtin_ia32_clflush(first + 128);
    __builtin_ia32_clflush(first + 192);
    first += 256;
  }
  for (u8 * p = first; p <= last; p += 64u) {
    __builtin_ia32_clflush(p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq (%rdi,%rsi), %rax
decq %rax
andq $-0x40, %rdi
andq $-0x40, %rax
movq %rax, %rcx
subq %rdi, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jl 0x8b4d
clflush (%rdi)
clflush 0x40(%rdi)
clflush 0x80(%rdi)
clflush 0xc0(%rdi)
addq $0x100, %rdi            # imm = 0x100
addq $-0x100, %rcx
cmpq $0xff, %rcx
jg 0x8b18
jmp 0x8b4d
clflush (%rdi)
addq $0x40, %rdi
cmpq %rax, %rdi
jbe 0x8b46
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: qsort_u64_sample
void
qsort_u64_sample(const u64 * const array0, const u64 nr, const u64 res, FILE * const out)
{
  const u64 datasize = nr * sizeof(array0[0]);
  u64 * const array = (typeof(array))malloc(datasize);
  debug_assert(array);
  memcpy(array, array0, datasize);
  qsort_u64(array, nr);

  const double sized = (double)nr;
  const u64 srate = res ? res : 64;
  const u64 xstep = ({u64 step = nr / srate; step ? step : 1; });
  const u64 ystep = ({u64 step = (array[nr - 1] - array[0]) / srate; step ? step : 1; });
  u64 i = 0;
  fprintf(out, "%lu %06.2lf %lu\n", i, ((double)(i + 1lu)) * 100.0 / sized, array[i]);
  for (u64 j = 1; j < nr; j++) {
    if (((j - i) >= xstep) || (array[j] - array[i]) >= ystep) {
      i = j;
      fprintf(out, "%lu %06.2lf %lu\n", i, ((double)(i + 1lu)) * 100.0 / sized, array[i]);
    }
  }
  if (i != (nr - 1)) {
    i = nr - 1;
    fprintf(out, "%lu %06.2lf %lu\n", i, ((double)(i + 1lu)) * 100.0 / sized, array[i]);
  }
  free(array);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x30(%rbp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq (,%rsi,8), %r12
movq %r12, %rdi
callq 0x63a0
movq %rax, %rbx
testq %rax, %rax
je 0x8d9d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x6340
leaq -0xa1(%rip), %rcx       # 0x8bcf
movl $0x8, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x60d0
vcvtusi2sd %r15, %xmm0, %xmm0
testq %r14, %r14
movl $0x40, %edi
cmovneq %r14, %rdi
movq %r15, %rax
xorl %edx, %edx
divq %rdi
movq %rax, %r13
xorl %r14d, %r14d
cmpq %r15, %rdi
movl $0x1, %r12d
cmovaq %r12, %r13
leaq -0x1(%r15), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbx,%r15,8), %rsi
movq (%rbx), %rcx
subq %rcx, %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
cmpq %rsi, %rdi
cmovaq %r12, %rax
movq %rax, -0x48(%rbp)
vmovsd 0xc38d(%rip), %xmm1     # 0x15068
vmovsd %xmm0, -0x38(%rbp)
vdivsd %xmm0, %xmm1, %xmm0
leaq 0xc563(%rip), %rsi      # 0x1524e
movq -0x30(%rbp), %rdi
xorl %edx, %edx
movb $0x1, %al
callq 0x6300
cmpq $0x2, %r15
jb 0x8d56
xorl %r14d, %r14d
movq %r12, %rax
subq %r14, %rax
cmpq %r13, %rax
jae 0x8d1a
movq (%rbx,%r12,8), %rax
subq (%rbx,%r14,8), %rax
cmpq -0x48(%rbp), %rax
jb 0x8d4e
leaq 0x1(%r12), %rax
vcvtusi2sd %rax, %xmm2, %xmm0
vmulsd 0xc33b(%rip), %xmm0, %xmm0 # 0x15068
vdivsd -0x38(%rbp), %xmm0, %xmm0
movq (%rbx,%r12,8), %rcx
movq -0x30(%rbp), %rdi
leaq 0xc50d(%rip), %rsi      # 0x1524e
movq %r12, %rdx
movb $0x1, %al
callq 0x6300
movq %r12, %r14
incq %r12
cmpq %r12, %r15
jne 0x8d01
movq -0x40(%rbp), %rdx
cmpq %rdx, %r14
je 0x8d87
vmovsd -0x38(%rbp), %xmm1
vmulsd 0xc2fc(%rip), %xmm1, %xmm0 # 0x15068
vdivsd %xmm1, %xmm0, %xmm0
movq -0x8(%rbx,%r15,8), %rcx
leaq 0xc4d2(%rip), %rsi      # 0x1524e
movq -0x30(%rbp), %rdi
movb $0x1, %al
callq 0x6300
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6060
callq 0x66ef
jmp 0x8c5b
// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: crc32
inline u32
crc32(const void * const ptr, const size_t size)
{
  const uint8_t * p = (typeof(p))ptr;
  size_t sz = size;

  u32 crc = UINT32_C(0xffffffff);

  while (sz--)
    crc = __crc32_tab[(crc ^ *p++) & 0xFF] ^ (crc >> 8);

  return crc ^ UINT32_C(0xffffffff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
je 0x8fb9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq 0xc895(%rip), %rdx      # 0x15830
movb (%rdi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdx,%r8,4), %eax
incq %rcx
cmpq %rcx, %rsi
jne 0x8f9b
notl %eax
jmp 0x8fbb
xorl %eax, %eax
popq %rbp
retq