// File: /workspace/github_c_makefile_star2_O3/felipelouza[P]egap/gap.c
// Function: main
int main(int argc, char *argv[]) {
  extern int optind, opterr, optopt;
  extern char *optarg;
  int c, group_size;
  char *path;
  g_data g;

  // default option values
  g.verbose=0; g.solid_limit = 256;
  group_size=MAX_NUMBER_OF_BWTS;      
  g.mwXMerge = g.bwtOnly = true;
  bool hm = false;
  g.unsortedLcp = NULL;
  g.outPath = NULL;
  g.algorithm = 0;
  g.extMem = g.smallAlpha=g.mmapZ=g.mmapBWT=g.mmapB= g.lcpMerge = g.lcpCompute = false;
  g.outputDA = 0;
  g.outputColors = 0;
  g.outputSA = 0;
  g.outputSL = 0;
  g.outputQS = 0;
  g.dbOrder = 0;           // order for deBruijn graph 
  int num_threads = 0;
  while ((c=getopt(argc, argv, "vhalrxmd:c:p:g:A:s:o:EZTBD:S:qL:")) != -1) {
    switch (c) 
      {
      case 'v':
        g.verbose++; break;         // verbose output (can be repeated)
      case 'o':
        g.outPath=optarg; break;    // basename for output files 
      case 'l':
        g.lcpCompute = true;        // compute lcp array from scratch 
        g.bwtOnly=false; break;  
      case 'r':
        g.lcpMerge = true;          // merge lcp values 
        g.bwtOnly=false; break;  
      case 'x':
        g.mwXMerge=false; break;      // do not use external multiway merge sort for computing lcp values
      case 'd':
        g.outputDA = atoi(optarg); break;  // output Document Array (for last iteration only) 
      case 'c':
        g.outputColors = atoi(optarg); break;  // output Document Array (one color for each chunk/file) 
      case 'S':
        g.outputSA = atoi(optarg); break;  // output Suffix Array (for last iteration only) 
      case 'L':
        g.outputSL = atoi(optarg); break;  // output Suffixes' lengths (for last iteration only) 
      case 'q':
        g.outputQS = 1; break;  // output QS permuted according to the BWT (for last iteration only) 
      case 'm':
        hm=true; break;                 // use hm algorithm 
      case 'a':
        g.smallAlpha=true; break;       // assume alphabet is small and use bwtOcc[][]
      case 'g':
        group_size = atoi(optarg);      // size for multigroup algorithm 
        break;      
      case 'A':
        g.algorithm = atoi(optarg);     // preferred algorithm 
        break;      
      case 'D':
        g.dbOrder = atoi(optarg);       // if > 1 compute order-k db graph 
        break;      
      case 's':
        g.solid_limit = atoi(optarg);   // smallest solid block 
        break;                
      case 'p':
        num_threads = atoi(optarg);     // number of consumer threads 
        break;       
      case 'E':
        g.extMem=true; break;           // use external memory (see mergegap.c)
      case 'Z':
        g.mmapZ=true; break;      // mmap merge and newmerge
      case 'B':
        g.mmapB=true; break;      // mmap B array
      case 'T':
        g.mmapBWT=true; break;    // mmap input BWTs
      case 'h':                   // usage instruction 
      case '?':
        usage(argv[0],&g);
        exit(EXIT_FAILURE);
      }
  }
  if(g.dbOrder<0 || g.dbOrder==1) { // illegal order
    printf("dbOrder must be at least 2\n");
    exit(EXIT_FAILURE);
  }
  if(g.dbOrder>1) { // valid order !=0
    if(!g.extMem) {
      printf("Option -D forces option -E\n");
      g.extMem = true;
    }
    if(g.algorithm!=128) {
      printf("Option -D forces option -A 128\n");
      g.algorithm = 128;
    }
    if(g.lcpMerge) {
      printf("Option -D incompatible with merging lcp values\n");
      exit(EXIT_FAILURE);
    }
  }
  if(num_threads <0) {
    printf("Invalid number of threads, must be non negative\n");
    exit(EXIT_FAILURE);
  }
  if(group_size<2 || group_size>MAX_NUMBER_OF_BWTS) {
    printf("Invalid group size. Must be in range [2,%llu]\n",MAX_NUMBER_OF_BWTS);
    exit(EXIT_FAILURE);
  } 
  if(hm && g.lcpCompute) {// not sure this is required, maybe changing something inside holtMcMillan() will suffice 
    printf("You cannot compute lcp values with H&M (only merge)\n");
    exit(EXIT_FAILURE);
  }
  if(g.lcpMerge && g.lcpCompute) {
    printf("You can *either* merge *or* compute lcp values\n");
    exit(EXIT_FAILURE);
  }
  if(!g.mwXMerge && !g.lcpCompute) {
    printf("Option -x can only be used with -l\n");
    exit(EXIT_FAILURE);
  }
  if(g.extMem) {
    if(hm) {
      printf("You cannot run H&M in external memory\n");
      exit(EXIT_FAILURE);
    }
    if(g.mmapBWT) { // extMem reads from the input bwt files from disk, it does not mmap them
      printf("Option -E incompatible with -T\n");
      exit(EXIT_FAILURE);
    }
    if(!g.smallAlpha) {
      printf("Option -E forces option -a\n");
      g.smallAlpha = true;
    }
  }
  if(optind+1==argc) {
    path=argv[optind];
  }
  else  {
    usage(argv[0],&g);
    exit(EXIT_FAILURE);
  }

  if(g.verbose>0) {
    puts("Command line:");
    for(int i=0;i<argc;i++)
      printf(" %s",argv[i]);
    puts("");
  }

  if(g.verbose>1) {
    puts(                    "***************************************************");
    if(g.bwtOnly)       puts("* Merge BWTs");
    else if(g.lcpMerge) puts("* Merge BWTs and LCPs");
    else                puts("* Merge BWTs and compute LCPs");
    if(hm)              puts("* Using multiround HM algorithm");
    else                puts("* Using multiround Gap algorithm");
    printf(                  "* Max #BWT %llu, Max LCP: %llu, Max mergeSize: %llu\n",
                     MAX_NUMBER_OF_BWTS, MAX_LCP_SIZE, MAX_OUTPUT_SIZE);  
    puts(                    "* Using Timo Bingmann's malloc_count to measure heap usage");
    puts(            "***************************************************");
  }

  // input check completed start measuring time 
  clock_t start = clock();
  time_t start_wc = time(NULL);
  double elapsed, elapsed_wc;

  // read BWT values. init g.numBWT, g.bwtLen[]; if !extMem also g.bws[]
  // also  remap BWTs init g->sizeOfAlpha and if g->smallAlpha is true init also g>bwtOcc[i]
  g.bwtOcc=NULL; g.sizeOfAlpha = 0;      //these two will be initialized later
  bool something_to_do = readBWTsingle(path, &g);
  
  if(g.numBwt> group_size) { // multiround computation required
    if(g.outputDA>0 || g.outputSA>0 || g.outputQS>0 || g.outputSL>0) {
      puts("Sorry, multiround DA, SA, QS or SL computation not supported");
      exit(EXIT_FAILURE);
    }
  }
  if(g.mmapBWT) { 
    if(g.outputDA>0 || g.outputSA>0 || g.outputQS>0 || g.outputSL>0) {
      puts("Sorry, internal memory DA, SA, QS or SL computation not supported");
      exit(EXIT_FAILURE);
    }
  }
  if(!something_to_do) {
    puts("Single BWT in input and no LCP/dBG computation. I have nothing to do!"); 
    //g.mergeLen = g.sizeOfAlpha = 1;
  }
  else {
    // init additional g fields 
    g.lcpinPath = path;
    if(g.outPath==NULL) g.outPath = path;  
    g.symb_offset = 0;
    g.blockBeginsAt = NULL; g.lcps = NULL; // prevent unintended use
    // if requested allocate space for and read lcp Values (B array)
    if(g.lcpMerge)
       initLCPmem(&g); // init g.lcps. lcp values are stored in mmapped memory 
          
    elapsed = (clock()-start)/(double)(CLOCKS_PER_SEC);
    elapsed_wc = difftime(time(NULL),start_wc);
    // printf("Partial elapsed time: %.4lf secs\n", elapsed_wc);
    // printf("Partial computing time: %.4lf secs\n", elapsed);    
    #if MALLOC_COUNT_FLAG
      printf("Merge starting (%d bwts). Mem: %zu peak, %zu current\n", g.numBwt, malloc_count_peak(), malloc_count_current());
    #else
      printf("Merge starting (%d bwts).\n", g.numBwt);
    #endif
      
    // do the merging
    multiround(hm,group_size,path,&g, num_threads);
    
    // computation done the result is in g->bws[0], and g->lcps[0] (if lcpMerge) 
    // if lcpCompute the result is already in the outputfile or in the pair files 
    // and a message is printed to run mergelcp 
  
    // write content of g.bws[0] to output file (if necessary) and/or free/munmap it 
    if(g.mmapBWT) {
      int e = munmap(g.bws[0],g.mergeLen*sizeof(symbol));
      if(e) die("main (unmap bws)");
    }
    else if(!g.extMem) { 
      writeOutputBWT(&g,path,hm); // if we are working in external memory output overwrites input
      free(g.bws[0]); // deallocate all bwt's (they are contiguous)
    }
    // free other bwt related stuff
    free(g.bws);
    if(g.smallAlpha) {free(g.bwtOcc[0]); free(g.bwtOcc);}
    free(g.bwtLen);
    // free lcp related stuff
    if(g.lcpMerge) {
      int e = munmap(g.lcps[0],g.mergeLen*sizeof(lcpInt));
      if(e) die("main (unmap lcps)");
      free(g.lcps);      
    }
  }
  
  // report running times  
  elapsed = (clock()-start)/(double)(CLOCKS_PER_SEC);
  elapsed_wc = difftime(time(NULL),start_wc);
  printf("##\n");
  printf("Elapsed time: %.4lf secs\n", elapsed_wc);
  // fprintf(stderr, "%.6lf\n", elapsed_wc);
  printf("Computing time: %.4lf secs\n", elapsed);
  printf("##\n");
  printf("Size of merged BWT: "CUSTOM_FORMAT, g.mergeLen);
  printf(" Alphabet size: %d\n", g.sizeOfAlpha);
  printf("##\n");
  printf("Microseconds per symbol: %.4lf\n", elapsed_wc*1000000.0/g.mergeLen);
  //  fprintf(stderr, "%.6lf\n", elapsed_wc*1000000.0/g.mergeLen);
  #if MALLOC_COUNT_FLAG
    printf("Peak memory allocation: %zu bytes, %.4lf bytes/symbol\n",
           malloc_count_peak(), (double)malloc_count_peak()/g.mergeLen);
  #endif
  printf("##\n");

  return 0; // Done!!!
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6168, %rsp           # imm = 0x6168
movq %rsi, %r14
movl %edi, %r15d
movq $0x100, 0xd0(%rsp) # imm = 0x100
movq $0x0, 0xc0(%rsp)
movl $0x1000001, 0x7c(%rsp)  # imm = 0x1000001
movw $0x0, 0xa8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rsp)
movups %xmm0, 0x90(%rsp)
xorl %eax, %eax
movl %eax, 0xac(%rsp)
movl $0x0, 0x28(%rsp)
movl %eax, 0xaf(%rsp)
movl $0x100, %eax            # imm = 0x100
movq %rax, 0x38(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
leaq 0xbaec(%rip), %r13      # 0xe5aa
leaq 0xb56b(%rip), %r12      # 0xe030
movq 0x1150c(%rip), %rbx     # 0x13fd8
leaq 0xb595(%rip), %rbp      # 0xe068
movl $0x0, 0x24(%rsp)
movb $0x1, %al
movl %eax, 0x2c(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, (%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x34(%rsp)
movl %r15d, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x2340
leal -0x53(%rax), %ecx
cmpl $0x25, %ecx
ja 0x2b51
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x8c(%rsp)
jmp 0x2b20
leal -0x3f(%rax), %ecx
cmpl $0xd, %ecx
ja 0x2cde
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x18(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0xd0(%rsp)
jmp 0x2b20
movw $0x100, 0x7c(%rsp)      # imm = 0x100
movb $0x1, %al
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x2b20
movb $0x1, %al
movl %eax, 0x34(%rsp)
jmp 0x2b20
movb $0x1, 0x7e(%rsp)
movb $0x0, 0x7c(%rsp)
movb $0x1, %al
movl %eax, 0x30(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x2b20
movb $0x0, 0x7f(%rsp)
movl $0x0, 0x2c(%rsp)
jmp 0x2b20
movb $0x1, 0xb2(%rsp)
movb $0x1, %al
movl %eax, 0x24(%rsp)
jmp 0x2b20
movb $0x1, 0xa8(%rsp)
movb $0x1, %al
movl %eax, 0x28(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x84(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x88(%rsp)
jmp 0x2b20
movb $0x1, 0xb0(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0xc(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movq %rax, 0x38(%rsp)
jmp 0x2b20
movq (%rbx), %rax
movq %rax, 0xc0(%rsp)
jmp 0x2b20
movl $0x1, 0x94(%rsp)
jmp 0x2b20
movl (%rsp), %eax
incl %eax
movl %eax, (%rsp)
movl %eax, 0xd4(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x1c(%rsp)
movl %eax, 0x80(%rsp)
jmp 0x2b20
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x90(%rsp)
jmp 0x2b20
movb $0x1, 0xb1(%rsp)
jmp 0x2b20
movb $0x1, 0xa9(%rsp)
movb $0x1, %al
movl %eax, 0x20(%rsp)
jmp 0x2b20
cmpl $-0x1, %eax
jne 0x2b20
movl 0x1c(%rsp), %eax
testl %eax, %eax
js 0x332d
cmpl $0x1, %eax
je 0x332d
movl 0x34(%rsp), %ebp
movl 0x20(%rsp), %ebx
jbe 0x2d4d
testb $0x1, %bl
jne 0x2d21
leaq 0xbc46(%rip), %rdi      # 0xe958
callq 0x2090
movb $0x1, 0xa9(%rsp)
movb $0x1, %bl
cmpl $0x80, 0x18(%rsp)
je 0x2d42
leaq 0xbc41(%rip), %rdi      # 0xe973
callq 0x2090
movl $0x80, 0xac(%rsp)
testb $0x1, 0x8(%rsp)
jne 0x3354
cmpl $0x0, 0xc(%rsp)
js 0x3336
movq 0x38(%rsp), %rax
addl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
cmpl $0xffffff00, %eax       # imm = 0xFFFFFF00
jbe 0x333f
testb $0x1, %bpl
movl 0x30(%rsp), %eax
je 0x2d7f
testb $0x1, %al
jne 0x335d
testb $0x1, 0x8(%rsp)
je 0x2d8e
testb $0x1, %al
jne 0x3366
testb $0x1, 0x2c(%rsp)
jne 0x2d9d
testb $0x1, %al
je 0x336f
testb $0x1, %bl
je 0x2dd2
testb $0x1, %bpl
jne 0x3378
testb $0x1, 0x24(%rsp)
jne 0x3381
testb $0x1, 0x28(%rsp)
jne 0x2dd2
leaq 0xbbf0(%rip), %rdi      # 0xe9b5
callq 0x2090
movb $0x1, 0xa8(%rsp)
movq 0x111f7(%rip), %rax     # 0x13fd0
movslq (%rax), %rax
leal 0x1(%rax), %ecx
cmpl %r15d, %ecx
jne 0x3316
movq (%r14,%rax,8), %r12
cmpl $0x0, (%rsp)
jle 0x2ec7
leaq 0xb7fd(%rip), %rdi      # 0xe5fa
callq 0x2090
testl %r15d, %r15d
jle 0x2e2a
movl %r15d, %r15d
leaq 0xb7f7(%rip), %rbx      # 0xe608
xorl %r13d, %r13d
movq (%r14,%r13,8), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2100
incq %r13
cmpq %r13, %r15
jne 0x2e14
movl $0xa, %edi
callq 0x2040
cmpl $0x1, (%rsp)
je 0x2ec7
leaq 0xb7c7(%rip), %rbx      # 0xe60c
movq %rbx, %rdi
callq 0x2090
leaq 0xb7f9(%rip), %rax      # 0xe64d
leaq 0xb808(%rip), %rcx      # 0xe663
testb $0x1, 0x8(%rsp)
cmovneq %rax, %rcx
leaq 0xb7d5(%rip), %rdi      # 0xe640
testb $0x1, 0x10(%rsp)
cmoveq %rcx, %rdi
callq 0x2090
leaq 0xb801(%rip), %rax      # 0xe681
leaq 0xb81a(%rip), %rdi      # 0xe6a1
testb $0x1, %bpl
cmovneq %rax, %rdi
callq 0x2090
leaq 0xb827(%rip), %rdi      # 0xe6c2
movl $0x100, %esi            # imm = 0x100
movl $0xff, %edx
movq $-0x2, %rcx
xorl %eax, %eax
callq 0x2100
leaq 0xb83d(%rip), %rdi      # 0xe6f7
callq 0x2090
movq %rbx, %rdi
callq 0x2090
callq 0x20d0
movq %rax, %r14
xorl %edi, %edi
callq 0x2200
movq %rax, %r13
leaq 0x40(%rsp), %r15
movq $0x0, 0x18(%r15)
movl $0x0, 0x38(%r15)
movq %r12, %rdi
movq %r15, %rsi
callq 0x343c
movq 0x38(%rsp), %rcx
cmpl %ecx, 0x20(%r15)
jle 0x2f3c
cmpl $0x0, 0x84(%rsp)
jg 0x338a
cmpl $0x0, 0x8c(%rsp)
jg 0x338a
cmpl $0x0, 0x94(%rsp)
jg 0x338a
cmpl $0x0, 0x90(%rsp)
jg 0x338a
cmpb $0x1, 0xb2(%rsp)
jne 0x2f7e
cmpl $0x0, 0x84(%rsp)
jg 0x3393
cmpl $0x0, 0x8c(%rsp)
jg 0x3393
cmpl $0x0, 0x94(%rsp)
jg 0x3393
cmpl $0x0, 0x90(%rsp)
jg 0x3393
testb %al, %al
je 0x305e
movq %r14, (%rsp)
movq %r12, 0xb8(%rsp)
cmpq $0x0, 0xc0(%rsp)
jne 0x2fa5
movq %r12, 0xc0(%rsp)
movq %r13, %r14
xorl %eax, %eax
movq %rax, 0x70(%rsp)
movq %rax, 0xd8(%rsp)
movq %rax, 0xc8(%rsp)
cmpb $0x1, 0x7d(%rsp)
jne 0x2fd0
leaq 0x40(%rsp), %rdi
callq 0x3c19
callq 0x20d0
xorl %edi, %edi
callq 0x2200
leaq 0x40(%rsp), %r15
movl 0x20(%r15), %r13d
callq 0xc6e8
movq %rax, %rbx
callq 0xc6e0
leaq 0xb7fe(%rip), %rdi      # 0xe7f7
movl %r13d, %esi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2100
movzbl %bpl, %edi
andl $0x1, %edi
movq 0x38(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
movl 0xc(%rsp), %r8d
callq 0xcdec
cmpb $0x1, 0x72(%r15)
jne 0x306f
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rsi
movq (%rax), %rdi
callq 0x2290
testl %eax, %eax
movq %r14, %r13
movq (%rsp), %r14
je 0x3146
leaq 0xb7d9(%rip), %rdi      # 0xe82d
callq 0x39fc
jmp 0x3146
leaq 0xb74c(%rip), %rdi      # 0xe7b1
callq 0x2090
jmp 0x31b4
cmpb $0x0, 0xa9(%rsp)
movq %r14, %r13
movq (%rsp), %r14
jne 0x3146
cmpl $0x2, 0xd4(%rsp)
jl 0x309a
leaq 0xb874(%rip), %rdi      # 0xe909
callq 0x2090
leaq 0xb883(%rip), %rax      # 0xe924
leaq 0xb882(%rip), %r8       # 0xe92a
testb $0x1, %bpl
cmovneq %rax, %r8
leaq 0xb867(%rip), %rdx      # 0xe91e
leaq 0x5160(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0xb856(%rip), %rsi      # 0xe92e
movq %rbx, %rdi
callq 0x21e0
movq %rax, %r15
testq %rax, %rax
jne 0x30f4
leaq 0xb842(%rip), %rdi      # 0xe931
callq 0x39fc
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rdx
movq (%rax), %rdi
movl $0x1, %esi
movq %r15, %rcx
callq 0x2390
cmpq 0x68(%rsp), %rax
je 0x3121
leaq 0xb824(%rip), %rdi      # 0xe940
callq 0x39fc
movq %r15, %rdi
callq 0x20e0
testl %eax, %eax
je 0x3139
leaq 0xb7fd(%rip), %rdi      # 0xe931
callq 0x39fc
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0xc7ba
movq 0x40(%rsp), %rdi
callq 0xc7ba
cmpb $0x1, 0xa8(%rsp)
jne 0x3171
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0xc7ba
movq 0x58(%rsp), %rdi
callq 0xc7ba
movq 0x48(%rsp), %rdi
callq 0xc7ba
cmpb $0x1, 0x7d(%rsp)
jne 0x31b4
movq 0x68(%rsp), %rsi
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
callq 0x2290
testl %eax, %eax
je 0x31a7
leaq 0xb69c(%rip), %rdi      # 0xe83e
callq 0x39fc
movq 0xc8(%rsp), %rdi
callq 0xc7ba
callq 0x20d0
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0xae3f(%rip), %xmm0     # 0xe008
movsd %xmm0, 0x10(%rsp)
xorl %edi, %edi
callq 0x2200
movq %rax, %rdi
movq %r13, %rsi
callq 0x2110
movsd %xmm0, (%rsp)
leaq 0xb7e3(%rip), %rbx      # 0xe9d0
movq %rbx, %rdi
callq 0x2090
leaq 0xb654(%rip), %rdi      # 0xe850
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x2100
leaq 0xb65b(%rip), %rdi      # 0xe86a
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
movq %rbx, %rdi
callq 0x2090
movq 0x68(%rsp), %rsi
leaq 0xb656(%rip), %rdi      # 0xe886
xorl %eax, %eax
callq 0x2100
movl 0x78(%rsp), %esi
leaq 0xb65c(%rip), %rdi      # 0xe89e
xorl %eax, %eax
callq 0x2100
movq %rbx, %rdi
callq 0x2090
movsd (%rsp), %xmm2
mulsd 0xadaa(%rip), %xmm2     # 0xe008
movsd 0x68(%rsp), %xmm0
unpcklps 0xada5(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xadad(%rip), %xmm0     # 0xe020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movapd %xmm2, %xmm0
leaq 0xb624(%rip), %rdi      # 0xe8b2
movb $0x1, %al
callq 0x2100
callq 0xc6e8
movq %rax, %r14
callq 0xc6e8
movq %rax, %xmm1
movq 0xad61(%rip), %xmm2     # 0xe010
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xad65(%rip), %xmm3     # 0xe020
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq 0x68(%rsp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0xb5e2(%rip), %rdi      # 0xe8d2
movq %r14, %rsi
movb $0x1, %al
callq 0x2100
movq %rbx, %rdi
callq 0x2090
xorl %eax, %eax
addq $0x6168, %rsp           # imm = 0x6168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
leaq 0x40(%rsp), %rsi
callq 0x28dc
movl $0x1, %edi
callq 0x2380
leaq 0xb7a6(%rip), %rdi      # 0xeada
jmp 0x339a
leaq 0xb73e(%rip), %rdi      # 0xea7b
jmp 0x339a
leaq 0xb285(%rip), %rdi      # 0xe5cb
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x2100
jmp 0x3323
leaq 0xb750(%rip), %rdi      # 0xeaab
jmp 0x339a
leaq 0xb6e3(%rip), %rdi      # 0xea47
jmp 0x339a
leaq 0xb6ab(%rip), %rdi      # 0xea18
jmp 0x339a
leaq 0xb61c(%rip), %rdi      # 0xe992
jmp 0x339a
leaq 0xb673(%rip), %rdi      # 0xe9f2
jmp 0x339a
leaq 0xb64b(%rip), %rdi      # 0xe9d3
jmp 0x339a
leaq 0xb3a1(%rip), %rdi      # 0xe732
jmp 0x339a
leaq 0xb3d5(%rip), %rdi      # 0xe76f
callq 0x2090
jmp 0x3323
nopl (%rax)