// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xdc20, %rsp           # imm = 0xDC20
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x14(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x3090
movss 0x6c9b2(%rip), %xmm0    # 0x7537c
movss %xmm0, -0x14(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x89e6
leaq -0x14(%rbp), %rdi
callq 0x9430
movl %eax, -0x4(%rbp)
jmp 0x9417
movq $0x63, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x2020(%rbp), %rdi
xorl %esi, %esi
movl $0x1fe9, %edx           # imm = 0x1FE9
callq 0x3090
movq $0x40, -0x2028(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq 0x6d3fa(%rip), %rdx     # 0x75e1c
callq 0x3210
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jl 0x8d2b
movl -0x18(%rbp), %eax
addl $-0x68, %eax
movl %eax, %ecx
movq %rcx, -0xdc08(%rbp)
subl $0x10, %eax
ja 0x8d0c
movq -0xdc08(%rbp), %rax
leaq 0x6d307(%rip), %rcx     # 0x75d60
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x7c577(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d3b3(%rip), %rsi     # 0x75e26
callq 0x3620
cmpl $0x0, %eax
jne 0x8a8a
movq $0x1, -0x20(%rbp)
jmp 0x8c67
movq 0x7c54f(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d390(%rip), %rsi     # 0x75e2b
callq 0x3620
cmpl $0x0, %eax
jne 0x8ab2
movq $0x2, -0x20(%rbp)
jmp 0x8c65
movq 0x7c527(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d36d(%rip), %rsi     # 0x75e30
callq 0x3620
cmpl $0x0, %eax
jne 0x8ada
movq $0x3, -0x20(%rbp)
jmp 0x8c63
movq 0x7c4ff(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d374(%rip), %rsi     # 0x75e5f
callq 0x3620
cmpl $0x0, %eax
jne 0x8b02
movq $0x3, -0x20(%rbp)
jmp 0x8c61
movq 0x7c4d7(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d356(%rip), %rsi     # 0x75e69
callq 0x3620
cmpl $0x0, %eax
jne 0x8b2a
movq $0x4, -0x20(%rbp)
jmp 0x8c5f
movq 0x7c4af(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d2fb(%rip), %rsi     # 0x75e36
callq 0x3620
cmpl $0x0, %eax
jne 0x8b52
movq $0x5, -0x20(%rbp)
jmp 0x8c5d
movq 0x7c487(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d2da(%rip), %rsi     # 0x75e3d
callq 0x3620
cmpl $0x0, %eax
jne 0x8b7a
movq $0x6, -0x20(%rbp)
jmp 0x8c5b
movq 0x7c45f(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d2b9(%rip), %rsi     # 0x75e44
callq 0x3620
cmpl $0x0, %eax
jne 0x8ba2
movq $0x6, -0x20(%rbp)
jmp 0x8c59
movq 0x7c437(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d299(%rip), %rsi     # 0x75e4c
callq 0x3620
cmpl $0x0, %eax
jne 0x8bca
movq $0x7, -0x20(%rbp)
jmp 0x8c57
movq 0x7c40f(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d279(%rip), %rsi     # 0x75e54
callq 0x3620
cmpl $0x0, %eax
jne 0x8bef
movq $0x1e, -0x20(%rbp)
jmp 0x8c55
movq 0x7c3ea(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d259(%rip), %rsi     # 0x75e59
callq 0x3620
cmpl $0x0, %eax
jne 0x8c14
movq $0x1f, -0x20(%rbp)
jmp 0x8c53
movq 0x7c3c5(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
leaq 0x6d23e(%rip), %rsi     # 0x75e63
callq 0x3620
cmpl $0x0, %eax
jne 0x8c39
movq $0x20, -0x20(%rbp)
jmp 0x8c51
movq 0x7c3a0(%rip), %rax     # 0x84fe0
movq (%rax), %rsi
leaq 0x6d225(%rip), %rdi     # 0x75e6f
movb $0x0, %al
callq 0x8390
jmp 0x8c53
jmp 0x8c55
jmp 0x8c57
jmp 0x8c59
jmp 0x8c5b
jmp 0x8c5d
jmp 0x8c5f
jmp 0x8c61
jmp 0x8c63
jmp 0x8c65
jmp 0x8c67
jmp 0x8d26
movq 0x7c36d(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
callq 0x35f0
movq %rax, -0x28(%rbp)
jmp 0x8d26
movq 0x7c355(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
callq 0x3300
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x8d26
movq 0x7c338(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
callq 0x3490
movq %rax, -0x2028(%rbp)
jmp 0x8d26
movq 0x7c320(%rip), %rax     # 0x84fe0
movq (%rax), %rdi
callq 0x3380
cmpq $0x1fe8, %rax           # imm = 0x1FE8
jbe 0x8ce3
leaq 0x6d1b5(%rip), %rdi     # 0x75e8c
movl $0x1fe9, %esi           # imm = 0x1FE9
movb $0x0, %al
callq 0x8390
leaq -0x2020(%rbp), %rdi
movq 0x7c2ef(%rip), %rax     # 0x84fe0
movq (%rax), %rsi
callq 0x3660
jmp 0x8d26
leaq -0x14(%rbp), %rdi
callq 0x9430
movl %eax, -0x4(%rbp)
jmp 0x9417
leaq -0x14(%rbp), %rdi
callq 0x9430
movl -0x18(%rbp), %esi
leaq 0x6c6e0(%rip), %rdi     # 0x753ff
movb $0x0, %al
callq 0x8390
jmp 0x8a14
cmpq $0x7, -0x20(%rbp)
jne 0x8d45
movq -0x2028(%rbp), %rax
shlq $0x8, %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x7c274(%rip), %rax     # 0x84fc0
movl (%rax), %eax
addl $0x2, %eax
cmpl -0x8(%rbp), %eax
jle 0x8d6d
leaq -0x14(%rbp), %rdi
callq 0x9430
leaq 0x6d14b(%rip), %rdi     # 0x75eb1
movb $0x0, %al
callq 0x8390
movq -0x10(%rbp), %rax
movq 0x7c248(%rip), %rcx     # 0x84fc0
movl (%rcx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movq 0x7c23a(%rip), %rdx     # 0x84fc0
movl %esi, (%rdx)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x9580
movq %rax, -0x2030(%rbp)
movq $0x0, -0x2038(%rbp)
movq 0x7c213(%rip), %rax     # 0x84fc0
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jge 0x8dd9
movq -0x10(%rbp), %rax
movq 0x7c201(%rip), %rcx     # 0x84fc0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x6d10a(%rip), %rsi     # 0x75ed7
callq 0x3260
movq %rax, -0x2038(%rbp)
movq $0x0, -0x2040(%rbp)
movq $0x0, -0x2048(%rbp)
movq $0x0, -0x2050(%rbp)
cmpq $0x6, -0x20(%rbp)
jne 0x8e7b
movq -0x10(%rbp), %rax
movq 0x7c1b4(%rip), %rcx     # 0x84fc0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3380
movq %rax, %rdi
addq $0xa, %rdi
movl $0x1, %esi
callq 0x36b0
movq %rax, -0x2040(%rbp)
movq -0x2040(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x7c17e(%rip), %rcx     # 0x84fc0
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3660
movq -0x2040(%rbp), %rdi
leaq 0x6d07e(%rip), %rsi     # 0x75eda
callq 0x3500
movq -0x2040(%rbp), %rdi
leaq 0x6d068(%rip), %rsi     # 0x75ed7
callq 0x3260
movq %rax, -0x2048(%rbp)
cmpq $0x20, -0x20(%rbp)
je 0x8e89
cmpq $0x1f, -0x20(%rbp)
jne 0x8ea3
leaq -0xc30(%rip), %rdi      # 0x8260
movl $0x2, %esi
callq 0x9600
movq %rax, -0x2058(%rbp)
jmp 0x8ebb
leaq -0xc4a(%rip), %rdi      # 0x8260
movl $0x1, %esi
callq 0x9600
movq %rax, -0x2058(%rbp)
movq $0x0, -0x2060(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x8f38
movq -0x28(%rbp), %rdi
leaq 0x6d008(%rip), %rsi     # 0x75ee0
callq 0x3620
cmpl $0x0, %eax
jne 0x8ef5
movq 0x7c10f(%rip), %rax     # 0x84ff8
movq (%rax), %rax
movq %rax, -0x2060(%rbp)
jmp 0x8f36
movq -0x28(%rbp), %rdi
leaq 0x6cfe7(%rip), %rsi     # 0x75ee7
callq 0x3620
cmpl $0x0, %eax
jne 0x8f1d
movq 0x7c0d7(%rip), %rax     # 0x84fe8
movq (%rax), %rax
movq %rax, -0x2060(%rbp)
jmp 0x8f34
movq -0x28(%rbp), %rdi
leaq 0x6c190(%rip), %rsi     # 0x750b8
callq 0x3260
movq %rax, -0x2060(%rbp)
jmp 0x8f36
jmp 0x8f38
movq $0x0, -0x2068(%rbp)
leaq -0xdbf0(%rbp), %rdi
xorl %esi, %esi
movl $0xbb80, %edx           # imm = 0xBB80
callq 0x3090
movq -0x2030(%rbp), %rdi
movq -0x2058(%rbp), %rsi
leaq -0xc5b(%rip), %rdx      # 0x8310
callq 0x9650
cmpl $0x0, %eax
je 0x9186
cmpq $0x0, -0x2060(%rbp)
je 0x8fbf
movq -0x2060(%rbp), %rdi
movq -0x2058(%rbp), %rax
movq (%rax), %rdx
movq -0x2058(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x2058(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x2068(%rbp), %r9
leaq 0x6cf36(%rip), %rsi     # 0x75eee
movb $0x0, %al
callq 0x37f0
cmpq $0x3e8, -0x2068(%rbp) # imm = 0x3E8
jge 0x9009
movq -0x2068(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x2068(%rbp)
leaq -0xdbf0(%rbp), %rdi
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq -0x2058(%rbp), %rax
movq 0x18(%rax), %rsi
movl $0x30, %edx
callq 0x3860
jmp 0x8f56
cmpq $0x3e8, -0x2068(%rbp) # imm = 0x3E8
jne 0x910f
cmpq $0x63, -0x20(%rbp)
jne 0x903c
leaq -0xdbf0(%rbp), %rdi
movq -0x2068(%rbp), %rax
movl %eax, %esi
callq 0x97c0
cltq
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x2038(%rbp)
je 0x9069
movq -0x20(%rbp), %rsi
movq -0x2068(%rbp), %rdx
leaq -0x2020(%rbp), %rcx
movq -0x2038(%rbp), %r8
movl $0x1, %edi
callq 0x9820
movq $0x0, -0xdbf8(%rbp)
movq -0xdbf8(%rbp), %rax
cmpq -0x2068(%rbp), %rax
jge 0x910d
cmpq $0x0, -0x2038(%rbp)
je 0x90df
leaq -0xdbf0(%rbp), %rdi
imulq $0x30, -0xdbf8(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x2038(%rbp), %rdx
movq -0xdbf8(%rbp), %rax
movl %eax, %ecx
movq -0x2048(%rbp), %r9
leaq -0xdbf9(%rbp), %r8
leaq -0x2050(%rbp), %r10
leaq -0x14(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x8450
leaq -0xdbf0(%rbp), %rdi
imulq $0x30, -0xdbf8(%rbp), %rax
addq %rax, %rdi
callq 0x82b0
movq -0xdbf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xdbf8(%rbp)
jmp 0x9074
jmp 0x910f
cmpq $0x0, -0x2038(%rbp)
je 0x915f
movq -0x2058(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x2038(%rbp), %rdx
movq -0x2068(%rbp), %rax
movl %eax, %ecx
movq -0x2048(%rbp), %r9
leaq -0xdbf9(%rbp), %r8
leaq -0x2050(%rbp), %r10
leaq -0x14(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x8450
movq -0x2058(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x82b0
movq -0x2068(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2068(%rbp)
jmp 0x8f56
cmpq $0x3e8, -0x2068(%rbp) # imm = 0x3E8
jg 0x928c
cmpq $0x63, -0x20(%rbp)
jne 0x91b9
leaq -0xdbf0(%rbp), %rdi
movq -0x2068(%rbp), %rax
movl %eax, %esi
callq 0x97c0
cltq
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x2038(%rbp)
je 0x91e6
movq -0x20(%rbp), %rsi
movq -0x2068(%rbp), %rdx
leaq -0x2020(%rbp), %rcx
movq -0x2038(%rbp), %r8
movl $0x1, %edi
callq 0x9820
movq $0x0, -0xdbf8(%rbp)
movq -0xdbf8(%rbp), %rax
cmpq -0x2068(%rbp), %rax
jge 0x928a
cmpq $0x0, -0x2038(%rbp)
je 0x925c
leaq -0xdbf0(%rbp), %rdi
imulq $0x30, -0xdbf8(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x2038(%rbp), %rdx
movq -0xdbf8(%rbp), %rax
movl %eax, %ecx
movq -0x2048(%rbp), %r9
leaq -0xdbf9(%rbp), %r8
leaq -0x2050(%rbp), %r10
leaq -0x14(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x8450
leaq -0xdbf0(%rbp), %rdi
imulq $0x30, -0xdbf8(%rbp), %rax
addq %rax, %rdi
callq 0x82b0
movq -0xdbf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xdbf8(%rbp)
jmp 0x91f1
jmp 0x928c
cmpq $0x2, -0x20(%rbp)
jne 0x92bf
cmpq $0x0, -0x2038(%rbp)
je 0x92b8
movq -0x2038(%rbp), %rcx
leaq -0xdbf9(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x3780
movb $0x0, -0xdbf9(%rbp)
movq -0x2058(%rbp), %rdi
leaq -0x101d(%rip), %rsi     # 0x82b0
callq 0x98d0
movq -0x2030(%rbp), %rdi
callq 0x9910
cmpq $0x0, -0x2060(%rbp)
je 0x92fd
movq -0x2060(%rbp), %rdi
callq 0x36d0
movq -0x28(%rbp), %rdi
callq 0x3370
movq -0x2038(%rbp), %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x3120
movq -0x2038(%rbp), %rcx
leaq -0x2068(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x3780
cmpq $0x0, -0x2048(%rbp)
je 0x93fa
movq -0x2048(%rbp), %rdi
callq 0x36d0
movq -0x2040(%rbp), %rdi
leaq 0x6c52d(%rip), %rsi     # 0x75882
callq 0x3260
movq %rax, -0x2048(%rbp)
movq -0x2038(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x3120
movl $0x0, -0xdc00(%rbp)
movl -0xdc00(%rbp), %eax
cmpq -0x2050(%rbp), %rax
jae 0x93d6
movq -0x2048(%rbp), %rcx
leaq -0xdbfa(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x35b0
movq -0x2038(%rbp), %rcx
leaq -0xdbfa(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x3780
movl -0xdc00(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc00(%rbp)
jmp 0x9380
movq -0x2048(%rbp), %rdi
callq 0x36d0
movq -0x2040(%rbp), %rdi
callq 0x3280
movq -0x2040(%rbp), %rdi
callq 0x3370
cmpq $0x0, -0x2038(%rbp)
je 0x9410
movq -0x2038(%rbp), %rdi
callq 0x36d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xdc20, %rsp           # imm = 0xDC20
popq %rbp
retq
nopw %cs:(%rax,%rax)