// File: /workspace/github_c_makefile_star2_O1/wuxb45[P]SLB/lib1.c
// Function: maptest_pass
int
maptest_pass(const int argc, char ** const argv, char ** const pref, struct pass_info * const pi)
{
  if ((argc < 10) || (strcmp(argv[0], "pass") != 0)) return -1;

  const u64 c = strtoull(argv[1], NULL, 10);
  const u64 cc = c ? c : process_affinity_core_count();
  const u64 end_type = strtoull(argv[2], NULL, 10);
  const u64 magic = strtoull(argv[3], NULL, 10);
  const u64 rep = strtoull(argv[4], NULL, 10);
  const u64 vlen = strtoull(argv[5], NULL, 10);
  const u64 pset = strtoull(argv[6], NULL, 10);
  const u64 pdel = strtoull(argv[7], NULL, 10);
  const u64 pget = strtoull(argv[8], NULL, 10);
  const u64 rgen_opt = strtoull(argv[9], NULL, 10);
  if (end_type > 1) return -1;

  const u64 nr_cores = process_affinity_core_count();
  u64 cores[nr_cores];
  process_affinity_core_list(nr_cores, cores);
  struct damp * const damp = damp_create(7, 0.004, 0.05);
  struct maptest_papi_info * const papi_info = maptest_papi_prepare();

  char out[1024] = {};
  // per-worker data
  struct maptest_worker_info info[cc];
  struct maptest_worker_info *infov[cc];
  rgen_next_func next_func = (rgen_opt == MAPTEST_GEN_OPT_NOWAIT) ? rgen_next_nowait : rgen_next_wait;
  for (u64 i = 0; i < cc; i++) {
    memset(&(info[i]), 0, sizeof(info[i]));
    infov[i] = &(info[i]);
    info[i].thread_func = pi->wf;
    info[i].api = pi->api;
    info[i].gen = rgen_dup(pi->gen0);
    info[i].rgen_next = next_func;
    info[i].seed = ((i >> 2) + 73) * 17 * 117;
    info[i].vlen = vlen;
    info[i].pset = pset;
    info[i].pdel = pset + pdel;
    info[i].pget = pset + pdel + pget;
    info[i].end_type = end_type;
    if (end_type == MAPTEST_END_COUNT) {
      info[i].end_magic = magic;
    }
    info[i].vctr = vctr_create(pi->vctr_size);
    if (papi_info) {
      info[i].papi_info = papi_info;
      info[i].papi_vctr = vctr_create(papi_info->nr);
    }

    if (rgen_opt == MAPTEST_GEN_OPT_WAIT) {
      const bool rconv = rgen_async_convert(info[i].gen, cores[i % nr_cores] + 1);
      (void)rconv;
      debug_assert(rconv);
    } else if (rgen_opt == MAPTEST_GEN_OPT_NOWAIT) {
      const bool rconv = rgen_async_convert(info[i].gen, cores[i % nr_cores] + 1);
      (void)rconv;
      debug_assert(rconv);
    }
  }

  bool done = false;
  const double t0 = time_sec();
  // until: rep times, or done determined by damp
  for (u64 r = 0; rep ? (r < rep) : (done == false); r++) {
    // prepare
    const double dt1 = time_diff_sec(t0);
    for (u64 i = 0; i < cc; i++) {
      vctr_reset(info[i].vctr);
      if (info[i].papi_vctr) vctr_reset(info[i].papi_vctr);
      rgen_async_wait_all(info[i].gen);
    }

    // set end-time
    if (end_type == MAPTEST_END_TIME) {
      const u64 end_time = time_nsec() + (UINT64_C(1000000000) * magic);
      for (u64 i = 0; i < cc; i++) {
        info[i].end_magic = end_time;
      }
    }

    const double dt = thread_fork_join_private(cc, maptest_thread_func, (void **)infov);
    struct vctr * const va = vctr_create(pi->vctr_size);
    for (u64 i = 0; i < cc; i++) vctr_merge(va, infov[i]->vctr);
    done = pi->af(va, dt, damp, out);
    vctr_destroy(va);

    maptest_papi_report(papi_info, infov, cc, stderr);

    // stderr messages
    fprintf(stderr, " try %"PRIu64" %.2lf %.2lf ", r, dt1, dt);
    for (int i = 0; pref[i]; i++) fprintf(stderr, "%s ", pref[i]);
    for (int i = 0; i < 10; i++) fprintf(stderr, "%s ", argv[i]);
    fprintf(stderr, "%s", out);
    fflush(stderr);
  }

  // clean up
  damp_destroy(damp);
  if (papi_info) free(papi_info);
  for (u64 i = 0; i < cc; i++) {
    rgen_destroy(info[i].gen);
    vctr_destroy(info[i].vctr);
    if (info[i].papi_vctr) vctr_destroy(info[i].papi_vctr);
  }

  // done messages
  for (int i = 0; pref[i]; i++) fprintf(stdout, "%s ", pref[i]);
  for (int i = 0; i < 10; i++) fprintf(stdout, "%s ", argv[i]);
  fprintf(stdout, "%s", out);
  fflush(stdout);
  return 10;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rcx, -0x48(%rbp)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpl $0xa, %edi
jl 0x13564
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %rdi
leaq 0x26bf(%rip), %rsi      # 0x155b8
callq 0x62f0
testl %eax, %eax
jne 0x13564
movq %r14, -0x50(%rbp)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, %r15
testq %rax, %rax
jne 0x12f2a
callq 0x7bee
movq %rax, %r15
movq 0x10(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, %r14
movq 0x18(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, -0x90(%rbp)
movq 0x20(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, -0xc0(%rbp)
movq 0x28(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, -0x68(%rbp)
movq 0x30(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, -0x38(%rbp)
movq 0x38(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, %r12
movq 0x40(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, -0x30(%rbp)
movq %rbx, -0x88(%rbp)
movq 0x48(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %r14, -0xb0(%rbp)
cmpq $0x1, %r14
ja 0x13564
movq %rax, %rbx
callq 0x7bee
movq %rax, %rdi
movq %rsp, -0xb8(%rbp)
movq %rsp, %rsi
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rsi
movq %rsi, %rsp
movq %rdi, -0xa0(%rbp)
movq %rsi, -0x98(%rbp)
callq 0x7c66
movl $0x68, %edi
callq 0x63a0
movq $0x7, (%rax)
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movabsq $0x3f70624dd2f1a9fc, %rcx # imm = 0x3F70624DD2F1A9FC
movq %rcx, 0x20(%rax)
movabsq $0x3fa999999999999a, %rcx # imm = 0x3FA999999999999A
movq %rax, -0x80(%rbp)
movq %rcx, 0x28(%rax)
leaq -0x4d0(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x6210
movq %rsp, %r13
imulq $0x78, %r15, %rax
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movq %rsp, %rcx
leaq 0xf(,%r15,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0xa8(%rbp)
movq %rcx, %rsp
cmpq $0x2, %rbx
leaq -0x8844(%rip), %rax     # 0xa869
leaq -0x8852(%rip), %rcx     # 0xa862
cmoveq %rax, %rcx
movq %rcx, -0x60(%rbp)
testq %r15, %r15
je 0x131fb
addq -0x38(%rbp), %r12
movq %r12, -0x58(%rbp)
addq %r12, -0x30(%rbp)
xorl %r12d, %r12d
movq %r13, %r14
movq %rbx, -0xc8(%rbp)
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %ymm0, 0x58(%r14)
vmovupd %ymm0, 0x40(%r14)
vmovupd %ymm0, 0x20(%r14)
vmovupd %ymm0, (%r14)
movq -0xa8(%rbp), %rax
movq %r14, (%rax,%r12,8)
movq -0x48(%rbp), %rcx
movq 0x18(%rcx), %rax
movq %rax, (%r14)
movq 0x8(%rcx), %rax
movq %rax, 0x8(%r14)
movq (%rcx), %rdi
vzeroupper
callq 0xac66
movq %r12, %rcx
shrq $0x2, %rcx
imulq $0x7c5, %rcx, %rdx      # imm = 0x7C5
addq $0x2372d, %rdx          # imm = 0x2372D
movq %rax, -0x40(%rbp)
movq %rax, 0x10(%r14)
movq -0x60(%rbp), %rcx
movq %rcx, 0x18(%r14)
movq %rdx, 0x20(%r14)
movq -0x68(%rbp), %rax
movq %rax, 0x28(%r14)
movq -0x38(%rbp), %rax
movq %rax, 0x30(%r14)
movq -0x58(%rbp), %rax
movq %rax, 0x38(%r14)
movq -0x30(%rbp), %rax
movq %rax, 0x40(%r14)
movq -0xb0(%rbp), %rax
movq %rax, 0x48(%r14)
cmpq $0x1, %rax
jne 0x13187
movq -0x90(%rbp), %rax
movq %rax, 0x50(%r14)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rbx
leaq 0x8(,%rbx,8), %rsi
movl $0x1, %edi
callq 0x62d0
movq %rbx, (%rax)
movq %rax, 0x60(%r14)
movq -0xc8(%rbp), %rbx
cmpq $0x1, %rbx
je 0x131bb
cmpq $0x2, %rbx
jne 0x131e2
movq %r12, %rax
xorl %edx, %edx
divq -0xa0(%rbp)
movq -0x98(%rbp), %rax
movq (%rax,%rdx,8), %rsi
incq %rsi
movq -0x40(%rbp), %rdi
callq 0xacfe
testb %al, %al
je 0x131f4
incq %r12
addq $0x78, %r14
cmpq %r12, %r15
jne 0x130de
jmp 0x131fb
callq 0x66ef
jmp 0x131e2
leaq -0x78(%rbp), %rbx
movl $0x4, %edi
movq %rbx, %rsi
callq 0x6110
imulq $0x3b9aca00, (%rbx), %rax # imm = 0x3B9ACA00
addq 0x8(%rbx), %rax
vcvtusi2sd %rax, %xmm1, %xmm0
vdivsd 0x1e33(%rip), %xmm0, %xmm0 # 0x15058
vmovsd %xmm0, -0x60(%rbp)
leaq 0x50(%r13), %rax
movq %rax, -0x58(%rbp)
xorl %edx, %edx
xorl %ecx, %ecx
movq -0xc0(%rbp), %rax
testq %rax, %rax
je 0x1324a
cmpq %rax, %rcx
setb %dl
jmp 0x1324d
xorb $0x1, %dl
testb $0x1, %dl
je 0x1349c
movq %rcx, -0x40(%rbp)
movl $0x4, %edi
leaq -0x78(%rbp), %rsi
callq 0x6110
imulq $0x3b9aca00, -0x78(%rbp), %rax # imm = 0x3B9ACA00
addq -0x70(%rbp), %rax
vcvtusi2sd %rax, %xmm2, %xmm0
vdivsd 0x1dd6(%rip), %xmm0, %xmm0 # 0x15058
vmovsd %xmm0, -0x30(%rbp)
testq %r15, %r15
je 0x13310
xorl %ebx, %ebx
imulq $0x78, %rbx, %rax
movq 0x60(%r13,%rax), %rcx
cmpq $0x0, (%rcx)
je 0x132b4
xorl %edx, %edx
movq $0x0, 0x8(%rcx,%rdx,8)
incq %rdx
cmpq (%rcx), %rdx
jb 0x132a3
addq %r13, %rax
movq 0x70(%rax), %rcx
testq %rcx, %rcx
je 0x132d9
cmpq $0x0, (%rcx)
je 0x132d9
xorl %edx, %edx
movq $0x0, 0x8(%rcx,%rdx,8)
incq %rdx
cmpq (%rcx), %rdx
jb 0x132c8
movq 0x10(%rax), %r14
cmpb $0x0, 0x15(%r14)
je 0x13308
xorl %r12d, %r12d
movb 0x160(%r14,%r12), %al
testb $0x1, %al
jne 0x132ff
movl $0x1, %edi
callq 0x6600
jmp 0x132e7
incq %r12
cmpq $0x4, %r12
jne 0x132e7
incq %rbx
cmpq %r15, %rbx
jne 0x13292
cmpq $0x0, -0xb0(%rbp)
jne 0x13356
movl $0x4, %edi
leaq -0x78(%rbp), %rsi
callq 0x6110
testq %r15, %r15
je 0x13356
movq -0x78(%rbp), %rax
addq -0x90(%rbp), %rax
imulq $0x3b9aca00, %rax, %rax # imm = 0x3B9ACA00
addq -0x70(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %r15, %rdx
movq %rax, (%rcx)
addq $0x78, %rcx
decq %rdx
jne 0x1334a
movq %r15, %rdi
leaq 0x216(%rip), %rsi       # 0x13576
movq -0xa8(%rbp), %rbx
movq %rbx, %rdx
callq 0x7e51
vmovsd %xmm0, -0x38(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %r14
leaq 0x8(,%r14,8), %rsi
movl $0x1, %edi
callq 0x62d0
movq %rbx, %r8
movq %rax, %rbx
movq %r14, (%rax)
testq %r15, %r15
je 0x133d4
xorl %eax, %eax
movq (%r8,%rax,8), %rcx
movq 0x60(%rcx), %rcx
movq (%rbx), %rsi
movq (%rcx), %rdx
cmpq %rdx, %rsi
cmovbq %rsi, %rdx
testq %rdx, %rdx
je 0x133cc
xorl %esi, %esi
movq 0x8(%rcx,%rsi,8), %rdi
addq %rdi, 0x8(%rbx,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x133ba
incq %rax
cmpq %r15, %rax
jne 0x1339e
vmovsd -0x30(%rbp), %xmm0
vsubsd -0x60(%rbp), %xmm0, %xmm0
vmovsd %xmm0, -0x68(%rbp)
movq %rbx, %rdi
vmovsd -0x38(%rbp), %xmm0
movq -0x80(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
movq -0x48(%rbp), %rax
callq *0x20(%rax)
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x6060
movq 0x8be8(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x21a3(%rip), %rsi      # 0x155bd
movq -0x40(%rbp), %rdx
vmovsd -0x68(%rbp), %xmm0
vmovsd -0x38(%rbp), %xmm1
movb $0x2, %al
callq 0x6300
movq -0x50(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x13444
movq -0x50(%rbp), %rsi
callq 0x6b8c
xorl %ebx, %ebx
movq -0x88(%rbp), %r14
movq 0x8ba4(%rip), %r12      # 0x1bff8
movq (%r12), %rdi
movq (%r14,%rbx,8), %rdx
leaq 0x2170(%rip), %rsi      # 0x155d3
xorl %eax, %eax
callq 0x6300
incq %rbx
cmpq $0xa, %rbx
jne 0x13454
movq (%r12), %rsi
leaq -0x4d0(%rbp), %rdi
callq 0x6200
movq (%r12), %rdi
callq 0x63b0
movq -0x40(%rbp), %rcx
incq %rcx
movq -0x30(%rbp), %rdx
jmp 0x13236
movq -0x80(%rbp), %rdi
callq 0x6060
testq %r15, %r15
je 0x134d7
addq $0x70, %r13
movq -0x60(%r13), %rdi
callq 0xa871
movq -0x10(%r13), %rdi
callq 0x6060
movq (%r13), %rdi
testq %rdi, %rdi
je 0x134ce
callq 0x6060
addq $0x78, %r13
decq %r15
jne 0x134ae
movq -0x50(%rbp), %r15
movq (%r15), %rdx
testq %rdx, %rdx
je 0x1350e
addq $0x8, %r15
movq 0x8aea(%rip), %r14      # 0x1bfd8
leaq 0x20de(%rip), %rbx      # 0x155d3
movq (%r14), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6300
movq (%r15), %rdx
addq $0x8, %r15
testq %rdx, %rdx
jne 0x134f5
movq 0x8ac3(%rip), %r14      # 0x1bfd8
leaq 0x20b7(%rip), %rbx      # 0x155d3
xorl %r15d, %r15d
movq -0x88(%rbp), %r12
movq (%r14), %rdi
movq (%r12,%r15,8), %rdx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6300
incq %r15
cmpq $0xa, %r15
jne 0x13526
movq (%r14), %rsi
leaq -0x4d0(%rbp), %rdi
callq 0x6200
movq (%r14), %rdi
callq 0x63b0
movl $0xa, %r13d
movq -0xb8(%rbp), %rsp
movl %r13d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq