// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/pack.c
// Function: main_pack
int main_pack(int argc, char *argv[]) {

  conf_pack_t conf = {0};
  conf.nan = -1.0;
  
  int c;
  if (argc<2) return usage(&conf);
  uint64_t dtype = DT_NA;
  char *idx_path = NULL;
  char msg[HDR_EXTRA] = {0};
  uint64_t max_str_length = 64;
  while ((c = getopt(argc, argv, "s:x:m:n:h"))>=0) {
    switch (c) {
    case 's':
      if (strcmp(optarg, "int1") == 0)             dtype = DT_INT1;
      else if (strcmp(optarg, "int2") == 0)        dtype = DT_INT2;
      else if (strcmp(optarg, "int32") == 0)       dtype = DT_INT32;
      else if (strcmp(optarg, "int") == 0)         dtype = DT_INT32;
      else if (strcmp(optarg, "float") == 0)       dtype = DT_FLOAT;
      else if (strcmp(optarg, "double") == 0)      dtype = DT_DOUBLE;
      else if (strcmp(optarg, "string") == 0)      dtype = DT_STRINGD;
      else if (strcmp(optarg, "stringd") == 0)     dtype = DT_STRINGD; /* fixed size string */
      else if (strcmp(optarg, "stringf") == 0)     dtype = DT_STRINGF;
      else if (strcmp(optarg, "ones") == 0)        dtype = DT_ONES;
      else if (strcmp(optarg, "float.int") == 0)   dtype = DT_FLOAT_INT;
      else if (strcmp(optarg, "float.float") == 0) dtype = DT_FLOAT_FLOAT;
      else wzfatal("Unrecognized data type: %s.\n", optarg);
      break;
    case 'x': idx_path = strdup(optarg); break;
    case 'n': conf.nan = atof(optarg); break;
    case 'i': max_str_length = atol(optarg); break;
    case 'm': {
      if (strlen(optarg) > HDR_EXTRA - 1) wzfatal("Message cannot be over %d in length.", HDR_EXTRA);
      strcpy(msg, optarg);
      break;
    }
    case 'h': return usage(&conf); break;
    default: usage(&conf); wzfatal("Unrecognized option: %c.\n", c);
    }
  }

  if (dtype == DT_STRINGF) {
    dtype |= (max_str_length << 8);
  }

  if (optind + 2 > argc) { 
    usage(&conf); 
    wzfatal("Please supply input and output file.\n"); 
  }

  bed_file_t *bed = init_bed_file(argv[optind++]);
  FILE *tbk_out = NULL;
  if (optind < argc) tbk_out = fopen(argv[optind], "wb");

  char *tmp_fname = NULL;       /* temporary file holding variable length strings */
  FILE *tmp_out = NULL;
  uint64_t tmp_out_offset = 0;
  if (dtype == DT_STRINGD) {
    tmp_fname = calloc(strlen(argv[optind])+10, 1);
    strcpy(tmp_fname, argv[optind]);
    strcat(tmp_fname, "_tmp_");
    tmp_out = fopen(tmp_fname, "wb");
  }

  bed1_t *b;
  if (dtype == DT_FLOAT_FLOAT || dtype == DT_FLOAT_INT) {
    b = init_bed1(init_data, (void*) 2);
  } else {
    b = init_bed1(init_data, (void*) 1);
  }

  FILE *idx = NULL;
  if (idx_path) {
    if (strcmp(idx_path, "stdout") == 0) {
      idx = stdout;
    } else if (strcmp(idx_path, "stderr") == 0) {
      idx = stderr;
    } else {
      idx = fopen(idx_path, "w");
    }
  }

  int64_t n = 0;
  beddata_t samples[1000] = {0};
  int64_t i;
  uint8_t aux;                  /* sub-byte encoding */
  while (bed_read1(bed, b, parse_data)) {

    if (idx) {
      fprintf(idx, "%s\t%"PRId64"\t%"PRId64"\t%"PRId64"\n", b->seqname, b->beg, b->end, n);
    }
    
    if (n < 1000) {
      samples[n++] = *((beddata_t*) b->data);
      continue;
    }

    if (n == 1000) {
      if (dtype == DT_NA) dtype = data_type(samples, n);
      if (tbk_out) tbk_write_hdr(1, dtype, n, msg, tbk_out);
      for(i=0; i<n; ++i) {
        if (tbk_out) tbk_write(&samples[i], dtype, tbk_out, i, &aux, tmp_out, &tmp_out_offset, &conf);
        free_data(&samples[i]);
      }
    }
    if (tbk_out) tbk_write(b->data, dtype, tbk_out, n, &aux, tmp_out, &tmp_out_offset, &conf);
    free_data(b->data);
    n++;
  }

  /* if no more than 1000 records */
  if (n <= 1000) {
    if (dtype == DT_NA) dtype = data_type(samples, n);
    if (tbk_out) tbk_write_hdr(1, dtype, n, msg, tbk_out);
    for(i=0; i<n; ++i) {
      if (tbk_out) tbk_write(&samples[i], dtype, tbk_out, i, &aux, tmp_out, &tmp_out_offset, &conf);
      free_data(&samples[i]);
    }
  }

  if (dtype == DT_INT2) { if (tbk_out) fwrite(&aux, 1, 1, tbk_out); aux=0; }
  
  free_bed1(b, free_data);
  free_bed_file(bed);
  if (idx) {
    fclose(idx);
    free(idx_path);
  }

  /* the actual size */
  fseek(tbk_out, HDR_NMAX0, SEEK_SET);
  fwrite(&n,     HDR_NMAX, 1, tbk_out);

  if (tmp_out) {
    fclose(tmp_out);

    /* exit(1); */
    tmp_out = fopen(tmp_fname, "rb");
    fseek(tbk_out, 0, SEEK_END);
    char data;
    unsigned j;
    for (j=0; j<tmp_out_offset; ++j) {
      fread(&data, 1, 1, tmp_out);
      fwrite(&data, 1, 1, tbk_out);
    }
    fclose(tmp_out);
    unlink(tmp_fname);
    free(tmp_fname);
  }

  if (tbk_out) fclose(tbk_out);
  
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xdc08, %rsp           # imm = 0xDC08
movl $0xbf800000, 0x1c(%rsp) # imm = 0xBF800000
cmpl $0x1, %edi
jle 0xa3e7
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x90(%rsp), %rdi
movl $0x1fe9, %edx           # imm = 0x1FE9
xorl %esi, %esi
callq 0x3090
leaq 0x4411a(%rip), %rdx     # 0x4db27
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3200
testl %eax, %eax
js 0x9c95
movl %eax, %r12d
movss 0x4381e(%rip), %xmm0    # 0x4d248
movss %xmm0, 0x30(%rsp)
movl $0x63, %eax
movq %rax, 0x10(%rsp)
movl $0x40, %eax
movq %rax, 0x20(%rsp)
movq $0x0, 0x58(%rsp)
movq 0x5558c(%rip), %r13     # 0x5efe0
leaq 0x440cc(%rip), %r15     # 0x4db27
leaq 0x44022(%rip), %r14     # 0x4da84
leal -0x68(%r12), %eax
cmpl $0xb, %eax
ja 0x9a88
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movq (%r13), %rdi
callq 0x3490
movq %rax, 0x20(%rsp)
jmp 0x9c26
cmpl $0x78, %r12d
jne 0xa721
movq (%r13), %rdi
callq 0x35f0
movq %rax, 0x58(%rsp)
jmp 0x9c26
movq (%r13), %rdi
callq 0x32f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
jmp 0x9c26
movq (%r13), %r12
movq %r12, %rdi
callq 0x3380
cmpq $0x1fe9, %rax           # imm = 0x1FE9
jae 0xa741
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0x3650
jmp 0x9c26
movq (%r13), %r12
movq %r12, %rdi
leaq 0x44039(%rip), %rsi     # 0x4db31
callq 0x3620
testl %eax, %eax
je 0x9c15
movq %r12, %rdi
leaq 0x44027(%rip), %rsi     # 0x4db36
callq 0x3620
testl %eax, %eax
je 0x9c1c
movq %r12, %rdi
leaq 0x44015(%rip), %rsi     # 0x4db3b
callq 0x3620
movl $0x3, %ecx
movq %rcx, 0x10(%rsp)
testl %eax, %eax
je 0x9c26
movq %r12, %rdi
leaq 0x44023(%rip), %rsi     # 0x4db6a
callq 0x3620
testl %eax, %eax
je 0x9c26
movq %r12, %rdi
leaq 0x44016(%rip), %rsi     # 0x4db74
callq 0x3620
testl %eax, %eax
je 0x9c40
movq %r12, %rdi
leaq 0x43fcc(%rip), %rsi     # 0x4db41
callq 0x3620
testl %eax, %eax
je 0x9c47
movq %r12, %rdi
leaq 0x43fbc(%rip), %rsi     # 0x4db48
callq 0x3620
movl $0x6, %ecx
movq %rcx, 0x10(%rsp)
testl %eax, %eax
je 0x9c26
movq %r12, %rdi
leaq 0x43fa2(%rip), %rsi     # 0x4db4f
callq 0x3620
testl %eax, %eax
je 0x9c26
movq %r12, %rdi
leaq 0x43f97(%rip), %rsi     # 0x4db57
callq 0x3620
testl %eax, %eax
je 0x9c4e
movq %r12, %rdi
leaq 0x43f88(%rip), %rsi     # 0x4db5f
callq 0x3620
testl %eax, %eax
je 0x9c55
movq %r12, %rdi
leaq 0x43f7a(%rip), %rsi     # 0x4db64
callq 0x3620
testl %eax, %eax
je 0x9c5c
movq %r12, %rdi
leaq 0x43f71(%rip), %rsi     # 0x4db6e
callq 0x3620
movl $0x20, %ecx
movq %rcx, 0x10(%rsp)
testl %eax, %eax
je 0x9c26
jmp 0xa78e
movl $0x1, %eax
jmp 0x9c21
movl $0x2, %eax
movq %rax, 0x10(%rsp)
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3200
movl %eax, %r12d
testl %eax, %eax
jns 0x9a62
jmp 0x9c63
movl $0x4, %eax
jmp 0x9c21
movl $0x5, %eax
jmp 0x9c21
movl $0x7, %eax
jmp 0x9c21
movl $0x1e, %eax
jmp 0x9c21
movl $0x1f, %eax
jmp 0x9c21
movq 0x20(%rsp), %rax
shlq $0x8, %rax
orq $0x7, %rax
movss 0x30(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movq 0x10(%rsp), %rcx
cmpq $0x7, %rcx
cmovneq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x58(%rsp), %r12
jmp 0x9caa
movl $0xbf800000, 0x1c(%rsp) # imm = 0xBF800000
movl $0x63, %eax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
movq 0x5530f(%rip), %r14     # 0x5efc0
movslq (%r14), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0xa754
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq (%rbx,%rax,8), %r15
movl $0x1, %edi
movl $0x28, %esi
callq 0x36a0
movq %rax, %r13
movq %r15, %rdi
callq 0x35f0
movq %rax, %r15
movq %r13, 0x28(%rsp)
movq %rax, (%r13)
cmpb $0x2d, (%rax)
jne 0x9cff
cmpb $0x0, 0x1(%r15)
je 0x9e60
leaq 0x4751f(%rip), %rsi     # 0x51225
movq %r15, %rdi
callq 0x3160
movq %rax, %r13
testq %rax, %rax
je 0xa76c
movq 0x28(%rsp), %rax
movq %r13, 0x8(%rax)
movslq (%r14), %rax
cmpl %ebp, %eax
jge 0x9d41
movq (%rbx,%rax,8), %rdi
leaq 0x43ead(%rip), %rsi     # 0x4dbe2
callq 0x3250
movq %rax, 0x10(%rsp)
jmp 0x9d4a
movq $0x0, 0x10(%rsp)
movq $0x0, 0x68(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x6, %rax
jne 0x9dc1
movslq (%r14), %rax
movq (%rbx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x3380
leaq 0xa(%rax), %rdi
movl $0x1, %esi
callq 0x36a0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3650
movq %r14, %rdi
callq 0x3380
movl $0x706d745f, (%r14,%rax) # imm = 0x706D745F
movw $0x5f, 0x4(%r14,%rax)
leaq 0x43e3a(%rip), %rsi     # 0x4dbe2
movq %r14, 0x78(%rsp)
movq %r14, %rdi
callq 0x3250
movq %rax, 0x30(%rsp)
movl $0x1, %ebx
jmp 0x9de3
addq $-0x1f, %rax
movq $0x0, 0x30(%rsp)
cmpq $0x2, %rax
movl $0x0, %ebx
adcl $0x1, %ebx
movq $0x0, 0x78(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x36a0
movq %rax, %r15
movl $0x30, %edi
movl $0x1, %esi
callq 0x36a0
movq %rax, 0x18(%r15)
movl %ebx, 0x28(%rax)
testq %r12, %r12
movq %r12, 0x58(%rsp)
je 0x9e4c
leaq 0x43dcf(%rip), %rsi     # 0x4dbeb
movq %r12, %rdi
callq 0x3620
testl %eax, %eax
je 0x9e57
leaq 0x43dc3(%rip), %rsi     # 0x4dbf2
movq %r12, %rdi
callq 0x3620
testl %eax, %eax
je 0x9e85
leaq 0x43276(%rip), %rsi     # 0x4d0b8
movq %r12, %rdi
callq 0x3250
jmp 0x9e8f
movq $0x0, 0x40(%rsp)
jmp 0x9e94
movq 0x5519a(%rip), %rax     # 0x5eff8
jmp 0x9e8c
movq 0x55171(%rip), %rax     # 0x5efd8
movq (%rax), %rdi
callq 0x3040
leaq 0x473af(%rip), %rsi     # 0x51225
movl %eax, %edi
callq 0x3420
movq %rax, %r13
jmp 0x9d1a
movq 0x5515c(%rip), %rax     # 0x5efe8
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x2080(%rsp), %rdi
xorl %r12d, %r12d
movl $0xbb80, %edx           # imm = 0xBB80
xorl %esi, %esi
callq 0x3090
testq %r13, %r13
movq %r15, 0x50(%rsp)
je 0xa404
xorl %ebp, %ebp
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rbx
movq %rbp, 0x88(%rsp)
movl $0xa, %esi
movq %rbx, %rdi
callq 0x37b0
movq %rax, %rbx
movl $0xa, %ebp
xorl %r14d, %r14d
movl (%r13), %eax
testl %eax, %eax
je 0x9f11
decl %eax
movl %eax, (%r13)
incq 0x10(%r13)
movq 0x8(%r13), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r13)
movzbl (%rax), %r12d
jmp 0x9f1c
movq %r13, %rdi
callq 0x3730
movl %eax, %r12d
leal -0x2(%rbp), %eax
cltq
cmpq %rax, %r14
jle 0x9f36
addl %ebp, %ebp
movslq %ebp, %rsi
movq %rbx, %rdi
callq 0x37b0
movq %rax, %rbx
cmpl $0xa, %r12d
je 0x9f4f
cmpl $-0x1, %r12d
je 0xa3b6
movb %r12b, (%rbx,%r14)
incq %r14
jmp 0x9eed
movl %r14d, %eax
movb $0x0, (%rbx,%rax)
movq %rbx, %rdi
movl $0x9, %esi
callq 0x3580
movl $0x1, %r12d
testq %rax, %rax
je 0x9f94
leaq 0x45bc4(%rip), %rbp     # 0x4fb39
incq %rax
movq %rax, %rdi
movl $0x9, %esi
callq 0x3580
incq %r12
testq %rax, %rax
jne 0x9f75
movl %r12d, 0x48(%rsp)
jmp 0x9fa3
movl $0x1, 0x48(%rsp)
leaq 0x45b96(%rip), %rbp     # 0x4fb39
movl $0x8, %esi
movq %r12, %rdi
callq 0x36a0
movq %rax, %r13
movq %rbx, %rdi
callq 0x3380
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x36a0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3650
movq %r12, %rdi
movq %rbp, %rsi
callq 0x3660
testq %rax, %rax
je 0xa008
movq %r13, %r14
movq %rax, %rdi
callq 0x35f0
movq %rax, (%r14)
xorl %edi, %edi
movq %rbp, %rsi
callq 0x3660
addq $0x8, %r14
testq %rax, %rax
jne 0x9fea
movq %r12, %rdi
callq 0x3370
movl 0x48(%rsp), %r14d
cmpl $0x2, %r14d
jle 0xa774
movq 0x28(%rsp), %rax
movq 0x18(%rax), %r12
movq (%r13), %rbp
testq %r12, %r12
je 0xa040
movq %rbp, %rdi
movq %r12, %rsi
callq 0x3620
testl %eax, %eax
je 0xa05c
movq %r12, %rdi
callq 0x3370
movq %rbp, %rdi
callq 0x35f0
movq %rax, %r12
movq 0x28(%rsp), %rax
movq %r12, 0x18(%rax)
movq %r12, (%r15)
movq 0x8(%r13), %r12
movb (%r12), %bpl
testb %bpl, %bpl
je 0xa09e
callq 0x3410
movq (%rax), %rax
leaq 0x1(%r12), %rcx
cmpb $0x2e, %bpl
je 0xa093
movsbq %bpl, %rdx
movzwl (%rax,%rdx,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0xa711
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0xa079
movq %r12, %rdi
callq 0x3550
cltq
movq %rax, 0x8(%r15)
movq 0x10(%r13), %r12
movb (%r12), %bpl
testb %bpl, %bpl
je 0xa0eb
callq 0x3410
movq (%rax), %rax
leaq 0x1(%r12), %rcx
cmpb $0x2e, %bpl
je 0xa0e0
movsbq %bpl, %rdx
movzwl (%rax,%rdx,2), %edx
andl $0x800, %edx            # imm = 0x800
je 0xa719
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0xa0c6
movq %r12, %rdi
callq 0x3550
cltq
movq %rax, 0x10(%r15)
movq %r15, %rdi
movq %r13, %rsi
movl %r14d, %edx
callq 0x9535
movl %r14d, %r14d
xorl %r15d, %r15d
movq (%r13,%r15,8), %rdi
callq 0x3370
incq %r15
cmpq %r15, %r14
jne 0xa10d
movq %r13, %rdi
callq 0x3370
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x50(%rsp), %r15
movq 0x88(%rsp), %rbp
je 0xa15a
movq (%r15), %rdx
movq 0x8(%r15), %rcx
movq 0x10(%r15), %r8
leaq 0x43aa9(%rip), %rsi     # 0x4dbf9
movq %rbp, %r9
xorl %eax, %eax
callq 0x37e0
cmpq $0x3e7, %rbp            # imm = 0x3E7
jg 0xa1bc
leaq 0x1(%rbp), %r12
movq %r12, 0x60(%rsp)
leaq (,%rbp,2), %rax
addq %rbp, %rax
shlq $0x4, %rax
movq 0x18(%r15), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20a0(%rsp,%rax)
movups %xmm1, 0x2090(%rsp,%rax)
movups %xmm0, 0x2080(%rsp,%rax)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %r13
movq %r12, %rbp
testq %r13, %r13
jne 0x9ecd
jmp 0xa3fb
movq 0x28(%rsp), %rax
movq %rbx, 0x10(%rax)
cmpq $0x3e8, %rbp            # imm = 0x3E8
jne 0xa339
movq 0x20(%rsp), %rax
cmpq $0x63, %rax
movq 0x10(%rsp), %r13
leaq 0x2080(%rsp), %r14
jne 0xa1f9
movq %r14, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0xa79f
cltq
movq %rax, 0x20(%rsp)
testq %r13, %r13
je 0xa2aa
movl $0x1, 0x4c(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
movq $0x3e8, 0x80(%rsp) # imm = 0x3E8
movb $0x6b, 0x3e(%rsp)
movw $0x6274, 0x3c(%rsp)     # imm = 0x6274
movl $0x3, %esi
movl $0x1, %edx
leaq 0x3c(%rsp), %rdi
movq %r13, %rcx
callq 0x3770
movl $0x4, %esi
movl $0x1, %edx
leaq 0x4c(%rsp), %rdi
movq %r13, %rcx
callq 0x3770
movl $0x8, %esi
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
movq %r13, %rcx
callq 0x3770
movl $0x8, %esi
movl $0x1, %edx
leaq 0x80(%rsp), %rdi
movq %r13, %rcx
callq 0x3770
movl $0x1fe9, %esi           # imm = 0x1FE9
movl $0x1, %edx
leaq 0x90(%rsp), %rdi
movq %r13, %rcx
callq 0x3770
xorl %ebx, %ebx
testq %r13, %r13
je 0xa2ed
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rdi
addq $0x2080, %rdi           # imm = 0x2080
movq 0x20(%rsp), %rsi
movq %r13, %rdx
movl %ebx, %ecx
leaq 0xf(%rsp), %r8
movq 0x30(%rsp), %r9
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0x9628
addq $0x10, %rsp
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
movslq 0x20a8(%rsp,%rax), %r15
testq %r15, %r15
jle 0xa31e
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
callq 0x3370
movq $0x0, (%r14,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0xa305
incq %rbx
addq $0x30, %r14
cmpq $0x3e8, %rbx            # imm = 0x3E8
jne 0xa2ac
movq 0x50(%rsp), %r15
jmp 0xa33e
movq 0x10(%rsp), %r13
testq %r13, %r13
je 0xa370
movq 0x18(%r15), %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
movl %ebp, %ecx
leaq 0xf(%rsp), %r8
movq 0x30(%rsp), %r9
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0x9628
addq $0x10, %rsp
movq 0x18(%r15), %rbx
cmpl $0x0, 0x28(%rbx)
jle 0xa39a
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x3370
movq $0x0, (%rbx,%r14,8)
incq %r14
movslq 0x28(%rbx), %rax
cmpq %rax, %r14
jl 0xa37d
incq %rbp
movq %rbp, 0x60(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %r13
testq %r13, %r13
jne 0x9ec4
jmp 0xa3cb
movq 0x28(%rsp), %rax
movq %rbx, 0x10(%rax)
movl %r14d, %eax
movb $0x0, (%rbx,%rax)
movq 0x60(%rsp), %rbp
movq %rbp, %r12
cmpq $0x3e8, %rbp            # imm = 0x3E8
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %r13
jg 0xa572
jmp 0xa40e
leaq 0x1c(%rsp), %rdi
callq 0x3d43
movl $0x1, %eax
jmp 0xa6eb
movq 0x28(%rsp), %rax
movq %rbx, 0x10(%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %r13
cmpq $0x63, %rax
jne 0xa426
leaq 0x2080(%rsp), %rdi
movl %r12d, %esi
callq 0xa79f
cltq
testq %r13, %r13
je 0xa4d6
leaq 0x4c(%rsp), %r13
movl $0x1, (%r13)
leaq 0x70(%rsp), %rbp
movq %rax, (%rbp)
leaq 0x80(%rsp), %rbx
movq %r12, (%rbx)
leaq 0x3c(%rsp), %rdi
movb $0x6b, 0x2(%rdi)
movw $0x6274, (%rdi)         # imm = 0x6274
movl $0x3, %esi
movl $0x1, %edx
movq 0x10(%rsp), %rcx
movq %rax, %r14
callq 0x3770
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq 0x10(%rsp), %r13
movq %r13, %rcx
callq 0x3770
movl $0x8, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %r13, %rcx
callq 0x3770
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rcx
callq 0x3770
leaq 0x90(%rsp), %rdi
movl $0x1fe9, %esi           # imm = 0x1FE9
movl $0x1, %edx
movq %r13, %rcx
callq 0x3770
movq %r14, %rax
testq %r12, %r12
jle 0xa572
movq %rax, %r13
leaq 0x2080(%rsp), %r14
xorl %ebx, %ebx
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0xa52d
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rdi
addq $0x2080, %rdi           # imm = 0x2080
movq %r13, %rsi
movl %ebx, %ecx
leaq 0xf(%rsp), %r8
movq 0x30(%rsp), %r9
leaq 0x1c(%rsp), %rax
pushq %rax
leaq 0x70(%rsp), %rax
pushq %rax
callq 0x9628
addq $0x10, %rsp
leaq (%rbx,%rbx,2), %rax
shlq $0x4, %rax
movslq 0x20a8(%rsp,%rax), %rbp
testq %rbp, %rbp
jle 0xa55e
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x3370
movq $0x0, (%r14,%r15,8)
incq %r15
cmpq %r15, %rbp
jne 0xa545
incq %rbx
addq $0x30, %r14
cmpq %r12, %rbx
jne 0xa4ec
movq %r13, %rax
movq 0x10(%rsp), %r13
cmpq $0x2, %rax
movq 0x58(%rsp), %r15
movq 0x78(%rsp), %r12
jne 0xa599
testq %r13, %r13
je 0xa594
movsbl 0xf(%rsp), %edi
movq %r13, %rsi
callq 0x3350
movb $0x0, 0xf(%rsp)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rbx
cmpl $0x0, 0x28(%rbx)
jle 0xa5c8
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x3370
movq $0x0, (%rbx,%r14,8)
incq %r14
movslq 0x28(%rbx), %rax
cmpq %rax, %r14
jl 0xa5ab
movq 0x50(%rsp), %rdi
callq 0x3370
movq 0x28(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x31a0
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0xa5f1
movq (%rax), %rdi
callq 0xc1ae
movq 0x28(%rsp), %rbx
movq (%rbx), %rdi
callq 0x3370
movq 0x10(%rbx), %rdi
callq 0x3370
movq 0x18(%rbx), %rdi
callq 0x3370
movq %rbx, %rdi
callq 0x3370
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xa62f
callq 0x36c0
movq %r15, %rdi
callq 0x3370
movl $0xf, %esi
movq %r13, %rdi
xorl %edx, %edx
callq 0x3120
leaq 0x60(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x3770
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xa6dc
callq 0x36c0
leaq 0x43197(%rip), %rsi     # 0x4d802
movq %r12, %rdi
callq 0x3250
movq %rax, %rbx
movq %r13, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x3120
movq 0x68(%rsp), %r15
testq %r15, %r15
je 0xa6c4
movl $0x1, %ebp
leaq 0x70(%rsp), %r14
movl $0x1, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x35b0
movsbl 0x70(%rsp), %edi
movq %r13, %rsi
callq 0x3350
movl %ebp, %eax
incl %ebp
cmpq %rax, %r15
ja 0xa699
movq %rbx, %rdi
callq 0x36c0
movq %r12, %rdi
callq 0x3270
movq %r12, %rdi
callq 0x3370
testq %r13, %r13
je 0xa6e9
movq %r13, %rdi
callq 0x36c0
xorl %eax, %eax
addq $0xdc08, %rsp           # imm = 0xDC08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c(%rsp), %rdi
movss 0x30(%rsp), %xmm0
movss %xmm0, (%rdi)
jmp 0xa3ec
movq %r12, %rdi
callq 0x3e7a
movq %r12, %rdi
callq 0x3eb0
leaq 0x1c(%rsp), %rdi
movss 0x30(%rsp), %xmm0
movss %xmm0, (%rdi)
callq 0x3d43
leaq 0x42c43(%rip), %rdi     # 0x4d37f
movl %r12d, %esi
jmp 0xa74d
leaq 0x4344f(%rip), %rdi     # 0x4db97
movl $0x1fe9, %esi           # imm = 0x1FE9
xorl %eax, %eax
callq 0x9585
leaq 0x1c(%rsp), %rdi
callq 0x3d43
leaq 0x43457(%rip), %rdi     # 0x4dbbc
xorl %eax, %eax
callq 0x9585
movq %r15, %rdi
callq 0x3e44
leaq 0x43159(%rip), %rdi     # 0x4d8d4
leaq 0x43646(%rip), %rsi     # 0x4ddc8
movl $0x6f, %edx
xorl %eax, %eax
callq 0x9585
leaq 0x433e5(%rip), %rdi     # 0x4db7a
movq %r12, %rsi
xorl %eax, %eax
callq 0x9585