// File: /workspace/github_c_makefile_star2_O3/yhg926[P]public_kssd/command_dist.c
// Function: mco_cbdco_nobin_dist
void mco_cbdco_nobin_dist(dist_opt_val_t *opt_val_in)
{
  int p_fit_mem = opt_val_in->p;
  llong mem_limit = (llong)opt_val_in->mmry*BBILLION;
  char *refmco_dname = opt_val_in->refpath;
  char *qryco_dname = opt_val_in->remaining_args[0];
  const char *distout_dir = opt_val_in->outdir;
  mkdir(distout_dir,0700);
  FILE *refmco_dstat_fp, *qryco_dstat_fp;
  char *refmco_dstat_fpath = malloc(PATHLEN*sizeof(char));
  char *qryco_dstat_fpath = malloc(PATHLEN*sizeof(char));
  sprintf(refmco_dstat_fpath,"%s/%s",refmco_dname,mco_dstat);
  sprintf(qryco_dstat_fpath,"%s/%s",qryco_dname,co_dstat);
  if( (refmco_dstat_fp = fopen(refmco_dstat_fpath,"rb")) == NULL )
    err(errno,"need provied mco dir path for mco_co_dist() arg 1. refmco_dstat_fpath");
  if( (qryco_dstat_fp = fopen(qryco_dstat_fpath,"rb")) == NULL )
    err(errno,"need provied co dir path for mco_co_dist() arg 2.  qryco_dstat_fpath");
  mco_dstat_t mco_dstat_readin ;
  co_dstat_t co_dstat_readin ;
  fread(&mco_dstat_readin,sizeof(mco_dstat_readin),1,refmco_dstat_fp);
  fread(&co_dstat_readin,sizeof(co_dstat_readin),1,qryco_dstat_fp);
  ctx_obj_ct_t * qry_ctx_ct_list = malloc(co_dstat_readin.infile_num * sizeof(ctx_obj_ct_t));
  ctx_obj_ct_t * ref_ctx_ct_list = malloc(mco_dstat_readin.infile_num * sizeof(ctx_obj_ct_t));
  fread(qry_ctx_ct_list,sizeof(ctx_obj_ct_t),co_dstat_readin.infile_num,qryco_dstat_fp);
  fread(ref_ctx_ct_list,sizeof(ctx_obj_ct_t),mco_dstat_readin.infile_num,refmco_dstat_fp);
  char (*cofname)[PATHLEN] = malloc(co_dstat_readin.infile_num * PATHLEN);
  char (*mcofname)[PATHLEN] = malloc(mco_dstat_readin.infile_num * PATHLEN);
  fread(cofname,PATHLEN,co_dstat_readin.infile_num,qryco_dstat_fp);
  fread(mcofname,PATHLEN,mco_dstat_readin.infile_num,refmco_dstat_fp);
  fclose(refmco_dstat_fp);
  fclose(qryco_dstat_fp);
  if( !(mco_dstat_readin.comp_num == co_dstat_readin.comp_num) )
    err(errno,"query args not match ref args: ref.comp_num = %d vs. %d = qry.comp_num",
    mco_dstat_readin.comp_num, co_dstat_readin.comp_num);
  if(!(mco_dstat_readin.shuf_id == co_dstat_readin.shuf_id))
    err(errno,"query args not match ref args: ref.shuf_id = %d vs. %d = qry.shuf_id",
    mco_dstat_readin.shuf_id, co_dstat_readin.shuf_id);
  char onedist[PATHLEN];
  sprintf(onedist,"%s/sharedk_ct.dat",distout_dir);
  int dist_bfp = open(onedist,O_RDWR,0600) ;
  if (dist_bfp == -1) {
    close(dist_bfp);
    dist_bfp = open(onedist,O_RDWR|O_CREAT, 0600) ;
    if (dist_bfp == -1) err(errno," mco_cbdco_nobin_dist()::%s",onedist);
  }else err(EEXIST," mco_cbdco_nobin_dist():%s",onedist);
  int page_sz = sysconf(_SC_PAGESIZE);
  size_t comp_sz = (1LLU << 4*COMPONENT_SZ);
  if( comp_sz % page_sz != 0 ) err(errno,"comp_sz %d is not multiple of page_sz %d ",comp_sz,page_sz );
  size_t maplength;
  int bnum_infile;
  size_t *mco_offset_index = malloc(sizeof(size_t) * comp_sz);
#define MCOMM_SZ 442317172
  gidobj_t* mco_mem = malloc( sizeof(gidobj_t) * MCOMM_SZ );
  char mco_fcode[PATHLEN]; char mco_index_fcode[PATHLEN];
  char co_cbd_fcode[PATHLEN];char co_cbd_index_fcode[PATHLEN];
  ref_seq_num = mco_dstat_readin.infile_num ;
  qry_seq_num = co_dstat_readin.infile_num ;
  kmerlen = co_dstat_readin.kmerlen;
  dim_reduct_len = co_dstat_readin.dim_rd_len;
  char distf[PATHLEN];
  sprintf(distf, "%s/distance.out", distout_dir);
  int num_unit_mem = mem_limit / (mco_dstat_readin.infile_num*sizeof(ctx_obj_ct_t) * page_sz);
  if(num_unit_mem < 1) err(errno,"at least %fG memory needed to map ./onedist, specify more memory use -m",
      (float)mco_dstat_readin.infile_num*sizeof(ctx_obj_ct_t) * page_sz/1073741824 );
  int num_cof_batch = num_unit_mem*page_sz;
  if( opt_val_in->shared_kmerpath[0] != '\0'){
    dist_print_nobin(distout_dir,ref_seq_num, qry_seq_num, ref_ctx_ct_list, qry_ctx_ct_list,num_cof_batch,mcofname, cofname,opt_val_in);
    return;
  }
  size_t unitsz_distf_mapped = (size_t)num_cof_batch * mco_dstat_readin.infile_num * sizeof(ctx_obj_ct_t) ;
  int num_mapping_distf = co_dstat_readin.infile_num / num_cof_batch ;
  size_t disf_sz = (size_t)mco_dstat_readin.infile_num*co_dstat_readin.infile_num*sizeof(ctx_obj_ct_t) ;
  if(ftruncate(dist_bfp, disf_sz) == -1) err(errno,"mco_cbdco_nobin_dist()::ftruncate");
  close(dist_bfp);
  dist_bfp = open(onedist,O_RDWR, 0600);
  if (dist_bfp == -1) err(errno,"mco_cbdco_nobin_dist()::%s",onedist);
  ctx_obj_ct_t *ctx_obj_ct = mmap(NULL,disf_sz,PROT_READ | PROT_WRITE,MAP_SHARED,dist_bfp,0);
  if(ctx_obj_ct == MAP_FAILED) err(errno,"ctx_obj_ct mmap error");
  close(dist_bfp);
 mmp_any_t* mco_offset_index_comps = malloc(sizeof( mmp_any_t) * mco_dstat_readin.comp_num);
 mmp_any_t* mco_mem_comps = malloc(sizeof( mmp_any_t) * mco_dstat_readin.comp_num);
 mmp_any_t* fco_pos_comps = malloc(sizeof( mmp_any_t) * mco_dstat_readin.comp_num);
 mmp_any_t* cbd_fcode_mem_comps = malloc(sizeof( mmp_any_t) * mco_dstat_readin.comp_num);
 for ( int j = 0; j < mco_dstat_readin.comp_num; j++ ) {
  sprintf(mco_index_fcode,"%s/%s.%d",refmco_dname,mco_idx_prefix,j);
  mco_offset_index_comps[j] = mmp_any(mco_index_fcode);
  sprintf(mco_fcode,"%s/%s.%d",refmco_dname,mco_gids_prefix,j);
  mco_mem_comps[j] = mmp_any(mco_fcode);
  sprintf(co_cbd_index_fcode,"%s/%s.%d",qryco_dname,idx_prefix,j);
  fco_pos_comps[j] = mmp_any(co_cbd_index_fcode);
  sprintf(co_cbd_fcode,"%s/%s.%d",qryco_dname,skch_prefix,j);
  cbd_fcode_mem_comps[j] = mmp_any(co_cbd_fcode);
 }
  for(int b=0;b<=num_mapping_distf;b++){
    if(b==num_mapping_distf) bnum_infile = co_dstat_readin.infile_num % num_cof_batch ;
  else bnum_infile = num_cof_batch;
    if( bnum_infile == 0 ) continue;
    maplength = (size_t)bnum_infile * mco_dstat_readin.infile_num * sizeof(ctx_obj_ct_t);
printf("disf_sz=%lu\trefnum=%d\tqrynum=%d\tnum_mapping_distf=%d\tbatch_qrynum=%d\t%lu\t%lu\n",disf_sz,mco_dstat_readin.infile_num,co_dstat_readin.infile_num,num_mapping_distf,bnum_infile,maplength,(size_t)b*unitsz_distf_mapped);
    for ( int j = 0; j < mco_dstat_readin.comp_num; j++ ) {
   size_t *mco_offset_index= (size_t *) mco_offset_index_comps[j].mmp;
   gidobj_t* mco_mem = (gidobj_t*) mco_mem_comps[j].mmp;
   size_t *fco_pos = (size_t *)fco_pos_comps[j].mmp;
   unsigned int *cbd_fcode_mem = (unsigned int *)cbd_fcode_mem_comps[j].mmp;
#pragma omp parallel for num_threads(p_fit_mem) schedule(guided)
      for(int kind = 0; kind < bnum_infile; kind++){
        int k = b*num_cof_batch + kind;
        if(qry_ctx_ct_list[k]==0) continue;
        size_t distf_offset = (size_t)k * mco_dstat_readin.infile_num;
        for(size_t n = fco_pos[k]; n < fco_pos[k+1]; n++){
          unsigned int ind = cbd_fcode_mem[n];
     size_t s = ind > 0 ? mco_offset_index[ind-1] : 0 ;
     for(size_t g = s; g < mco_offset_index[ind] ; g++)
      ctx_obj_ct[distf_offset + mco_mem[g]]++ ;
        }
      }
    }
    if ( msync( ctx_obj_ct + (size_t)b*num_cof_batch*mco_dstat_readin.infile_num, maplength, MS_SYNC ) < 0 )
      err(errno,"mco_cbdco_nobin_dist()::ctx_obj_ct msync failed");
    munmap(ctx_obj_ct + (size_t)b*num_cof_batch*mco_dstat_readin.infile_num, maplength);
  }
 for ( int j = 0; j < mco_dstat_readin.comp_num; j++ ){
  munmap(mco_offset_index_comps[j].mmp,mco_offset_index_comps[j].fsize);
  munmap(mco_mem_comps[j].mmp,mco_mem_comps[j].fsize);
  munmap(fco_pos_comps[j].mmp,fco_pos_comps[j].fsize);
  munmap(cbd_fcode_mem_comps[j].mmp,cbd_fcode_mem_comps[j].fsize);
 }
  free(mco_offset_index_comps);
  free( mco_mem_comps);
  free( fco_pos_comps);
  free (cbd_fcode_mem_comps);
  dist_print_nobin(distout_dir,ref_seq_num, qry_seq_num, ref_ctx_ct_list, qry_ctx_ct_list,num_cof_batch,mcofname,cofname,opt_val_in);
  free(mco_offset_index);
  free(mco_mem);
  free(ref_ctx_ct_list);
  free(qry_ctx_ct_list);
  free(mcofname);
  free(cofname);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7b8, %rsp            # imm = 0x7B8
movsd 0x110(%rdi), %xmm0
movapd %xmm0, 0xb0(%rsp)
leaq 0x122(%rdi), %r12
movq 0x658(%rdi), %rax
movq (%rax), %r13
movq %rdi, 0x98(%rsp)
addq $0x322, %rdi            # imm = 0x322
movq %rdi, 0x28(%rsp)
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x3090
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, %rbx
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, %r14
leaq 0xd7de(%rip), %r15      # 0x153e3
leaq 0xdbb1(%rip), %rcx      # 0x157bd
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3430
leaq 0xdb8d(%rip), %rcx      # 0x157b0
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3430
leaq 0xd42d(%rip), %rsi      # 0x15067
movq %rbx, %rdi
callq 0x33a0
testq %rax, %rax
je 0x86d2
movq %rax, %rbp
movq %r13, 0x38(%rsp)
movq %r12, 0x20(%rsp)
leaq 0xd408(%rip), %rsi      # 0x15067
movq %r14, %rdi
callq 0x33a0
testq %rax, %rax
je 0x86e2
movq %rax, %r12
leaq 0x10c(%rsp), %rdi
movl $0x14, %esi
movl $0x1, %edx
movq %rdi, %r14
movq %rbp, %rcx
callq 0x30c0
leaq 0xe8(%rsp), %r15
movl $0x20, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rcx
callq 0x30c0
movl 0x14(%r15), %eax
movl %eax, 0x1c(%rsp)
movslq %eax, %r13
leaq (,%r13,4), %rdi
movq %rdi, 0x30(%rsp)
callq 0x3340
movq %rax, %r15
movl 0x10(%r14), %eax
movl %eax, 0x18(%rsp)
movslq %eax, %rbx
leaq (,%rbx,4), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x3340
movq %rax, %r14
movl $0x4, %esi
movq %r15, 0x70(%rsp)
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x30c0
movl $0x4, %esi
movq %r14, 0x90(%rsp)
movq %r14, %rdi
movq %rbx, %rdx
movq %rbp, %rcx
movq %rbp, %r15
callq 0x30c0
movq %r13, %rdi
shlq $0x8, %rdi
callq 0x3340
movq %rax, %r14
movq %rbx, %rdi
shlq $0x8, %rdi
callq 0x3340
movq %rax, %rbp
movl $0x100, %esi            # imm = 0x100
movq %r14, 0x88(%rsp)
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x30c0
movl $0x100, %esi            # imm = 0x100
movq %rbp, 0x80(%rsp)
movq %rbp, %rdi
movq %rbx, 0x68(%rsp)
movq %rbx, %rdx
movq %r15, %rcx
callq 0x30c0
movq %r15, %rdi
callq 0x3100
movq %r12, %rdi
callq 0x3100
leaq 0x10c(%rsp), %rax
movslq 0xc(%rax), %r14
leaq 0xe8(%rsp), %rax
movl 0x10(%rax), %ebx
cmpl %ebx, %r14d
jne 0x86f2
movl 0x10c(%rsp), %ebx
movl 0xe8(%rsp), %ebp
cmpl %ebp, %ebx
jne 0x8707
leaq 0xe263(%rip), %rsi      # 0x1602f
leaq 0x1b0(%rsp), %rbx
movq %rbx, %rdi
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x3430
movq %rbx, %rdi
movl $0x2, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
jne 0x8720
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3220
leaq 0x1b0(%rsp), %rdi
movl $0x42, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
je 0x8739
movl %eax, %ebx
movl $0x1e, %edi
callq 0x33d0
movq %rax, %r12
movslq %r12d, %rbp
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
divq %rbp
testq %rdx, %rdx
jne 0x8749
movapd 0xb0(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0xd8f6(%rip), %xmm0     # 0x15760
sarq $0x3f, %rcx
cvttsd2si %xmm0, %r13
andq %rcx, %r13
orq %rax, %r13
shlq $0x1e, %r13
movl 0x18(%rsp), %eax
movl %eax, 0x56669(%rip)     # 0x5e4f0
movl 0x1c(%rsp), %eax
movl %eax, 0x56663(%rip)     # 0x5e4f4
movl 0xf0(%rsp), %eax
movl 0xf4(%rsp), %ecx
movl %eax, 0x56653(%rip)     # 0x5e4f8
movl %ecx, 0x56651(%rip)     # 0x5e4fc
leaq 0xe124(%rip), %rsi      # 0x15fd6
leaq 0x6b0(%rsp), %rdi
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x3430
imulq 0xa0(%rsp), %rbp
movq %r13, %rax
xorl %edx, %edx
divq %rbp
movq %rax, %r13
testl %r13d, %r13d
jle 0x8766
imull %r12d, %r13d
movq 0x98(%rsp), %rax
cmpb $0x0, 0x54b(%rax)
je 0x7f3d
movl 0x565f2(%rip), %esi     # 0x5e4f0
movl 0x565f0(%rip), %edx     # 0x5e4f4
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x98(%rsp), %rcx
movq 0x78(%rsp), %r8
movl %r13d, %r9d
pushq %rax
pushq 0x98(%rsp)
pushq 0x98(%rsp)
callq 0xabee
addq $0x7d8, %rsp            # imm = 0x7D8
jmp 0x86b2
movl 0x1c(%rsp), %eax
cltd
idivl %r13d
movl %eax, 0x14(%rsp)
movl %edx, 0x7c(%rsp)
movq 0x30(%rsp), %rsi
imulq 0x68(%rsp), %rsi
movl %ebx, %edi
movq %rsi, 0x30(%rsp)
callq 0x31e0
cmpl $-0x1, %eax
je 0x87a4
movl %ebx, %edi
callq 0x3220
leaq 0x1b0(%rsp), %rdi
movl $0x2, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
je 0x87b7
movl %eax, %ebx
movq %r13, 0x40(%rsp)
xorl %edi, %edi
movq 0x30(%rsp), %rsi
movl $0x3, %edx
movl $0x1, %ecx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, 0xb0(%rsp)
cmpq $-0x1, %rax
je 0x87d4
movl %ebx, %edi
callq 0x3220
movq %r14, %rbx
shlq $0x4, %rbx
movq %rbx, %rdi
callq 0x3340
movq %rax, 0x60(%rsp)
movq %rbx, %rdi
callq 0x3340
movq %rax, 0xa8(%rsp)
movq %rbx, %rdi
callq 0x3340
movq %rax, 0x58(%rsp)
movq %rbx, 0xc0(%rsp)
movq %rbx, %rdi
callq 0x3340
movq %rax, 0x50(%rsp)
testl %r14d, %r14d
jle 0x83bf
movl $0x8, %ebp
xorl %ecx, %ecx
movq %rcx, 0x8(%rsp)
leaq 0x4b0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xd01f(%rip), %rsi      # 0x1505e
movq 0x20(%rsp), %rdx
leaq 0xd009(%rip), %rcx      # 0x15054
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x3430
movq %rbx, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3380
movl %eax, %r13d
movl %eax, %r12d
shrl $0x1f, %r12d
callq 0x3060
movq %rax, %r15
movl (%rax), %edi
callq 0x3470
movl %r12d, %edi
leaq 0xd129(%rip), %rsi      # 0x151af
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
leaq 0x120(%rsp), %rsi
callq 0x34a0
movq 0x150(%rsp), %rsi
movq %rsi, (%rsp)
xorl %edi, %edi
movl $0x1, %edx
movl $0x2, %ecx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, %rbx
xorl %r12d, %r12d
cmpq $-0x1, %rax
sete %r12b
movl (%r15), %edi
callq 0x3470
movl %r12d, %edi
leaq 0xd0dc(%rip), %rsi      # 0x151c2
leaq 0x4b0(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
callq 0x3220
movq 0x60(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, -0x8(%rax,%rbp)
movq %rbx, (%rax,%rbp)
leaq 0x5b0(%rsp), %r12
movq %r12, %rdi
leaq 0xcf3a(%rip), %rsi      # 0x1505e
movq 0x20(%rsp), %rdx
leaq 0xcf20(%rip), %rcx      # 0x15050
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3380
movl %eax, %r13d
movl %eax, %ebx
shrl $0x1f, %ebx
movl (%r15), %edi
callq 0x3470
movl %ebx, %edi
leaq 0xd04e(%rip), %rsi      # 0x151af
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
leaq 0x120(%rsp), %rsi
callq 0x34a0
movq 0x150(%rsp), %rsi
movq %rsi, (%rsp)
xorl %edi, %edi
movl $0x1, %edx
movl $0x2, %ecx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, %rbx
xorl %r12d, %r12d
cmpq $-0x1, %rax
sete %r12b
movl (%r15), %edi
callq 0x3470
movl %r12d, %edi
leaq 0xd001(%rip), %rsi      # 0x151c2
leaq 0x5b0(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
callq 0x3220
movq 0xa8(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, -0x8(%rax,%rbp)
movq %rbx, (%rax,%rbp)
leaq 0x2b0(%rsp), %r12
movq %r12, %rdi
leaq 0xce5c(%rip), %rsi      # 0x1505e
movq 0x38(%rsp), %rdx
leaq 0xedc5(%rip), %rcx      # 0x16fd3
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3380
movl %eax, %r13d
movl %eax, %ebx
shrl $0x1f, %ebx
movl (%r15), %edi
callq 0x3470
movl %ebx, %edi
leaq 0xcf70(%rip), %rsi      # 0x151af
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
leaq 0x120(%rsp), %rsi
callq 0x34a0
movq 0x150(%rsp), %rsi
movq %rsi, (%rsp)
xorl %edi, %edi
movl $0x1, %edx
movl $0x2, %ecx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, %rbx
xorl %r12d, %r12d
cmpq $-0x1, %rax
sete %r12b
movl (%r15), %edi
movq %r15, 0x48(%rsp)
callq 0x3470
movl %r12d, %edi
leaq 0xcf1e(%rip), %rsi      # 0x151c2
leaq 0x2b0(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
callq 0x3220
movq 0x58(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, -0x8(%rax,%rbp)
movq %rbx, (%rax,%rbp)
leaq 0x3b0(%rsp), %r12
movq %r12, %rdi
leaq 0xcd7c(%rip), %rsi      # 0x1505e
movq 0x38(%rsp), %rdx
leaq 0xecde(%rip), %rcx      # 0x16fcc
movq 0x8(%rsp), %r8
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x3380
movl %eax, %r13d
movl %eax, %ebx
shrl $0x1f, %ebx
movl (%r15), %edi
callq 0x3470
movl %ebx, %edi
leaq 0xce90(%rip), %rsi      # 0x151af
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
leaq 0x120(%rsp), %rsi
callq 0x34a0
movq 0x150(%rsp), %r15
xorl %edi, %edi
movq %r15, %rsi
movl $0x1, %edx
movl $0x2, %ecx
movl %r13d, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, %rbx
xorl %r12d, %r12d
cmpq $-0x1, %rax
sete %r12b
movq 0x48(%rsp), %rax
movl (%rax), %edi
callq 0x3470
movl %r12d, %edi
leaq 0xce40(%rip), %rsi      # 0x151c2
leaq 0x3b0(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xbf3d
movl %r13d, %edi
callq 0x3220
movq 0x8(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %r15, -0x8(%rax,%rbp)
movq %rbx, (%rax,%rbp)
incq %rcx
addq $0x10, %rbp
cmpq %rcx, %r14
jne 0x8028
cmpl $0x0, 0x14(%rsp)
movq 0x40(%rsp), %rdx
movq 0xa8(%rsp), %rbp
js 0x85b9
movslq %edx, %rax
movq 0x68(%rsp), %rcx
movq %rax, 0xc8(%rsp)
imulq %rax, %rcx
movq %rcx, 0xd8(%rsp)
leaq (,%rcx,4), %rax
movq %rax, 0xd0(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ecx
movq %rcx, 0x48(%rsp)
incl %eax
movq %rax, (%rsp)
xorl %r12d, %r12d
movq %rbp, %r15
movq %r14, 0xe0(%rsp)
cmpq 0x48(%rsp), %r12
movl %edx, %ebx
cmovel 0x7c(%rsp), %ebx
testl %ebx, %ebx
je 0x85ac
movslq %ebx, %r11
imulq 0xa0(%rsp), %r11
movq 0xd0(%rsp), %r10
movq %r12, 0x20(%rsp)
imulq %r12, %r10
leaq 0xdd66(%rip), %rdi      # 0x161c0
movq 0x30(%rsp), %rsi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl 0x14(%rsp), %r8d
movl %ebx, %r9d
xorl %eax, %eax
pushq %r10
movq %r11, 0x40(%rsp)
pushq %r11
callq 0x3170
addq $0x10, %rsp
testl %r14d, %r14d
jle 0x8562
movq 0x20(%rsp), %rax
imulq 0xc8(%rsp), %rax
movl %ebx, %ecx
xorl %edx, %edx
movl %ebx, 0x8(%rsp)
testl %ebx, %ebx
jle 0x854a
movq %rdx, %r9
shlq $0x4, %r9
movq 0x60(%rsp), %rsi
movq 0x8(%rsi,%r9), %rsi
movq 0x8(%rbp,%r9), %rdi
movq 0x58(%rsp), %r8
movq 0x8(%r8,%r9), %r8
movq 0x50(%rsp), %r10
movq 0x8(%r10,%r9), %r9
xorl %r10d, %r10d
leaq (%r10,%rax), %rbx
movq 0x70(%rsp), %r11
cmpl $0x0, (%r11,%rbx,4)
je 0x8542
movq (%r8,%rbx,8), %r11
movq 0x8(%r8,%rbx,8), %r12
cmpq %r12, %r11
jae 0x8542
imulq 0x68(%rsp), %rbx
movq 0xb0(%rsp), %r14
leaq (%r14,%rbx,4), %r13
movl (%r9,%r11,4), %ebx
testq %rbx, %rbx
je 0x851a
leal -0x1(%rbx), %r14d
movq (%rsi,%r14,8), %r14
jmp 0x851d
xorl %r14d, %r14d
movq (%rsi,%rbx,8), %rbx
cmpq %rbx, %r14
jae 0x8537
movl (%rdi,%r14,4), %ebp
incl (%r13,%rbp,4)
incq %r14
cmpq %r14, %rbx
jne 0x8526
incq %r11
cmpq %r12, %r11
movq %r15, %rbp
jne 0x8507
incq %r10
cmpq %rcx, %r10
jne 0x84d7
incq %rdx
movq 0xe0(%rsp), %r14
cmpq %r14, %rdx
movl 0x8(%rsp), %ebx
jne 0x84a2
movq 0xd8(%rsp), %rax
movq 0x20(%rsp), %r12
imulq %r12, %rax
movq 0xb0(%rsp), %rcx
leaq (%rcx,%rax,4), %rbx
movq %rbx, %rdi
movq 0x38(%rsp), %r13
movq %r13, %rsi
movl $0x4, %edx
callq 0x3120
testl %eax, %eax
js 0x86bd
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3360
movq 0x40(%rsp), %rdx
incq %r12
cmpq (%rsp), %r12
jne 0x8422
testl %r14d, %r14d
movq 0xc0(%rsp), %r14
movq 0x60(%rsp), %r13
movq 0x58(%rsp), %r15
movq 0x50(%rsp), %r12
jle 0x861a
xorl %ebx, %ebx
movq (%r13,%rbx), %rsi
movq 0x8(%r13,%rbx), %rdi
callq 0x3360
movq (%rbp,%rbx), %rsi
movq 0x8(%rbp,%rbx), %rdi
callq 0x3360
movq (%r15,%rbx), %rsi
movq 0x8(%r15,%rbx), %rdi
callq 0x3360
movq (%r12,%rbx), %rsi
movq 0x8(%r12,%rbx), %rdi
callq 0x3360
addq $0x10, %rbx
cmpq %rbx, %r14
jne 0x85d7
movq %r13, %rdi
callq 0x3040
movq %rbp, %rdi
callq 0x3040
movq %r15, %rdi
callq 0x3040
movq %r12, %rdi
callq 0x3040
movl 0x55eb0(%rip), %esi     # 0x5e4f0
movl 0x55eae(%rip), %edx     # 0x5e4f4
subq $0x8, %rsp
movq 0x30(%rsp), %rdi
movq 0x98(%rsp), %rbx
movq %rbx, %rcx
movq 0x78(%rsp), %r15
movq %r15, %r8
movq 0x48(%rsp), %r9
pushq 0xa0(%rsp)
movq 0x98(%rsp), %r14
pushq %r14
movq 0x98(%rsp), %r12
pushq %r12
callq 0xabee
addq $0x20, %rsp
movq %rbx, %rdi
callq 0x3040
movq %r15, %rdi
callq 0x3040
movq %r12, %rdi
callq 0x3040
movq %r14, %rdi
callq 0x3040
addq $0x7b8, %rsp            # imm = 0x7B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
leaq 0xdb43(%rip), %rsi      # 0x1620e
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0xd738(%rip), %rsi      # 0x15e18
jmp 0x86cb
callq 0x3060
movl (%rax), %edi
leaq 0xd76e(%rip), %rsi      # 0x15e5e
jmp 0x86cb
callq 0x3060
movl (%rax), %edi
leaq 0xd7a3(%rip), %rsi      # 0x15ea3
movl %r14d, %edx
movl %ebx, %ecx
jmp 0x8719
callq 0x3060
movl (%rax), %edi
leaq 0xd7d5(%rip), %rsi      # 0x15eea
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3330
leaq 0xda5c(%rip), %rsi      # 0x16183
leaq 0x1b0(%rsp), %rdx
movl $0x11, %edi
jmp 0x87cd
callq 0x3060
movl (%rax), %edi
leaq 0xda20(%rip), %rsi      # 0x16167
jmp 0x87c5
callq 0x3060
movl (%rax), %edi
leaq 0xd91d(%rip), %rsi      # 0x16074
movl $0x10000000, %edx       # imm = 0x10000000
movl %r12d, %ecx
xorl %eax, %eax
callq 0x3330
callq 0x3060
xorps %xmm0, %xmm0
cvtsi2ssl 0x18(%rsp), %xmm0
mulss 0xd01c(%rip), %xmm0     # 0x15798
movl (%rax), %edi
cvtsi2ss %r12d, %xmm1
mulss %xmm0, %xmm1
mulss 0xd00d(%rip), %xmm1     # 0x1579c
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0xd901(%rip), %rsi      # 0x1609e
movb $0x1, %al
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0xd9ec(%rip), %rsi      # 0x1619e
jmp 0x86cb
callq 0x3060
movl (%rax), %edi
leaq 0xd9a3(%rip), %rsi      # 0x16168
leaq 0x1b0(%rsp), %rdx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0xd7b7(%rip), %rsi      # 0x15f99
jmp 0x86cb