// File: /workspace/github_c_makefile_star2_O0/thegenemyers[P]DASCRUBBER/DB.c
// Function: Open_DB
int Open_DB(char* path, DAZZ_DB *db)
{ DAZZ_DB dbcopy;
  char   *root, *pwd, *bptr, *fptr, *cat;
  int     nreads;
  FILE   *index, *dbvis, *bases;
  int     status, plen, isdam;
  int     part, cutoff, all;
  int     ufirst, tfirst, ulast, tlast;

  status = -1;
  dbcopy = *db;

  plen = strlen(path);
  if (strcmp(path+(plen-4),".dam") == 0)
    { root = Root(path,".dam");
      isdam = 1;
    }
  else
    { if (strcmp(path+(plen-3),".db") == 0)
        isdam = -1;
      else
        isdam = 0;
      root = Root(path,".db");
    }
  pwd = PathTo(path);

  bptr = rindex(root,'.');
  if (bptr != NULL && bptr[1] != '\0' && bptr[1] != '-')
    { part = strtol(bptr+1,&fptr,10);
      if (*fptr != '\0' || part == 0)
        part = 0;
      else
        *bptr = '\0';
    }
  else
    part = 0;

  if (isdam > 0)
    cat = MyCatenate(pwd,"/",root,".dam");
  else
    cat = MyCatenate(pwd,"/",root,".db");
  if (cat == NULL)
    return (-1);
  if ((dbvis = fopen(cat,"r")) == NULL)
    { if (isdam < 0)
        { EPRINTF(EPLACE,"%s: Could not open DB %s\n",Prog_Name,path);
          goto error;
        }
      if (isdam > 0)
        { EPRINTF(EPLACE,"%s: Could not open DAM %s\n",Prog_Name,path);
          goto error;
        }
      cat = MyCatenate(pwd,"/",root,".dam");
      if (cat == NULL)
        return (-1);
      if ((dbvis = fopen(cat,"r")) == NULL)
        { EPRINTF(EPLACE,"%s: Could not open %s as a DB or a DAM\n",Prog_Name,path);
          goto error;
        }
      isdam = 1;
    }
  if (isdam < 0)
    isdam = 0;

  if ((index = Fopen(MyCatenate(pwd,PATHSEP,root,".idx"),"r")) == NULL)
    goto error1;
  if (fread(db,sizeof(DAZZ_DB),1,index) != 1)
    { EPRINTF(EPLACE,"%s: Index file (.idx) of %s is junk\n",Prog_Name,root);
      goto error2;
    }

  { int   p, nblocks, nfiles;
    int64 size;
    char  fname[MAX_NAME], prolog[MAX_NAME];

    nblocks = 0;
    if (fscanf(dbvis,DB_NFILE,&nfiles) != 1)
      { EPRINTF(EPLACE,"%s: Stub file (.db) of %s is junk\n",Prog_Name,root);
        goto error2;
      }
    for (p = 0; p < nfiles; p++)
      if (fscanf(dbvis,DB_FDATA,&tlast,fname,prolog) != 3)
        { EPRINTF(EPLACE,"%s: Stub file (.db) of %s is junk\n",Prog_Name,root);
          goto error2;
        }
    if (fscanf(dbvis,DB_NBLOCK,&nblocks) != 1)
      if (part == 0)
        { cutoff = 0;
          all    = DB_ALL;
        }
      else
        { EPRINTF(EPLACE,"%s: DB %s has not yet been partitioned, cannot request a block !\n",
                         Prog_Name,root);
          goto error2;
        }
    else
      { if (fscanf(dbvis,DB_PARAMS,&size,&cutoff,&all) != 3)
          { EPRINTF(EPLACE,"%s: Stub file (.db) of %s is junk\n",Prog_Name,root);
            goto error2;
          }
        if (part > nblocks)
          { EPRINTF(EPLACE,"%s: DB %s has only %d blocks\n",Prog_Name,root,nblocks);
            goto error2;
          }
      }

    if (part > 0)
      { for (p = 1; p <= part; p++)
          if (fscanf(dbvis,DB_BDATA,&ufirst,&tfirst) != 2)
            { EPRINTF(EPLACE,"%s: Stub file (.db) of %s is junk\n",Prog_Name,root);
              goto error2;
            }
        if (fscanf(dbvis,DB_BDATA,&ulast,&tlast) != 2)
          { EPRINTF(EPLACE,"%s: Stub file (.db) of %s is junk\n",Prog_Name,root);
            goto error2;
          }
      }
    else
      { ufirst = tfirst = 0;
        ulast  = db->ureads;
        tlast  = db->treads;
      }
  }

  db->trimmed = 0;
  db->tracks  = NULL;
  db->part    = part;
  db->cutoff  = cutoff;
  db->allarr |= all;
  db->ufirst  = ufirst;
  db->tfirst  = tfirst;

  nreads = ulast-ufirst;
  if (part <= 0)
    { db->reads = (DAZZ_READ *) Malloc(sizeof(DAZZ_READ)*(nreads+2),"Allocating Open_DB index");
      if (db->reads == NULL)
        goto error2;
        
      db->reads += 1;
      if (fread(db->reads,sizeof(DAZZ_READ),nreads,index) != (size_t) nreads)
        { EPRINTF(EPLACE,"%s: Index file (.idx) of %s is junk\n",Prog_Name,root);
          free(db->reads-1);
          goto error2;
        }
    }
  else
    { DAZZ_READ *reads;
      int        i, r, maxlen;
      int64      totlen;

      reads = (DAZZ_READ *) Malloc(sizeof(DAZZ_READ)*(nreads+2),"Allocating Open_DB index");
      if (reads == NULL)
        goto error2;
      reads += 1;

      fseeko(index,sizeof(DAZZ_READ)*ufirst,SEEK_CUR);
      if (fread(reads,sizeof(DAZZ_READ),nreads,index) != (size_t) nreads)
        { EPRINTF(EPLACE,"%s: Index file (.idx) of %s is junk\n",Prog_Name,root);
          free(reads-1);
          goto error2;
        }

      totlen = 0;
      maxlen = 0;
      for (i = 0; i < nreads; i++)
        { r = reads[i].rlen;
          totlen += r;
          if (r > maxlen)
            maxlen = r;
        }

      db->maxlen = maxlen;
      db->totlen = totlen;
      db->reads  = reads;
    }

  ((int *) (db->reads))[-1] = ulast - ufirst;   //  Kludge, need these for DB part
  ((int *) (db->reads))[-2] = tlast - tfirst;

  db->nreads = nreads;
  db->path   = Strdup(MyCatenate(pwd,PATHSEP,root,""),"Allocating Open_DB path");
  if (db->path == NULL)
    { free(db->reads-1);
      goto error2;
    }
  bases = Fopen(MyCatenate(db->path,"","",".bps"),"r");
  if (bases == NULL)
     { free(db->path);
       free(db->reads-1);
       goto error2;
     }
  db->bases = (void *) bases;
  db->loaded = 0;

  status = isdam;

error2:
  fclose(index);
error1:
  fclose(dbvis);
error:
  if (bptr != NULL)
    *bptr = '.';

  free(pwd);
  free(root);

  if (status < 0)
    *db = dbcopy;

  return (status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4f50, %rsp           # imm = 0x4F50
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0xffffffff, -0xd4(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rsi
leaq -0x88(%rbp), %rdi
movl $0x70, %edx
callq 0x11c0
movq -0x10(%rbp), %rdi
callq 0x10d0
movl %eax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
movl -0xd8(%rbp), %eax
subl $0x4, %eax
cltq
addq %rax, %rdi
leaq 0xa9bb(%rip), %rsi      # 0xe485
callq 0x1170
cmpl $0x0, %eax
jne 0x3af7
movq -0x10(%rbp), %rdi
leaq 0xa9a6(%rip), %rsi      # 0xe485
callq 0x2590
movq %rax, -0x90(%rbp)
movl $0x1, -0xdc(%rbp)
jmp 0x3b47
movq -0x10(%rbp), %rdi
movl -0xd8(%rbp), %eax
subl $0x3, %eax
cltq
addq %rax, %rdi
leaq 0xa97a(%rip), %rsi      # 0xe48a
callq 0x1170
cmpl $0x0, %eax
jne 0x3b26
movl $0xffffffff, -0xdc(%rbp) # imm = 0xFFFFFFFF
jmp 0x3b30
movl $0x0, -0xdc(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xa94f(%rip), %rsi      # 0xe48a
callq 0x2590
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2500
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movl $0x2e, %esi
callq 0x1240
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
je 0x3beb
movq -0xa0(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x3beb
movq -0xa0(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2d, %eax
je 0x3beb
movq -0xa0(%rbp), %rdi
addq $0x1, %rdi
leaq -0xa8(%rbp), %rsi
movl $0xa, %edx
callq 0x11b0
movl %eax, -0xe0(%rbp)
movq -0xa8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x3bd3
cmpl $0x0, -0xe0(%rbp)
jne 0x3bdf
movl $0x0, -0xe0(%rbp)
jmp 0x3be9
movq -0xa0(%rbp), %rax
movb $0x0, (%rax)
jmp 0x3bf5
movl $0x0, -0xe0(%rbp)
cmpl $0x0, -0xdc(%rbp)
jle 0x3c28
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0xa87b(%rip), %rsi      # 0xe48e
leaq 0xa86b(%rip), %rcx      # 0xe485
callq 0x4550
movq %rax, -0xb0(%rbp)
jmp 0x3c50
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0xa851(%rip), %rsi      # 0xe48e
leaq 0xa846(%rip), %rcx      # 0xe48a
callq 0x4550
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x3c66
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4540
movq -0xb0(%rbp), %rdi
leaq 0xb0e0(%rip), %rsi      # 0xed54
callq 0x1230
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
jne 0x3d7c
cmpl $0x0, -0xdc(%rbp)
jge 0x3cbb
movq 0xe35e(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10de4(%rip), %rdx     # 0x14a88
movq -0x10(%rbp), %rcx
leaq 0xa7e1(%rip), %rsi      # 0xe490
movb $0x0, %al
callq 0x1180
jmp 0x44ed
cmpl $0x0, -0xdc(%rbp)
jle 0x3cec
movq 0xe32d(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10db3(%rip), %rdx     # 0x14a88
movq -0x10(%rbp), %rcx
leaq 0xa7ca(%rip), %rsi      # 0xe4aa
movb $0x0, %al
callq 0x1180
jmp 0x44ed
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0xa78d(%rip), %rsi      # 0xe48e
leaq 0xa77d(%rip), %rcx      # 0xe485
callq 0x4550
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x3d2a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4540
movq -0xb0(%rbp), %rdi
leaq 0xb01c(%rip), %rsi      # 0xed54
callq 0x1230
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
jne 0x3d72
movq 0xe2a7(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10d2d(%rip), %rdx     # 0x14a88
movq -0x10(%rbp), %rcx
leaq 0xa75f(%rip), %rsi      # 0xe4c5
movb $0x0, %al
callq 0x1180
jmp 0x44ed
movl $0x1, -0xdc(%rbp)
cmpl $0x0, -0xdc(%rbp)
jge 0x3d8f
movl $0x0, -0xdc(%rbp)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0xa749(%rip), %rsi      # 0xe4ed
leaq 0xa745(%rip), %rcx      # 0xe4f0
callq 0x4550
movq %rax, %rdi
leaq 0xaf9a(%rip), %rsi      # 0xed54
callq 0x2480
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
jne 0x3dd1
jmp 0x44e1
movq -0x18(%rbp), %rdi
movq -0xc0(%rbp), %rcx
movl $0x70, %esi
movl $0x1, %edx
callq 0x10a0
cmpq $0x1, %rax
je 0x3e1c
movq 0xe200(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10c86(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa6e5(%rip), %rsi      # 0xe4f5
movb $0x0, %al
callq 0x1180
jmp 0x44d5
movl $0x0, -0x100(%rbp)
movq -0xc8(%rbp), %rdi
leaq 0xa5c5(%rip), %rsi      # 0xe3f9
leaq -0x104(%rbp), %rdx
movb $0x0, %al
callq 0x1080
cmpl $0x1, %eax
je 0x3e72
movq 0xe1aa(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10c30(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa6b4(%rip), %rsi      # 0xe51a
movb $0x0, %al
callq 0x1180
jmp 0x44d5
movl $0x0, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
cmpl -0x104(%rbp), %eax
jge 0x3ef7
movq -0xc8(%rbp), %rdi
leaq -0x2820(%rbp), %rcx
leaq -0x4f30(%rbp), %r8
leaq 0xa560(%rip), %rsi      # 0xe406
leaq -0xf8(%rbp), %rdx
movb $0x0, %al
callq 0x1080
cmpl $0x3, %eax
je 0x3ee4
movq 0xe138(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10bbe(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa642(%rip), %rsi      # 0xe51a
movb $0x0, %al
callq 0x1180
jmp 0x44d5
jmp 0x3ee6
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x3e7c
movq -0xc8(%rbp), %rdi
leaq 0xa528(%rip), %rsi      # 0xe42d
leaq -0x100(%rbp), %rdx
movb $0x0, %al
callq 0x1080
cmpl $0x1, %eax
je 0x3f67
cmpl $0x0, -0xe0(%rbp)
jne 0x3f37
movl $0x0, -0xe4(%rbp)
movl $0x1, -0xe8(%rbp)
jmp 0x3f62
movq 0xe0ba(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10b40(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa5e7(%rip), %rsi      # 0xe53d
movb $0x0, %al
callq 0x1180
jmp 0x44d5
jmp 0x4003
movq -0xc8(%rbp), %rdi
leaq 0xa4c6(%rip), %rsi      # 0xe43b
leaq -0x110(%rbp), %rdx
leaq -0xe4(%rbp), %rcx
leaq -0xe8(%rbp), %r8
movb $0x0, %al
callq 0x1080
cmpl $0x3, %eax
je 0x3fc1
movq 0xe05b(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10ae1(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa565(%rip), %rsi      # 0xe51a
movb $0x0, %al
callq 0x1180
jmp 0x44d5
movl -0xe0(%rbp), %eax
cmpl -0x100(%rbp), %eax
jle 0x4001
movq 0xe022(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10aa8(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
movl -0x100(%rbp), %r8d
leaq 0xa58a(%rip), %rsi      # 0xe57f
movb $0x0, %al
callq 0x1180
jmp 0x44d5
jmp 0x4003
cmpl $0x0, -0xe0(%rbp)
jle 0x40e3
movl $0x1, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
cmpl -0xe0(%rbp), %eax
jg 0x408e
movq -0xc8(%rbp), %rdi
leaq 0xa42b(%rip), %rsi      # 0xe461
leaq -0xec(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
movb $0x0, %al
callq 0x1080
cmpl $0x2, %eax
je 0x407b
movq 0xdfa1(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x10a27(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa4ab(%rip), %rsi      # 0xe51a
movb $0x0, %al
callq 0x1180
jmp 0x44d5
jmp 0x407d
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x401a
movq -0xc8(%rbp), %rdi
leaq 0xa3c5(%rip), %rsi      # 0xe461
leaq -0xf4(%rbp), %rdx
leaq -0xf8(%rbp), %rcx
movb $0x0, %al
callq 0x1080
cmpl $0x2, %eax
je 0x40e1
movq 0xdf3b(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x109c1(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa445(%rip), %rsi      # 0xe51a
movb $0x0, %al
callq 0x1180
jmp 0x44d5
jmp 0x4110
movl $0x0, -0xf0(%rbp)
movl $0x0, -0xec(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xf8(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x34(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x68(%rax)
movl -0xe0(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x38(%rax)
movl -0xe4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0xe8(%rbp), %ecx
movq -0x18(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movl -0xec(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x3c(%rax)
movl -0xf0(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x40(%rax)
movl -0xf4(%rbp), %eax
subl -0xec(%rbp), %eax
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xe0(%rbp)
jg 0x423d
movl -0xb4(%rbp), %eax
addl $0x2, %eax
cltq
imulq $0x28, %rax, %rdi
leaq 0xa3fd(%rip), %rsi      # 0xe59d
callq 0x22c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x41c0
jmp 0x44d5
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rcx
addq $0x28, %rcx
movq %rcx, 0x60(%rax)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
movslq -0xb4(%rbp), %rdx
movq -0xc0(%rbp), %rcx
movl $0x28, %esi
callq 0x10a0
movslq -0xb4(%rbp), %rcx
cmpq %rcx, %rax
je 0x4238
movq 0xddf5(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x1087b(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa2da(%rip), %rsi      # 0xe4f5
movb $0x0, %al
callq 0x1180
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
addq $-0x28, %rdi
callq 0x1030
jmp 0x44d5
jmp 0x43ba
movl -0xb4(%rbp), %eax
addl $0x2, %eax
cltq
imulq $0x28, %rax, %rdi
leaq 0xa34a(%rip), %rsi      # 0xe59d
callq 0x22c0
movq %rax, -0x4f38(%rbp)
cmpq $0x0, -0x4f38(%rbp)
jne 0x426e
jmp 0x44d5
movq -0x4f38(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x4f38(%rbp)
movq -0xc0(%rbp), %rdi
movslq -0xec(%rbp), %rax
imulq $0x28, %rax, %rsi
movl $0x1, %edx
callq 0x1220
movq -0x4f38(%rbp), %rdi
movslq -0xb4(%rbp), %rdx
movq -0xc0(%rbp), %rcx
movl $0x28, %esi
callq 0x10a0
movslq -0xb4(%rbp), %rcx
cmpq %rcx, %rax
je 0x4302
movq 0xdd2a(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x107b0(%rip), %rdx     # 0x14a88
movq -0x90(%rbp), %rcx
leaq 0xa20f(%rip), %rsi      # 0xe4f5
movb $0x0, %al
callq 0x1180
movq -0x4f38(%rbp), %rdi
addq $-0x28, %rdi
callq 0x1030
jmp 0x44d5
movq $0x0, -0x4f50(%rbp)
movl $0x0, -0x4f44(%rbp)
movl $0x0, -0x4f3c(%rbp)
movl -0x4f3c(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jge 0x438f
movq -0x4f38(%rbp), %rax
movslq -0x4f3c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x4f40(%rbp)
movslq -0x4f40(%rbp), %rax
addq -0x4f50(%rbp), %rax
movq %rax, -0x4f50(%rbp)
movl -0x4f40(%rbp), %eax
cmpl -0x4f44(%rbp), %eax
jle 0x437c
movl -0x4f40(%rbp), %eax
movl %eax, -0x4f44(%rbp)
jmp 0x437e
movl -0x4f3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4f3c(%rbp)
jmp 0x4321
movl -0x4f44(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x4f50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x4f38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movl -0xf4(%rbp), %ecx
subl -0xec(%rbp), %ecx
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movl %ecx, -0x4(%rax)
movl -0xf8(%rbp), %ecx
subl -0xf0(%rbp), %ecx
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movl %ecx, -0x8(%rax)
movl -0xb4(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0xa0e3(%rip), %rsi      # 0xe4ed
leaq 0xa54c(%rip), %rcx      # 0xe95d
callq 0x4550
movq %rax, %rdi
leaq 0xa196(%rip), %rsi      # 0xe5b6
callq 0x23e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x4451
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
addq $-0x28, %rdi
callq 0x1030
jmp 0x44d5
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
leaq 0xa4fd(%rip), %rdx      # 0xe95d
leaq 0xa167(%rip), %rcx      # 0xe5ce
movq %rdx, %rsi
callq 0x4550
movq %rax, %rdi
leaq 0xa8db(%rip), %rsi      # 0xed54
callq 0x2480
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x44af
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x1030
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
addq $-0x28, %rdi
callq 0x1030
jmp 0x44d5
movq -0xd0(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x50(%rax)
movl -0xdc(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x10b0
movq -0xc8(%rbp), %rdi
callq 0x10b0
cmpq $0x0, -0xa0(%rbp)
je 0x4501
movq -0xa0(%rbp), %rax
movb $0x2e, (%rax)
movq -0x98(%rbp), %rdi
callq 0x1030
movq -0x90(%rbp), %rdi
callq 0x1030
cmpl $0x0, -0xd4(%rbp)
jge 0x4537
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x70, %edx
callq 0x11c0
movl -0xd4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x4f50, %rsp           # imm = 0x4F50
popq %rbp
retq
nopl (%rax)