// File: /workspace/github_c_makefile_star2_O2/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 $0x100, 0xd0(%rsp) # imm = 0x100
andq $0x0, 0xc0(%rsp)
movl $0x1000001, 0x7c(%rsp)  # imm = 0x1000001
andw $0x0, 0xa8(%rsp)
movq %rsi, %r14
movl %edi, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rsp)
movups %xmm0, 0x90(%rsp)
andl $0x0, 0xac(%rsp)
andl $0x0, 0xaf(%rsp)
movl $0x100, %eax            # imm = 0x100
movq %rax, 0x38(%rsp)
movl $0x0, 0x28(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
leaq 0xaec7(%rip), %r13      # 0xd5aa
leaq 0xa946(%rip), %r12      # 0xd030
movq 0x108e7(%rip), %rbx     # 0x12fd8
leaq 0xa970(%rip), %rbp      # 0xd068
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 0x2776
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x8c(%rsp)
jmp 0x2745
leal -0x3f(%rax), %ecx
cmpl $0xd, %ecx
ja 0x2903
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x18(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0xd0(%rsp)
jmp 0x2745
movw $0x100, 0x7c(%rsp)      # imm = 0x100
movb $0x1, %al
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x2745
movb $0x1, %al
movl %eax, 0x34(%rsp)
jmp 0x2745
movb $0x1, 0x7e(%rsp)
movb $0x0, 0x7c(%rsp)
movb $0x1, %al
movl %eax, 0x30(%rsp)
movl $0x0, 0x10(%rsp)
jmp 0x2745
movb $0x0, 0x7f(%rsp)
movl $0x0, 0x2c(%rsp)
jmp 0x2745
movb $0x1, 0xb2(%rsp)
movb $0x1, %al
movl %eax, 0x24(%rsp)
jmp 0x2745
movb $0x1, 0xa8(%rsp)
movb $0x1, %al
movl %eax, 0x28(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x84(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x88(%rsp)
jmp 0x2745
movb $0x1, 0xb0(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0xc(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movq %rax, 0x38(%rsp)
jmp 0x2745
movq (%rbx), %rax
movq %rax, 0xc0(%rsp)
jmp 0x2745
movl $0x1, 0x94(%rsp)
jmp 0x2745
movl (%rsp), %eax
incl %eax
movl %eax, (%rsp)
movl %eax, 0xd4(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x1c(%rsp)
movl %eax, 0x80(%rsp)
jmp 0x2745
movq (%rbx), %rdi
callq 0x2360
movl %eax, 0x90(%rsp)
jmp 0x2745
movb $0x1, 0xb1(%rsp)
jmp 0x2745
movb $0x1, 0xa9(%rsp)
movb $0x1, %al
movl %eax, 0x20(%rsp)
jmp 0x2745
cmpl $-0x1, %eax
jne 0x2745
movl 0x1c(%rsp), %eax
testl %eax, %eax
js 0x2f46
cmpl $0x1, %eax
je 0x2f46
movl 0x34(%rsp), %ebp
movl 0x20(%rsp), %ebx
jbe 0x2972
testb $0x1, %bl
jne 0x2946
leaq 0xb021(%rip), %rdi      # 0xd958
callq 0x2090
movb $0x1, 0xa9(%rsp)
movb $0x1, %bl
cmpl $0x80, 0x18(%rsp)
je 0x2967
leaq 0xb01c(%rip), %rdi      # 0xd973
callq 0x2090
movl $0x80, 0xac(%rsp)
testb $0x1, 0x8(%rsp)
jne 0x2f6d
cmpl $0x0, 0xc(%rsp)
js 0x2f4f
movq 0x38(%rsp), %rax
addl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
cmpl $0xffffff00, %eax       # imm = 0xFFFFFF00
jbe 0x2f58
testb $0x1, %bpl
movl 0x30(%rsp), %eax
je 0x29a4
testb $0x1, %al
jne 0x2f76
testb $0x1, 0x8(%rsp)
je 0x29b3
testb $0x1, %al
jne 0x2f7f
testb $0x1, 0x2c(%rsp)
jne 0x29c2
testb $0x1, %al
je 0x2f88
testb $0x1, %bl
je 0x29f7
testb $0x1, %bpl
jne 0x2f91
testb $0x1, 0x24(%rsp)
jne 0x2f9a
testb $0x1, 0x28(%rsp)
jne 0x29f7
leaq 0xafcb(%rip), %rdi      # 0xd9b5
callq 0x2090
movb $0x1, 0xa8(%rsp)
movq 0x105d2(%rip), %rax     # 0x12fd0
movslq (%rax), %rax
leal 0x1(%rax), %ecx
cmpl %r15d, %ecx
jne 0x2f31
movq (%r14,%rax,8), %r12
cmpl $0x0, (%rsp)
jle 0x2ae9
leaq 0xabd8(%rip), %rdi      # 0xd5fa
callq 0x2090
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
leaq 0xabd1(%rip), %rbx      # 0xd608
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x2a52
movq (%r14,%r13,8), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2100
incq %r13
jmp 0x2a3a
pushq $0xa
popq %rdi
callq 0x2040
cmpl $0x1, (%rsp)
je 0x2ae9
leaq 0xaba1(%rip), %rbx      # 0xd60c
movq %rbx, %rdi
callq 0x2090
leaq 0xabd3(%rip), %rax      # 0xd64d
leaq 0xabe2(%rip), %rcx      # 0xd663
testb $0x1, 0x8(%rsp)
cmovneq %rax, %rcx
leaq 0xabaf(%rip), %rdi      # 0xd640
testb $0x1, 0x10(%rsp)
cmoveq %rcx, %rdi
callq 0x2090
leaq 0xabdb(%rip), %rax      # 0xd681
leaq 0xabf4(%rip), %rdi      # 0xd6a1
testb $0x1, %bpl
cmovneq %rax, %rdi
callq 0x2090
leaq 0xac01(%rip), %rdi      # 0xd6c2
pushq $-0x2
popq %rcx
movl $0x100, %esi            # imm = 0x100
movl $0xff, %edx
xorl %eax, %eax
callq 0x2100
leaq 0xac1b(%rip), %rdi      # 0xd6f7
callq 0x2090
movq %rbx, %rdi
callq 0x2090
callq 0x20d0
movq %rax, %r14
xorl %edi, %edi
callq 0x2200
leaq 0x40(%rsp), %r15
andq $0x0, 0x18(%r15)
movq %rax, %r13
andl $0x0, 0x38(%r15)
movq %r12, %rdi
movq %r15, %rsi
callq 0x2fcd
movq 0x38(%rsp), %rcx
cmpl %ecx, 0x20(%r15)
jle 0x2b58
cmpl $0x0, 0x84(%rsp)
jg 0x2fa3
cmpl $0x0, 0x8c(%rsp)
jg 0x2fa3
cmpl $0x0, 0x94(%rsp)
jg 0x2fa3
cmpl $0x0, 0x90(%rsp)
jg 0x2fa3
cmpb $0x1, 0xb2(%rsp)
jne 0x2b9a
cmpl $0x0, 0x84(%rsp)
jg 0x2fac
cmpl $0x0, 0x8c(%rsp)
jg 0x2fac
cmpl $0x0, 0x94(%rsp)
jg 0x2fac
cmpl $0x0, 0x90(%rsp)
jg 0x2fac
testb %al, %al
je 0x2c7b
movq %r14, (%rsp)
movq %r12, 0xb8(%rsp)
cmpq $0x0, 0xc0(%rsp)
jne 0x2bc1
movq %r12, 0xc0(%rsp)
movq %r13, %r14
andq $0x0, 0x70(%rsp)
andq $0x0, 0xd8(%rsp)
andq $0x0, 0xc8(%rsp)
cmpb $0x1, 0x7d(%rsp)
jne 0x2bed
leaq 0x40(%rsp), %rdi
callq 0x37cc
callq 0x20d0
xorl %edi, %edi
callq 0x2200
leaq 0x40(%rsp), %r15
movl 0x20(%r15), %r13d
callq 0xbc94
movq %rax, %rbx
callq 0xbc8c
leaq 0xabe1(%rip), %rdi      # 0xd7f7
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 0xc3b4
cmpb $0x1, 0x72(%r15)
jne 0x2c8c
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rsi
movq (%rax), %rdi
callq 0x2290
testl %eax, %eax
movq %r14, %r13
movq (%rsp), %r14
je 0x2d61
leaq 0xabbc(%rip), %rdi      # 0xd82d
callq 0x35b7
jmp 0x2d61
leaq 0xab2f(%rip), %rdi      # 0xd7b1
callq 0x2090
jmp 0x2dcf
cmpb $0x0, 0xa9(%rsp)
movq %r14, %r13
movq (%rsp), %r14
jne 0x2d61
cmpl $0x2, 0xd4(%rsp)
jl 0x2cb7
leaq 0xac57(%rip), %rdi      # 0xd909
callq 0x2090
leaq 0xac66(%rip), %rax      # 0xd924
leaq 0xac65(%rip), %r8       # 0xd92a
testb $0x1, %bpl
cmovneq %rax, %r8
leaq 0xac4a(%rip), %rdx      # 0xd91e
leaq 0x5160(%rsp), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2140
leaq 0xac39(%rip), %rsi      # 0xd92e
movq %rbx, %rdi
callq 0x21e0
movq %rax, %r15
testq %rax, %rax
jne 0x2d11
leaq 0xac25(%rip), %rdi      # 0xd931
callq 0x35b7
movq 0x40(%rsp), %rax
movq 0x68(%rsp), %rdx
movq (%rax), %rdi
pushq $0x1
popq %rsi
movq %r15, %rcx
callq 0x2390
cmpq 0x68(%rsp), %rax
je 0x2d3c
leaq 0xac09(%rip), %rdi      # 0xd940
callq 0x35b7
movq %r15, %rdi
callq 0x20e0
testl %eax, %eax
je 0x2d54
leaq 0xabe2(%rip), %rdi      # 0xd931
callq 0x35b7
movq 0x40(%rsp), %rax
movq (%rax), %rdi
callq 0xbdb4
movq 0x40(%rsp), %rdi
callq 0xbdb4
cmpb $0x1, 0xa8(%rsp)
jne 0x2d8c
movq 0x58(%rsp), %rax
movq (%rax), %rdi
callq 0xbdb4
movq 0x58(%rsp), %rdi
callq 0xbdb4
movq 0x48(%rsp), %rdi
callq 0xbdb4
cmpb $0x1, 0x7d(%rsp)
jne 0x2dcf
movq 0x68(%rsp), %rsi
movq 0xc8(%rsp), %rax
movq (%rax), %rdi
callq 0x2290
testl %eax, %eax
je 0x2dc2
leaq 0xaa81(%rip), %rdi      # 0xd83e
callq 0x35b7
movq 0xc8(%rsp), %rdi
callq 0xbdb4
callq 0x20d0
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0xa224(%rip), %xmm0     # 0xd008
movsd %xmm0, 0x10(%rsp)
xorl %edi, %edi
callq 0x2200
movq %rax, %rdi
movq %r13, %rsi
callq 0x2110
movsd %xmm0, (%rsp)
leaq 0xabc8(%rip), %rbx      # 0xd9d0
movq %rbx, %rdi
callq 0x2090
leaq 0xaa39(%rip), %rdi      # 0xd850
movsd (%rsp), %xmm0
movb $0x1, %al
callq 0x2100
leaq 0xaa40(%rip), %rdi      # 0xd86a
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x2100
movq %rbx, %rdi
callq 0x2090
movq 0x68(%rsp), %rsi
leaq 0xaa3b(%rip), %rdi      # 0xd886
xorl %eax, %eax
callq 0x2100
movl 0x78(%rsp), %esi
leaq 0xaa41(%rip), %rdi      # 0xd89e
xorl %eax, %eax
callq 0x2100
movq %rbx, %rdi
callq 0x2090
movsd (%rsp), %xmm2
mulsd 0xa18f(%rip), %xmm2     # 0xd008
movsd 0x68(%rsp), %xmm0
unpcklps 0xa18a(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa192(%rip), %xmm0     # 0xd020
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd %xmm1, %xmm2
movapd %xmm2, %xmm0
leaq 0xaa09(%rip), %rdi      # 0xd8b2
movb $0x1, %al
callq 0x2100
callq 0xbc94
movq %rax, %r14
callq 0xbc94
movq %rax, %xmm1
movq 0xa146(%rip), %xmm2     # 0xd010
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xa14a(%rip), %xmm3     # 0xd020
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 0xa9c7(%rip), %rdi      # 0xd8d2
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 0x24fc
pushq $0x1
popq %rdi
callq 0x2380
leaq 0xab8d(%rip), %rdi      # 0xdada
jmp 0x2fb3
leaq 0xab25(%rip), %rdi      # 0xda7b
jmp 0x2fb3
leaq 0xa66c(%rip), %rdi      # 0xd5cb
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x2100
jmp 0x2f3e
leaq 0xab37(%rip), %rdi      # 0xdaab
jmp 0x2fb3
leaq 0xaaca(%rip), %rdi      # 0xda47
jmp 0x2fb3
leaq 0xaa92(%rip), %rdi      # 0xda18
jmp 0x2fb3
leaq 0xaa03(%rip), %rdi      # 0xd992
jmp 0x2fb3
leaq 0xaa5a(%rip), %rdi      # 0xd9f2
jmp 0x2fb3
leaq 0xaa32(%rip), %rdi      # 0xd9d3
jmp 0x2fb3
leaq 0xa788(%rip), %rdi      # 0xd732
jmp 0x2fb3
leaq 0xa7bc(%rip), %rdi      # 0xd76f
callq 0x2090
jmp 0x2f3e
nop