// File: /workspace/github_cpp_makefile_star2_O2/thunlp[P]KB2E/cluster/apcluster.cpp
// Function: main
int main(int argc, char** argv)
{
  int flag, dn, it, conv, decit, maxits, convits;
  unsigned long i1, i2, j, *i, *k, m, n, l, **dec, *decsum, *idx, K;
  double tmp, *s, *a, *r, *p, *mx1, *mx2, *srp, netsim, dpsim, expref, lam;
  FILE *f;

  /* Usage */
  if((argc!=4)&&(argc!=7)){
    printf("\nUsage:\n\n");
    printf("apcluster <Similarity file> <Preference file> <Output: Index file>\n");
    printf("          [ <maxits> <convits> <dampfact> ]\n\n");
    printf("\nAPCLUSTER uses the affinity propagation algorithm by\n");
    printf("BJ Frey and D Dueck (Science 315, 972-976, Feb 16, 2007)\n");
    printf("to identify data clusters, using a set of real-valued\n");
    printf("pair-wise data point similarities as input. Each cluster is\n");
    printf("represented by a data point called a cluster center, and the\n");
    printf("method searches for clusters so as to maximize a fitness\n");
    printf("function called net similarity. The method is iterative and\n");
    printf("stops after maxits iterations (default: 500) or when the cluster\n");
    printf("centers stay constant for convits iterations (default: 50).\n\n");
    printf("For N data points, there may be as many as N^2-N pair-wise\n");
    printf("similarities (note that the similarity of data point i to k\n");
    printf("need not be equal to the similarity of data point k to i).\n");
    printf("APCLUSTER can work with this full set of similarities or\n");
    printf("a smaller subset (which is helpful when N is large). The\n");
    printf("similarities should be in the input similarity file, where\n");
    printf("each line should be of the form <i k s> where i and k are\n");
    printf("data point indices and s is a real number corresponding\n");
    printf("to the similarity of data point i to data point k.\n\n");
    printf("APCLUSTER automatically determines the number of clusters,\n");
    printf("based on numbers called preferences -- there is one such\n");
    printf("number for each data point and data points with large\n");
    printf("preferences are more likely to be chosen as centers. Values\n");
    printf("of the prefences should be in the input preference file and\n");
    printf("the jth entry in this file should be the preference of the\n");
    printf("jth data point. How should you choose the preferences? A good\n");
    printf("choice is to set all preference values to the median of the\n");
    printf("similarity values. Then, the number of identified clusters can\n");
    printf("be increased or decreased  by changing this value accordingly.\n\n");
    printf("The fitness function (net similarity) used to search for\n");
    printf("solutions equals the sum of the preferences of the the data\n");
    printf("centers plus the sum of the similarities of the other data\n");
    printf("points to their cluster centers.\n\n");
    printf("The identified cluster centers and the assignments of other\n");
    printf("data points to these centers are stored in the output index\n");
    printf("file. The jth entry in this file is the index of the data\n");
    printf("point that is the cluster center for data point j. If the\n");
    printf("jth entry equals j, then data point j is itself a cluster\n");
    printf("center. The sum of the similarities of the data points to\n");
    printf("their cluster centers, the  sum of the preferences of the\n");
    printf("identified cluster centers, and the fitness or net similarity\n");
    printf("(sum of the data point similarities and preferences) are\n");
    printf("printed to the screen.\n\n");
    printf("See http://www.psi.toronto.edu/affinitypropagation for test\n");
    printf("files and MATLAB software.\n\n");
    printf("Copyright 2007, BJ Frey and D Dueck. This software may be\n");
    printf("freely distributed and used for non-commercial purposes.\n\n");
    return 0 ;
  }

  if (MINDOUBLE==0.0) {
	  printf("There are numerical precision problems on this architecture.  Please recompile after adjusting MIN_DOUBLE and MAX_DOUBLE\n\n");
  }

  /* Parse command line */
  if(argc==4){ lam=0.9; maxits=500; convits=50;
  } else {
    flag=sscanf(argv[4],"%d",&maxits);
    if(flag==1){
      flag=sscanf(argv[5],"%d",&convits);
      if(flag==1){
	flag=sscanf(argv[6],"%lf",&lam);
	if(flag==0){
	  printf("\n\n*** Error in <damping factor> argument\n\n");
	  return 0;
	}
      } else {
	printf("\n\n*** Error in <convergence iterations> argument\n\n");
	return 0;
      }
    } else {
      printf("\n\n*** Error in <maximum iterations> argument\n\n");
      return 0;
    }
  }
  if(maxits<1){
    printf("\n\n*** Error: maximum number of iterations must be at least 1\n\n");
    return 0 ;
  }
  if(convits<1){
    printf("\n\n*** Error: number of iterations to test convergence must be at least 1\n\n");
    return 0 ;
  }
  if((lam<0.5)||(lam>=1)){
    printf("\n\n*** Error: damping factor must be between 0.5 and 1\n\n");
    return 0 ;
  }
  printf("\nmaxits=%d, convits=%d, dampfact=%lf\n",maxits,convits,lam);


  /* Find out how many data points and similarities there are */
  f=fopen(argv[1],"r");
  if(f==NULL){
    printf("\n\n*** Error opening similarities file\n\n");
    return 0;
  }
  m=0; n=0;
  flag=fscanf(f,"%lu %lu %lf",&i1,&i2,&tmp);
  while(flag!=EOF){
    if(i1>n) n=i1;
    if(i2>n) n=i2;
    m=m+1;
    flag=fscanf(f,"%lu %lu %lf",&i1,&i2,&tmp);
  }
  fclose(f);

  /* Allocate memory for similarities, preferences, messages, etc */
  i=(unsigned long *)calloc(m+n,sizeof(unsigned long));
  k=(unsigned long *)calloc(m+n,sizeof(unsigned long));
  s=(double *)calloc(m+n,sizeof(double));
  a=(double *)calloc(m+n,sizeof(double));
  r=(double *)calloc(m+n,sizeof(double));
  mx1=(double *)calloc(n,sizeof(double));
  mx2=(double *)calloc(n,sizeof(double));
  srp=(double *)calloc(n,sizeof(double));
  dec=(unsigned long **)calloc(convits,sizeof(unsigned long *));
  for(j=0;j<convits;j++)
    dec[j]=(unsigned long *)calloc(n,sizeof(unsigned long));
  decsum=(unsigned long *)calloc(n,sizeof(unsigned long));
  idx=(unsigned long *)calloc(n,sizeof(unsigned long));

  /* Read similarities and preferences */
  f=fopen(argv[1],"r");
  for(j=0;j<m;j++){
    fscanf(f,"%lu %lu %lf",&(i[j]),&(k[j]),&(s[j]));
    i[j]--; k[j]--;
  }
  fclose(f);
  f=fopen(argv[2],"r");
  if(f==NULL){
    printf("\n\n*** Error opening preferences file\n\n");
    return 0;
  }
  for(j=0;j<n;j++){
    i[m+j]=j; k[m+j]=j;
    flag=fscanf(f,"%lf",&(s[m+j]));
  }
  fclose(f);
  if(flag==EOF){
    printf("\n*** Error: Number of entries in the preferences file is\n");
    printf("    less than number of data points\n\n");
    return 0;
  }
  m=m+n;

  /* Include a tiny amount of noise in similarities to avoid degeneracies */
  for(j=0;j<m;j++) s[j]=s[j]+(1e-16*s[j]+MINDOUBLE*100)*(rand()/((double)RAND_MAX+1));

  /* Initialize availabilities to 0 and run affinity propagation */
  for(j=0;j<m;j++) a[j]=0.0;
  for(j=0;j<convits;j++) for(i1=0;i1<n;i1++) dec[j][i1]=0;
  for(j=0;j<n;j++) decsum[j]=0;
  dn=0; it=0; decit=convits;
  while(dn==0){
    it++; /* Increase iteration index */

    /* Compute responsibilities */
    for(j=0;j<n;j++){ mx1[j]=-MAXDOUBLE; mx2[j]=-MAXDOUBLE; }
    for(j=0;j<m;j++){
      tmp=a[j]+s[j];
      if(tmp>mx1[i[j]]){
	mx2[i[j]]=mx1[i[j]];
	mx1[i[j]]=tmp;
      } else if(tmp>mx2[i[j]]) mx2[i[j]]=tmp;
    }
    for(j=0;j<m;j++){
      tmp=a[j]+s[j];
      if(tmp==mx1[i[j]]) r[j]=lam*r[j]+(1-lam)*(s[j]-mx2[i[j]]);
      else r[j]=lam*r[j]+(1-lam)*(s[j]-mx1[i[j]]);
    }

    /* Compute availabilities */
    for(j=0;j<n;j++) srp[j]=0.0;
    for(j=0;j<m-n;j++) if(r[j]>0.0) srp[k[j]]=srp[k[j]]+r[j];
    for(j=m-n;j<m;j++) srp[k[j]]=srp[k[j]]+r[j];
    for(j=0;j<m-n;j++){
      if(r[j]>0.0) tmp=srp[k[j]]-r[j]; else tmp=srp[k[j]];
      if(tmp<0.0) a[j]=lam*a[j]+(1-lam)*tmp; else a[j]=lam*a[j];
    }
    for(j=m-n;j<m;j++) a[j]=lam*a[j]+(1-lam)*(srp[k[j]]-r[j]);

    /* Identify exemplars and check to see if finished */
    decit++; if(decit>=convits) decit=0;
    for(j=0;j<n;j++) decsum[j]=decsum[j]-dec[decit][j];
    for(j=0;j<n;j++)
      if(a[m-n+j]+r[m-n+j]>0.0) dec[decit][j]=1; else dec[decit][j]=0;
    K=0; for(j=0;j<n;j++) K=K+dec[decit][j];
    for(j=0;j<n;j++) decsum[j]=decsum[j]+dec[decit][j];
    if((it>=convits)||(it>=maxits)){
      /* Check convergence */
      conv=1; for(j=0;j<n;j++) if((decsum[j]!=0)&&(decsum[j]!=convits)) conv=0;
      /* Check to see if done */
      if(((conv==1)&&(K>0))||(it==maxits)) dn=1;
    }
  }
  /* If clusters were identified, find the assignments and output them */
  if(K>0){
    for(j=0;j<m;j++)
      if(dec[decit][k[j]]==1) a[j]=0.0; else a[j]=-MAXDOUBLE;
    for(j=0;j<n;j++) mx1[j]=-MAXDOUBLE;
    for(j=0;j<m;j++){
      tmp=a[j]+s[j];
      if(tmp>mx1[i[j]]){
	mx1[i[j]]=tmp;
	idx[i[j]]=k[j];
      }
    }
    for(j=0;j<n;j++) if(dec[decit][j]) idx[j]=j;
    for(j=0;j<n;j++) srp[j]=0.0;
    for(j=0;j<m;j++) if(idx[i[j]]==idx[k[j]]) srp[k[j]]=srp[k[j]]+s[j];
    for(j=0;j<n;j++) mx1[j]=-MAXDOUBLE;
    for(j=0;j<n;j++) if(srp[j]>mx1[idx[j]]) mx1[idx[j]]=srp[j];
    for(j=0;j<n;j++)
      if(srp[j]==mx1[idx[j]]) dec[decit][j]=1; else dec[decit][j]=0;
    for(j=0;j<m;j++)
      if(dec[decit][k[j]]==1) a[j]=0.0; else a[j]=-MAXDOUBLE;
    for(j=0;j<n;j++) mx1[j]=-MAXDOUBLE;
    for(j=0;j<m;j++){
      tmp=a[j]+s[j];
      if(tmp>mx1[i[j]]){
	mx1[i[j]]=tmp;
	idx[i[j]]=k[j];
      }
    }
    for(j=0;j<n;j++) if(dec[decit][j]) idx[j]=j;
    f=fopen(argv[3],"w");
    for(j=0;j<n;j++) fprintf(f,"%lu\n",idx[j]+1);
    fclose(f);
    dpsim=0.0; expref=0.0;
    for(j=0;j<m;j++){
      if(idx[i[j]]==k[j]){
	if(i[j]==k[j]) expref=expref+s[j];
	else dpsim=dpsim+s[j];
      }
    }
    netsim=dpsim+expref;
    printf("\nNumber of identified clusters: %d\n",K);
    printf("Fitness (net similarity): %f\n",netsim);
    printf("  Similarities of data points to exemplars: %f\n",dpsim);
    printf("  Preferences of selected exemplars: %f\n",expref);
    printf("Number of iterations: %d\n\n",it);
  } else printf("\nDid not identify any clusters\n");
  if(conv==0){
    printf("\n*** Warning: Algorithm did not converge. Consider increasing\n");
    printf("    maxits to enable more iterations. It may also be necessary\n");
    printf("    to increase damping (increase dampfact).\n\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
cmpl $0x4, %edi
je 0x1267
cmpl $0x7, %edi
jne 0x135f
movq 0x20(%r14), %rdi
leaq 0x1e53(%rip), %rsi      # 0x3040
leaq 0x4c(%rsp), %rdx
xorl %eax, %eax
callq 0x1060
cmpl $0x1, %eax
jne 0x15b7
movq 0x28(%r14), %rdi
leaq 0x1e33(%rip), %rsi      # 0x3040
leaq 0x34(%rsp), %rdx
xorl %eax, %eax
callq 0x1060
cmpl $0x1, %eax
jne 0x17c7
movq 0x30(%r14), %rdi
leaq 0x1e44(%rip), %rsi      # 0x3071
leaq 0x90(%rsp), %rdx
xorl %eax, %eax
callq 0x1060
testl %eax, %eax
je 0x1cc8
movl 0x4c(%rsp), %esi
testl %esi, %esi
jle 0x2002
movl 0x34(%rsp), %edx
testl %edx, %edx
jle 0x203f
movsd 0x90(%rsp), %xmm0
jmp 0x1299
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x90(%rsp)
movl $0x1f4, 0x4c(%rsp)      # imm = 0x1F4
movl $0x32, 0x34(%rsp)
pushq $0x32
popq %rdx
movl $0x1f4, %esi            # imm = 0x1F4
movsd 0x1d6f(%rip), %xmm0     # 0x3008
movsd 0x1d6f(%rip), %xmm1     # 0x3010
ucomisd %xmm0, %xmm1
ja 0x15ab
ucomisd 0x1d65(%rip), %xmm0     # 0x3018
jae 0x15ab
leaq 0x1d83(%rip), %rdi      # 0x3043
movb $0x1, %al
callq 0x1030
movq 0x8(%r14), %rdi
leaq 0x290f(%rip), %rsi      # 0x3be1
callq 0x1080
testq %rax, %rax
je 0x1846
movq %rax, %rbx
movq %r14, 0x80(%rsp)
leaq 0x98(%rsp), %r14
leaq 0xc0(%rsp), %r12
leaq 0x50(%rsp), %rbp
xorl %r15d, %r15d
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movq %rbx, %rdi
leaq 0x1d50(%rip), %rsi      # 0x3069
movq %r14, %rdx
movq %r12, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x10b0
cmpl $-0x1, %eax
je 0x15c3
movq 0x98(%rsp), %rax
cmpq %r13, %rax
cmovaq %rax, %r13
movq 0xc0(%rsp), %rax
cmpq %r13, %rax
ja 0x1351
movq %r13, %rax
addq $0x8, 0x40(%rsp)
decq %r15
movq %rax, %r13
jmp 0x130f
leaq 0x208a(%rip), %rdi      # 0x33f0
callq 0x10a0
leaq 0x2087(%rip), %rdi      # 0x33f9
callq 0x10a0
leaq 0x20be(%rip), %rdi      # 0x343c
callq 0x10a0
leaq 0x20df(%rip), %rdi      # 0x3469
callq 0x10a0
leaq 0x2109(%rip), %rdi      # 0x349f
callq 0x10a0
leaq 0x2136(%rip), %rdi      # 0x34d8
callq 0x10a0
leaq 0x2160(%rip), %rdi      # 0x350e
callq 0x10a0
leaq 0x2190(%rip), %rdi      # 0x354a
callq 0x10a0
leaq 0x21c1(%rip), %rdi      # 0x3587
callq 0x10a0
leaq 0x21ee(%rip), %rdi      # 0x35c0
callq 0x10a0
leaq 0x221e(%rip), %rdi      # 0x35fc
callq 0x10a0
leaq 0x2253(%rip), %rdi      # 0x363d
callq 0x10a0
leaq 0x2284(%rip), %rdi      # 0x367a
callq 0x10a0
leaq 0x22b3(%rip), %rdi      # 0x36b5
callq 0x10a0
leaq 0x22e3(%rip), %rdi      # 0x36f1
callq 0x10a0
leaq 0x2312(%rip), %rdi      # 0x372c
callq 0x10a0
leaq 0x233f(%rip), %rdi      # 0x3765
callq 0x10a0
leaq 0x236c(%rip), %rdi      # 0x379e
callq 0x10a0
leaq 0x239b(%rip), %rdi      # 0x37d9
callq 0x10a0
leaq 0x23c9(%rip), %rdi      # 0x3813
callq 0x10a0
leaq 0x23f5(%rip), %rdi      # 0x384b
callq 0x10a0
leaq 0x241d(%rip), %rdi      # 0x387f
callq 0x10a0
leaq 0x244c(%rip), %rdi      # 0x38ba
callq 0x10a0
leaq 0x2479(%rip), %rdi      # 0x38f3
callq 0x10a0
leaq 0x24a3(%rip), %rdi      # 0x3929
callq 0x10a0
leaq 0x24d3(%rip), %rdi      # 0x3965
callq 0x10a0
leaq 0x2503(%rip), %rdi      # 0x39a1
callq 0x10a0
leaq 0x2532(%rip), %rdi      # 0x39dc
callq 0x10a0
leaq 0x2564(%rip), %rdi      # 0x3a1a
callq 0x10a0
leaq 0x2594(%rip), %rdi      # 0x3a56
callq 0x10a0
leaq 0x25c7(%rip), %rdi      # 0x3a95
callq 0x10a0
leaq 0x25fb(%rip), %rdi      # 0x3ad5
callq 0x10a0
leaq 0x2628(%rip), %rdi      # 0x3b0e
callq 0x10a0
leaq 0x2658(%rip), %rdi      # 0x3b4a
callq 0x10a0
leaq 0x2687(%rip), %rdi      # 0x3b85
callq 0x10a0
leaq 0x269d(%rip), %rdi      # 0x3ba7
callq 0x10a0
leaq 0x26cd(%rip), %rdi      # 0x3be3
callq 0x10a0
leaq 0x26fd(%rip), %rdi      # 0x3c1f
callq 0x10a0
leaq 0x272b(%rip), %rdi      # 0x3c59
callq 0x10a0
leaq 0x2759(%rip), %rdi      # 0x3c93
callq 0x10a0
leaq 0x2787(%rip), %rdi      # 0x3ccd
callq 0x10a0
leaq 0x27b5(%rip), %rdi      # 0x3d07
callq 0x10a0
leaq 0x27e3(%rip), %rdi      # 0x3d41
callq 0x10a0
leaq 0x2815(%rip), %rdi      # 0x3d7f
callq 0x10a0
leaq 0x2842(%rip), %rdi      # 0x3db8
callq 0x10a0
leaq 0x284e(%rip), %rdi      # 0x3dd0
callq 0x10a0
leaq 0x287e(%rip), %rdi      # 0x3e0c
callq 0x10a0
leaq 0x288e(%rip), %rdi      # 0x3e28
callq 0x10a0
leaq 0x28bc(%rip), %rdi      # 0x3e62
jmp 0x2046
leaq 0x1d7f(%rip), %rdi      # 0x3331
jmp 0x2046
leaq 0x1b74(%rip), %rdi      # 0x3132
jmp 0x2046
movq %rbx, %rdi
callq 0x1070
movq %r13, %r14
movq %r15, 0x58(%rsp)
subq %r15, %r14
pushq $0x8
popq %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, 0x18(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, 0x20(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, %rbx
movq %r14, 0x28(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, %r12
movq %r13, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, 0x68(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, %r14
movslq 0x34(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1050
movq %rax, 0x70(%rsp)
negq 0x58(%rsp)
xorl %r15d, %r15d
movq %r13, %rdi
pushq $0x8
popq %rsi
callq 0x1050
movq %rax, %rcx
cmpq %r15, %rbp
je 0x1696
movq 0x70(%rsp), %rax
movq %rcx, (%rax,%r15,8)
incq %r15
jmp 0x1675
movq %r14, 0xa8(%rsp)
movq %rbx, 0xb0(%rsp)
movq %rcx, 0x78(%rsp)
pushq $0x8
popq %rsi
movq %r13, %rdi
callq 0x1050
movq %rax, 0x88(%rsp)
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x2510(%rip), %rsi      # 0x3be1
callq 0x1080
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rbp
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %r14
movq 0x58(%rsp), %r15
subq $0x1, %r15
jb 0x1725
movq 0x8(%rsp), %rdi
leaq 0x1968(%rip), %rsi      # 0x3069
movq %r14, %rdx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x10b0
decq (%r14)
decq (%rbx)
addq $0x8, %r14
addq $0x8, %rbx
addq $0x8, %rbp
jmp 0x16ef
movq 0x8(%rsp), %rdi
callq 0x1070
movq 0x80(%rsp), %rax
movq 0x10(%rax), %rdi
leaq 0x249f(%rip), %rsi      # 0x3be1
callq 0x1080
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x1cbc
movq 0x10(%rsp), %r15
movq 0x40(%rsp), %rax
addq %rax, %r15
movq 0x20(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x38(%rsp)
movq 0x18(%rsp), %rcx
addq %rax, %rcx
movq %rcx, 0x60(%rsp)
pushq $-0x1
popq %rax
xorl %ebp, %ebp
movq 0xb0(%rsp), %rbx
movq 0xa8(%rsp), %r14
cmpq %rbp, %r13
je 0x17d3
movq 0x60(%rsp), %rax
movq %rbp, (%rax,%rbp,8)
movq 0x38(%rsp), %rax
movq %rbp, (%rax,%rbp,8)
movq 0x8(%rsp), %rdi
leaq 0x18bd(%rip), %rsi      # 0x3071
movq %r15, %rdx
xorl %eax, %eax
callq 0x10b0
incq %rbp
addq $0x8, %r15
jmp 0x1791
leaq 0x1992(%rip), %rdi      # 0x3160
jmp 0x2046
movq 0x8(%rsp), %rdi
movl %eax, %ebp
callq 0x1070
cmpl $-0x1, %ebp
je 0x1fed
xorl %r15d, %r15d
movq 0x10(%rsp), %rbp
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1852
movsd (%rbp,%r15,8), %xmm0
movsd %xmm0, 0x8(%rsp)
mulsd 0x1811(%rip), %xmm0     # 0x3020
addsd 0x1811(%rip), %xmm0     # 0x3028
movsd %xmm0, 0x38(%rsp)
callq 0x1040
cvtsi2sd %eax, %xmm0
mulsd 0x1802(%rip), %xmm0     # 0x3030
mulsd 0x38(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rbp,%r15,8)
incq %r15
jmp 0x17f0
leaq 0x1abd(%rip), %rdi      # 0x330a
jmp 0x2046
xorl %eax, %eax
movq 0x70(%rsp), %rbp
movq 0x58(%rsp), %rdx
movq 0x68(%rsp), %rcx
cmpq %rax, %rdi
je 0x1872
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0x1863
movl 0x34(%rsp), %eax
movl %eax, 0x60(%rsp)
movslq %eax, %r8
xorl %eax, %eax
cmpq %r8, %rax
je 0x18b4
xorl %ecx, %ecx
movq %rcx, 0x98(%rsp)
cmpq %r13, %rcx
jae 0x18aa
movq (%rbp,%rax,8), %rsi
andq $0x0, (%rsi,%rcx,8)
movq 0x98(%rsp), %rcx
incq %rcx
jmp 0x1886
incq %rax
movq 0x68(%rsp), %rcx
jmp 0x187f
xorl %eax, %eax
movq 0x78(%rsp), %rsi
cmpq %rax, %r13
je 0x18ca
andq $0x0, (%rsi,%rax,8)
incq %rax
jmp 0x18bb
movq %r8, 0xb8(%rsp)
movl 0x4c(%rsp), %eax
movl 0x60(%rsp), %esi
cmpl %eax, %esi
movl %eax, 0xa0(%rsp)
cmovll %esi, %eax
movl %eax, 0xa4(%rsp)
cmpq %rdi, %rdx
movq %rdi, %r8
cmovaq %rdx, %r8
movq %r12, %r9
movq 0x40(%rsp), %rax
addq %rax, %r9
movq %rbx, %r10
addq %rax, %r10
movsd 0x1708(%rip), %xmm0     # 0x3018
xorpd %xmm1, %xmm1
movabsq $-0x10006ca6337efc, %rax # imm = 0xFFEFFF9359CC8104
movl %esi, 0x8(%rsp)
movl $0x0, 0x40(%rsp)
xorl %esi, %esi
testl %esi, %esi
sete %r11b
testb $0x1, %r11b
je 0x1c6b
xorl %esi, %esi
movq (%rsp), %r11
cmpq %rsi, %r13
je 0x1954
movq %rax, (%r11,%rsi,8)
movq %rax, (%rcx,%rsi,8)
incq %rsi
jmp 0x1942
xorl %r11d, %r11d
cmpq %r11, %rdi
je 0x19bb
movsd (%rbx,%r11,8), %xmm2
movq 0x10(%rsp), %rsi
addsd (%rsi,%r11,8), %xmm2
movsd %xmm2, 0x50(%rsp)
movq 0x18(%rsp), %rsi
movq (%rsi,%r11,8), %r15
movq (%rsp), %rbp
movsd (%rbp,%r15,8), %xmm3
ucomisd %xmm3, %xmm2
leaq (%rcx,%r15,8), %rsi
jbe 0x19a7
movsd %xmm3, (%rsi)
leaq (,%r15,8), %rsi
addq %rbp, %rsi
movq 0x70(%rsp), %rbp
jmp 0x19b2
ucomisd (%rsi), %xmm2
movq 0x70(%rsp), %rbp
jbe 0x19b6
movsd %xmm2, (%rsi)
incq %r11
jmp 0x1957
movsd 0x90(%rsp), %xmm2
movapd %xmm0, %xmm3
subsd %xmm2, %xmm3
xorl %r11d, %r11d
movq (%rsp), %r15
cmpq %r11, %rdi
je 0x1a32
movq 0x10(%rsp), %rsi
movsd (%rsi,%r11,8), %xmm4
movsd (%rbx,%r11,8), %xmm6
addsd %xmm4, %xmm6
movsd %xmm6, 0x50(%rsp)
movq 0x18(%rsp), %rsi
movq (%rsi,%r11,8), %rsi
movsd (%r15,%rsi,8), %xmm5
ucomisd %xmm5, %xmm6
jne 0x1a11
jp 0x1a11
subsd (%rcx,%rsi,8), %xmm4
jmp 0x1a15
subsd %xmm5, %xmm4
mulsd %xmm3, %xmm4
movsd (%r12,%r11,8), %xmm5
mulsd %xmm2, %xmm5
addsd %xmm4, %xmm5
movsd %xmm5, (%r12,%r11,8)
incq %r11
jmp 0x19d3
xorl %esi, %esi
movq 0x20(%rsp), %rdi
movq 0x58(%rsp), %rcx
cmpq %rsi, %r13
je 0x1a4d
andq $0x0, (%r14,%rsi,8)
incq %rsi
jmp 0x1a3e
xorl %r11d, %r11d
cmpq %r11, %rcx
je 0x1a76
movsd (%r12,%r11,8), %xmm4
ucomisd %xmm1, %xmm4
jbe 0x1a71
movq (%rdi,%r11,8), %rsi
addsd (%r14,%rsi,8), %xmm4
movsd %xmm4, (%r14,%rsi,8)
incq %r11
jmp 0x1a50
movq %rcx, %r11
cmpq %r11, %r8
je 0x1a99
movq (%rdi,%r11,8), %rsi
movsd (%r14,%rsi,8), %xmm4
addsd (%r12,%r11,8), %xmm4
movsd %xmm4, (%r14,%rsi,8)
incq %r11
jmp 0x1a79
xorl %r11d, %r11d
cmpq %r11, %rcx
je 0x1b06
movsd (%r12,%r11,8), %xmm4
movq (%rdi,%r11,8), %rsi
movsd (%r14,%rsi,8), %xmm5
xorpd %xmm6, %xmm6
cmpltsd %xmm4, %xmm6
movapd %xmm6, %xmm7
andnpd %xmm5, %xmm7
subsd %xmm4, %xmm5
andpd %xmm5, %xmm6
orpd %xmm7, %xmm6
movlpd %xmm6, 0x50(%rsp)
movapd %xmm6, %xmm4
mulsd %xmm3, %xmm4
movsd (%rbx,%r11,8), %xmm5
mulsd %xmm2, %xmm5
addsd %xmm5, %xmm4
cmpltsd %xmm1, %xmm6
andpd %xmm6, %xmm4
andnpd %xmm5, %xmm6
orpd %xmm4, %xmm6
movlpd %xmm6, (%rbx,%r11,8)
incq %r11
jmp 0x1a9c
movq %rcx, %r11
movq 0x68(%rsp), %rcx
cmpq %r11, %r8
je 0x1b40
movq (%rdi,%r11,8), %rsi
movsd (%r14,%rsi,8), %xmm4
subsd (%r12,%r11,8), %xmm4
mulsd %xmm3, %xmm4
movsd (%rbx,%r11,8), %xmm5
mulsd %xmm2, %xmm5
addsd %xmm4, %xmm5
movsd %xmm5, (%rbx,%r11,8)
incq %r11
jmp 0x1b0e
movl 0x8(%rsp), %esi
incl %esi
cmpl 0x60(%rsp), %esi
movl $0x0, %edx
cmovgel %edx, %esi
movl %esi, 0x8(%rsp)
movslq %esi, %r11
xorl %esi, %esi
movq 0x78(%rsp), %rdi
cmpq %rsi, %r13
je 0x1b77
movq (%rbp,%r11,8), %r15
movq (%r15,%rsi,8), %r15
subq %r15, (%rdi,%rsi,8)
incq %rsi
jmp 0x1b60
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x1ba3
movsd (%r10,%r15,8), %xmm2
addsd (%r9,%r15,8), %xmm2
xorl %esi, %esi
ucomisd %xmm1, %xmm2
seta %sil
movq (%rbp,%r11,8), %rdi
movq %rsi, (%rdi,%r15,8)
incq %r15
jmp 0x1b7a
xorl %r15d, %r15d
xorl %esi, %esi
cmpq %rsi, %r13
je 0x1bbb
movq (%rbp,%r11,8), %rdi
addq (%rdi,%rsi,8), %r15
incq %rsi
jmp 0x1ba8
xorl %esi, %esi
cmpq %rsi, %r13
je 0x1bd9
movq (%rbp,%r11,8), %rdi
movq (%rdi,%rsi,8), %rdi
movq 0x78(%rsp), %rdx
addq %rdi, (%rdx,%rsi,8)
incq %rsi
jmp 0x1bbd
movl 0x40(%rsp), %edx
incl %edx
movb $0x1, %r11b
movl %edx, 0x40(%rsp)
cmpl 0xa4(%rsp), %edx
movq 0x28(%rsp), %rdi
jl 0x1932
xorl %r11d, %r11d
pushq $0x1
popq %rcx
movl %ecx, 0x38(%rsp)
cmpq %r11, %r13
movq 0x78(%rsp), %rcx
je 0x1c33
movq (%rcx,%r11,8), %rsi
cmpq 0xb8(%rsp), %rsi
movl $0x0, %edi
movl 0x38(%rsp), %edx
cmovel %edx, %edi
testq %rsi, %rsi
cmovnel %edi, %edx
movl %edx, 0x38(%rsp)
incq %r11
jmp 0x1c02
cmpl $0x1, 0x38(%rsp)
sete %sil
testq %r15, %r15
setne %dil
andb %sil, %dil
movl 0x40(%rsp), %ecx
cmpl 0xa0(%rsp), %ecx
sete %sil
orb %dil, %sil
movzbl %sil, %esi
movq 0x28(%rsp), %rdi
movq 0x68(%rsp), %rcx
jmp 0x192c
testq %r15, %r15
je 0x200b
movslq 0x8(%rsp), %rcx
xorl %edx, %edx
movsd 0x13b5(%rip), %xmm0     # 0x3038
movq 0x88(%rsp), %r8
cmpq %rdx, %rdi
je 0x1cd4
movq (%rbp,%rcx,8), %rsi
movq 0x20(%rsp), %rdi
movq (%rdi,%rdx,8), %rdi
cmpq $0x1, (%rsi,%rdi,8)
xorpd %xmm1, %xmm1
je 0x1cad
movapd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rdx,8)
incq %rdx
movq 0x28(%rsp), %rdi
jmp 0x1c8b
leaq 0x1621(%rip), %rdi      # 0x32e4
jmp 0x2046
leaq 0x14c3(%rip), %rdi      # 0x3192
jmp 0x2046
xorl %edx, %edx
movq (%rsp), %rsi
cmpq %rdx, %r13
je 0x1ce8
movq %rax, (%rsi,%rdx,8)
incq %rdx
jmp 0x1cda
xorl %edx, %edx
movq (%rsp), %r9
cmpq %rdx, %rdi
je 0x1d39
movsd (%rbx,%rdx,8), %xmm0
movq 0x10(%rsp), %rsi
addsd (%rsi,%rdx,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x18(%rsp), %rsi
movq (%rsi,%rdx,8), %rsi
ucomisd (%r9,%rsi,8), %xmm0
jbe 0x1d34
movq (%rsp), %rdi
movsd %xmm0, (%rdi,%rsi,8)
movq 0x20(%rsp), %rdi
movq (%rdi,%rdx,8), %rdi
movq %rdi, (%r8,%rsi,8)
movq 0x28(%rsp), %rdi
incq %rdx
jmp 0x1cee
xorl %edx, %edx
cmpq %rdx, %r13
je 0x1d55
movq (%rbp,%rcx,8), %rsi
cmpq $0x0, (%rsi,%rdx,8)
je 0x1d50
movq %rdx, (%r8,%rdx,8)
incq %rdx
jmp 0x1d3b
xorl %edx, %edx
cmpq %rdx, %r13
je 0x1d66
andq $0x0, (%r14,%rdx,8)
incq %rdx
jmp 0x1d57
xorl %edx, %edx
cmpq %rdx, %rdi
je 0x1da9
movq 0x18(%rsp), %rsi
movq (%rsi,%rdx,8), %rsi
movq (%r8,%rsi,8), %rdi
movq 0x20(%rsp), %rsi
movq (%rsi,%rdx,8), %rsi
cmpq (%r8,%rsi,8), %rdi
jne 0x1d9f
movsd (%r14,%rsi,8), %xmm0
movq 0x10(%rsp), %rdi
addsd (%rdi,%rdx,8), %xmm0
movsd %xmm0, (%r14,%rsi,8)
incq %rdx
movq 0x28(%rsp), %rdi
jmp 0x1d68
xorl %edx, %edx
movq (%rsp), %rsi
cmpq %rdx, %r13
je 0x1dbd
movq %rax, (%rsi,%rdx,8)
incq %rdx
jmp 0x1daf
xorl %edx, %edx
cmpq %rdx, %r13
je 0x1de7
movsd (%r14,%rdx,8), %xmm0
movq (%r8,%rdx,8), %rsi
movq (%rsp), %rdi
ucomisd (%rdi,%rsi,8), %xmm0
jbe 0x1de2
movq (%rsp), %rdi
movsd %xmm0, (%rdi,%rsi,8)
incq %rdx
jmp 0x1dbf
xorl %edx, %edx
cmpq %rdx, %r13
je 0x1e18
movq (%r8,%rdx,8), %rsi
movq (%rsp), %rdi
movsd (%rdi,%rsi,8), %xmm0
cmpeqsd (%r14,%rdx,8), %xmm0
movq %xmm0, %rsi
andl $0x1, %esi
movq (%rbp,%rcx,8), %rdi
movq %rsi, (%rdi,%rdx,8)
incq %rdx
jmp 0x1de9
xorl %edx, %edx
movsd 0x1216(%rip), %xmm0     # 0x3038
movq 0x28(%rsp), %rdi
cmpq %rdx, %rdi
je 0x1e53
movq (%rbp,%rcx,8), %rsi
movq 0x20(%rsp), %rdi
movq (%rdi,%rdx,8), %rdi
cmpq $0x1, (%rsi,%rdi,8)
xorpd %xmm1, %xmm1
je 0x1e49
movapd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rdx,8)
incq %rdx
jmp 0x1e22
xorl %edx, %edx
movq (%rsp), %rsi
cmpq %rdx, %r13
je 0x1e67
movq %rax, (%rsi,%rdx,8)
incq %rdx
jmp 0x1e59
xorl %eax, %eax
cmpq %rax, %rdi
je 0x1eb2
movsd (%rbx,%rax,8), %xmm0
movq 0x10(%rsp), %rdx
addsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x18(%rsp), %rdx
movq (%rdx,%rax,8), %rdx
movq (%rsp), %rsi
ucomisd (%rsi,%rdx,8), %xmm0
jbe 0x1ead
movq (%rsp), %rsi
movsd %xmm0, (%rsi,%rdx,8)
movq 0x20(%rsp), %rsi
movq (%rsi,%rax,8), %rsi
movq %rsi, (%r8,%rdx,8)
incq %rax
jmp 0x1e69
xorl %eax, %eax
cmpq %rax, %r13
je 0x1ece
movq (%rbp,%rcx,8), %rdx
cmpq $0x0, (%rdx,%rax,8)
je 0x1ec9
movq %rax, (%r8,%rax,8)
incq %rax
jmp 0x1eb4
movq 0x80(%rsp), %rax
movq 0x18(%rax), %rdi
leaq 0x1194(%rip), %rsi      # 0x3075
callq 0x1080
movq %rax, %rbx
leaq 0x1187(%rip), %r14      # 0x3077
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x1f19
movq 0x88(%rsp), %rax
movq (%rax,%r12,8), %rdx
incq %rdx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1090
incq %r12
jmp 0x1ef3
movq %rbx, %rdi
callq 0x1070
xorpd %xmm2, %xmm2
xorl %eax, %eax
xorpd %xmm1, %xmm1
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movq 0x88(%rsp), %r9
movq 0x10(%rsp), %r8
cmpq %rax, %rsi
je 0x1f74
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
movq (%r9,%rcx,8), %rdx
cmpq (%rdi,%rax,8), %rdx
jne 0x1f6f
movsd (%r8,%rax,8), %xmm0
cmpq %rdx, %rcx
jne 0x1f6b
addsd %xmm0, %xmm1
jmp 0x1f6f
addsd %xmm0, %xmm2
incq %rax
jmp 0x1f42
movapd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x10f3(%rip), %rdi      # 0x307c
movq %r15, %rsi
xorl %eax, %eax
movsd %xmm1, 0x10(%rsp)
movsd %xmm2, (%rsp)
callq 0x1030
leaq 0x10fb(%rip), %rdi      # 0x30a0
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x1030
leaq 0x1105(%rip), %rdi      # 0x30be
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x1030
leaq 0x1122(%rip), %rdi      # 0x30ee
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x1030
leaq 0x1137(%rip), %rdi      # 0x3117
movl 0x40(%rsp), %esi
xorl %eax, %eax
callq 0x1030
jmp 0x2017
leaq 0x1292(%rip), %rdi      # 0x3286
callq 0x10a0
leaq 0x12bf(%rip), %rdi      # 0x32bf
jmp 0x2046
leaq 0x13a9(%rip), %rdi      # 0x33b2
jmp 0x2046
leaq 0x11aa(%rip), %rdi      # 0x31bc
callq 0x10a0
cmpl $0x0, 0x38(%rsp)
jne 0x204b
leaq 0x11b6(%rip), %rdi      # 0x31db
callq 0x10a0
leaq 0x11e8(%rip), %rdi      # 0x3219
callq 0x10a0
leaq 0x121b(%rip), %rdi      # 0x3258
jmp 0x2046
leaq 0x1322(%rip), %rdi      # 0x3368
callq 0x10a0
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq