// File: /workspace/github_c_makefile_star2_O0/ryancdotorg[P]bloomslice/bfstool.c
// Function: main
int main(int argc, char **argv) {
  hash160_t hash;
  FILE *ifile = stdin, *ofile = stdout;
  FILE *dfile = NULL, *hfile = NULL, *bfile = NULL, *ffile = NULL, *rfile = NULL;

  mmapf_ctx bloom_mmapf, reference_mmapf, diff_mmapf;
  struct stat sb;

  uint8_t kopt = 0;
  uint8_t wopt = DEFAULT_MAX_BIT_WIDTH;
  double sopt = DEFAULT_MAX_SATURATION;
  double eopt = DEFAULT_MAX_ERROR_RATE;

  unsigned char *bopt = NULL, *xopt = NULL, *ropt = NULL;
  unsigned char *dopt = NULL, *iopt = NULL, *oopt = NULL;

  char mode = 0;
  char hfmt = 0;

  unsigned char *bloom;

  char *line = NULL;
  size_t line_sz = 0;

  unsigned char buf[41];

  double pct, err_rate, sat;
  uint64_t mask = 0, bloom_size = 0, i, items;
  uint8_t h = 254;

  int c, r;

  while ((c = getopt(argc, argv, "hABHWRDPb:x:d:r:f:i:o:w:k:e:s:")) != -1) {
    switch (c) {
      case 'A':
        for (int i = 0; i < 256; ++i) {
          printf("%3u: %8s        ", i, bloom_deschash(i));
          if (i % 4 == 3) printf("\n");
        }
        return 0;
      case 'W':
      case 'R':
      case 'D':
      case 'P':
        if (mode) bail(1, "[!] Mode '%c' already selected, can't also specify '%c'\n", mode, c);
        mode = c; break;
      case 'H':
      case 'B':
        if (hfmt) bail(1, "[!] Format '%c' already selected, can't also specify '%c'\n", hfmt, c);
        hfmt = c; break;
      case 'b':
        bopt = optarg; break;
      case 'x':
        xopt = optarg; break;
      case 'r':
        ropt = optarg; break;
      case 'd':
        dopt = optarg; break;
      case 'i':
        iopt = optarg; break;
      case 'o':
        oopt = optarg; break;
      case 'w':
        wopt = atoi(optarg); break;
      case 'k':
        kopt = atoi(optarg); break;
      case 'e':
        eopt = atof(optarg); break;
      case 's':
        sopt = atof(optarg); break;
      case 'h':
        // show help
        usage(argv[0]);
        return 0;
      case '?':
        // show error
        return 1;
      default:
        // should never be reached...
        printf("got option '%c' (%d)\n", c, c);
        return 1;
    }
  }

  if (mode == 'W') {
    // #####################
    // ##                 ##
    // ##   CREATE MODE   ##
    // ##                 ##
    // #####################
    if (!bopt) bail(1, "[!] Bloom filter file must be specified with '-b'\n");
    if (!xopt) bail(1, "[!] Hash file must be specified with '-x'\n");
    if (dopt || ropt || iopt || oopt) {
      bail(1, "[!] Invalid combination of file options for create mode\n");
    }

    // manually specified number of hashes
    if (kopt) {
      fprintf(stderr, "bloom_pick_hash_wk w:%u k:%u\n", wopt, kopt);
      if ((h = bloom_pick_hash_wk(wopt, kopt)) == 255) {
        bail(1, "[!] No hash routine found for specified parameters\n");
      }
    }

    // open input hash file
    if ((hfile = fopen(xopt, "r")) == NULL) {
      bail(1, "[!] Failed to open hash file '%s': %s\n", xopt, strerror(errno));
    }
    if ((r = fstat(fileno(hfile), &sb)) != 0) {
      bail(1, "[!] Failed to stat hash file '%s': %s\n", xopt, strerror(errno));
    }
    if ((sb.st_size % 20) && (sb.st_size % 41)) {
      bail(1, "[!] Hash file '%s' is not a valid size\n", xopt);
    }
    if (hfmt == 0) {
      if (!(sb.st_size % 20) != !(sb.st_size % 41)) {
        hfmt = !(sb.st_size % 20) ? 'B' : 'H';
        fprintf(stderr, "[*] Auto-detected hash format %c by size\n", hfmt);
      } else {
        if ((hfmt = hash_file_type(hfile)) < 0) {
          bail(1, "[!] fgetc/ungetc failed on hash file\n");
        }
        if (hfmt == 0) {
          bail(1, "[!] Unable to determine type of hash file, please specify -B or -H\n");
        }
        fprintf(stderr, "[*] Auto-detected hash format %c by content\n", hfmt);
      }
    }

    items = sb.st_size / (hfmt == 'H' ? 41 : 20);

    fprintf(stderr, "defaults h:%u w:%u\n", h, wopt);
    // if a hash routine still hasn't been chosen, pick one now
    if (items == 0) {
      bail(1, "[!] No hashes to load\n");
    } else if (items == 1) {
      bloom_size = bloom_width_to_size(BFS_TYPE_SINGLE);
      h = BFS_TYPE_SINGLE;
    } else if (h >= 254) {
      if (eopt < 0) {
        fprintf(stderr, "bloom_pick_hash_wi w:%u i:%lu\n", wopt, items);
        if ((h = bloom_pick_hash_wi(wopt, items, &kopt)) >= 254) {
          bail(1, "[!] No hash routine found for specified parameters\n");
        }
      } else {
        fprintf(stderr, "bloom_pick_hash_es e:%.3e s:%.3f i:%lu w:%u k:%u\n", eopt, sopt, items, wopt, kopt);
        if ((h = bloom_pick_hash_es(eopt, sopt, items, &wopt, &kopt)) >= 254) {
          bail(1, "[!] No hash routine found for specified parameters\n");
        }
      }
    }

    if (bloom_size == 0 && (bloom_size = bloom_width_to_size(wopt)) == 0) {
      bail(1, "[!] Failed to compute bloom filter file size (bug?)\n");
    }

    if (stat(bopt, &sb) == 0) {
      bail(1, "[!] Bloom filter file '%s' already exists\n", bopt);
    } else {
      if ((r = open64(bopt, O_RDWR|O_CREAT|O_EXCL, 0644)) < 0) {
        bail(1, "[!] Failed to create bloom filter file '%s': %s\n", bopt, strerror(errno));
      } else if ((bfile = fdopen(r, "w+")) == NULL) {
        bail(1, "[!] Failed fdopen on bloom filter file descriptor\n");
      }
    }

    fprintf(stderr, "parameters h:%u w:%u k:%u i:%lu\n", h, wopt, kopt, items);
    mask = bloom_width_to_mask(wopt);
    sat = bloom_saturation(kopt, 1ULL<<wopt, items);
    err_rate = pow(sat, kopt);

    fprintf(stderr, "[*] Selected function %s (%u) with mask 0x%zx\n", bloom_deschash(h), h, mask);
    fprintf(stderr, "[*] Have %zu hashes to load into %zu bit filter (%zu bytes)\n", items, (bloom_size - 9) * 8, bloom_size);
    if (items > 0) {
      fprintf(stderr, "[*] Saturation: ~%.3f\n", sat);
      fprintf(stderr, "[*] False positive rate: ~%.3e (1 in ~%.3e)\n", err_rate, 1/err_rate);
    }

    bloom = chkmalloc(bloom_size);
    fprintf(stderr, "[*] Zeroing memory...\n");
    memset(bloom, 0, bloom_size);

    fprintf(stderr, "[*] Loading hash160s from '%s'   0.0%%", xopt);
    for (i = 0; i < items; ++i) {
      if (hfmt == 'H') {
        if ((r = fread(buf, 41, 1, hfile)) != 1) {
          bail(1, "[!] Error reading hex hashes\n");
        }
        unhex(buf, 40, hash.uc, sizeof(hash.uc));
      } else { // hfmt == 'B'
        if ((r = fread(hash.uc, 20, 1, hfile)) != 1) {
          bail(1, "[!] Error reading binary hashes\n");
        }
      }

      bloom_h160_set(bloom, hash.uc, h, mask);

      if ((i & 0x7ffff) == 0) {
        pct = 100.0 * i / items;
        fprintf(stderr, "\033[7D %5.1f%%", pct);
        fflush(stderr);
      }
    }

    fprintf(stderr, "\033[7D 100.0%%\n");

    bloom_set_hash(bloom, bloom_size, h);
    bloom_set_items(bloom, bloom_size, items);

    fprintf(stderr, "[*] Writing bloom filter to '%s'...\n", bopt);
    if (fwrite(bloom, bloom_size, 1, bfile) != 1) {
      bail(1, "[!] Failed to write bloom filter file '%s'\n", bopt);
    }
    fprintf(stderr, "[+] Success!\n");

    return 0;
  } else if (mode == 'R') {
    // ####################
    // ##                ##
    // ##   CHECK MODE   ##
    // ##                ##
    // ####################
    if (!bopt) bail(1, "[!] Bloom filter file must be specified with '-b'\n");
    if (dopt || xopt || ropt) {
      bail(1, "[!] Invalid combination of file options for check mode\n");
    }
    if (iopt && (ifile = fopen(iopt, "r")) == NULL) {
      bail(1, "[!] Failed to open input file '%s': %s\n", iopt, strerror(errno));
    }

    if (stat(bopt, &sb) == 0) {
      if (!S_ISREG(sb.st_mode)) {
        bail(1, "[!] Bloom filter file '%s' is not a regular file\n", bopt);
      }
      bloom_size = sb.st_size;
      if (!bloom_chk_size(bloom_size)) {
        bail(1, "[!] Bloom filter file '%s' is not a valid size\n", bopt);
      }
    } else {
      bail(1, "[!] Failed to stat '%s': %s\n", bopt, strerror(errno));
    }

    if ((r = mmapf(&bloom_mmapf, bopt, bloom_size, MMAPF_RNDRD)) != MMAPF_OKAY) {
      bail(1, "[!] Failed to open bloom filter '%s': %s\n", bopt, mmapf_strerror(r));
    } else if (bloom_mmapf.mem == NULL) {
      bail(1, "[!] Got NULL pointer trying to set up bloom filter\n");
    }

    bloom = bloom_mmapf.mem;
    h = bloom_get_hash(bloom, bloom_size);

    mask = bloom_size_to_mask(sb.st_size); // h == BFS_TYPE_SINGLE ? 0 : ((sb.st_size<<3ULL) & 0xffffffffff00)-1;
    //items = bloom_get_items(bloom, bloom_size);

    fprintf(stderr, "[*] Using function %s (0x%02x) with mask 0x%zx\n", bloom_deschash(h), h, mask);

    while ((r = getline(&line, &line_sz, ifile)) > 0) {
      if (r > 40) {
        unhex(line, 40, hash.uc, sizeof(hash.uc));
        if (bloom_h160_chk(bloom, hash.ul, h, mask)) {
          fprintf(ofile, "%s", line);
        }
      }
    }
  } else if (mode == 'D') {
    // ###################
    // ##               ##
    // ##   DIFF MODE   ##
    // ##               ##
    // ###################
    if (!ropt) bail(1, "[!] Old bloom filter file must be specified with '-r'\n");
    if (!bopt) bail(1, "[!] New bloom filter file must be specified with '-b'\n");
    if (!dopt) bail(1, "[!] Bloom filter diff file must be specified with '-d'\n");
    if (xopt) {
      bail(1, "[!] Invalid combination of file options for diff mode\n");
    }

    if (stat(bopt, &sb) == 0) {
      if (!S_ISREG(sb.st_mode)) {
        bail(1, "[!] Bloom filter file '%s' is not a regular file\n", bopt);
      }
      if (!bloom_chk_size(sb.st_size)) {
        bail(1, "[!] Bloom filter file '%s' is not a valid size\n", bopt);
      }
    } else {
      bail(1, "[!] Failed to stat '%s': %s\n", bopt, strerror(errno));
    }

    if ((r = mmapf(&bloom_mmapf, bopt, sb.st_size, MMAPF_SEQRD)) != MMAPF_OKAY) {
      bail(1, "[!] Failed to open bloom filter '%s': %s\n", bopt, mmapf_strerror(r));
    } else if (bloom_mmapf.mem == NULL) {
      bail(1, "[!] Got NULL pointer trying to set up bloom filter '%s'\n", bopt);
    }

    if (stat(ropt, &sb) == 0) {
      if (!S_ISREG(sb.st_mode)) {
        bail(1, "[!] Bloom filter file '%s' is not a regular file\n", ropt);
      }
      if (!bloom_chk_size(sb.st_size)) {
        bail(1, "[!] Bloom filter file '%s' is not a valid size\n", ropt);
      }
    } else {
      bail(1, "[!] Failed to stat '%s': %s\n", ropt, strerror(errno));
    }

    if ((r = mmapf(&reference_mmapf, ropt, sb.st_size, MMAPF_SEQRD)) != MMAPF_OKAY) {
      bail(1, "[!] Failed to open bloom filter '%s': %s\n", ropt, mmapf_strerror(r));
    } else if (reference_mmapf.mem == NULL) {
      bail(1, "[!] Got NULL pointer trying to set up bloom filter '%s'\n", ropt);
    }

    if (bloom_mmapf.file_sz != reference_mmapf.file_sz) {
      bail(1, "[!] Old and new bloom filter files are different sizes!\n");
    }

    if ((r = mmapf(&diff_mmapf, dopt, bloom_mmapf.file_sz, MMAPF_SEQCR)) != MMAPF_OKAY) {
      bail(1, "[!] Failed to open bloom filter diff '%s': %s\n", dopt, mmapf_strerror(r));
    } else if (diff_mmapf.mem == NULL) {
      bail(1, "[!] Got NULL pointer trying to set up bloom filter diff '%s'\n", ropt);
    }

    fprintf(stderr, "[*] Generating diff between '%s' and '%s'   0.0%%", ropt, bopt);
    for (int i = 0; i < bloom_mmapf.file_sz; ++i) {
      ((unsigned char *)diff_mmapf.mem)[i] = ((unsigned char *)reference_mmapf.mem)[i] ^ ((unsigned char *)bloom_mmapf.mem)[i];
      if ((i & 0x7ffff) == 0) {
        pct = 100.0 * i / bloom_mmapf.file_sz;
        fprintf(stderr, "\033[7D %5.1f%%", pct);
        fflush(stderr);
      }
    }
    fprintf(stderr, "\033[7D 100.0%%\n");
  } else if (mode == 'P') {
    // ####################
    // ##                ##
    // ##   PATCH MODE   ##
    // ##                ##
    // ####################
    if (!ropt) bail(1, "[!] Old bloom filter file must be specified with '-r'\n");
    if (!bopt) bail(1, "[!] New bloom filter file must be specified with '-b'\n");
    if (!dopt) bail(1, "[!] Bloom filter diff file must be specified with '-d'\n");
    if (xopt) {
      bail(1, "[!] Invalid combination of file options for diff mode\n");
    }
  } else {
    bail(1, "[!] No valid mode selected\n");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x320, %rsp            # imm = 0x320
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0xcb80(%rip), %rax      # 0xdfd0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq 0xcb6a(%rip), %rax      # 0xdfc8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x151(%rbp)
movb $0x23, -0x152(%rbp)
movsd 0x9b6d(%rip), %xmm0     # 0xb010
movsd %xmm0, -0x160(%rbp)
movsd 0x9b55(%rip), %xmm0     # 0xb008
movsd %xmm0, -0x168(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x180(%rbp)
movq $0x0, -0x188(%rbp)
movq $0x0, -0x190(%rbp)
movq $0x0, -0x198(%rbp)
movb $0x0, -0x199(%rbp)
movb $0x0, -0x19a(%rbp)
movq $0x0, -0x1b0(%rbp)
movq $0x0, -0x1b8(%rbp)
movq $0x0, -0x210(%rbp)
movq $0x0, -0x218(%rbp)
movb $-0x2, -0x229(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x9e0c(%rip), %rdx      # 0xb358
callq 0x1210
movl %eax, -0x230(%rbp)
cmpl $-0x1, %eax
je 0x17e5
movl -0x230(%rbp), %eax
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x248(%rbp)
subl $0x39, %eax
ja 0x17ba
movq -0x248(%rbp), %rax
leaq 0x9ac7(%rip), %rcx      # 0xb050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x238(%rbp)
cmpl $0x100, -0x238(%rbp)    # imm = 0x100
jge 0x160d
movl -0x238(%rbp), %eax
movl %eax, -0x24c(%rbp)
movl -0x238(%rbp), %eax
movzbl %al, %edi
callq 0x9100
movl -0x24c(%rbp), %esi
movq %rax, %rdx
leaq 0x9da5(%rip), %rdi      # 0xb377
movb $0x0, %al
callq 0x10b0
movl -0x238(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x3, %edx
jne 0x15fa
leaq 0x9d63(%rip), %rdi      # 0xb356
movb $0x0, %al
callq 0x10b0
jmp 0x15fc
movl -0x238(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x238(%rbp)
jmp 0x159c
movl $0x0, -0x4(%rbp)
jmp 0x2dd9
cmpb $0x0, -0x199(%rbp)
je 0x1653
jmp 0x1624
movq 0xc9cd(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsbl -0x199(%rbp), %edx
movl -0x230(%rbp), %ecx
leaq 0x9d46(%rip), %rsi      # 0xb388
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movl -0x230(%rbp), %eax
movb %al, -0x199(%rbp)
jmp 0x17e0
cmpb $0x0, -0x19a(%rbp)
je 0x169e
jmp 0x166f
movq 0xc982(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsbl -0x19a(%rbp), %edx
movl -0x230(%rbp), %ecx
leaq 0x9d34(%rip), %rsi      # 0xb3c1
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movl -0x230(%rbp), %eax
movb %al, -0x19a(%rbp)
jmp 0x17e0
movq 0xc922(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x170(%rbp)
jmp 0x17e0
movq 0xc90c(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x178(%rbp)
jmp 0x17e0
movq 0xc8f6(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x180(%rbp)
jmp 0x17e0
movq 0xc8e0(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x188(%rbp)
jmp 0x17e0
movq 0xc8ca(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x190(%rbp)
jmp 0x17e0
movq 0xc8b4(%rip), %rax      # 0xdfd8
movq (%rax), %rax
movq %rax, -0x198(%rbp)
jmp 0x17e0
movq 0xc89e(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x1230
movb %al, -0x152(%rbp)
jmp 0x17e0
movq 0xc884(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x1230
movb %al, -0x151(%rbp)
jmp 0x17e0
movq 0xc86d(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x1060
movsd %xmm0, -0x168(%rbp)
jmp 0x17e0
movq 0xc854(%rip), %rax      # 0xdfd8
movq (%rax), %rdi
callq 0x1060
movsd %xmm0, -0x160(%rbp)
jmp 0x17e0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x1400
movl $0x0, -0x4(%rbp)
jmp 0x2dd9
movl $0x1, -0x4(%rbp)
jmp 0x2dd9
movl -0x230(%rbp), %esi
movl -0x230(%rbp), %edx
leaq 0x9c2f(%rip), %rdi      # 0xb3fc
movb $0x0, %al
callq 0x10b0
movl $0x1, -0x4(%rbp)
jmp 0x2dd9
jmp 0x153e
movsbl -0x199(%rbp), %eax
cmpl $0x57, %eax
jne 0x2327
cmpq $0x0, -0x170(%rbp)
jne 0x1823
jmp 0x1801
movq 0xc7f0(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9c00(%rip), %rsi      # 0xb412
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x178(%rbp)
jne 0x1851
jmp 0x182f
movq 0xc7c2(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9c05(%rip), %rsi      # 0xb445
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x188(%rbp)
jne 0x1879
cmpq $0x0, -0x180(%rbp)
jne 0x1879
cmpq $0x0, -0x190(%rbp)
jne 0x1879
cmpq $0x0, -0x198(%rbp)
je 0x189d
jmp 0x187b
movq 0xc776(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9be4(%rip), %rsi      # 0xb470
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpb $0x0, -0x151(%rbp)
je 0x1917
movq 0xc74b(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl -0x152(%rbp), %edx
movzbl -0x151(%rbp), %ecx
leaq 0x9be4(%rip), %rsi      # 0xb4a9
movb $0x0, %al
callq 0x1130
movb -0x152(%rbp), %al
movzbl %al, %edi
movzbl -0x151(%rbp), %esi
callq 0x93c0
movb %al, -0x229(%rbp)
movzbl %al, %eax
cmpl $0xff, %eax
jne 0x1915
jmp 0x18f3
movq 0xc6fe(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9bc3(%rip), %rsi      # 0xb4c7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x1917
movq -0x178(%rbp), %rdi
leaq 0xa804(%rip), %rsi      # 0xc129
callq 0x11f0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0x198a
jmp 0x1936
movq 0xc6bb(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x260(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x258(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x260(%rbp), %rdi
movq -0x258(%rbp), %rdx
movq %rax, %rcx
leaq 0x9b82(%rip), %rsi      # 0xb4fb
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x48(%rbp), %rdi
callq 0x1160
movl %eax, %edi
leaq -0x150(%rbp), %rsi
callq 0x1280
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
je 0x1a02
jmp 0x19ae
movq 0xc643(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x270(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x268(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x270(%rbp), %rdi
movq -0x268(%rbp), %rdx
movq %rax, %rcx
leaq 0x9b31(%rip), %rsi      # 0xb522
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x120(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x1a5b
movq -0x120(%rbp), %rax
movl $0x29, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0x1a5b
jmp 0x1a32
movq 0xc5bf(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x178(%rbp), %rdx
leaq 0x9aff(%rip), %rsi      # 0xb549
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movsbl -0x19a(%rbp), %eax
cmpl $0x0, %eax
jne 0x1b9c
movq -0x120(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x274(%rbp)
movq -0x120(%rbp), %rax
movl $0x29, %ecx
cqto
idivq %rcx
movl -0x274(%rbp), %eax
cmpq $0x0, %rdx
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x1b10
movq -0x120(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
setne %dl
xorb $-0x1, %dl
movl $0x48, %eax
movl $0x42, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movb %al, -0x19a(%rbp)
movq 0xc505(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsbl -0x19a(%rbp), %edx
leaq 0x9a6d(%rip), %rsi      # 0xb571
movb $0x0, %al
callq 0x1130
jmp 0x1b9a
movq -0x48(%rbp), %rdi
callq 0x1390
movb %al, -0x19a(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
jge 0x1b4b
jmp 0x1b29
movq 0xc4c8(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9a61(%rip), %rsi      # 0xb59b
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movsbl -0x19a(%rbp), %eax
cmpl $0x0, %eax
jne 0x1b7b
jmp 0x1b59
movq 0xc498(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9a57(%rip), %rsi      # 0xb5c1
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq 0xc476(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsbl -0x19a(%rbp), %edx
leaq 0x9a72(%rip), %rsi      # 0xb605
movb $0x0, %al
callq 0x1130
jmp 0x1b9c
movq -0x120(%rbp), %rax
movsbl -0x19a(%rbp), %esi
movl $0x14, %ecx
movl $0x29, %edx
cmpl $0x48, %esi
cmovel %edx, %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movq %rax, -0x228(%rbp)
movq 0xc428(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl -0x229(%rbp), %edx
movzbl -0x152(%rbp), %ecx
leaq 0x9a4a(%rip), %rsi      # 0xb632
movb $0x0, %al
callq 0x1130
cmpq $0x0, -0x228(%rbp)
jne 0x1c1d
jmp 0x1bfb
movq 0xc3f6(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9a3a(%rip), %rsi      # 0xb646
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x1, -0x228(%rbp)
jne 0x1c44
movl $0x1, %edi
callq 0x9120
movq %rax, -0x218(%rbp)
movb $0x1, -0x229(%rbp)
jmp 0x1d80
movzbl -0x229(%rbp), %eax
cmpl $0xfe, %eax
jl 0x1d7e
xorps %xmm0, %xmm0
ucomisd -0x168(%rbp), %xmm0
jbe 0x1cde
movq 0xc38e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl -0x152(%rbp), %edx
movq -0x228(%rbp), %rcx
leaq 0x99db(%rip), %rsi      # 0xb65d
movb $0x0, %al
callq 0x1130
movb -0x152(%rbp), %al
movq -0x228(%rbp), %rsi
leaq -0x151(%rbp), %rdx
movzbl %al, %edi
callq 0x9510
movb %al, -0x229(%rbp)
movzbl %al, %eax
cmpl $0xfe, %eax
jl 0x1cd9
jmp 0x1cb7
movq 0xc33a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x97ff(%rip), %rsi      # 0xb4c7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x1d7c
movq 0xc313(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsd -0x168(%rbp), %xmm0
movsd -0x160(%rbp), %xmm1
movq -0x228(%rbp), %rdx
movzbl -0x152(%rbp), %ecx
movzbl -0x151(%rbp), %r8d
leaq 0x9967(%rip), %rsi      # 0xb67c
movb $0x2, %al
callq 0x1130
movsd -0x168(%rbp), %xmm0
movsd -0x160(%rbp), %xmm1
movq -0x228(%rbp), %rdi
leaq -0x152(%rbp), %rsi
leaq -0x151(%rbp), %rdx
callq 0x97f0
movb %al, -0x229(%rbp)
movzbl %al, %eax
cmpl $0xfe, %eax
jl 0x1d7a
jmp 0x1d58
movq 0xc299(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x975e(%rip), %rsi      # 0xb4c7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x1d7c
jmp 0x1d7e
jmp 0x1d80
jmp 0x1d82
cmpq $0x0, -0x218(%rbp)
jne 0x1dc9
movzbl -0x152(%rbp), %edi
callq 0x9120
movq %rax, -0x218(%rbp)
cmpq $0x0, %rax
jne 0x1dc9
jmp 0x1da7
movq 0xc24a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x98f6(%rip), %rsi      # 0xb6ae
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1140
cmpl $0x0, %eax
jne 0x1e0c
jmp 0x1de3
movq 0xc20e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x98e8(%rip), %rsi      # 0xb6e3
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rdi
movl $0xc2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x11d0
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
jge 0x1e85
jmp 0x1e31
movq 0xc1c0(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x288(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x280(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x288(%rbp), %rdi
movq -0x280(%rbp), %rdx
movq %rax, %rcx
leaq 0x989a(%rip), %rsi      # 0xb70e
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movl -0x234(%rbp), %edi
leaq 0x98ad(%rip), %rsi      # 0xb73f
callq 0x11a0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x1ec5
jmp 0x1ea3
movq 0xc14e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x988e(%rip), %rsi      # 0xb742
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x1ec7
jmp 0x1ec9
movq 0xc128(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movzbl -0x229(%rbp), %edx
movzbl -0x152(%rbp), %ecx
movzbl -0x151(%rbp), %r8d
movq -0x228(%rbp), %r9
leaq 0x987e(%rip), %rsi      # 0xb775
xorl %eax, %eax
callq 0x1130
movzbl -0x152(%rbp), %edi
callq 0x9190
movq %rax, -0x210(%rbp)
movzbl -0x151(%rbp), %edi
movb -0x152(%rbp), %cl
movl $0x1, %esi
shlq %cl, %rsi
movq -0x228(%rbp), %rdx
callq 0x9070
movsd %xmm0, -0x208(%rbp)
movsd -0x208(%rbp), %xmm0
movzbl -0x151(%rbp), %eax
cvtsi2sd %eax, %xmm1
callq 0x1080
movsd %xmm0, -0x200(%rbp)
movq 0xc097(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x290(%rbp)
movzbl -0x229(%rbp), %edi
callq 0x9100
movq -0x290(%rbp), %rdi
movq %rax, %rdx
movzbl -0x229(%rbp), %ecx
movq -0x210(%rbp), %r8
leaq 0x9800(%rip), %rsi      # 0xb796
movb $0x0, %al
callq 0x1130
movq 0xc054(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x228(%rbp), %rdx
movq -0x218(%rbp), %rcx
subq $0x9, %rcx
shlq $0x3, %rcx
movq -0x218(%rbp), %r8
leaq 0x97fa(%rip), %rsi      # 0xb7c5
movb $0x0, %al
callq 0x1130
cmpq $0x0, -0x228(%rbp)
jbe 0x202c
movq 0xc015(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsd -0x208(%rbp), %xmm0
leaq 0x980d(%rip), %rsi      # 0xb802
movb $0x1, %al
callq 0x1130
movq 0xbff5(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsd -0x200(%rbp), %xmm0
movsd 0x900a(%rip), %xmm1     # 0xb020
divsd -0x200(%rbp), %xmm1
leaq 0x97f4(%rip), %rsi      # 0xb819
movb $0x2, %al
callq 0x1130
movq -0x218(%rbp), %rdi
leaq 0x980c(%rip), %rsi      # 0xb846
movl $0x110, %edx            # imm = 0x110
callq 0x2df0
movq %rax, -0x1a8(%rbp)
movq 0xbfa6(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x97f4(%rip), %rsi      # 0xb850
movb $0x0, %al
callq 0x1130
movq -0x1a8(%rbp), %rdi
movq -0x218(%rbp), %rdx
xorl %esi, %esi
callq 0x10d0
movq 0xbf79(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x178(%rbp), %rdx
leaq 0x97d7(%rip), %rsi      # 0xb867
movb $0x0, %al
callq 0x1130
movq $0x0, -0x220(%rbp)
movq -0x220(%rbp), %rax
cmpq -0x228(%rbp), %rax
jae 0x224b
movsbl -0x19a(%rbp), %eax
cmpl $0x48, %eax
jne 0x2127
leaq -0x1f0(%rbp), %rdi
movq -0x48(%rbp), %rcx
movl $0x29, %esi
movl $0x1, %edx
callq 0x1050
movl %eax, -0x234(%rbp)
cmpl $0x1, %eax
je 0x210b
jmp 0x20e9
movq 0xbf08(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9794(%rip), %rsi      # 0xb88e
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
leaq -0x1f0(%rbp), %rdi
leaq -0x24(%rbp), %rdx
movl $0x28, %esi
movl $0x14, %ecx
callq 0x2e80
jmp 0x216f
leaq -0x24(%rbp), %rdi
movq -0x48(%rbp), %rcx
movl $0x14, %esi
movl $0x1, %edx
callq 0x1050
movl %eax, -0x234(%rbp)
cmpl $0x1, %eax
je 0x216d
jmp 0x214b
movq 0xbea6(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9750(%rip), %rsi      # 0xb8ac
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x216f
movq -0x1a8(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movb -0x229(%rbp), %al
movq -0x210(%rbp), %rcx
movzbl %al, %edx
callq 0x8680
movq -0x220(%rbp), %rax
andq $0x7ffff, %rax          # imm = 0x7FFFF
cmpq $0x0, %rax
jne 0x2232
movq -0x220(%rbp), %xmm0
movaps 0x8e7b(%rip), %xmm3     # 0xb030
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x8e7f(%rip), %xmm2     # 0xb040
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x8e40(%rip), %xmm1     # 0xb018
mulsd %xmm1, %xmm0
movq -0x228(%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
movsd %xmm0, -0x1f8(%rbp)
movq 0xbdee(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsd -0x1f8(%rbp), %xmm0
leaq 0x96b1(%rip), %rsi      # 0xb8cd
movb $0x1, %al
callq 0x1130
movq 0xbdce(%rip), %rax      # 0xdff8
movq (%rax), %rdi
callq 0x1180
jmp 0x2234
movq -0x220(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x220(%rbp)
jmp 0x20a2
movq 0xbda6(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x967e(%rip), %rsi      # 0xb8da
movb $0x0, %al
callq 0x1130
movq -0x1a8(%rbp), %rdi
movq -0x218(%rbp), %rsi
movzbl -0x229(%rbp), %edx
callq 0x9320
movq -0x1a8(%rbp), %rdi
movq -0x218(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x9390
movq 0xbd5a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x9639(%rip), %rsi      # 0xb8e8
movb $0x0, %al
callq 0x1130
movq -0x1a8(%rbp), %rdi
movq -0x218(%rbp), %rsi
movq -0x50(%rbp), %rcx
movl $0x1, %edx
callq 0x1260
cmpq $0x1, %rax
je 0x2303
jmp 0x22da
movq 0xbd17(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x961b(%rip), %rsi      # 0xb90d
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq 0xbcee(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x9625(%rip), %rsi      # 0xb939
movb $0x0, %al
callq 0x1130
movl $0x0, -0x4(%rbp)
jmp 0x2dd9
movsbl -0x199(%rbp), %eax
cmpl $0x52, %eax
jne 0x26d1
cmpq $0x0, -0x170(%rbp)
jne 0x2365
jmp 0x2343
movq 0xbcae(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x90be(%rip), %rsi      # 0xb412
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x188(%rbp)
jne 0x2383
cmpq $0x0, -0x178(%rbp)
jne 0x2383
cmpq $0x0, -0x180(%rbp)
je 0x23a7
jmp 0x2385
movq 0xbc6c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x95b1(%rip), %rsi      # 0xb947
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x190(%rbp)
je 0x2424
movq -0x190(%rbp), %rdi
leaq 0x9d6a(%rip), %rsi      # 0xc129
callq 0x11f0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x2424
jmp 0x23d0
movq 0xbc21(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2a0(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x298(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x2a0(%rbp), %rdi
movq -0x298(%rbp), %rdx
movq %rax, %rcx
leaq 0x956c(%rip), %rsi      # 0xb97f
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1140
cmpl $0x0, %eax
jne 0x24c9
movl -0x138(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x247d
jmp 0x2454
movq 0xbb9d(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x953b(%rip), %rsi      # 0xb9a7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x120(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rdi
callq 0x9270
cmpl $0x0, %eax
jne 0x24c7
jmp 0x249e
movq 0xbb53(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x9523(%rip), %rsi      # 0xb9d9
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x251f
jmp 0x24cb
movq 0xbb26(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2b0(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x2a8(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x2b0(%rbp), %rdi
movq -0x2a8(%rbp), %rdx
movq %rax, %rcx
leaq 0x94fb(%rip), %rsi      # 0xba09
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rsi
movq -0x218(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movl $0x2501, %ecx           # imm = 0x2501
callq 0x9b90
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
je 0x259b
jmp 0x2548
movq 0xbaa9(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2c0(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movl -0x234(%rbp), %edi
callq 0x9a90
movq -0x2c0(%rbp), %rdi
movq -0x2b8(%rbp), %rdx
movq %rax, %rcx
leaq 0x949c(%rip), %rsi      # 0xba26
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x80(%rbp)
jne 0x25c6
jmp 0x25a4
movq 0xba4d(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x949b(%rip), %rsi      # 0xba50
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x25c8
movq -0x80(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x92e0
movb %al, -0x229(%rbp)
movq -0x120(%rbp), %rdi
callq 0x9200
movq %rax, -0x210(%rbp)
movq 0xb9f2(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2c8(%rbp)
movzbl -0x229(%rbp), %edi
callq 0x9100
movq -0x2c8(%rbp), %rdi
movq %rax, %rdx
movzbl -0x229(%rbp), %ecx
movq -0x210(%rbp), %r8
leaq 0x9449(%rip), %rsi      # 0xba84
movb $0x0, %al
callq 0x1130
movq -0x30(%rbp), %rdx
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x1240
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
jle 0x26cc
cmpl $0x28, -0x234(%rbp)
jle 0x26c7
movq -0x1b0(%rbp), %rdi
leaq -0x24(%rbp), %rdx
movl $0x28, %esi
movl $0x14, %ecx
callq 0x2e80
movq -0x1a8(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movb -0x229(%rbp), %al
movq -0x210(%rbp), %rcx
movzbl %al, %edx
callq 0x2f20
cmpl $0x0, %eax
je 0x26c5
movq -0x38(%rbp), %rdi
movq -0x1b0(%rbp), %rdx
leaq 0x93f6(%rip), %rsi      # 0xbab4
movb $0x0, %al
callq 0x1130
jmp 0x26c7
jmp 0x2642
jmp 0x2dd7
movsbl -0x199(%rbp), %eax
cmpl $0x44, %eax
jne 0x2ce5
cmpq $0x0, -0x180(%rbp)
jne 0x270f
jmp 0x26ed
movq 0xb904(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x93b9(%rip), %rsi      # 0xbab7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x170(%rbp)
jne 0x273d
jmp 0x271b
movq 0xb8d6(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x93c2(%rip), %rsi      # 0xbaee
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x188(%rbp)
jne 0x276b
jmp 0x2749
movq 0xb8a8(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x93cb(%rip), %rsi      # 0xbb25
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x178(%rbp)
je 0x2799
jmp 0x2777
movq 0xb87a(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x93d5(%rip), %rsi      # 0xbb5d
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1140
cmpl $0x0, %eax
jne 0x282c
movl -0x138(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x27ee
jmp 0x27c5
movq 0xb82c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x91ca(%rip), %rsi      # 0xb9a7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x120(%rbp), %rdi
callq 0x9270
cmpl $0x0, %eax
jne 0x282a
jmp 0x2801
movq 0xb7f0(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x91c0(%rip), %rsi      # 0xb9d9
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2882
jmp 0x282e
movq 0xb7c3(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2d8(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x2d0(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x2d8(%rbp), %rdi
movq -0x2d0(%rbp), %rdx
movq %rax, %rcx
leaq 0x9198(%rip), %rsi      # 0xba09
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x170(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x80(%rbp), %rdi
movl $0x2201, %ecx           # imm = 0x2201
callq 0x9b90
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
je 0x28fe
jmp 0x28ab
movq 0xb746(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2e8(%rbp)
movq -0x170(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movl -0x234(%rbp), %edi
callq 0x9a90
movq -0x2e8(%rbp), %rdi
movq -0x2e0(%rbp), %rdx
movq %rax, %rcx
leaq 0x9139(%rip), %rsi      # 0xba26
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x80(%rbp)
jne 0x2930
jmp 0x2907
movq 0xb6ea(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x170(%rbp), %rdx
leaq 0x9275(%rip), %rsi      # 0xbb94
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2932
movq -0x180(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1140
cmpl $0x0, %eax
jne 0x29c5
movl -0x138(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
je 0x2987
jmp 0x295e
movq 0xb693(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x180(%rbp), %rdx
leaq 0x9031(%rip), %rsi      # 0xb9a7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x120(%rbp), %rdi
callq 0x9270
cmpl $0x0, %eax
jne 0x29c3
jmp 0x299a
movq 0xb657(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x180(%rbp), %rdx
leaq 0x9027(%rip), %rsi      # 0xb9d9
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2a1b
jmp 0x29c7
movq 0xb62a(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x2f8(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x2f0(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1270
movq -0x2f8(%rbp), %rdi
movq -0x2f0(%rbp), %rdx
movq %rax, %rcx
leaq 0x8fff(%rip), %rsi      # 0xba09
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x180(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
movl $0x2201, %ecx           # imm = 0x2201
callq 0x9b90
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
je 0x2a9a
jmp 0x2a47
movq 0xb5aa(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x308(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x300(%rbp)
movl -0x234(%rbp), %edi
callq 0x9a90
movq -0x308(%rbp), %rdi
movq -0x300(%rbp), %rdx
movq %rax, %rcx
leaq 0x8f9d(%rip), %rsi      # 0xba26
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0xa0(%rbp)
jne 0x2acf
jmp 0x2aa6
movq 0xb54b(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x180(%rbp), %rdx
leaq 0x90d6(%rip), %rsi      # 0xbb94
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2ad1
movq -0x70(%rbp), %rax
cmpq -0x90(%rbp), %rax
je 0x2b02
jmp 0x2ae0
movq 0xb511(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x90dc(%rip), %rsi      # 0xbbcd
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
movq -0x188(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
movl $0x20e, %ecx            # imm = 0x20E
callq 0x9b90
movl %eax, -0x234(%rbp)
cmpl $0x0, %eax
je 0x2b7e
jmp 0x2b2b
movq 0xb4c6(%rip), %rax      # 0xdff8
movq (%rax), %rax
movq %rax, -0x318(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x310(%rbp)
movl -0x234(%rbp), %edi
callq 0x9a90
movq -0x318(%rbp), %rdi
movq -0x310(%rbp), %rdx
movq %rax, %rcx
leaq 0x9099(%rip), %rsi      # 0xbc06
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0xc0(%rbp)
jne 0x2bb3
jmp 0x2b8a
movq 0xb467(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x180(%rbp), %rdx
leaq 0x9093(%rip), %rsi      # 0xbc35
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2bb5
movq 0xb43c(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movq -0x180(%rbp), %rdx
movq -0x170(%rbp), %rcx
leaq 0x909f(%rip), %rsi      # 0xbc73
movb $0x0, %al
callq 0x1130
movl $0x0, -0x23c(%rbp)
movslq -0x23c(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x2cc8
movq -0xa0(%rbp), %rax
movslq -0x23c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x80(%rbp), %rcx
movslq -0x23c(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0xc0(%rbp), %rax
movslq -0x23c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x23c(%rbp), %eax
andl $0x7ffff, %eax          # imm = 0x7FFFF
cmpl $0x0, %eax
jne 0x2cb2
cvtsi2sdl -0x23c(%rbp), %xmm0
movsd 0x83cc(%rip), %xmm1     # 0xb018
mulsd %xmm1, %xmm0
movaps 0x83d9(%rip), %xmm2     # 0xb030
movq -0x70(%rbp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x83d8(%rip), %xmm2     # 0xb040
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x1f8(%rbp)
movq 0xb36e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
movsd -0x1f8(%rbp), %xmm0
leaq 0x8c31(%rip), %rsi      # 0xb8cd
movb $0x1, %al
callq 0x1130
movq 0xb34e(%rip), %rax      # 0xdff8
movq (%rax), %rdi
callq 0x1180
jmp 0x2cb4
movl -0x23c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x23c(%rbp)
jmp 0x2be5
movq 0xb329(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8c01(%rip), %rsi      # 0xb8da
movb $0x0, %al
callq 0x1130
jmp 0x2dd5
movsbl -0x199(%rbp), %eax
cmpl $0x50, %eax
jne 0x2daf
cmpq $0x0, -0x180(%rbp)
jne 0x2d23
jmp 0x2d01
movq 0xb2f0(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8da5(%rip), %rsi      # 0xbab7
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x170(%rbp)
jne 0x2d51
jmp 0x2d2f
movq 0xb2c2(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8dae(%rip), %rsi      # 0xbaee
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x188(%rbp)
jne 0x2d7f
jmp 0x2d5d
movq 0xb294(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8db7(%rip), %rsi      # 0xbb25
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
cmpq $0x0, -0x178(%rbp)
je 0x2dad
jmp 0x2d8b
movq 0xb266(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8dc1(%rip), %rsi      # 0xbb5d
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2dd3
jmp 0x2db1
movq 0xb240(%rip), %rax      # 0xdff8
movq (%rax), %rdi
leaq 0x8ee3(%rip), %rsi      # 0xbca5
movb $0x0, %al
callq 0x1130
movl $0x1, %edi
callq 0x1250
jmp 0x2dd5
jmp 0x2dd7
jmp 0x2dd9
movl -0x4(%rbp), %eax
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
nopw %cs:(%rax,%rax)