// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/main.c
// Function: main
int main(int argc, char** argv){

  time_t t_start=0;
  clock_t c_start=0;

  extern char *optarg;
  extern int optind, opterr, optopt;

  int c=0, verbose=0, time=0, check=0, print=0, output=0, stats=0, factors=0, subs=0;
  //input options
  int bin=0;// bin or formatted (default) input (txt, fasta and fastq)
  char *c_file=NULL;

  size_t  d=0; //number of documents
  int ALG=10;//Algorithm

  while ((c=getopt(argc, argv, "vthp:d:A:cosbflL")) != -1) {
    switch (c)
    {
      case 'v':
        verbose++; break;
      case 't':
        time++; break;
      case 'p':
        print=(size_t)atoi(optarg); break;
      case 'h':
        usage(argv[0]); break;       // show usage and stop
      case 'd':
        d=(size_t)atoi(optarg); break;
      case 'A':
        ALG=(size_t)atoi(optarg); break;
      case 'c':
        check++; break;
      case 'o':
        output++; break;
      case 's':
        stats++; break;
      case 'b':
        bin=1; break;
      case 'f':
        bin=0; break;
      case 'l':
        factors=1; break;
      case 'L':
        factors =1; subs=1; break;
      case '?':
        exit(EXIT_FAILURE);
    }
  }
  free(optarg);
  
  if(optind+1==argc) {
    c_file=argv[optind++];
  }
  else  usage(argv[0]);

  if(verbose>0) {
    puts("Command line:");
    int i;
    for(i=0;i<argc;i++)
      printf(" %s",argv[i]);
    puts("");
  }

  /********/
  unsigned char *str = NULL;
  size_t i, n=0;

  if(bin==0){
    // reading the input as a collection of documents
    unsigned char **R;

    //disk access
    R = (unsigned char**) file_load_multiple(c_file, &d, &n);
    if(!R){
      fprintf(stderr, "Error: less than %zu strings in %s\n", d, c_file);
      return 0;
    }

    //concatenate strings
    str = cat_char(R, d, &n);

    printf("d = %zu\n", d);
    printf("N = %zu bytes\n", n);
    printf("sizeof(int) = %zu bytes\n", sizeof(int_t));

    #if DEBUG
      printf("R:\n");
      for(i=0; i<d; i++)
        printf("%zu) %s (%zu)\n", i, R[i], strlen((char*)R[i]));
    #endif

    //free memory
    for(i=0; i<d; i++)
      free(R[i]);
    free(R);
  }
  else{ //bin
    // reading the input file as a single document
    FILE *f = fopen(c_file,"r");
    if(f==NULL) {perror("Cannot open input file"); exit(1);}
    int e = fseek(f,0,SEEK_END);
    if(e)  {perror("Cannot seek"); exit(1);}
    n = ftell(f);
    rewind(f);

    str = malloc((n+1)*sizeof(char));
    if(str==NULL) {perror("Cannot alloc"); exit(1);}

    e = fread(str,1,n,f);
    if(e!=n) if(f==NULL) {perror("Cannot read from input file"); exit(1);}
    str[n++] = 0; // terminator 

    (void) d;
    printf("N = %zu bytes\n", n);
    printf("sizeof(int) = %zu bytes\n", sizeof(int_t));  
  }

  /********/

  char* copy = NULL;
  if(check && ALG==5){
      copy = (char*) malloc((n+1)*sizeof(char));
      strcpy(copy, (char*)str);
  }

  //lyndon array
  int_t *LA = NULL;
  if(ALG<=10){
    LA = (int_t*) malloc(n*sizeof(int_t));
    for(i=0; i<n; i++) LA[i]=0;
  }

  int_t *SA = NULL;
  if(ALG>=6){ //also computes SA[1,n]
    SA = (int_t*) malloc(n*sizeof(int_t));
    for(i=0; i<n; i++) SA[i]=0;
  }


  switch(ALG){

    /****/
    case 1:  printf("## LYNDON_NSV ##\n"); 
      compute_lyndon_nsv(str, (int_t*)LA, n);
      break;

    case 2:  printf("## GSACA_LYN ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      gsaca_cl(str, (uint_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;

    case 3:  printf("## MAX_LYN ##\n"); 
      compute_lyndon_max_lyn(str, (int_t*)LA, n);
      break;

    case 4: printf("## LYNDON_BWT ##\n"); 
      compute_lyndon_bwt(str, (int_t*)LA, n);
      break;

    case 5:  printf("## BWT_INPLACE_LYN ##\n"); 
      bwt_lyndon_inplace((char*)str, (int_t*)LA, n);
      break;

    /****/
    case 6:  printf("## GSACA_LYN_SA ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      gsaca_cl_la(str, (uint_t*)SA, (uint_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;
    
    case 7:  printf("## SACAK_LYNDON (non-linear) ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      sacak_lyndon_9n_non_linear(str, (int_t*)SA, (int_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;

    case 8:  printf("## SACAK_LYNDON 17n (linear) ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      sacak_lyndon_17n_linear(str, (int_t*)SA, (int_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;
    
    case 9:  printf("## SACAK_LYNDON 13n (linear) ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      sacak_lyndon_13n_linear(str, (int_t*)SA, (int_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;
    
    case 10:  printf("## SACAK_LYNDON 9n (linear) ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      sacak_lyndon_9n_linear(str, (int_t*)SA, (int_t*)LA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;

    case 11:  printf("## SACAK 5n (linear) ##\n"); 
      if(time)
        time_start(&t_start, &c_start);
      sacak(str, (int_t*)SA, n);
      if(time){
        printf("TOTAL:\n");
        fprintf(stderr,"%.6lf\n", time_stop(t_start, c_start));
      }
      break;
    
    /****/

    default: break;
  }

  // validate  
  if(check){
    if(ALG==5){
      free(str);
      str = (unsigned char*) copy;
    }

    printf("LA: ");
    if(!lyndon_check(str, LA, n, 0)){
      printf("isNOTLyndonArray!!\n");
      fprintf(stderr, "ERROR\n");
    }
    else {
      printf("isLyndonArray!!\n");
    }
    if(SA){
      printf("SA: ");
      if(!suffix_array_check((unsigned char*)str, (int_t*)SA, n, sizeof(char), 0)) fprintf(stderr,"isNotSorted!!\n");//compares upt to symbol '0'
      else printf("isSorted!!\n");
    }
  }

  if(print){ 
    printf("########\n");
    printf("i) LA\t");
    if(SA) printf("SA\t");
    printf("suffixes\n");
    for(i=0; i<min(n,print); i++){
      printf("%zu) %" PRIdN "\t", i, LA[i]);
      if(SA) printf("%" PRIdN "\t", SA[i]);
      int_t j=i;
      for(j=i; j<(int_t) min(i+LA[i],n); j++){
        char c = (str[j]==0)?'#':(str[j]>1?str[j]-1:'$');
        printf("%c", c);
      }
      printf("\n");
    }
    printf("########\n");
  }

  if(output){
    char c_out[255];
    FILE *f_out = NULL;
    printf("OUTPUT:\n");
    if(LA){
      sprintf(c_out, "%s.la", c_file);
      printf("%s\n", c_out);
      f_out = file_open(c_out, "wb");
      fwrite(LA, sizeof(int_t), n, f_out);
      file_close(f_out);
    }
    if(SA){
      sprintf(c_out, "%s.sa", c_file);
      printf("%s\n", c_out);
      f_out = file_open(c_out, "wb");
      fwrite(SA, sizeof(int_t), n, f_out);
      file_close(f_out);
    }
    {
      sprintf(c_out, "%s.bin", c_file);
      printf("%s\n", c_out);
      f_out = file_open(c_out, "wb");
      fwrite(str, sizeof(unsigned char), n, f_out);
      file_close(f_out);
    }
  }
  if(factors){

    if(!output) printf("OUTPUT:\n");
    char c_out[255];
    FILE *f_out = NULL, *F_out = NULL;
    sprintf(c_out, "%s.pos", c_file);
    printf("%s\n", c_out);
    f_out = file_open(c_out, "wb");

    if(subs==1){
      sprintf(c_out, "%s.lyn", c_file);
      printf("%s\n", c_out);
      F_out = file_open(c_out, "w");
    }

    size_t curr;
    i=0;
    char tmp[64], l='\n';
    while(i<n){
      curr=i;
      sprintf(tmp, "%lu\n", i);
      fwrite(tmp, sizeof(char), strlen(tmp), f_out);
      if(subs==1){
        size_t j;
        for(j=curr; j<curr+LA[i]; j++){
          char c;
          if(bin) c = str[j];
          else  c = (str[j]==0)?'#':(str[j]>1?str[j]-1:'$');
          fwrite(&c, sizeof(unsigned char),1, F_out);
          //printf("%c", c);
        }
        if(!bin)  fwrite(&l, sizeof(unsigned char),1, F_out);
      }
      i+=LA[i];
    }

    file_close(f_out);
    if(subs==2)
      file_close(F_out);
  }

  if(LA && stats){
    int_t max=0, j=0;
    size_t sum=0;
    
    for(i=0;i<n;i++){
      sum+=LA[i];
      if(LA[i]>max){max=LA[i];j=i;}
    }

    printf("##\n");
    printf("Max(LA[%d]): % "PRIdN"\n", j, max);
    printf("Avg(LA[i]): %.2lf\n", (double)sum/(double)n);

    i=0;
    int_t count=0;
    max=0;
    while(i<n){
      #if DEBUG
      printf("%zu\t%d\n", i, LA[i]);
      #endif
      count++;
      if(LA[i]>max) max=LA[i];
      i+=LA[i];
    }

    printf("##\n");
    printf("Number of Lyndon factors: % "PRIdN"\n", count);
    printf("Average length: %.2lf\n", (double)n/(double)count);
    printf("Maximum length: % "PRIdN"\n", max);
    printf("##\n");

    fprintf(stderr, "%"PRIdN"\t%.2lf\t%"PRIdN"\n", count, (double)n/(double)count, max);
  }

  free(str);
  if(LA) free(LA);
  if(SA) free(SA);

return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl $0xa, -0x5c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x9db7(%rip), %rdx      # 0xc3eb
callq 0x21f0
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x2742
movl -0x24(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x358(%rbp)
subl $0x37, %eax
ja 0x273d
movq -0x358(%rbp), %rax
leaq 0x99f1(%rip), %rcx      # 0xc05c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x273d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x273d
movq 0xc941(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0x2210
cltq
movl %eax, -0x34(%rbp)
jmp 0x273d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x24b0
jmp 0x273d
movq 0xc917(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0x2210
cltq
movq %rax, -0x58(%rbp)
jmp 0x273d
movq 0xc900(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0x2210
cltq
movl %eax, -0x5c(%rbp)
jmp 0x273d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x273d
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x273d
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x273d
movl $0x1, -0x48(%rbp)
jmp 0x273d
movl $0x0, -0x48(%rbp)
jmp 0x273d
movl $0x1, -0x40(%rbp)
jmp 0x273d
movl $0x1, -0x40(%rbp)
movl $0x1, -0x44(%rbp)
jmp 0x273d
movl $0x1, %edi
callq 0x2250
jmp 0x2626
movq 0xc88f(%rip), %rax      # 0xefd8
movq (%rax), %rdi
callq 0xb810
movq 0xc878(%rip), %rax      # 0xefd0
movl (%rax), %eax
addl $0x1, %eax
cmpl -0x8(%rbp), %eax
jne 0x278a
movq -0x10(%rbp), %rax
movq 0xc863(%rip), %rcx      # 0xefd0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0xc855(%rip), %rdx      # 0xefd0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
jmp 0x2796
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x24b0
cmpl $0x0, -0x28(%rbp)
jle 0x27e8
leaq 0x9c59(%rip), %rdi      # 0xc3fc
callq 0x2070
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x27dc
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x9c40(%rip), %rdi      # 0xc40a
movb $0x0, %al
callq 0x20e0
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x27af
leaq 0x9e47(%rip), %rdi      # 0xc62a
callq 0x2070
movq $0x0, -0x68(%rbp)
movq $0x0, -0x78(%rbp)
cmpl $0x0, -0x48(%rbp)
jne 0x28d5
movq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x4730
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0x284a
movq 0xc7d3(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq 0x9bd7(%rip), %rsi      # 0xc40e
movb $0x0, %al
callq 0x2160
movl $0x0, -0x4(%rbp)
jmp 0x39b4
movq -0x80(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x2380
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rsi
leaq 0x9bc8(%rip), %rdi      # 0xc432
movb $0x0, %al
callq 0x20e0
movq -0x78(%rbp), %rsi
leaq 0x9bbf(%rip), %rdi      # 0xc43b
movb $0x0, %al
callq 0x20e0
leaq 0x9bc0(%rip), %rdi      # 0xc44a
movl $0x4, %esi
movb $0x0, %al
callq 0x20e0
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x28c7
movq -0x80(%rbp), %rax
movq -0x70(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb810
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x289e
movq -0x80(%rbp), %rdi
callq 0xb810
jmp 0x2a1e
movq -0x50(%rbp), %rdi
leaq 0x9e8e(%rip), %rsi      # 0xc76e
callq 0x21d0
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x290c
leaq 0x9b66(%rip), %rdi      # 0xc463
callq 0x21e0
movl $0x1, %edi
callq 0x2250
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x21b0
movl %eax, -0x8c(%rbp)
cmpl $0x0, -0x8c(%rbp)
je 0x2946
leaq 0x9b43(%rip), %rdi      # 0xc47a
callq 0x21e0
movl $0x1, %edi
callq 0x2250
movq -0x88(%rbp), %rdi
callq 0x2170
movq %rax, -0x78(%rbp)
movq -0x88(%rbp), %rdi
callq 0x2100
movq -0x78(%rbp), %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0xb6a0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x2994
leaq 0x9b01(%rip), %rdi      # 0xc486
callq 0x21e0
movl $0x1, %edi
callq 0x2250
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x88(%rbp), %rcx
movl $0x1, %esi
callq 0x2080
movl %eax, -0x8c(%rbp)
movslq -0x8c(%rbp), %rax
cmpq -0x78(%rbp), %rax
je 0x29e2
cmpq $0x0, -0x88(%rbp)
jne 0x29e0
leaq 0x9ac2(%rip), %rdi      # 0xc493
callq 0x21e0
movl $0x1, %edi
callq 0x2250
jmp 0x29e2
movq -0x68(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x78(%rbp)
movb $0x0, (%rax,%rcx)
movq -0x78(%rbp), %rsi
leaq 0x9a37(%rip), %rdi      # 0xc43b
movb $0x0, %al
callq 0x20e0
leaq 0x9a38(%rip), %rdi      # 0xc44a
movl $0x4, %esi
movb $0x0, %al
callq 0x20e0
movq $0x0, -0x98(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x2a5d
cmpl $0x5, -0x5c(%rbp)
jne 0x2a5d
movq -0x78(%rbp), %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0xb6a0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2060
movq $0x0, -0xa0(%rbp)
cmpl $0xa, -0x5c(%rbp)
jg 0x2ab6
movq -0x78(%rbp), %rdi
shlq $0x2, %rdi
callq 0xb6a0
movq %rax, -0xa0(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x2ab4
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2a8a
jmp 0x2ab6
movq $0x0, -0xa8(%rbp)
cmpl $0x6, -0x5c(%rbp)
jl 0x2b0f
movq -0x78(%rbp), %rdi
shlq $0x2, %rdi
callq 0xb6a0
movq %rax, -0xa8(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x2b0d
movq -0xa8(%rbp), %rax
movq -0x70(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x2ae3
jmp 0x2b0f
movl -0x5c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x360(%rbp)
subl $0xa, %eax
ja 0x2f96
movq -0x360(%rbp), %rax
leaq 0x94fc(%rip), %rcx      # 0xc030
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x996b(%rip), %rdi      # 0xc4af
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0x71a0
jmp 0x2f98
leaq 0x9954(%rip), %rdi      # 0xc4c1
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2b87
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0x8430
cmpl $0x0, -0x2c(%rbp)
je 0x2be4
leaq 0x9928(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc440(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x368(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x368(%rbp), %rdi
leaq 0x98fd(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x98f1(%rip), %rdi      # 0xc4e1
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0x72e0
jmp 0x2f98
leaq 0x98d7(%rip), %rdi      # 0xc4f0
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0x6e00
jmp 0x2f98
leaq 0x98c0(%rip), %rdi      # 0xc502
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0x5400
jmp 0x2f98
leaq 0x98ae(%rip), %rdi      # 0xc519
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2c85
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x78(%rbp), %rax
movl %eax, %ecx
callq 0x8470
cmpl $0x0, -0x2c(%rbp)
je 0x2ce9
leaq 0x9823(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc33b(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x370(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x370(%rbp), %rdi
leaq 0x97f8(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x9838(%rip), %rdi      # 0xc52d
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2d0f
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x78(%rbp), %rax
movl %eax, %ecx
callq 0xb400
cmpl $0x0, -0x2c(%rbp)
je 0x2d73
leaq 0x9799(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc2b1(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x378(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x378(%rbp), %rdi
leaq 0x976e(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x97cf(%rip), %rdi      # 0xc54e
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2d99
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x78(%rbp), %rax
movl %eax, %ecx
callq 0xb480
cmpl $0x0, -0x2c(%rbp)
je 0x2dfd
leaq 0x970f(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc227(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x380(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x380(%rbp), %rdi
leaq 0x96e4(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x9766(%rip), %rdi      # 0xc56f
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2e23
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x78(%rbp), %rax
movl %eax, %ecx
callq 0xb500
cmpl $0x0, -0x2c(%rbp)
je 0x2e87
leaq 0x9685(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc19d(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x388(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x388(%rbp), %rdi
leaq 0x965a(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x96fd(%rip), %rdi      # 0xc590
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2ead
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x78(%rbp), %rax
movl %eax, %ecx
callq 0xb580
cmpl $0x0, -0x2c(%rbp)
je 0x2f11
leaq 0x95fb(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc113(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x390(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x390(%rbp), %rdi
leaq 0x95d0(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
leaq 0x9693(%rip), %rdi      # 0xc5b0
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x2c(%rbp)
je 0x2f37
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x39c0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
callq 0xb390
cmpl $0x0, -0x2c(%rbp)
je 0x2f94
leaq 0x9578(%rip), %rdi      # 0xc4d2
movb $0x0, %al
callq 0x20e0
movq 0xc090(%rip), %rax      # 0xeff8
movq (%rax), %rax
movq %rax, -0x398(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3a00
movq -0x398(%rbp), %rdi
leaq 0x954d(%rip), %rsi      # 0xc4da
movb $0x1, %al
callq 0x2160
jmp 0x2f98
jmp 0x2f98
cmpl $0x0, -0x30(%rbp)
je 0x3082
cmpl $0x5, -0x5c(%rbp)
jne 0x2fbc
movq -0x68(%rbp), %rdi
callq 0xb810
movq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0x9606(%rip), %rdi      # 0xc5c9
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq -0x78(%rbp), %rax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x6e30
cmpl $0x0, %eax
jne 0x300f
leaq 0x95e0(%rip), %rdi      # 0xc5ce
movb $0x0, %al
callq 0x20e0
movq 0xbffc(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x95dc(%rip), %rsi      # 0xc5e2
movb $0x0, %al
callq 0x2160
jmp 0x301d
leaq 0x95d3(%rip), %rdi      # 0xc5e9
movb $0x0, %al
callq 0x20e0
cmpq $0x0, -0xa8(%rbp)
je 0x3080
leaq 0x95cc(%rip), %rdi      # 0xc5fa
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq -0x78(%rbp), %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x5b60
cmpl $0x0, %eax
jne 0x3070
movq 0xbf9b(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0x9598(%rip), %rsi      # 0xc5ff
movb $0x0, %al
callq 0x2160
jmp 0x307e
leaq 0x9597(%rip), %rdi      # 0xc60e
movb $0x0, %al
callq 0x20e0
jmp 0x3080
jmp 0x3082
cmpl $0x0, -0x34(%rbp)
je 0x32a8
leaq 0x9587(%rip), %rdi      # 0xc61a
movb $0x0, %al
callq 0x20e0
leaq 0x9583(%rip), %rdi      # 0xc624
movb $0x0, %al
callq 0x20e0
cmpq $0x0, -0xa8(%rbp)
je 0x30c0
leaq 0x9572(%rip), %rdi      # 0xc62b
movb $0x0, %al
callq 0x20e0
leaq 0x9780(%rip), %rdi      # 0xc847
movb $0x0, %al
callq 0x20e0
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x3a0(%rbp)
movq -0x78(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jae 0x30fb
movq -0x78(%rbp), %rax
movq %rax, -0x3a8(%rbp)
jmp 0x3106
movslq -0x34(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movq -0x3a0(%rbp), %rax
movq -0x3a8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x329a
movq -0x70(%rbp), %rsi
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %edx
leaq 0x94f9(%rip), %rdi      # 0xc62f
movb $0x0, %al
callq 0x20e0
cmpq $0x0, -0xa8(%rbp)
je 0x3163
movq -0xa8(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x968d(%rip), %rdi      # 0xc7e9
movb $0x0, %al
callq 0x20e0
movq -0x70(%rbp), %rax
movl %eax, -0xac(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0xac(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x3ac(%rbp)
movq -0x70(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq -0x70(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
addq %rcx, %rax
cmpq -0x78(%rbp), %rax
jae 0x31be
movq -0x70(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq -0x70(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
addq %rcx, %rax
movq %rax, -0x3b8(%rbp)
jmp 0x31c9
movq -0x78(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movl -0x3ac(%rbp), %eax
movq -0x3b8(%rbp), %rcx
cmpl %ecx, %eax
jge 0x327b
movq -0x68(%rbp), %rax
movslq -0xac(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x31ff
movl $0x23, %eax
movl %eax, -0x3bc(%rbp)
jmp 0x3246
movq -0x68(%rbp), %rax
movslq -0xac(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jle 0x322d
movq -0x68(%rbp), %rax
movslq -0xac(%rbp), %rcx
movzbl (%rax,%rcx), %eax
subl $0x1, %eax
movl %eax, -0x3c0(%rbp)
jmp 0x323a
movl $0x24, %eax
movl %eax, -0x3c0(%rbp)
jmp 0x323a
movl -0x3c0(%rbp), %eax
movl %eax, -0x3bc(%rbp)
movl -0x3bc(%rbp), %eax
movb %al, -0xad(%rbp)
movsbl -0xad(%rbp), %esi
leaq 0x93d8(%rip), %rdi      # 0xc638
movb $0x0, %al
callq 0x20e0
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x3177
leaq 0x8ee3(%rip), %rdi      # 0xc165
movb $0x0, %al
callq 0x20e0
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x30d6
leaq 0x9379(%rip), %rdi      # 0xc61a
movb $0x0, %al
callq 0x20e0
cmpl $0x0, -0x38(%rbp)
je 0x342c
movq $0x0, -0x1b8(%rbp)
leaq 0x9377(%rip), %rdi      # 0xc63b
movb $0x0, %al
callq 0x20e0
cmpq $0x0, -0xa0(%rbp)
je 0x3345
leaq -0x1b0(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x935d(%rip), %rsi      # 0xc644
movb $0x0, %al
callq 0x2240
leaq -0x1b0(%rbp), %rsi
leaq 0x9132(%rip), %rdi      # 0xc42e
movb $0x0, %al
callq 0x20e0
leaq -0x1b0(%rbp), %rdi
leaq 0x9339(%rip), %rsi      # 0xc64a
callq 0x40e0
movq %rax, -0x1b8(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x1b8(%rbp), %rcx
movl $0x4, %esi
callq 0x2260
movq -0x1b8(%rbp), %rdi
callq 0x4130
cmpq $0x0, -0xa8(%rbp)
je 0x33bf
leaq -0x1b0(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x92ec(%rip), %rsi      # 0xc64d
movb $0x0, %al
callq 0x2240
leaq -0x1b0(%rbp), %rsi
leaq 0x90b8(%rip), %rdi      # 0xc42e
movb $0x0, %al
callq 0x20e0
leaq -0x1b0(%rbp), %rdi
leaq 0x92bf(%rip), %rsi      # 0xc64a
callq 0x40e0
movq %rax, -0x1b8(%rbp)
movq -0xa8(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x1b8(%rbp), %rcx
movl $0x4, %esi
callq 0x2260
movq -0x1b8(%rbp), %rdi
callq 0x4130
leaq -0x1b0(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x9282(%rip), %rsi      # 0xc653
movb $0x0, %al
callq 0x2240
leaq -0x1b0(%rbp), %rsi
leaq 0x9048(%rip), %rdi      # 0xc42e
movb $0x0, %al
callq 0x20e0
leaq -0x1b0(%rbp), %rdi
leaq 0x924f(%rip), %rsi      # 0xc64a
callq 0x40e0
movq %rax, -0x1b8(%rbp)
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x1b8(%rbp), %rcx
movl $0x1, %esi
callq 0x2260
movq -0x1b8(%rbp), %rdi
callq 0x4130
cmpl $0x0, -0x40(%rbp)
je 0x36ce
cmpl $0x0, -0x38(%rbp)
jne 0x344a
leaq 0x91f8(%rip), %rdi      # 0xc63b
movb $0x0, %al
callq 0x20e0
movq $0x0, -0x2c8(%rbp)
movq $0x0, -0x2d0(%rbp)
leaq -0x2c0(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x91e8(%rip), %rsi      # 0xc65a
movb $0x0, %al
callq 0x2240
leaq -0x2c0(%rbp), %rsi
leaq 0x8fa7(%rip), %rdi      # 0xc42e
movb $0x0, %al
callq 0x20e0
leaq -0x2c0(%rbp), %rdi
leaq 0x91ae(%rip), %rsi      # 0xc64a
callq 0x40e0
movq %rax, -0x2c8(%rbp)
cmpl $0x1, -0x44(%rbp)
jne 0x34f6
leaq -0x2c0(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x91a1(%rip), %rsi      # 0xc661
movb $0x0, %al
callq 0x2240
leaq -0x2c0(%rbp), %rsi
leaq 0x8f59(%rip), %rdi      # 0xc42e
movb $0x0, %al
callq 0x20e0
leaq -0x2c0(%rbp), %rdi
leaq 0x917e(%rip), %rsi      # 0xc668
callq 0x40e0
movq %rax, -0x2d0(%rbp)
movq $0x0, -0x70(%rbp)
movb $0xa, -0x321(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x36ae
movq -0x70(%rbp), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x320(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0x913a(%rip), %rsi      # 0xc66a
movb $0x0, %al
callq 0x2240
leaq -0x320(%rbp), %rax
movq %rax, -0x3c8(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x20b0
movq -0x3c8(%rbp), %rdi
movq %rax, %rdx
movq -0x2c8(%rbp), %rcx
movl $0x1, %esi
callq 0x2260
cmpl $0x1, -0x44(%rbp)
jne 0x3692
movq -0x2d8(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x330(%rbp), %rax
movq -0x2d8(%rbp), %rcx
movq -0xa0(%rbp), %rdx
movq -0x70(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x366f
cmpl $0x0, -0x48(%rbp)
je 0x35c9
movq -0x68(%rbp), %rax
movq -0x330(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x331(%rbp)
jmp 0x363d
movq -0x68(%rbp), %rax
movq -0x330(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x35ea
movl $0x23, %eax
movl %eax, -0x3cc(%rbp)
jmp 0x3631
movq -0x68(%rbp), %rax
movq -0x330(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jle 0x3618
movq -0x68(%rbp), %rax
movq -0x330(%rbp), %rcx
movzbl (%rax,%rcx), %eax
subl $0x1, %eax
movl %eax, -0x3d0(%rbp)
jmp 0x3625
movl $0x24, %eax
movl %eax, -0x3d0(%rbp)
jmp 0x3625
movl -0x3d0(%rbp), %eax
movl %eax, -0x3cc(%rbp)
movl -0x3cc(%rbp), %eax
movb %al, -0x331(%rbp)
movq -0x2d0(%rbp), %rcx
leaq -0x331(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2260
movq -0x330(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x330(%rbp)
jmp 0x3584
cmpl $0x0, -0x48(%rbp)
jne 0x3690
movq -0x2d0(%rbp), %rcx
leaq -0x321(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2260
jmp 0x3692
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x3505
movq -0x2c8(%rbp), %rdi
callq 0x4130
cmpl $0x2, -0x44(%rbp)
jne 0x36cc
movq -0x2d0(%rbp), %rdi
callq 0x4130
jmp 0x36ce
cmpq $0x0, -0xa0(%rbp)
je 0x3978
cmpl $0x0, -0x3c(%rbp)
je 0x3978
movl $0x0, -0x338(%rbp)
movl $0x0, -0x33c(%rbp)
movq $0x0, -0x348(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x3778
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x348(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x338(%rbp), %eax
jle 0x3768
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x338(%rbp)
movq -0x70(%rbp), %rax
movl %eax, -0x33c(%rbp)
jmp 0x376a
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x370d
leaq 0x8e0d(%rip), %rdi      # 0xc58c
xorl %eax, %eax
movb %al, -0x3d1(%rbp)
callq 0x20e0
movb -0x3d1(%rbp), %al
movl -0x33c(%rbp), %esi
movl -0x338(%rbp), %edx
leaq 0x8eca(%rip), %rdi      # 0xc66f
callq 0x20e0
movaps 0x885f(%rip), %xmm3     # 0xc010
movq -0x348(%rbp), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x885b(%rip), %xmm2     # 0xc020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x78(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
leaq 0x8e8a(%rip), %rdi      # 0xc681
movb $0x1, %al
callq 0x20e0
movq $0x0, -0x70(%rbp)
movl $0x0, -0x34c(%rbp)
movl $0x0, -0x338(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
jae 0x3876
movl -0x34c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34c(%rbp)
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x338(%rbp), %eax
jle 0x385d
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x338(%rbp)
movq -0xa0(%rbp), %rax
movq -0x70(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x381a
leaq 0x8d0f(%rip), %rdi      # 0xc58c
movq %rdi, -0x410(%rbp)
xorl %eax, %eax
movb %al, -0x401(%rbp)
callq 0x20e0
movb -0x401(%rbp), %al
movl -0x34c(%rbp), %esi
leaq 0x8df0(%rip), %rdi      # 0xc694
callq 0x20e0
movq -0x78(%rbp), %xmm0
movaps 0x875b(%rip), %xmm1     # 0xc010
movaps %xmm1, -0x400(%rbp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x8758(%rip), %xmm1     # 0xc020
movaps %xmm1, -0x3f0(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
cvtsi2sdl -0x34c(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq 0x8dc2(%rip), %rdi      # 0xc6b3
movb $0x1, %al
callq 0x20e0
movb -0x401(%rbp), %al
movl -0x338(%rbp), %esi
leaq 0x8dbf(%rip), %rdi      # 0xc6ca
callq 0x20e0
movq -0x410(%rbp), %rdi
movb -0x401(%rbp), %al
callq 0x20e0
movaps -0x400(%rbp), %xmm2
movaps -0x3f0(%rbp), %xmm1
movq 0xb6c1(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movl -0x34c(%rbp), %edx
movq -0x78(%rbp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
cvtsi2sdl -0x34c(%rbp), %xmm1
divsd %xmm1, %xmm0
movl -0x338(%rbp), %ecx
leaq 0x8d6e(%rip), %rsi      # 0xc6df
movb $0x1, %al
callq 0x2160
movq -0x68(%rbp), %rdi
callq 0xb810
cmpq $0x0, -0xa0(%rbp)
je 0x3997
movq -0xa0(%rbp), %rdi
callq 0xb810
cmpq $0x0, -0xa8(%rbp)
je 0x39ad
movq -0xa8(%rbp), %rdi
callq 0xb810
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq