// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/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 */
  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 nUri = 0;            /* Number of bytes of URI args at *zUri */

  /* Figure out how much space is required for each journal file-handle
  ** (there are two of them, the main journal and the sub-journal). This
  ** is the maximum space required for an in-memory journal file handle 
  ** and a regular journal file-handle. Note that a "regular journal-handle"
  ** may be a wrapper capable of caching the first portion of the journal
  ** file in memory to implement the atomic-write optimization (see 
  ** source file journal.c).
  */
  if( sqlite3JournalSize(pVfs)>sqlite3MemJournalSize() ){
    journalFileSize = ROUND8(sqlite3JournalSize(pVfs));
  }else{
    journalFileSize = ROUND8(sqlite3MemJournalSize());
  }

  /* 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;
      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;
    }
    zPathname[0] = 0; /* Make sure initialized even if FullPathname() fails */
    rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname);
    nPathname = sqlite3Strlen30(zPathname);
    z = zUri = &zFilename[sqlite3Strlen30(zFilename)+1];
    while( *z ){
      z += sqlite3Strlen30(z)+1;
      z += sqlite3Strlen30(z)+1;
    }
    nUri = (int)(&z[1] - zUri);
    assert( nUri>=0 );
    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)
  **     Database file name              (nPathname+1 bytes)
  **     Journal file name               (nPathname+8+1 bytes)
  */
  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 */ 
    nPathname + 1 + nUri +         /* zFilename */
    nPathname + 8 + 2              /* zJournal */
#ifndef SQLITE_OMIT_WAL
    + nPathname + 4 + 2            /* zWal */
#endif
  );
  assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) );
  if( !pPtr ){
    sqlite3DbFree(0, zPathname);
    return SQLITE_NOMEM;
  }
  pPager =              (Pager*)(pPtr);
  pPager->pPCache =    (PCache*)(pPtr += ROUND8(sizeof(*pPager)));
  pPager->fd =   (sqlite3_file*)(pPtr += ROUND8(pcacheSize));
  pPager->sjfd = (sqlite3_file*)(pPtr += ROUND8(pVfs->szOsFile));
  pPager->jfd =  (sqlite3_file*)(pPtr += journalFileSize);
  pPager->zFilename =    (char*)(pPtr += journalFileSize);
  assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );

  /* Fill in the Pager.zFilename and Pager.zJournal buffers, if required. */
  if( zPathname ){
    assert( nPathname>0 );
    pPager->zJournal =   (char*)(pPtr += nPathname + 1 + nUri);
    memcpy(pPager->zFilename, zPathname, nPathname);
    if( nUri ) memcpy(&pPager->zFilename[nPathname+1], zUri, nUri);
    memcpy(pPager->zJournal, zPathname, nPathname);
    memcpy(&pPager->zJournal[nPathname], "-journal\000", 8+2);
    sqlite3FileSuffix3(pPager->zFilename, pPager->zJournal);
#ifndef SQLITE_OMIT_WAL
    pPager->zWal = &pPager->zJournal[nPathname+8+1];
    memcpy(pPager->zWal, zPathname, nPathname);
    memcpy(&pPager->zWal[nPathname], "-wal\000", 4+1);
    sqlite3FileSuffix3(pPager->zFilename, pPager->zWal);
#endif
    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 );
    readOnly = (fout&SQLITE_OPEN_READONLY);

    /* 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 && !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 iDc = sqlite3OsDeviceCharacteristics(pPager->fd);
        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
    }
  }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.
    */ 
    tempFile = 1;
    pPager->eState = PAGER_READER;
    pPager->eLock = EXCLUSIVE_LOCK;
    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 );
  }

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

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

  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; */
#if 0
  assert( pPager->state == (tempFile ? PAGER_EXCLUSIVE : PAGER_UNLOCK) );
