// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PagerOpen
SQLITE_PRIVATE int sqlite3PagerOpen(
  sqlite3_vfs *pVfs,       /* The virtual file system to use */
  Pager **ppPager,         /* OUT: Return the Pager structure here */
  const char *zFilename,   /* Name of the database file to open */
  int nExtra,              /* Extra bytes append to each in-memory page */
  int flags,               /* flags controlling this file */
  int vfsFlags,            /* flags passed through to sqlite3_vfs.xOpen() */
  void (*xReinit)(DbPage*) /* Function to reinitialize pages */
){
  u8 *pPtr;
  Pager *pPager = 0;       /* Pager object to allocate and return */
  int rc = SQLITE_OK;      /* Return code */
  int tempFile = 0;        /* True for temp files (incl. in-memory files) */
  int memDb = 0;           /* True if this is an in-memory file */
#ifdef SQLITE_ENABLE_DESERIALIZE
  int memJM = 0;           /* Memory journal mode */
#else
# define memJM 0
#endif
  int readOnly = 0;        /* True if this is a read-only file */
  int journalFileSize;     /* Bytes to allocate for each journal fd */
  char *zPathname = 0;     /* Full path to database file */
  int nPathname = 0;       /* Number of bytes in zPathname */
  int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */
  int pcacheSize = sqlite3PcacheSize();       /* Bytes to allocate for PCache */
  u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE;  /* Default page size */
  const char *zUri = 0;    /* URI args to copy */
  int nUriByte = 1;        /* Number of bytes of URI args at *zUri */
  int nUri = 0;            /* Number of URI parameters */

  /* Figure out how much space is required for each journal file-handle
  ** (there are two of them, the main journal and the sub-journal).  */
  journalFileSize = ROUND8(sqlite3JournalSize(pVfs));

  /* Set the output variable to NULL in case an error occurs. */
  *ppPager = 0;

#ifndef SQLITE_OMIT_MEMORYDB
  if( flags & PAGER_MEMORY ){
    memDb = 1;
    if( zFilename && zFilename[0] ){
      zPathname = sqlite3DbStrDup(0, zFilename);
      if( zPathname==0  ) return SQLITE_NOMEM_BKPT;
      nPathname = sqlite3Strlen30(zPathname);
      zFilename = 0;
    }
  }
#endif

  /* Compute and store the full pathname in an allocated buffer pointed
  ** to by zPathname, length nPathname. Or, if this is a temporary file,
  ** leave both nPathname and zPathname set to 0.
  */
  if( zFilename && zFilename[0] ){
    const char *z;
    nPathname = pVfs->mxPathname+1;
    zPathname = sqlite3DbMallocRaw(0, nPathname*2);
    if( zPathname==0 ){
      return SQLITE_NOMEM_BKPT;
    }
    zPathname[0] = 0; /* Make sure initialized even if FullPathname() fails */
    rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname);
    if( rc!=SQLITE_OK ){
      if( rc==SQLITE_OK_SYMLINK ){
        if( vfsFlags & SQLITE_OPEN_NOFOLLOW ){
          rc = SQLITE_CANTOPEN_SYMLINK;
        }else{
          rc = SQLITE_OK;
        }
      }
    }
    nPathname = sqlite3Strlen30(zPathname);
    z = zUri = &zFilename[sqlite3Strlen30(zFilename)+1];
    while( *z ){
      z += strlen(z)+1;
      z += strlen(z)+1;
      nUri++;
    }
    nUriByte = (int)(&z[1] - zUri);
    assert( nUriByte>=1 );
    if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){
      /* This branch is taken when the journal path required by
      ** the database being opened will be more than pVfs->mxPathname
      ** bytes in length. This means the database cannot be opened,
      ** as it will not be possible to open the journal file or even
      ** check for a hot-journal before reading.
      */
      rc = SQLITE_CANTOPEN_BKPT;
    }
    if( rc!=SQLITE_OK ){
      sqlite3DbFree(0, zPathname);
      return rc;
    }
  }

  /* Allocate memory for the Pager structure, PCache object, the
  ** three file descriptors, the database file name and the journal
  ** file name. The layout in memory is as follows:
  **
  **     Pager object                    (sizeof(Pager) bytes)
  **     PCache object                   (sqlite3PcacheSize() bytes)
  **     Database file handle            (pVfs->szOsFile bytes)
  **     Sub-journal file handle         (journalFileSize bytes)
  **     Main journal file handle        (journalFileSize bytes)
  **     Ptr back to the Pager           (sizeof(Pager*) bytes)
  **     \0\0\0\0 database prefix        (4 bytes)
  **     Database file name              (nPathname+1 bytes)
  **     URI query parameters            (nUriByte bytes)
  **     Journal filename                (nPathname+8+1 bytes)
  **     WAL filename                    (nPathname+4+1 bytes)
  **     \0\0\0 terminator               (3 bytes)
  **
  ** Some 3rd-party software, over which we have no control, depends on
  ** the specific order of the filenames and the \0 separators between them
  ** so that it can (for example) find the database filename given the WAL
  ** filename without using the sqlite3_filename_database() API.  This is a
  ** misuse of SQLite and a bug in the 3rd-party software, but the 3rd-party
  ** software is in widespread use, so we try to avoid changing the filename
  ** order and formatting if possible.  In particular, the details of the
  ** filename format expected by 3rd-party software should be as follows:
  **
  **   - Main Database Path
  **   - \0
  **   - Multiple URI components consisting of:
  **     - Key
  **     - \0
  **     - Value
  **     - \0
  **   - \0
  **   - Journal Path
  **   - \0
  **   - WAL Path (zWALName)
  **   - \0
  **
  ** The sqlite3_create_filename() interface and the databaseFilename() utility
  ** that is used by sqlite3_filename_database() and kin also depend on the
  ** specific formatting and order of the various filenames, so if the format
  ** changes here, be sure to change it there as well.
  */
  pPtr = (u8 *)sqlite3MallocZero(
    ROUND8(sizeof(*pPager)) +            /* Pager structure */
    ROUND8(pcacheSize) +                 /* PCache object */
    ROUND8(pVfs->szOsFile) +             /* The main db file */
    journalFileSize * 2 +                /* The two journal files */
    sizeof(pPager) +                     /* Space to hold a pointer */
    4 +                                  /* Database prefix */
    nPathname + 1 +                      /* database filename */
    nUriByte +                           /* query parameters */
    nPathname + 8 + 1 +                  /* Journal filename */
#ifndef SQLITE_OMIT_WAL
    nPathname + 4 + 1 +                  /* WAL filename */
#endif
    3                                    /* Terminator */
  );
  assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) );
  if( !pPtr ){
    sqlite3DbFree(0, zPathname);
    return SQLITE_NOMEM_BKPT;
  }
  pPager = (Pager*)pPtr;                  pPtr += ROUND8(sizeof(*pPager));
  pPager->pPCache = (PCache*)pPtr;        pPtr += ROUND8(pcacheSize);
  pPager->fd = (sqlite3_file*)pPtr;       pPtr += ROUND8(pVfs->szOsFile);
  pPager->sjfd = (sqlite3_file*)pPtr;     pPtr += journalFileSize;
  pPager->jfd =  (sqlite3_file*)pPtr;     pPtr += journalFileSize;
  assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
  memcpy(pPtr, &pPager, sizeof(pPager));  pPtr += sizeof(pPager);

  /* Fill in the Pager.zFilename and pPager.zQueryParam fields */
                                          pPtr += 4;  /* Skip zero prefix */
  pPager->zFilename = (char*)pPtr;
  if( nPathname>0 ){
    memcpy(pPtr, zPathname, nPathname);   pPtr += nPathname + 1;
    if( zUri ){
      memcpy(pPtr, zUri, nUriByte);       pPtr += nUriByte;
    }else{
                                          pPtr++;
    }
  }


  /* Fill in Pager.zJournal */
  if( nPathname>0 ){
    pPager->zJournal = (char*)pPtr;
    memcpy(pPtr, zPathname, nPathname);   pPtr += nPathname;
    memcpy(pPtr, "-journal",8);           pPtr += 8 + 1;
#ifdef SQLITE_ENABLE_8_3_NAMES
    sqlite3FileSuffix3(zFilename,pPager->zJournal);
    pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1);
#endif
  }else{
    pPager->zJournal = 0;
  }

#ifndef SQLITE_OMIT_WAL
  /* Fill in Pager.zWal */
  if( nPathname>0 ){
    pPager->zWal = (char*)pPtr;
    memcpy(pPtr, zPathname, nPathname);   pPtr += nPathname;
    memcpy(pPtr, "-wal", 4);              pPtr += 4 + 1;
#ifdef SQLITE_ENABLE_8_3_NAMES
    sqlite3FileSuffix3(zFilename, pPager->zWal);
    pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1);
#endif
  }else{
    pPager->zWal = 0;
  }
#endif

  if( nPathname ) sqlite3DbFree(0, zPathname);
  pPager->pVfs = pVfs;
  pPager->vfsFlags = vfsFlags;

  /* Open the pager file.
  */
  if( zFilename && zFilename[0] ){
    int fout = 0;                    /* VFS flags returned by xOpen() */
    rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout);
    assert( !memDb );
#ifdef SQLITE_ENABLE_DESERIALIZE
    memJM = (fout&SQLITE_OPEN_MEMORY)!=0;
#endif
    readOnly = (fout&SQLITE_OPEN_READONLY)!=0;

    /* If the file was successfully opened for read/write access,
    ** choose a default page size in case we have to create the
    ** database file. The default page size is the maximum of:
    **
    **    + SQLITE_DEFAULT_PAGE_SIZE,
    **    + The value returned by sqlite3OsSectorSize()
    **    + The largest page size that can be written atomically.
    */
    if( rc==SQLITE_OK ){
      int iDc = sqlite3OsDeviceCharacteristics(pPager->fd);
      if( !readOnly ){
        setSectorSize(pPager);
        assert(SQLITE_DEFAULT_PAGE_SIZE<=SQLITE_MAX_DEFAULT_PAGE_SIZE);
        if( szPageDflt<pPager->sectorSize ){
          if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){
            szPageDflt = SQLITE_MAX_DEFAULT_PAGE_SIZE;
          }else{
            szPageDflt = (u32)pPager->sectorSize;
          }
        }
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
        {
          int ii;
          assert(SQLITE_IOCAP_ATOMIC512==(512>>8));
          assert(SQLITE_IOCAP_ATOMIC64K==(65536>>8));
          assert(SQLITE_MAX_DEFAULT_PAGE_SIZE<=65536);
          for(ii=szPageDflt; ii<=SQLITE_MAX_DEFAULT_PAGE_SIZE; ii=ii*2){
            if( iDc&(SQLITE_IOCAP_ATOMIC|(ii>>8)) ){
              szPageDflt = ii;
            }
          }
        }
#endif
      }
      pPager->noLock = sqlite3_uri_boolean(pPager->zFilename, "nolock", 0);
      if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0
       || sqlite3_uri_boolean(pPager->zFilename, "immutable", 0) ){
          vfsFlags |= SQLITE_OPEN_READONLY;
          goto act_like_temp_file;
      }
    }
  }else{
    /* If a temporary file is requested, it is not opened immediately.
    ** In this case we accept the default page size and delay actually
    ** opening the file until the first call to OsWrite().
    **
    ** This branch is also run for an in-memory database. An in-memory
    ** database is the same as a temp-file that is never written out to
    ** disk and uses an in-memory rollback journal.
    **
    ** This branch also runs for files marked as immutable.
    */
act_like_temp_file:
    tempFile = 1;
    pPager->eState = PAGER_READER;     /* Pretend we already have a lock */
    pPager->eLock = EXCLUSIVE_LOCK;    /* Pretend we are in EXCLUSIVE mode */
    pPager->noLock = 1;                /* Do no locking */
    readOnly = (vfsFlags&SQLITE_OPEN_READONLY);
  }

  /* The following call to PagerSetPagesize() serves to set the value of
  ** Pager.pageSize and to allocate the Pager.pTmpSpace buffer.
  */
  if( rc==SQLITE_OK ){
    assert( pPager->memDb==0 );
    rc = sqlite3PagerSetPagesize(pPager, &szPageDflt, -1);
    testcase( rc!=SQLITE_OK );
  }

  /* Initialize the PCache object. */
  if( rc==SQLITE_OK ){
    nExtra = ROUND8(nExtra);
    assert( nExtra>=8 && nExtra<1000 );
    rc = sqlite3PcacheOpen(szPageDflt, nExtra, !memDb,
                       !memDb?pagerStress:0, (void *)pPager, pPager->pPCache);
  }

  /* If an error occurred above, free the  Pager structure and close the file.
  */
  if( rc!=SQLITE_OK ){
    sqlite3OsClose(pPager->fd);
    sqlite3PageFree(pPager->pTmpSpace);
    sqlite3_free(pPager);
    return rc;
  }

  PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename));
  IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename))

  pPager->useJournal = (u8)useJournal;
  /* pPager->stmtOpen = 0; */
  /* pPager->stmtInUse = 0; */
  /* pPager->nRef = 0; */
  /* pPager->stmtSize = 0; */
  /* pPager->stmtJSize = 0; */
  /* pPager->nPage = 0; */
  pPager->mxPgno = SQLITE_MAX_PAGE_COUNT;
  /* pPager->state = PAGER_UNLOCK; */
  /* pPager->errMask = 0; */
  pPager->tempFile = (u8)tempFile;
  assert( tempFile==PAGER_LOCKINGMODE_NORMAL
          || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE );
  assert( PAGER_LOCKINGMODE_EXCLUSIVE==1 );
  pPager->exclusiveMode = (u8)tempFile;
  pPager->changeCountDone = pPager->tempFile;
  pPager->memDb = (u8)memDb;
  pPager->readOnly = (u8)readOnly;
  assert( useJournal || pPager->tempFile );
  pPager->noSync = pPager->tempFile;
  if( pPager->noSync ){
    assert( pPager->fullSync==0 );
    assert( pPager->extraSync==0 );
    assert( pPager->syncFlags==0 );
    assert( pPager->walSyncFlags==0 );
  }else{
    pPager->fullSync = 1;
    pPager->extraSync = 0;
    pPager->syncFlags = SQLITE_SYNC_NORMAL;
    pPager->walSyncFlags = SQLITE_SYNC_NORMAL | (SQLITE_SYNC_NORMAL<<2);
  }
  /* pPager->pFirst = 0; */
  /* pPager->pFirstSynced = 0; */
  /* pPager->pLast = 0; */
  pPager->nExtra = (u16)nExtra;
  pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
  assert( isOpen(pPager->fd) || tempFile );
  setSectorSize(pPager);
  if( !useJournal ){
    pPager->journalMode = PAGER_JOURNALMODE_OFF;
  }else if( memDb || memJM ){
    pPager->journalMode = PAGER_JOURNALMODE_MEMORY;
  }
  /* pPager->xBusyHandler = 0; */
  /* pPager->pBusyHandlerArg = 0; */
  pPager->xReiniter = xReinit;
  setGetterMethod(pPager);
  /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
  /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */

  *ppPager = pPager;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x28(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x68(%rbp)
callq 0x3dbb50
movl %eax, -0x6c(%rbp)
movl $0x1000, -0x70(%rbp)    # imm = 0x1000
movq $0x0, -0x78(%rbp)
movl $0x1, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3dbb60
addl $0x7, %eax
andl $-0x8, %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movl -0x28(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3dae2e
movl $0x1, -0x4c(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3dae2c
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3dae2c
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3c91a0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x3dae18
movl $0x7, -0x4(%rbp)
jmp 0x3db56d
movq -0x60(%rbp), %rdi
callq 0x3c3400
movl %eax, -0x64(%rbp)
movq $0x0, -0x20(%rbp)
jmp 0x3dae2e
cmpq $0x0, -0x20(%rbp)
je 0x3dafb3
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3dafb3
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
shll %eax
movslq %eax, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3cd3a0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x3dae7e
movl $0x7, -0x4(%rbp)
jmp 0x3db56d
movq -0x60(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x64(%rbp), %edx
movq -0x60(%rbp), %rcx
callq 0x3dac90
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x3daecc
cmpl $0x200, -0x44(%rbp)     # imm = 0x200
jne 0x3daeca
movl -0x2c(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x3daec1
movl $0x60e, -0x44(%rbp)     # imm = 0x60E
jmp 0x3daec8
movl $0x0, -0x44(%rbp)
jmp 0x3daeca
jmp 0x3daecc
movq -0x60(%rbp), %rdi
callq 0x3c3400
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3c3400
movl %eax, %ecx
movq -0x98(%rbp), %rax
addl $0x1, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
cmpb $0x0, (%rax)
je 0x3daf5c
movq -0x88(%rbp), %rdi
callq 0x192b0
addq $0x1, %rax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x192b0
addq $0x1, %rax
addq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x3daf09
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq -0x78(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x3daf93
movl -0x64(%rbp), %eax
addl $0x8, %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0x3daf93
movl $0xdc73, %edi           # imm = 0xDC73
callq 0x3d80e0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x3dafb1
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3c00a0
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3db56d
jmp 0x3dafb3
movl -0x6c(%rbp), %eax
addl $0x7, %eax
andl $-0x8, %eax
movslq %eax, %rdi
addq $0x130, %rdi            # imm = 0x130
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x7, %eax
andl $-0x8, %eax
cltq
addq %rax, %rdi
movl -0x54(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
addq $0x8, %rdi
addq $0x4, %rdi
movslq -0x64(%rbp), %rax
addq %rax, %rdi
addq $0x1, %rdi
movslq -0x7c(%rbp), %rax
addq %rax, %rdi
movslq -0x64(%rbp), %rax
addq %rax, %rdi
addq $0x8, %rdi
addq $0x1, %rdi
movslq -0x64(%rbp), %rax
addq %rax, %rdi
addq $0x4, %rdi
addq $0x1, %rdi
addq $0x3, %rdi
callq 0x3c51d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x3db047
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3c00a0
movl $0x7, -0x4(%rbp)
jmp 0x3db56d
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
addq $0x130, %rax            # imm = 0x130
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x118(%rax)
movl -0x6c(%rbp), %ecx
addl $0x7, %ecx
andl $-0x8, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x7, %ecx
andl $-0x8, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x58(%rax)
movl -0x54(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
movl -0x54(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd0(%rax)
cmpl $0x0, -0x64(%rbp)
jle 0x3db17a
movq -0x38(%rbp), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x19610
movl -0x64(%rbp), %ecx
addl $0x1, %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x3db16c
movq -0x38(%rbp), %rdi
movq -0x78(%rbp), %rsi
movslq -0x7c(%rbp), %rdx
callq 0x19610
movl -0x7c(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0x3db178
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x3db17a
cmpl $0x0, -0x64(%rbp)
jle 0x3db1cd
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x38(%rbp), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x19610
movl -0x64(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x1cff69(%rip), %rcx    # 0x5ab125
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
addq $0x9, %rax
movq %rax, -0x38(%rbp)
jmp 0x3db1dc
movq -0x40(%rbp), %rax
movq $0x0, 0xd8(%rax)
cmpl $0x0, -0x64(%rbp)
jle 0x3db22d
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x128(%rax)
movq -0x38(%rbp), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x19610
movl -0x64(%rbp), %ecx
movq -0x38(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x1cff11(%rip), %ecx    # 0x5ab12e
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x38(%rbp)
jmp 0x3db23c
movq -0x40(%rbp), %rax
movq $0x0, 0x128(%rax)
cmpl $0x0, -0x64(%rbp)
je 0x3db24f
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3c00a0
movq -0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movl -0x2c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xb4(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x3db390
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3db390
movl $0x0, -0x8c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0xd0(%rax), %rsi
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rdx
movl -0x2c(%rbp), %ecx
leaq -0x8c(%rbp), %r8
callq 0x3dbb90
movl %eax, -0x44(%rbp)
movl -0x8c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x3db38e
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x3dbbe0
movl %eax, -0x90(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0x3db331
movq -0x40(%rbp), %rdi
callq 0x3dbc10
movl -0x70(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0xb8(%rcx), %eax
jae 0x3db32f
movq -0x40(%rbp), %rax
cmpl $0x2000, 0xb8(%rax)     # imm = 0x2000
jbe 0x3db320
movl $0x2000, -0x70(%rbp)    # imm = 0x2000
jmp 0x3db32d
movq -0x40(%rbp), %rax
movl 0xb8(%rax), %eax
movl %eax, -0x70(%rbp)
jmp 0x3db32f
jmp 0x3db331
movq -0x40(%rbp), %rax
movq 0xd0(%rax), %rdi
leaq 0x1cfdf0(%rip), %rsi    # 0x5ab133
xorl %edx, %edx
callq 0x3d55b0
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x11(%rax)
movl -0x90(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x3db381
movq -0x40(%rbp), %rax
movq 0xd0(%rax), %rdi
leaq 0x1cfdc5(%rip), %rsi    # 0x5ab13a
xorl %edx, %edx
callq 0x3d55b0
cmpl $0x0, %eax
je 0x3db38c
movl -0x2c(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3db392
jmp 0x3db38e
jmp 0x3db3ba
jmp 0x3db392
movl $0x1, -0x48(%rbp)
movq -0x40(%rbp), %rax
movb $0x1, 0x14(%rax)
movq -0x40(%rbp), %rax
movb $0x4, 0x15(%rax)
movq -0x40(%rbp), %rax
movb $0x1, 0x11(%rax)
movl -0x2c(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x3db3d5
movq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3db760
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x3db431
movl -0x24(%rbp), %eax
addl $0x7, %eax
andl $-0x8, %eax
movl %eax, -0x24(%rbp)
movl -0x70(%rbp), %edi
movl -0x24(%rbp), %esi
cmpl $0x0, -0x4c(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
cmpl $0x0, -0x4c(%rbp)
setne %r8b
xorb $-0x1, %r8b
xorl %eax, %eax
movl %eax, %ecx
leaq 0x8fe(%rip), %rax       # 0x3dbd10
testb $0x1, %r8b
cmovneq %rax, %rcx
movq -0x40(%rbp), %r8
movq -0x40(%rbp), %rax
movq 0x118(%rax), %r9
callq 0x3dbc70
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x3db468
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x3dbe40
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rdi
callq 0x3dbe80
movq -0x40(%rbp), %rdi
callq 0x3c0800
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3db56d
movl -0x68(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0xa(%rax)
movq -0x40(%rbp), %rax
movl $0x3fffffff, 0xc0(%rax) # imm = 0x3FFFFFFF
movl -0x48(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x10(%rax)
movl -0x48(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x40(%rbp), %rax
movb 0x10(%rax), %cl
movq -0x40(%rbp), %rax
movb %cl, 0x16(%rax)
movl -0x4c(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x13(%rax)
movl -0x50(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x12(%rax)
movq -0x40(%rbp), %rax
movb 0x10(%rax), %cl
movq -0x40(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x40(%rbp), %rax
cmpb $0x0, 0xb(%rax)
je 0x3db4da
jmp 0x3db4fa
movq -0x40(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x40(%rbp), %rax
movb $0x0, 0xd(%rax)
movq -0x40(%rbp), %rax
movb $0x2, 0xe(%rax)
movq -0x40(%rbp), %rax
movb $0xa, 0xf(%rax)
movl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x40(%rbp), %rax
movw %cx, 0xb0(%rax)
movq -0x40(%rbp), %rax
movq $-0x1, 0xc8(%rax)
movq -0x40(%rbp), %rdi
callq 0x3dbc10
cmpl $0x0, -0x68(%rbp)
jne 0x3db533
movq -0x40(%rbp), %rax
movb $0x2, 0x9(%rax)
jmp 0x3db543
cmpl $0x0, -0x4c(%rbp)
je 0x3db541
movq -0x40(%rbp), %rax
movb $0x4, 0x9(%rax)
jmp 0x3db543
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x100(%rax)
movq -0x40(%rbp), %rdi
callq 0x3dbea0
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)