// File: /workspace/github_c_makefile_star2_O2/yhg926[P]public_kssd/command_dist.c
// Function: mco_cbd_co_dist
void mco_cbd_co_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;
  printf("run mco_cbd_co_dist(), %fG memory used\t%d threads used\n",opt_val_in->mmry,p_fit_mem);
  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);
  int ref_bin_num = mco_dstat_readin.infile_num / BIN_SZ;
 if( mco_dstat_readin.infile_num % BIN_SZ > 0 ) ref_bin_num +=1;
 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_cbd_co_dist()::%s",onedist);
 }
 else{
  errno = EEXIST;
  err(errno,"mco_cbd_co_dist()::%s",onedist);
 }
 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_cbd_co_dist()::ftruncate");
 close(dist_bfp);
 dist_bfp = open(onedist,O_RDWR, 0600);
 if (dist_bfp == -1) err(errno,"mco_cbd_co_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);
 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 );
 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;
 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 maplength;
 int bnum_infile;
 FILE *cbd_fcode_comp_fp,*cbd_fcode_comp_index_fp;
  struct stat cbd_fcode_stat;
 size_t *fco_pos = malloc(sizeof(size_t) * (co_dstat_readin.infile_num + 1) );
 size_t *mco_offset_index = malloc(sizeof(size_t) * comp_sz);
 unsigned int *mco_bin_index = malloc( sizeof(unsigned int) * comp_sz * ref_bin_num );
 gidobj_t* mco_mem = malloc( sizeof(gidobj_t) * 442317172 );
 char mco_fcode[PATHLEN]; char mco_index_fcode[PATHLEN];
 char co_cbd_fcode[PATHLEN];char co_cbd_index_fcode[PATHLEN];
 for(int b=0;b<=num_mapping_distf;b++){
  if(b==num_mapping_distf){
   bnum_infile = co_dstat_readin.infile_num % num_cof_batch ;
   if( bnum_infile == 0 ) continue;
  }else bnum_infile = num_cof_batch;
  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=%dbnum_infile=%d\t\t%lu\t%lu\tflag1:Ok\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++ ) {
   sprintf(mco_index_fcode,"%s/mco.index.%d",refmco_dname,j);
      sprintf(mco_fcode,"%s/mco.%d",refmco_dname,j);
   FILE *indexfp, *mcofp;
   if( (indexfp = fopen(mco_index_fcode,"rb"))==NULL) err(errno,"mco_cbd_co_dist()::%s",mco_index_fcode);
   fread(mco_offset_index,sizeof(size_t),comp_sz,indexfp);
   fread(mco_bin_index,sizeof(unsigned int),comp_sz * ref_bin_num,indexfp);
   fclose(indexfp);
   struct stat s;
   if( (mcofp = fopen(mco_fcode,"rb"))==NULL) err(errno,"mco_cbd_co_dist()::%s",mco_fcode);
   stat(mco_fcode, &s);
   fread(mco_mem,sizeof(gidobj_t),s.st_size/sizeof(gidobj_t),mcofp);
   fclose(mcofp);
      sprintf(co_cbd_fcode,"%s/combco.%d",qryco_dname,j);
      if( (cbd_fcode_comp_fp = fopen(co_cbd_fcode,"rb"))==NULL) err(errno,"mco_cbd_co_dist()::%s",co_cbd_fcode);
      stat(co_cbd_fcode, &cbd_fcode_stat);
   if(co_dstat_readin.koc){
   }
      unsigned int *cbd_fcode_mem = malloc(cbd_fcode_stat.st_size);
      fread(cbd_fcode_mem,sizeof(unsigned int),cbd_fcode_stat.st_size/sizeof(unsigned int),cbd_fcode_comp_fp);
      fclose(cbd_fcode_comp_fp);
   sprintf(co_cbd_index_fcode,"%s/combco.index.%d",qryco_dname,j);
   if( (cbd_fcode_comp_index_fp = fopen(co_cbd_index_fcode,"rb"))==NULL)
    err(errno,"mco_cbd_co_dist()::%s",co_cbd_index_fcode);
   fread(fco_pos,sizeof(size_t),co_dstat_readin.infile_num + 1 ,cbd_fcode_comp_index_fp);
   fclose(cbd_fcode_comp_index_fp);
#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;
    unsigned int ind, mcogid, pos;
    llong distf_offset = (size_t)k * mco_dstat_readin.infile_num;
     for(int n = 0; n < fco_pos[k+1] - fco_pos[k]; n++){
       ind = cbd_fcode_mem[ fco_pos[k] + n ];
     pos = 0;
     for(int bin=0; bin < ref_bin_num; bin++){
      int bin_gnum = mco_bin_index[ ind *ref_bin_num + bin];
      for(int g = 0; g < bin_gnum ; g++ ){
       mcogid = bin*BIN_SZ + mco_mem[ mco_offset_index[ind] + pos ];
       ctx_obj_ct[distf_offset + mcogid ]++ ;
       pos++;
      }
     }
     }
     }
    free(cbd_fcode_mem);
    munmap(mco_offset_index, comp_sz * sizeof(size_t));
    munmap(mco_bin_index,comp_sz*ref_bin_num*sizeof(unsigned int) );
   }
    if ( msync( ctx_obj_ct + (size_t)b*num_cof_batch*mco_dstat_readin.infile_num, maplength, MS_SYNC ) < 0 )
     err(errno,"mco_cbd_co_dist()::ctx_obj_ct msync failed");
    munmap(ctx_obj_ct + (size_t)b*num_cof_batch*mco_dstat_readin.infile_num, maplength);
  }
 free(fco_pos);
  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;
 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(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 $0x788, %rsp            # imm = 0x788
movl 0x4(%rdi), %esi
movsd 0x110(%rdi), %xmm0
leaq 0x122(%rdi), %r12
movq %rdi, 0x60(%rsp)
movq 0x658(%rdi), %rax
movq (%rax), %r13
leaq 0xb83e(%rip), %rdi      # 0x14fa7
movapd %xmm0, 0x20(%rsp)
movb $0x1, %al
callq 0x3170
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, %rbx
movl $0x100, %edi            # imm = 0x100
callq 0x3340
movq %rax, %r14
leaq 0xabfc(%rip), %r15      # 0x14393
leaq 0xafcf(%rip), %rcx      # 0x1476d
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, 0x80(%rsp)
movq %r12, %rdx
xorl %eax, %eax
callq 0x3430
leaq 0xafa3(%rip), %rcx      # 0x14760
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x3430
leaq 0xa893(%rip), %rsi      # 0x14067
movq %rbx, %rdi
callq 0x33a0
testq %rax, %rax
je 0xa109
movq %rax, %rbx
leaq 0xa878(%rip), %rsi      # 0x14067
movq %r14, %rdi
callq 0x33a0
testq %rax, %rax
je 0xa119
movq %rax, %r14
movq %r13, 0x100(%rsp)
leaq 0x14c(%rsp), %rdi
pushq $0x14
popq %rsi
pushq $0x1
popq %r13
movq %rdi, %r15
movq %r13, %rdx
movq %rbx, %rcx
callq 0x30c0
leaq 0x128(%rsp), %r12
pushq $0x20
popq %rsi
movq %r12, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x30c0
movl 0x14(%r12), %eax
movl %eax, 0x14(%rsp)
movslq %eax, %r12
leaq (,%r12,4), %rdi
movq %rdi, 0x18(%rsp)
callq 0x3340
movq %rax, %rbp
movl 0x10(%r15), %eax
movl %eax, 0x4(%rsp)
movq %rbx, %r13
movslq %eax, %rbx
leaq (,%rbx,4), %rdi
movq %rdi, 0x70(%rsp)
callq 0x3340
movq %rax, %r15
pushq $0x4
popq %rsi
movq %rbp, 0x98(%rsp)
movq %rbp, %rdi
movq %rsi, %rbp
movq %r12, %rdx
movq %r14, %rcx
callq 0x30c0
movq %r15, 0xb8(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rbp
movq %r13, %rcx
callq 0x30c0
movq %r12, %rdi
shlq $0x8, %rdi
callq 0x3340
movq %rax, %r15
movq %rbx, %rdi
shlq $0x8, %rdi
callq 0x3340
movq %rax, %r13
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movq %r12, 0x38(%rsp)
movq %r12, %rdx
movq %r14, %rcx
callq 0x30c0
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movq %rbx, 0x40(%rsp)
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x30c0
movq %rbp, %rdi
callq 0x3100
movq %r14, %rdi
callq 0x3100
leaq 0x14c(%rsp), %rax
movl 0xc(%rax), %eax
leaq 0x128(%rsp), %rcx
movl 0x10(%rcx), %ebx
movl %eax, 0x8(%rsp)
cmpl %ebx, %eax
jne 0xa129
movq %r13, 0xb0(%rsp)
movl 0x14c(%rsp), %ebx
movl 0x128(%rsp), %ebp
cmpl %ebp, %ebx
jne 0xa13f
movq 0x60(%rsp), %rax
leaq 0x322(%rax), %r8
movl $0x10000, %ecx          # imm = 0x10000
movl 0x4(%rsp), %esi
movl %esi, %eax
cltd
idivl %ecx
movl %eax, %ebx
xorl %r12d, %r12d
testl $0x8000ffff, %esi       # imm = 0x8000FFFF
setg %r13b
leaq 0xb654(%rip), %rsi      # 0x14fdf
leaq 0x160(%rsp), %r14
movq %r14, %rdi
movq %r8, 0xa8(%rsp)
movq %r8, %rdx
xorl %eax, %eax
callq 0x3430
pushq $0x2
popq %rsi
movq %r14, %rdi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
jne 0xa158
pushq $-0x1
popq %rdi
callq 0x3220
leaq 0x160(%rsp), %rdi
pushq $0x42
popq %rsi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
je 0xa0f9
movl %eax, %ebp
movq 0x18(%rsp), %rsi
imulq 0x40(%rsp), %rsi
movl %eax, %edi
movq %rsi, 0x18(%rsp)
callq 0x31e0
cmpl $-0x1, %eax
je 0xa17a
movl %ebp, %edi
callq 0x3220
leaq 0x160(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x3380
cmpl $-0x1, %eax
je 0xa0f9
movl %eax, %ebp
movq %r15, 0xa0(%rsp)
pushq $0x3
popq %rdx
pushq $0x1
popq %rcx
xorl %edi, %edi
movq 0x18(%rsp), %rsi
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x3150
movq %rax, 0x88(%rsp)
cmpq $-0x1, %rax
je 0xa18d
movl %ebp, %edi
callq 0x3220
pushq $0x1e
popq %rdi
callq 0x33d0
movq %rax, %r15
movslq %r15d, %rcx
movl $0x10000000, %eax       # imm = 0x10000000
xorl %edx, %edx
divq %rcx
testq %rdx, %rdx
jne 0xa1a0
movapd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %rdx
movq %rdx, %rsi
sarq $0x3f, %rsi
subsd 0xac66(%rip), %xmm0     # 0x14710
cvttsd2si %xmm0, %rax
andq %rsi, %rax
orq %rdx, %rax
shlq $0x1e, %rax
imulq 0x70(%rsp), %rcx
xorl %edx, %edx
divq %rcx
testl %eax, %eax
jle 0xa1bd
movb %r13b, %r12b
imull %r15d, %eax
movq %rax, 0x78(%rsp)
movslq %eax, %rbp
movq 0x38(%rsp), %rcx
movl %ecx, %eax
cltd
idivl %ebp
movq %rax, 0x68(%rsp)
movl %edx, %r14d
addl %r12d, %ebx
leaq 0x8(,%rcx,8), %rdi
incq %rcx
movq %rcx, 0x38(%rsp)
callq 0x3340
movq %rax, 0x48(%rsp)
movl $0x80000000, %edi       # imm = 0x80000000
callq 0x3340
movq %rax, %r15
movl %ebx, 0x5c(%rsp)
movslq %ebx, %r12
movq %r12, %rdi
shlq $0x1e, %rdi
movq %rdi, 0xf8(%rsp)
callq 0x3340
movq %rax, %r13
movl $0x6974e5d0, %edi       # imm = 0x6974E5D0
callq 0x3340
movq 0x68(%rsp), %r8
movq %rbp, %rcx
movq %rax, %rbp
movq 0x40(%rsp), %rax
imulq %rcx, %rax
movq %rax, 0xd0(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0xd8(%rsp)
movq %r12, %rax
shlq $0x1c, %rax
movq %rax, 0x108(%rsp)
testl %r12d, %r12d
movl $0x0, %edx
cmovlel %edx, %r12d
movl 0x8(%rsp), %eax
testl %eax, %eax
cmovlel %edx, %eax
movl %eax, 0x8(%rsp)
movslq %r8d, %rax
movq %rax, 0xe0(%rsp)
movl %r14d, 0x10(%rsp)
movslq %r14d, %rax
movq %rax, 0xc0(%rsp)
xorl %ebx, %ebx
movq %rcx, 0xc8(%rsp)
cmpq 0xe0(%rsp), %rbx
jg 0x9fcb
movq %rcx, %r9
movq 0x78(%rsp), %rax
cmpq %r8, %rbx
jne 0x9bea
cmpl $0x0, 0x10(%rsp)
je 0x9fc3
movq 0xc0(%rsp), %r9
movl 0x10(%rsp), %eax
movq %rax, 0x50(%rsp)
imulq 0x70(%rsp), %r9
movq 0xd8(%rsp), %r10
imulq %rbx, %r10
leaq 0xb48e(%rip), %rdi      # 0x15096
movq 0x18(%rsp), %rsi
movl 0x4(%rsp), %edx
movq %r9, %r11
movq %rbx, %r14
movq %rcx, %rbx
movl 0x14(%rsp), %ecx
movl %eax, %r9d
xorl %eax, %eax
pushq %r10
movq %r11, 0xf0(%rsp)
pushq %r11
callq 0x3170
xorl %ecx, %ecx
movq 0x60(%rsp), %rax
addq $0x10, %rsp
movq %r14, 0xf0(%rsp)
imulq %rbx, %r14
movq %r14, 0x110(%rsp)
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, 0x50(%rsp)
cmpl 0x8(%rsp), %ecx
je 0x9f69
leaq 0x380(%rsp), %rdi
leaq 0xa445(%rip), %rsi      # 0x140bb
movq 0x80(%rsp), %rdx
movl %ecx, %ebx
xorl %eax, %eax
callq 0x3430
leaq 0x480(%rsp), %rdi
leaq 0xa435(%rip), %rsi      # 0x140cb
movq 0x80(%rsp), %rdx
movl %ebx, 0xc(%rsp)
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3430
leaq 0x380(%rsp), %rdi
leaq 0xa3ad(%rip), %rsi      # 0x14067
callq 0x33a0
testq %rax, %rax
je 0xa07f
movl $0x10000000, %edx       # imm = 0x10000000
movq %r15, %rdi
pushq $0x8
popq %rsi
movq %rax, %rcx
movq %rax, %r14
callq 0x30c0
movq %r13, %rdi
pushq $0x4
popq %rbx
movq %rbx, %rsi
movq 0x108(%rsp), %rdx
movq %r14, %rcx
callq 0x30c0
movq %r14, %rdi
callq 0x3100
leaq 0x480(%rsp), %r14
movq %r14, %rdi
leaq 0xa356(%rip), %rsi      # 0x14067
callq 0x33a0
testq %rax, %rax
je 0xa097
movq %r14, %rdi
leaq 0x260(%rsp), %rsi
movq %rax, %r14
callq 0x32e0
movq 0x290(%rsp), %rdx
shrq $0x2, %rdx
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rcx
callq 0x30c0
movq %r14, %rdi
callq 0x3100
leaq 0x680(%rsp), %r14
movq %r14, %rdi
leaq 0xa32b(%rip), %rsi      # 0x14091
movq 0x100(%rsp), %rbx
movq %rbx, %rdx
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x3430
movq %r14, %rdi
leaq 0xa2e1(%rip), %rsi      # 0x14067
callq 0x33a0
testq %rax, %rax
je 0xa0af
movq %r14, %rdi
leaq 0x2f0(%rsp), %rsi
movq %rax, 0x20(%rsp)
callq 0x32e0
movq 0x320(%rsp), %r14
movq %r14, %rdi
callq 0x3340
shrq $0x2, %r14
movq %rax, 0x90(%rsp)
movq %rax, %rdi
pushq $0x4
popq %rsi
movq %r14, %rdx
movq 0x20(%rsp), %r14
movq %r14, %rcx
callq 0x30c0
movq %r14, %rdi
callq 0x3100
leaq 0x580(%rsp), %r14
movq %r14, %rdi
leaq 0xa289(%rip), %rsi      # 0x1407e
movq %rbx, %rdx
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x3430
movq %r14, %rdi
leaq 0xa25a(%rip), %rsi      # 0x14067
callq 0x33a0
testq %rax, %rax
je 0xa0c7
movq %rax, %rbx
movq 0x48(%rsp), %rdi
pushq $0x8
popq %rsi
movq 0x38(%rsp), %rdx
movq %rax, %rcx
callq 0x30c0
movq %rbx, %rdi
callq 0x3100
xorl %ecx, %ecx
cmpq 0x50(%rsp), %rcx
je 0x9f34
movq 0x110(%rsp), %rax
movq %rcx, 0x118(%rsp)
addq %rcx, %rax
movq 0x98(%rsp), %rcx
cmpl $0x0, (%rcx,%rax,4)
je 0x9f24
movq %rax, %rdx
imulq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq 0x8(%rcx,%rax,8), %rax
subq %rsi, %rax
movq %rax, 0x20(%rsp)
movq 0x90(%rsp), %rax
leaq (%rax,%rsi,4), %rax
movq %rax, 0x120(%rsp)
movq 0x88(%rsp), %rax
leaq (%rax,%rdx,4), %rsi
xorl %edi, %edi
cmpq 0x20(%rsp), %rdi
je 0x9f24
movq 0x120(%rsp), %rax
movl (%rax,%rdi,4), %r8d
movl %r8d, %r9d
imull 0x5c(%rsp), %r9d
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpq %r12, %r10
je 0x9f1f
leal (%r9,%r10), %eax
movl (%r13,%rax,4), %ebx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
leal (%r11,%rbx), %eax
movl %r10d, %edx
shll $0x10, %edx
subl $0x1, %ebx
jb 0x9f17
movq (%r15,%r8,8), %rcx
movl %r11d, %r14d
leaq (,%rcx,4), %rcx
addq %rbp, %rcx
movl (%rcx,%r14,4), %ecx
addl %edx, %ecx
incl (%rsi,%rcx,4)
incl %r11d
jmp 0x9ef2
incq %r10
movl %eax, %r11d
jmp 0x9ed0
incq %rdi
jmp 0x9eae
movq 0x118(%rsp), %rcx
incq %rcx
jmp 0x9e3d
movq 0x90(%rsp), %rdi
callq 0x3040
movl $0x80000000, %esi       # imm = 0x80000000
movq %r15, %rdi
callq 0x3360
movq %r13, %rdi
movq 0xf8(%rsp), %rsi
callq 0x3360
movl 0xc(%rsp), %ecx
incl %ecx
jmp 0x9c5d
movq 0xd0(%rsp), %rax
movq 0xf0(%rsp), %rbx
imulq %rbx, %rax
movq 0x88(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
movq %rdi, 0x20(%rsp)
movq 0xe8(%rsp), %r14
movq %r14, %rsi
pushq $0x4
popq %rdx
callq 0x3120
testl %eax, %eax
js 0xa0e4
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3360
movq 0xc8(%rsp), %rcx
movq 0x68(%rsp), %r8
incq %rbx
jmp 0x9bb8
movq 0x48(%rsp), %rdi
callq 0x3040
movl 0x4(%rsp), %esi
movl %esi, 0x53511(%rip)     # 0x5d4f0
movl 0x14(%rsp), %edx
movl %edx, 0x5350b(%rip)     # 0x5d4f4
movl 0x130(%rsp), %eax
movl 0x134(%rsp), %ecx
movl %eax, 0x534fb(%rip)     # 0x5d4f8
movl %ecx, 0x534f9(%rip)     # 0x5d4fc
subq $0x8, %rsp
movq 0xb0(%rsp), %rdi
movq 0xc0(%rsp), %r14
movq %r14, %rcx
movq 0xa0(%rsp), %rbx
movq %rbx, %r8
movq 0x80(%rsp), %r9
pushq 0x68(%rsp)
movq 0xb0(%rsp), %r15
pushq %r15
movq 0xc8(%rsp), %r12
pushq %r12
callq 0xa1f5
addq $0x20, %rsp
movq %r14, %rdi
callq 0x3040
movq %rbx, %rdi
callq 0x3040
movq %r12, %rdi
callq 0x3040
movq %r15, %rdi
addq $0x788, %rsp            # imm = 0x788
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3040
callq 0x3060
movl (%rax), %edi
leaq 0xaf64(%rip), %rsi      # 0x14ff1
leaq 0x380(%rsp), %rdx
jmp 0xa0dd
callq 0x3060
movl (%rax), %edi
leaq 0xaf4c(%rip), %rsi      # 0x14ff1
leaq 0x480(%rsp), %rdx
jmp 0xa0dd
callq 0x3060
movl (%rax), %edi
leaq 0xaf34(%rip), %rsi      # 0x14ff1
leaq 0x680(%rsp), %rdx
jmp 0xa0dd
callq 0x3060
movl (%rax), %edi
leaq 0xaf1c(%rip), %rsi      # 0x14ff1
leaq 0x580(%rsp), %rdx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0xaffa(%rip), %rsi      # 0x150ec
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl (%rax), %edi
leaq 0xaeea(%rip), %rsi      # 0x14ff1
jmp 0xa16d
callq 0x3060
movl (%rax), %edi
leaq 0xacb1(%rip), %rsi      # 0x14dc8
jmp 0xa0f2
callq 0x3060
movl (%rax), %edi
leaq 0xace7(%rip), %rsi      # 0x14e0e
jmp 0xa0f2
callq 0x3060
movl (%rax), %edi
leaq 0xad1c(%rip), %rsi      # 0x14e53
movl 0x8(%rsp), %edx
movl %ebx, %ecx
jmp 0xa151
callq 0x3060
movl (%rax), %edi
leaq 0xad4d(%rip), %rsi      # 0x14e9a
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x3330
callq 0x3060
movl $0x11, (%rax)
leaq 0xae87(%rip), %rsi      # 0x14ff1
pushq $0x11
popq %rdi
leaq 0x160(%rsp), %rdx
jmp 0xa0dd
callq 0x3060
movl (%rax), %edi
leaq 0xae7f(%rip), %rsi      # 0x15007
jmp 0xa0f2
callq 0x3060
movl (%rax), %edi
leaq 0xadae(%rip), %rsi      # 0x14f49
jmp 0xa0f2
callq 0x3060
movl (%rax), %edi
leaq 0xae76(%rip), %rsi      # 0x15024
movl $0x10000000, %edx       # imm = 0x10000000
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3330
callq 0x3060
cvtsi2ssl 0x4(%rsp), %xmm0
mulss 0xa578(%rip), %xmm0     # 0x14748
movl (%rax), %edi
cvtsi2ss %r15d, %xmm1
mulss %xmm0, %xmm1
mulss 0xa569(%rip), %xmm1     # 0x1474c
cvtss2sd %xmm1, %xmm0
leaq 0xae60(%rip), %rsi      # 0x1504e
movb $0x1, %al
callq 0x3330