#endif
  /* 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->syncFlags==0 );
    assert( pPager->walSyncFlags==0 );
    assert( pPager->ckptSyncFlags==0 );
  }else{
    pPager->fullSync = 1;
    pPager->syncFlags = SQLITE_SYNC_NORMAL;
    pPager->walSyncFlags = SQLITE_SYNC_NORMAL | WAL_SYNC_TRANSACTIONS;
    pPager->ckptSyncFlags = SQLITE_SYNC_NORMAL;
  }
  /* 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 ){
    pPager->journalMode = PAGER_JOURNALMODE_MEMORY;
  }
  /* pPager->xBusyHandler = 0; */
  /* pPager->pBusyHandlerArg = 0; */
  pPager->xReiniter = xReinit;
  /* 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 0x20dd0
movl %eax, -0x6c(%rbp)
movl $0x400, -0x70(%rbp)     # imm = 0x400
movq $0x0, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x90(%rbp)
callq 0x20de0
movl %eax, %ecx
movl -0x90(%rbp), %eax
cmpl %ecx, %eax
jle 0x2023b
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x7, %eax
andl $-0x8, %eax
movl %eax, -0x54(%rbp)
jmp 0x20249
callq 0x20de0
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 0x202b3
movl $0x1, -0x4c(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x202b1
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x202b1
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x11720
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x2029d
movl $0x7, -0x4(%rbp)
jmp 0x208b2
movq -0x60(%rbp), %rdi
callq 0x92f0
movl %eax, -0x64(%rbp)
movq $0x0, -0x20(%rbp)
jmp 0x202b3
cmpq $0x0, -0x20(%rbp)
je 0x2040a
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2040a
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %esi
shll %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x134e0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x20300
movl $0x7, -0x4(%rbp)
jmp 0x208b2
movq -0x60(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x64(%rbp), %edx
movq -0x60(%rbp), %rcx
callq 0x200e0
movl %eax, -0x44(%rbp)
movq -0x60(%rbp), %rdi
callq 0x92f0
movl %eax, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0x92f0
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 0x203b3
movq -0x88(%rbp), %rdi
callq 0x92f0
movl %eax, %ecx
addl $0x1, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x92f0
movl %eax, %ecx
addl $0x1, %ecx
movq -0x88(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
jmp 0x2035b
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq -0x78(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x203ea
movl -0x64(%rbp), %eax
addl $0x8, %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0x203ea
movl $0xa7b1, %edi           # imm = 0xA7B1
callq 0x1d9a0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x20408
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9cd0
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x208b2
jmp 0x2040a
movl -0x6c(%rbp), %eax
addl $0x7, %eax
andl $-0x8, %eax
cltq
addq $0x128, %rax            # imm = 0x128
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
addl $0x7, %ecx
andl $-0x8, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl -0x54(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movslq -0x64(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movslq -0x7c(%rbp), %rcx
addq %rcx, %rax
movslq -0x64(%rbp), %rcx
addq %rcx, %rax
addq $0x8, %rax
addq $0x2, %rax
movslq -0x64(%rbp), %rcx
addq %rcx, %rax
addq $0x4, %rax
addq $0x2, %rax
movl %eax, %edi
callq 0xd860
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x20494
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9cd0
movl $0x7, -0x4(%rbp)
jmp 0x208b2
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
addq $0x128, %rcx            # imm = 0x128
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0x110(%rax)
movl -0x6c(%rbp), %eax
addl $0x7, %eax
andl $-0x8, %eax
movq -0x38(%rbp), %rcx
cltq
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
addl $0x7, %eax
andl $-0x8, %eax
movq -0x38(%rbp), %rcx
cltq
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0x58(%rax)
movl -0x54(%rbp), %eax
movq -0x38(%rbp), %rcx
cltq
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0x50(%rax)
movl -0x54(%rbp), %eax
movq -0x38(%rbp), %rcx
cltq
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0xd0(%rax)
cmpq $0x0, -0x60(%rbp)
je 0x2063f
movl -0x64(%rbp), %eax
addl $0x1, %eax
addl -0x7c(%rbp), %eax
movq -0x38(%rbp), %rcx
cltq
addq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x40(%rbp), %rax
movq 0xd0(%rax), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x82f0
cmpl $0x0, -0x7c(%rbp)
je 0x20596
movq -0x40(%rbp), %rax
movq 0xd0(%rax), %rdi
movl -0x64(%rbp), %eax
addl $0x1, %eax
cltq
addq %rax, %rdi
movq -0x78(%rbp), %rsi
movslq -0x7c(%rbp), %rdx
callq 0x82f0
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x82f0
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rax
movslq -0x64(%rbp), %rcx
movq 0x8a8f0(%rip), %rdx     # 0xaaeb4
movq %rdx, (%rax,%rcx)
movw 0x8a8ed(%rip), %dx      # 0xaaebc
movw %dx, 0x8(%rax,%rcx)
movq -0x40(%rbp), %rax
movq 0xd8(%rax), %rcx
movl -0x64(%rbp), %eax
addl $0x8, %eax
addl $0x1, %eax
cltq
addq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x120(%rax)
movq -0x40(%rbp), %rax
movq 0x120(%rax), %rdi
movq -0x60(%rbp), %rsi
movslq -0x64(%rbp), %rdx
callq 0x82f0
movq -0x40(%rbp), %rax
movq 0x120(%rax), %rax
movslq -0x64(%rbp), %rcx
movl 0x8a899(%rip), %edx     # 0xaaebe
movl %edx, (%rax,%rcx)
movb 0x8a894(%rip), %dl      # 0xaaec2
movb %dl, 0x4(%rax,%rcx)
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9cd0
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 0x20701
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x20701
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 0x20df0
movl %eax, -0x44(%rbp)
movl -0x8c(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x206ff
cmpl $0x0, -0x50(%rbp)
jne 0x206ff
movq -0x40(%rbp), %rdi
callq 0x20e40
movl -0x70(%rbp), %eax
movq -0x40(%rbp), %rcx
cmpl 0xb8(%rcx), %eax
jae 0x206fd
movq -0x40(%rbp), %rax
cmpl $0x2000, 0xb8(%rax)     # imm = 0x2000
jbe 0x206ee
movl $0x2000, -0x70(%rbp)    # imm = 0x2000
jmp 0x206fb
movq -0x40(%rbp), %rax
movl 0xb8(%rax), %eax
movl %eax, -0x70(%rbp)
jmp 0x206fd
jmp 0x206ff
jmp 0x20721
movl $0x1, -0x48(%rbp)
movq -0x40(%rbp), %rax
movb $0x1, 0x13(%rax)
movq -0x40(%rbp), %rax
movb $0x4, 0x14(%rax)
movl -0x2c(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0x2073c
movq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x20a90
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x20763
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x20ea0
movq -0x40(%rbp), %rdi
callq 0xa420
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x208b2
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 0x7d6(%rip), %rax       # 0x20f70
testb $0x1, %r8b
cmovneq %rax, %rcx
movq -0x40(%rbp), %r8
movq -0x40(%rbp), %rax
movq 0x110(%rax), %r9
callq 0x20ef0
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, 0x15(%rax)
movl -0x4c(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x12(%rax)
movl -0x50(%rbp), %eax
movb %al, %cl
movq -0x40(%rbp), %rax
movb %cl, 0x11(%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 0x20828
jmp 0x20848
movq -0x40(%rbp), %rax
movb $0x1, 0xc(%rax)
movq -0x40(%rbp), %rax
movb $0x2, 0xf(%rax)
movq -0x40(%rbp), %rax
movb $0x22, 0xe(%rax)
movq -0x40(%rbp), %rax
movb $0x2, 0xd(%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 0x20e40
cmpl $0x0, -0x68(%rbp)
jne 0x20881
movq -0x40(%rbp), %rax
movb $0x2, 0x9(%rax)
jmp 0x20891
cmpl $0x0, -0x4c(%rbp)
je 0x2088f
movq -0x40(%rbp), %rax
movb $0x4, 0x9(%rax)
jmp 0x20891
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x100(%rax)
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
nop