// File: /workspace/github_c_makefile_star2_O2/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 $0xdbe8, %rsp           # imm = 0xDBE8
movl $0xbf800000, 0x10(%rsp) # imm = 0xBF800000
cmpl $0x1, %edi
jg 0x7143
leaq 0x10(%rsp), %rdi
callq 0x7bdc
pushq $0x1
popq %rax
jmp 0x7b28
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x70(%rsp), %rdi
movq $0x0, 0x60(%rsp)
movl $0x1fe9, %edx           # imm = 0x1FE9
xorl %esi, %esi
callq 0x3090
pushq $0x40
popq %rax
movq %rax, 0x20(%rsp)
pushq $0x63
popq %r12
movss 0x380d2(%rip), %xmm0    # 0x3f248
movss %xmm0, 0x18(%rsp)
leaq 0x389a4(%rip), %r15     # 0x3fb27
leaq 0x388fa(%rip), %r14     # 0x3fa84
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3200
testl %eax, %eax
js 0x7394
movl %eax, %r13d
leal -0x68(%r13), %eax
cmpl $0xb, %eax
ja 0x71ca
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movq 0x4be25(%rip), %rax     # 0x52fe0
movq (%rax), %rdi
callq 0x3490
movq %rax, 0x20(%rsp)
jmp 0x718a
cmpl $0x78, %r13d
jne 0x7b44
movq 0x4be05(%rip), %rax     # 0x52fe0
movq (%rax), %rdi
callq 0x3600
movq %rax, 0x60(%rsp)
jmp 0x718a
movq 0x4bdef(%rip), %rax     # 0x52fe0
movq (%rax), %rdi
callq 0x32f0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
jmp 0x718a
movq 0x4bdd4(%rip), %rax     # 0x52fe0
movq (%rax), %r13
movq %r13, %rdi
callq 0x3380
cmpq $0x1fe9, %rax           # imm = 0x1FE9
jae 0x7b64
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
callq 0x3660
jmp 0x718a
movq 0x4bda4(%rip), %rax     # 0x52fe0
movq (%rax), %r13
movq %r13, %rdi
leaq 0x388e8(%rip), %rsi     # 0x3fb31
callq 0x3630
pushq $0x1
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x388d2(%rip), %rsi     # 0x3fb36
callq 0x3630
pushq $0x2
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x388bc(%rip), %rsi     # 0x3fb3b
callq 0x3630
pushq $0x3
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x388d0(%rip), %rsi     # 0x3fb6a
callq 0x3630
pushq $0x3
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x388bf(%rip), %rsi     # 0x3fb74
callq 0x3630
pushq $0x4
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x38871(%rip), %rsi     # 0x3fb41
callq 0x3630
pushq $0x5
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x3885d(%rip), %rsi     # 0x3fb48
callq 0x3630
pushq $0x6
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x38849(%rip), %rsi     # 0x3fb4f
callq 0x3630
pushq $0x6
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x38836(%rip), %rsi     # 0x3fb57
callq 0x3630
pushq $0x7
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x38823(%rip), %rsi     # 0x3fb5f
callq 0x3630
pushq $0x1e
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x3880d(%rip), %rsi     # 0x3fb64
callq 0x3630
pushq $0x1f
popq %r12
testl %eax, %eax
je 0x718a
movq %r13, %rdi
leaq 0x387fc(%rip), %rsi     # 0x3fb6e
callq 0x3630
pushq $0x20
popq %r12
testl %eax, %eax
je 0x718a
leaq 0x387f0(%rip), %rdi     # 0x3fb7a
movq %r13, %rsi
xorl %eax, %eax
callq 0x6d03
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rax
shlq $0x8, %rax
orq $0x7, %rax
cmpq $0x7, %r12
cmovneq %r12, %rax
movq %rax, 0x20(%rsp)
movq 0x4bbff(%rip), %r12     # 0x52fc0
movslq (%r12), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0x7b77
leal 0x1(%rax), %ecx
movl %ecx, (%r12)
movq (%rbx,%rax,8), %r15
pushq $0x1
popq %r14
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x36b0
movq %rax, %r13
movq %r15, %rdi
callq 0x3600
movq %rax, %r15
movq %r13, 0x18(%rsp)
movq %rax, (%r13)
cmpb $0x2d, (%rax)
jne 0x7411
cmpb $0x0, 0x1(%r15)
je 0x7557
leaq 0x3bb61(%rip), %rsi     # 0x42f79
movq %r15, %rdi
callq 0x3160
movq %rax, %r13
testq %rax, %rax
je 0x7ba7
movq 0x18(%rsp), %rax
movq %r13, 0x8(%rax)
movslq (%r12), %rax
cmpl %ebp, %eax
jge 0x7452
movq (%rbx,%rax,8), %rdi
leaq 0x3879a(%rip), %rsi     # 0x3fbe2
callq 0x3250
movq %rax, %r15
jmp 0x7455
xorl %r15d, %r15d
movq 0x20(%rsp), %rax
andq $0x0, 0x48(%rsp)
cmpq $0x6, %rax
jne 0x74c1
movslq (%r12), %rax
movq (%rbx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x3380
leaq 0xa(%rax), %rdi
movq %r14, %rsi
callq 0x36b0
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3660
movq %r12, %rdi
callq 0x3380
movl $0x706d745f, (%r12,%rax) # imm = 0x706D745F
movw $0x5f, 0x4(%r12,%rax)
leaq 0x38733(%rip), %rsi     # 0x3fbe2
movq %r12, 0x50(%rsp)
movq %r12, %rdi
callq 0x3250
movq %rax, %rbx
jmp 0x74de
addq $-0x1f, %rax
xorl %ebx, %ebx
cmpq $0x2, %rax
movl $0x0, %r14d
adcq $0x1, %r14
movq $0x0, 0x50(%rsp)
movq %r14, %rdi
callq 0x7cdd
movq %rax, %r12
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
movq %rbx, 0x40(%rsp)
je 0x752f
leaq 0x386ec(%rip), %rsi     # 0x3fbeb
movq %rdi, %rbx
callq 0x3630
testl %eax, %eax
je 0x753a
leaq 0x386e0(%rip), %rsi     # 0x3fbf2
movq %rbx, %rdi
callq 0x3630
testl %eax, %eax
je 0x757c
leaq 0x37b93(%rip), %rsi     # 0x3f0b8
movq %rbx, %rdi
callq 0x3250
jmp 0x7586
movq $0x0, 0x30(%rsp)
jmp 0x758b
movq 0x4bab7(%rip), %rax     # 0x52ff8
jmp 0x7583
leaq 0x10(%rsp), %rdi
movss 0x18(%rsp), %xmm0
movss %xmm0, (%rdi)
jmp 0x7136
movq 0x4ba7a(%rip), %rax     # 0x52fd8
movq (%rax), %rdi
callq 0x3040
leaq 0x3ba0c(%rip), %rsi     # 0x42f79
movl %eax, %edi
callq 0x3420
movq %rax, %r13
jmp 0x742c
movq 0x4ba65(%rip), %rax     # 0x52fe8
movq (%rax), %rax
movq %rax, 0x30(%rsp)
andq $0x0, 0x28(%rsp)
leaq 0x2060(%rsp), %rdi
movl $0xbb80, %edx           # imm = 0xBB80
xorl %esi, %esi
callq 0x3090
pushq $0xa
popq %rbp
xorl %r14d, %r14d
movq %r12, 0x38(%rsp)
movq 0x20(%rsp), %rbx
testq %r13, %r13
je 0x7b3a
movq %r14, 0x58(%rsp)
movq 0x18(%rsp), %rbx
movq 0x10(%rbx), %rdi
movq %rbp, %rsi
callq 0x37c0
movq %rax, %r14
movq %rax, 0x10(%rbx)
xorl %ebx, %ebx
pushq $0xa
popq %rax
movl %eax, %r12d
movl (%r13), %eax
testl %eax, %eax
je 0x7606
decl %eax
movl %eax, (%r13)
incq 0x10(%r13)
movq 0x8(%r13), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%r13)
movzbl (%rax), %ebp
jmp 0x7610
movq %r13, %rdi
callq 0x3740
movl %eax, %ebp
leal -0x2(%r12), %eax
cltq
cmpq %rax, %rbx
jle 0x7636
addl %r12d, %r12d
movslq %r12d, %rsi
movq %r14, %rdi
callq 0x37c0
movq %rax, %r14
movq 0x18(%rsp), %rax
movq %r14, 0x10(%rax)
cmpl $0xa, %ebp
je 0x764d
cmpl $-0x1, %ebp
je 0x7923
movb %bpl, (%r14,%rbx)
incq %rbx
jmp 0x75e3
movl %ebx, %eax
movb $0x0, (%r14,%rax)
pushq $-0x1
popq %rbx
movq %r14, %rax
pushq $0x9
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x3590
testq %rax, %rax
je 0x7674
incq %rax
decq %rbx
jmp 0x765d
movq %rbx, %rdi
negq %rdi
movq %rdi, 0x68(%rsp)
pushq $0x8
popq %rsi
callq 0x36b0
movq %rax, %rbp
movq %r14, %rdi
callq 0x3380
leaq 0x1(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x36b0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x3660
movq %r12, %rdi
leaq 0x3a2aa(%rip), %rsi     # 0x41960
callq 0x3670
movq %rbp, %r14
testq %rax, %rax
je 0x76e2
movq %rax, %rdi
callq 0x3600
movq %rax, (%r14)
xorl %edi, %edi
leaq 0x3a289(%rip), %rsi     # 0x41960
callq 0x3670
addq $0x8, %r14
jmp 0x76be
movq %r12, %rdi
callq 0x3370
cmpl $0x2, 0x68(%rsp)
jbe 0x7b8f
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r14
movq (%rbp), %r12
testq %r14, %r14
je 0x7716
movq %r12, %rdi
movq %r14, %rsi
callq 0x3630
testl %eax, %eax
je 0x7732
movq %r14, %rdi
callq 0x3370
movq %r12, %rdi
callq 0x3600
movq %rax, %r14
movq 0x18(%rsp), %rax
movq %r14, 0x18(%rax)
movq 0x38(%rsp), %r12
movq %r14, (%r12)
movq 0x8(%rbp), %r14
movq %r14, %rdi
callq 0x7e56
movq %r14, %rdi
callq 0x3560
cltq
movq %rax, 0x8(%r12)
movq 0x10(%rbp), %r14
movq %r14, %rdi
callq 0x7e56
movq %r14, %rdi
callq 0x3560
cltq
movq %rax, 0x10(%r12)
movq %r12, %rdi
movq %rbp, %rsi
movq 0x68(%rsp), %rdx
callq 0x6cb6
xorl %r14d, %r14d
movq %rbx, %rax
addq %r14, %rax
je 0x779b
movq (%rbp,%r14,8), %rdi
callq 0x3370
incq %r14
jmp 0x7784
movq %rbp, %rdi
callq 0x3370
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
movq 0x58(%rsp), %r14
je 0x77d1
movq (%r12), %rdx
movq 0x8(%r12), %rcx
movq 0x10(%r12), %r8
leaq 0x38432(%rip), %rsi     # 0x3fbf9
movq %r14, %r9
xorl %eax, %eax
callq 0x37f0
cmpq $0x3e7, %r14            # imm = 0x3E7
movq 0x20(%rsp), %rbx
pushq $0xa
popq %rbp
jg 0x7816
imulq $0x30, %r14, %rax
incq %r14
movq 0x18(%r12), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x2080(%rsp,%rax)
movups %xmm1, 0x2070(%rsp,%rax)
movups %xmm0, 0x2060(%rsp,%rax)
jmp 0x75b5
movq %r14, 0x28(%rsp)
cmpq $0x3e8, %r14            # imm = 0x3E8
jne 0x78bf
cmpq $0x63, %rbx
leaq 0xf(%rsp), %r13
jne 0x7848
leaq 0x2060(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x7d08
movslq %eax, %rbx
movq %rbx, 0x20(%rsp)
testq %r15, %r15
je 0x7869
movl $0x3e8, %esi            # imm = 0x3E8
movq 0x20(%rsp), %rdi
leaq 0x70(%rsp), %rdx
movq %r15, %rcx
callq 0x7db0
leaq 0x2060(%rsp), %r14
xorl %r12d, %r12d
movq 0x40(%rsp), %rbx
cmpq $0x3e8, %r12            # imm = 0x3E8
je 0x78cb
testq %r15, %r15
je 0x78ae
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
movl %r12d, %ecx
movq %r13, %r8
movq %rbx, %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x6da4
popq %rax
popq %rcx
movq %r14, %rdi
callq 0x6c88
incq %r12
addq $0x30, %r14
jmp 0x7879
leaq 0xf(%rsp), %r13
movq 0x40(%rsp), %rbx
jmp 0x78d5
movq 0x38(%rsp), %r12
movq 0x58(%rsp), %r14
testq %r15, %r15
je 0x7903
movq 0x18(%r12), %rdi
movq 0x20(%rsp), %rsi
movq %r15, %rdx
movl %r14d, %ecx
movq %r13, %r8
movq %rbx, %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x6da4
popq %rax
popq %rcx
movq 0x18(%r12), %rdi
callq 0x6c88
incq %r14
movq %r14, 0x28(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %r13
jmp 0x75b0
movq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
movl %ebx, %eax
movb $0x0, (%r14,%rax)
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %rbx
movq 0x38(%rsp), %r12
cmpq $0x3e8, %r14            # imm = 0x3E8
jg 0x79e2
cmpq $0x63, %rbx
jne 0x7969
leaq 0x2060(%rsp), %rdi
movl %r14d, %esi
callq 0x7d08
movslq %eax, %rbx
testq %r15, %r15
je 0x7981
leaq 0x70(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x7db0
movq %r14, %rbp
xorl %r14d, %r14d
testq %rbp, %rbp
cmovleq %r14, %rbp
leaq 0x2060(%rsp), %r12
leaq 0xf(%rsp), %r13
cmpq %r14, %rbp
je 0x79dd
testq %r15, %r15
je 0x79cc
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl %r14d, %ecx
movq %r13, %r8
movq 0x40(%rsp), %r9
leaq 0x10(%rsp), %rax
pushq %rax
leaq 0x50(%rsp), %rax
pushq %rax
callq 0x6da4
popq %rax
popq %rcx
movq %r12, %rdi
callq 0x6c88
incq %r14
addq $0x30, %r12
jmp 0x799b
movq 0x38(%rsp), %r12
cmpq $0x2, %rbx
jne 0x79ff
testq %r15, %r15
je 0x79fa
movsbl 0xf(%rsp), %edi
movq %r15, %rsi
callq 0x3350
movb $0x0, 0xf(%rsp)
movq 0x18(%r12), %rdi
callq 0x6c88
movq %r12, %rdi
callq 0x3370
movq 0x18(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x31a0
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x7a30
movq (%rax), %rdi
callq 0x96bc
movq 0x18(%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 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x7a70
callq 0x36d0
movq 0x60(%rsp), %rdi
callq 0x3370
pushq $0xf
popq %rsi
xorl %r13d, %r13d
movq %r15, %rdi
xorl %edx, %edx
callq 0x3120
leaq 0x28(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r15, %rcx
callq 0x3780
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x7b19
callq 0x36d0
leaq 0x37d59(%rip), %rsi     # 0x3f802
movq 0x50(%rsp), %rdi
callq 0x3250
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x3120
movq 0x48(%rsp), %rbp
leaq 0x17(%rsp), %r14
pushq $0x1
popq %r12
movl %r13d, %eax
cmpq %rax, %rbp
jbe 0x7afc
movq %r14, %rdi
movq %r12, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x35c0
movsbl 0x17(%rsp), %edi
movq %r15, %rsi
callq 0x3350
incl %r13d
jmp 0x7ad1
movq %rbx, %rdi
callq 0x36d0
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x3270
movq %rbx, %rdi
callq 0x3370
testq %r15, %r15
je 0x7b26
movq %r15, %rdi
callq 0x36d0
xorl %eax, %eax
addq $0xdbe8, %rsp           # imm = 0xDBE8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, 0x28(%rsp)
jmp 0x7943
leaq 0x10(%rsp), %rdi
movss 0x18(%rsp), %xmm0
movss %xmm0, (%rdi)
callq 0x7bdc
leaq 0x37820(%rip), %rdi     # 0x3f37f
movl %r13d, %esi
jmp 0x7b70
leaq 0x3802c(%rip), %rdi     # 0x3fb97
movl $0x1fe9, %esi           # imm = 0x1FE9
xorl %eax, %eax
callq 0x6d03
leaq 0x10(%rsp), %rdi
callq 0x7bdc
leaq 0x38034(%rip), %rdi     # 0x3fbbc
xorl %eax, %eax
callq 0x6d03
leaq 0x37d3e(%rip), %rdi     # 0x3f8d4
leaq 0x3822b(%rip), %rsi     # 0x3fdc8
pushq $0x6f
popq %rdx
xorl %eax, %eax
callq 0x6d03
movq 0x4b43a(%rip), %rbx     # 0x52fe8
movq (%rbx), %rdi
leaq 0x37c86(%rip), %rsi     # 0x3f83e
leaq 0x37ca4(%rip), %rdx     # 0x3f863
pushq $0x14
popq %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x37f0
movq (%rbx), %rdi
callq 0x38c0
pushq $0x1
popq %rdi
callq 0x3170