// File: /workspace/github_c_makefile_star2_O3/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 0x12fef
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %rdi
leaq 0x1c46(%rip), %rsi      # 0x145c8
callq 0x62f0
testl %eax, %eax
jne 0x12fef
movq %r14, -0x50(%rbp)
movq 0x8(%rbx), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x62c0
movq %rax, %r15
testq %rax, %rax
jne 0x129b3
callq 0x7b67
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 0x12fef
movq %rax, %rbx
callq 0x7b67
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 0x7bdf
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 -0x83d5(%rip), %rax     # 0xa761
leaq -0x83e3(%rip), %rcx     # 0xa75a
cmoveq %rax, %rcx
movq %rcx, -0x60(%rbp)
testq %r15, %r15
je 0x12c87
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, 0x50(%r14)
vmovupd %ymm0, 0x30(%r14)
vmovupd %ymm0, 0x10(%r14)
movq $0x0, 0x70(%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 0xab5e
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 0x12c13
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 0x12c47
cmpq $0x2, %rbx
jne 0x12c6e
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 0xabf6
testb %al, %al
je 0x12c80
incq %r12
addq $0x78, %r14
cmpq %r12, %r15
jne 0x12b67
jmp 0x12c87
callq 0x66ef
jmp 0x12c6e
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 0x13a7(%rip), %xmm0, %xmm0 # 0x14058
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 0x12cd8
cmpq %rax, %rcx
jb 0x12ce1
jmp 0x12f27
testb $0x1, %dl
jne 0x12f27
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 0x134b(%rip), %xmm0, %xmm0 # 0x14058
vmovsd %xmm0, -0x30(%rbp)
testq %r15, %r15
je 0x12d9b
xorl %ebx, %ebx
imulq $0x78, %rbx, %rax
movq 0x60(%r13,%rax), %rcx
cmpq $0x0, (%rcx)
je 0x12d3f
xorl %edx, %edx
movq $0x0, 0x8(%rcx,%rdx,8)
incq %rdx
cmpq (%rcx), %rdx
jb 0x12d2e
addq %r13, %rax
movq 0x70(%rax), %rcx
testq %rcx, %rcx
je 0x12d64
cmpq $0x0, (%rcx)
je 0x12d64
xorl %edx, %edx
movq $0x0, 0x8(%rcx,%rdx,8)
incq %rdx
cmpq (%rcx), %rdx
jb 0x12d53
movq 0x10(%rax), %r14
cmpb $0x0, 0x15(%r14)
je 0x12d93
xorl %r12d, %r12d
movb 0x160(%r14,%r12), %al
testb $0x1, %al
jne 0x12d8a
movl $0x1, %edi
callq 0x6600
jmp 0x12d72
incq %r12
cmpq $0x4, %r12
jne 0x12d72
incq %rbx
cmpq %r15, %rbx
jne 0x12d1d
cmpq $0x0, -0xb0(%rbp)
jne 0x12de1
movl $0x4, %edi
leaq -0x78(%rbp), %rsi
callq 0x6110
testq %r15, %r15
je 0x12de1
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 0x12dd5
movq %r15, %rdi
leaq 0x216(%rip), %rsi       # 0x13001
movq -0xa8(%rbp), %rbx
movq %rbx, %rdx
callq 0x7dcc
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 0x12e5f
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 0x12e57
xorl %esi, %esi
movq 0x8(%rcx,%rsi,8), %rdi
addq %rdi, 0x8(%rbx,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x12e45
incq %rax
cmpq %r15, %rax
jne 0x12e29
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 0x715d(%rip), %rax      # 0x19ff8
movq (%rax), %rdi
leaq 0x1728(%rip), %rsi      # 0x145cd
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 0x12ecf
movq -0x50(%rbp), %rsi
callq 0x6b75
xorl %ebx, %ebx
movq -0x88(%rbp), %r14
movq 0x7119(%rip), %r12      # 0x19ff8
movq (%r12), %rdi
movq (%r14,%rbx,8), %rdx
leaq 0x16f5(%rip), %rsi      # 0x145e3
xorl %eax, %eax
callq 0x6300
incq %rbx
cmpq $0xa, %rbx
jne 0x12edf
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 0x12cc2
movq -0x80(%rbp), %rdi
callq 0x6060
testq %r15, %r15
je 0x12f62
addq $0x70, %r13
movq -0x60(%r13), %rdi
callq 0xa769
movq -0x10(%r13), %rdi
callq 0x6060
movq (%r13), %rdi
testq %rdi, %rdi
je 0x12f59
callq 0x6060
addq $0x78, %r13
decq %r15
jne 0x12f39
movq -0x50(%rbp), %r15
movq (%r15), %rdx
testq %rdx, %rdx
je 0x12f99
addq $0x8, %r15
movq 0x705f(%rip), %r14      # 0x19fd8
leaq 0x1663(%rip), %rbx      # 0x145e3
movq (%r14), %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6300
movq (%r15), %rdx
addq $0x8, %r15
testq %rdx, %rdx
jne 0x12f80
movq 0x7038(%rip), %r14      # 0x19fd8
leaq 0x163c(%rip), %rbx      # 0x145e3
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 0x12fb1
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