// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: openDatabase
static int openDatabase(
  const char *zFilename, /* Database filename UTF-8 encoded */
  sqlite3 **ppDb,        /* OUT: Returned database handle */
  unsigned int flags,    /* Operational flags */
  const char *zVfs       /* Name of the VFS to use */
){
  sqlite3 *db;                    /* Store allocated handle here */
  int rc;                         /* Return code */
  int isThreadsafe;               /* True for threadsafe connections */
  char *zOpen = 0;                /* Filename argument to pass to BtreeOpen() */
  char *zErrMsg = 0;              /* Error message from sqlite3ParseUri() */

#ifdef SQLITE_ENABLE_API_ARMOR
  if( ppDb==0 ) return SQLITE_MISUSE_BKPT;
#endif
  *ppDb = 0;
#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ) return rc;
#endif

  /* Only allow sensible combinations of bits in the flags argument.  
  ** Throw an error if any non-sense combination is used.  If we
  ** do not block illegal combinations here, it could trigger
  ** assert() statements in deeper layers.  Sensible combinations
  ** are:
  **
  **  1:  SQLITE_OPEN_READONLY
  **  2:  SQLITE_OPEN_READWRITE
  **  6:  SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
  */
  assert( SQLITE_OPEN_READONLY  == 0x01 );
  assert( SQLITE_OPEN_READWRITE == 0x02 );
  assert( SQLITE_OPEN_CREATE    == 0x04 );
  testcase( (1<<(flags&7))==0x02 ); /* READONLY */
  testcase( (1<<(flags&7))==0x04 ); /* READWRITE */
  testcase( (1<<(flags&7))==0x40 ); /* READWRITE | CREATE */
  if( ((1<<(flags&7)) & 0x46)==0 ){
    return SQLITE_MISUSE_BKPT;  /* IMP: R-65497-44594 */
  }

  if( sqlite3GlobalConfig.bCoreMutex==0 ){
    isThreadsafe = 0;
  }else if( flags & SQLITE_OPEN_NOMUTEX ){
    isThreadsafe = 0;
  }else if( flags & SQLITE_OPEN_FULLMUTEX ){
    isThreadsafe = 1;
  }else{
    isThreadsafe = sqlite3GlobalConfig.bFullMutex;
  }
  if( flags & SQLITE_OPEN_PRIVATECACHE ){
    flags &= ~SQLITE_OPEN_SHAREDCACHE;
  }else if( sqlite3GlobalConfig.sharedCacheEnabled ){
    flags |= SQLITE_OPEN_SHAREDCACHE;
  }

  /* Remove harmful bits from the flags parameter
  **
  ** The SQLITE_OPEN_NOMUTEX and SQLITE_OPEN_FULLMUTEX flags were
  ** dealt with in the previous code block.  Besides these, the only
  ** valid input flags for sqlite3_open_v2() are SQLITE_OPEN_READONLY,
  ** SQLITE_OPEN_READWRITE, SQLITE_OPEN_CREATE, SQLITE_OPEN_SHAREDCACHE,
  ** SQLITE_OPEN_PRIVATECACHE, and some reserved bits.  Silently mask
  ** off all other flags.
  */
  flags &=  ~( SQLITE_OPEN_DELETEONCLOSE |
               SQLITE_OPEN_EXCLUSIVE |
               SQLITE_OPEN_MAIN_DB |
               SQLITE_OPEN_TEMP_DB | 
               SQLITE_OPEN_TRANSIENT_DB | 
               SQLITE_OPEN_MAIN_JOURNAL | 
               SQLITE_OPEN_TEMP_JOURNAL | 
               SQLITE_OPEN_SUBJOURNAL | 
               SQLITE_OPEN_MASTER_JOURNAL |
               SQLITE_OPEN_NOMUTEX |
               SQLITE_OPEN_FULLMUTEX |
               SQLITE_OPEN_WAL
             );

  /* Allocate the sqlite data structure */
  db = sqlite3MallocZero( sizeof(sqlite3) );
  if( db==0 ) goto opendb_out;
  if( isThreadsafe ){
    db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
    if( db->mutex==0 ){
      sqlite3_free(db);
      db = 0;
      goto opendb_out;
    }
  }
  sqlite3_mutex_enter(db->mutex);
  db->errMask = 0xff;
  db->nDb = 2;
  db->magic = SQLITE_MAGIC_BUSY;
  db->aDb = db->aDbStatic;

  assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
  memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));
  db->aLimit[SQLITE_LIMIT_WORKER_THREADS] = SQLITE_DEFAULT_WORKER_THREADS;
  db->autoCommit = 1;
  db->nextAutovac = -1;
  db->szMmap = sqlite3GlobalConfig.szMmap;
  db->nextPagesize = 0;
  db->nMaxSorterMmap = 0x7FFFFFFF;
  db->flags |= SQLITE_ShortColNames | SQLITE_EnableTrigger | SQLITE_CacheSpill
#if !defined(SQLITE_DEFAULT_AUTOMATIC_INDEX) || SQLITE_DEFAULT_AUTOMATIC_INDEX
                 | SQLITE_AutoIndex
#endif
#if SQLITE_DEFAULT_CKPTFULLFSYNC
                 | SQLITE_CkptFullFSync
#endif
#if SQLITE_DEFAULT_FILE_FORMAT<4
                 | SQLITE_LegacyFileFmt
#endif
#ifdef SQLITE_ENABLE_LOAD_EXTENSION
                 | SQLITE_LoadExtension
#endif
#if SQLITE_DEFAULT_RECURSIVE_TRIGGERS
                 | SQLITE_RecTriggers
#endif
#if defined(SQLITE_DEFAULT_FOREIGN_KEYS) && SQLITE_DEFAULT_FOREIGN_KEYS
                 | SQLITE_ForeignKeys
#endif
#if defined(SQLITE_REVERSE_UNORDERED_SELECTS)
                 | SQLITE_ReverseOrder
#endif
#if defined(SQLITE_ENABLE_OVERSIZE_CELL_CHECK)
                 | SQLITE_CellSizeCk
#endif
      ;
  sqlite3HashInit(&db->aCollSeq);
#ifndef SQLITE_OMIT_VIRTUALTABLE
  sqlite3HashInit(&db->aModule);
#endif

  /* Add the default collation sequence BINARY. BINARY works for both UTF-8
  ** and UTF-16, so add a version for each to avoid any unnecessary
  ** conversions. The only error that can occur here is a malloc() failure.
  **
  ** EVIDENCE-OF: R-52786-44878 SQLite defines three built-in collating
  ** functions:
  */
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF8, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16BE, 0, binCollFunc, 0);
  createCollation(db, sqlite3StrBINARY, SQLITE_UTF16LE, 0, binCollFunc, 0);
  createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0);
  createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0);
  if( db->mallocFailed ){
    goto opendb_out;
  }
  /* EVIDENCE-OF: R-08308-17224 The default collating function for all
  ** strings is BINARY. 
  */
  db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, sqlite3StrBINARY, 0);
  assert( db->pDfltColl!=0 );

  /* Parse the filename/URI argument. */
  db->openFlags = flags;
  rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
  if( rc!=SQLITE_OK ){
    if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
    sqlite3ErrorWithMsg(db, rc, zErrMsg ? "%s" : 0, zErrMsg);
    sqlite3_free(zErrMsg);
    goto opendb_out;
  }

  /* Open the backend database driver */
  rc = sqlite3BtreeOpen(db->pVfs, zOpen, db, &db->aDb[0].pBt, 0,
                        flags | SQLITE_OPEN_MAIN_DB);
  if( rc!=SQLITE_OK ){
    if( rc==SQLITE_IOERR_NOMEM ){
      rc = SQLITE_NOMEM;
    }
    sqlite3Error(db, rc);
    goto opendb_out;
  }
  sqlite3BtreeEnter(db->aDb[0].pBt);
  db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
  if( !db->mallocFailed ) ENC(db) = SCHEMA_ENC(db);
  sqlite3BtreeLeave(db->aDb[0].pBt);
  db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);

  /* The default safety_level for the main database is 'full'; for the temp
  ** database it is 'NONE'. This matches the pager layer defaults.  
  */
  db->aDb[0].zName = "main";
  db->aDb[0].safety_level = 3;
  db->aDb[1].zName = "temp";
  db->aDb[1].safety_level = 1;

  db->magic = SQLITE_MAGIC_OPEN;
  if( db->mallocFailed ){
    goto opendb_out;
  }

  /* Register all built-in functions, but do not attempt to read the
  ** database schema yet. This is delayed until the first time the database
  ** is accessed.
  */
  sqlite3Error(db, SQLITE_OK);
  sqlite3RegisterBuiltinFunctions(db);

  /* Load automatic extensions - extensions that have been registered
  ** using the sqlite3_automatic_extension() API.
  */
  rc = sqlite3_errcode(db);
  if( rc==SQLITE_OK ){
    sqlite3AutoLoadExtensions(db);
    rc = sqlite3_errcode(db);
    if( rc!=SQLITE_OK ){
      goto opendb_out;
    }
  }

#ifdef SQLITE_ENABLE_FTS1
  if( !db->mallocFailed ){
    extern int sqlite3Fts1Init(sqlite3*);
    rc = sqlite3Fts1Init(db);
  }
#endif

#ifdef SQLITE_ENABLE_FTS2
  if( !db->mallocFailed && rc==SQLITE_OK ){
    extern int sqlite3Fts2Init(sqlite3*);
    rc = sqlite3Fts2Init(db);
  }
#endif

#ifdef SQLITE_ENABLE_FTS3 /* automatically defined by SQLITE_ENABLE_FTS4 */
  if( !db->mallocFailed && rc==SQLITE_OK ){
    rc = sqlite3Fts3Init(db);
  }
#endif

#ifdef SQLITE_ENABLE_FTS5
  if( !db->mallocFailed && rc==SQLITE_OK ){
    rc = sqlite3Fts5Init(db);
  }
#endif

#ifdef SQLITE_ENABLE_ICU
  if( !db->mallocFailed && rc==SQLITE_OK ){
    rc = sqlite3IcuInit(db);
  }
#endif

#ifdef SQLITE_ENABLE_RTREE
  if( !db->mallocFailed && rc==SQLITE_OK){
    rc = sqlite3RtreeInit(db);
  }
#endif

#ifdef SQLITE_ENABLE_DBSTAT_VTAB
  if( !db->mallocFailed && rc==SQLITE_OK){
    rc = sqlite3DbstatRegister(db);
  }
#endif

#ifdef SQLITE_ENABLE_JSON1
  if( !db->mallocFailed && rc==SQLITE_OK){
    rc = sqlite3Json1Init(db);
  }
#endif

  /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
  ** mode.  -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
  ** mode.  Doing nothing at all also makes NORMAL the default.
  */
#ifdef SQLITE_DEFAULT_LOCKING_MODE
  db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
  sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
                          SQLITE_DEFAULT_LOCKING_MODE);
#endif

  if( rc ) sqlite3Error(db, rc);

  /* Enable the lookaside-malloc subsystem */
  setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
                        sqlite3GlobalConfig.nLookaside);

  sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);

opendb_out:
  if( db ){
    assert( db->mutex!=0 || isThreadsafe==0
           || sqlite3GlobalConfig.bFullMutex==0 );
    sqlite3_mutex_leave(db->mutex);
  }
  rc = sqlite3_errcode(db);
  assert( db!=0 || rc==SQLITE_NOMEM );
  if( rc==SQLITE_NOMEM ){
    sqlite3_close(db);
    db = 0;
  }else if( rc!=SQLITE_OK ){
    db->magic = SQLITE_MAGIC_SICK;
  }
  *ppDb = db;
#ifdef SQLITE_ENABLE_SQLLOG
  if( sqlite3GlobalConfig.xSqllog ){
    /* Opening a db handle. Fourth parameter is passed 0. */
    void *pArg = sqlite3GlobalConfig.pSqllogArg;
    sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0);
  }
#endif
#if defined(SQLITE_HAS_CODEC)
  if( rc==SQLITE_OK ){
    const char *zHexKey = sqlite3_uri_parameter(zOpen, "hexkey");
    if( zHexKey && zHexKey[0] ){
      u8 iByte;
      int i;
      char zKey[40];
      for(i=0, iByte=0; i<sizeof(zKey)*2 && sqlite3Isxdigit(zHexKey[i]); i++){
        iByte = (iByte<<4) + sqlite3HexToInt(zHexKey[i]);
        if( (i&1)!=0 ) zKey[i/2] = iByte;
      }
      sqlite3_key_v2(db, 0, zKey, i/2);
    }
  }
#endif
  sqlite3_free(zOpen);
  return rc & 0xff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
callq 0xb0a0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x1e7db
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1ed23
movl -0x1c(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %eax
shll %cl, %eax
andl $0x46, %eax
cmpl $0x0, %eax
jne 0x1e802
movl $0x20e84, %edi          # imm = 0x20E84
callq 0xc850
movl %eax, -0x4(%rbp)
jmp 0x1ed23
cmpl $0x0, 0xa0cbb(%rip)     # 0xbf4c4
jne 0x1e814
movl $0x0, -0x38(%rbp)
jmp 0x1e84d
movl -0x1c(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x1e82a
movl $0x0, -0x38(%rbp)
jmp 0x1e84b
movl -0x1c(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x1e840
movl $0x1, -0x38(%rbp)
jmp 0x1e849
movl 0xa0c82(%rip), %eax     # 0xbf4c8
movl %eax, -0x38(%rbp)
jmp 0x1e84b
jmp 0x1e84d
movl -0x1c(%rbp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x1e867
movl -0x1c(%rbp), %eax
andl $0xfffdffff, %eax       # imm = 0xFFFDFFFF
movl %eax, -0x1c(%rbp)
jmp 0x1e87d
cmpl $0x0, 0xa0db6(%rip)     # 0xbf624
je 0x1e87b
movl -0x1c(%rbp), %eax
orl $0x20000, %eax          # imm = 0x20000
movl %eax, -0x1c(%rbp)
jmp 0x1e87d
movl -0x1c(%rbp), %eax
andl $0xfff600e7, %eax       # imm = 0xFFF600E7
movl %eax, -0x1c(%rbp)
movl $0x330, %edi            # imm = 0x330
callq 0x114b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1e8a2
jmp 0x1ecb8
cmpl $0x0, -0x38(%rbp)
je 0x1e8e0
movl $0x1, %edi
callq 0xd5f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1e8de
movq -0x30(%rbp), %rdi
callq 0xb958
movq $0x0, -0x30(%rbp)
jmp 0x1ecb8
jmp 0x1e8e0
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb550
movq -0x30(%rbp), %rax
movl $0xff, 0x48(%rax)
movq -0x30(%rbp), %rax
movl $0x2, 0x28(%rax)
movq -0x30(%rbp), %rax
movl $0xf03b7906, 0x5c(%rax) # imm = 0xF03B7906
movq -0x30(%rbp), %rcx
addq $0x2c0, %rcx            # imm = 0x2C0
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
leaq 0x84640(%rip), %rsi     # 0xa2f70
movl $0x30, %edx
callq 0xb420
movq -0x30(%rbp), %rax
movl $0x0, 0x94(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x4f(%rax)
movq -0x30(%rbp), %rax
movb $-0x1, 0x53(%rax)
movq 0xa0c91(%rip), %rcx     # 0xbf5f0
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x58(%rax)
movq -0x30(%rbp), %rax
movl $0x7fffffff, 0x98(%rax) # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %ecx
orl $0x900050, %ecx         # imm = 0x900050
movl %ecx, 0x2c(%rax)
movq -0x30(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
callq 0x49370
movq -0x30(%rbp), %rdi
addq $0x1a8, %rdi            # imm = 0x1A8
callq 0x49370
movq -0x30(%rbp), %rdi
leaq 0x845e8(%rip), %rsi     # 0xa2fa3
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x81124(%rip), %r8      # 0x9faf0
movq %r9, %rcx
callq 0x1ef40
movq -0x30(%rbp), %rdi
leaq 0x845c4(%rip), %rsi     # 0xa2fa3
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x81100(%rip), %r8      # 0x9faf0
movq %r9, %rcx
callq 0x1ef40
movq -0x30(%rbp), %rdi
leaq 0x845a0(%rip), %rsi     # 0xa2fa3
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x810dc(%rip), %r8      # 0x9faf0
movq %r9, %rcx
callq 0x1ef40
movq -0x30(%rbp), %rdi
leaq 0x89932(%rip), %rsi     # 0xa8359
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x81168(%rip), %r8      # 0x9fba0
movq %r9, %rcx
callq 0x1ef40
movq -0x30(%rbp), %rdi
leaq 0x8b326(%rip), %rsi     # 0xa9d71
movl $0x1, %edx
movl $0x1, %ecx
leaq 0x81094(%rip), %r8      # 0x9faf0
xorl %eax, %eax
movl %eax, %r9d
callq 0x1ef40
movq -0x30(%rbp), %rax
cmpb $0x0, 0x51(%rax)
je 0x1ea75
jmp 0x1ecb8
movq -0x30(%rbp), %rdi
movl $0x1, %esi
leaq 0x8451e(%rip), %rdx     # 0xa2fa3
xorl %ecx, %ecx
callq 0x6c7b0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq -0x1c(%rbp), %rdx
leaq -0x40(%rbp), %r8
leaq -0x48(%rbp), %r9
callq 0x970a0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x1eb0c
cmpl $0x7, -0x34(%rbp)
jne 0x1ead5
movq -0x30(%rbp), %rax
movb $0x1, 0x51(%rax)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x48(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x871d1(%rip), %rax     # 0xa5cbc
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq -0x48(%rbp), %rcx
movb $0x0, %al
callq 0x11390
movq -0x48(%rbp), %rdi
callq 0xb958
jmp 0x1ecb8
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x8, %rcx
movl -0x1c(%rbp), %r9d
orl $0x100, %r9d            # imm = 0x100
xorl %r8d, %r8d
callq 0x25800
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x1eb64
cmpl $0xc0a, -0x34(%rbp)     # imm = 0xC0A
jne 0x1eb53
movl $0x7, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x114f0
jmp 0x1ecb8
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x11e30
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x97970
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x51(%rax)
jne 0x1ebb9
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movb 0x71(%rax), %cl
movq -0x30(%rbp), %rax
movb %cl, 0x4e(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x13330
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x97970
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
leaq 0x8b182(%rip), %rcx     # 0xa9d77
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x3, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
leaq 0x86e7b(%rip), %rcx     # 0xa5a8e
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x30(%rax)
movq -0x30(%rbp), %rax
movl $0xa029a697, 0x5c(%rax) # imm = 0xA029A697
movq -0x30(%rbp), %rax
cmpb $0x0, 0x51(%rax)
je 0x1ec3a
jmp 0x1ecb8
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x114f0
movq -0x30(%rbp), %rdi
callq 0x9fc10
movq -0x30(%rbp), %rdi
callq 0xb340
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x1ec7f
movq -0x30(%rbp), %rdi
callq 0x9fc50
movq -0x30(%rbp), %rdi
callq 0xb340
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x1ec7d
jmp 0x1ecb8
jmp 0x1ec7f
cmpl $0x0, -0x34(%rbp)
je 0x1ec91
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x114f0
movq -0x30(%rbp), %rdi
movl 0xa0841(%rip), %edx     # 0xbf4dc
movl 0xa083f(%rip), %ecx     # 0xbf4e0
xorl %eax, %eax
movl %eax, %esi
callq 0x1d050
movq -0x30(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0xb1d0
cmpq $0x0, -0x30(%rbp)
je 0x1eccc
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0xb4f0
movq -0x30(%rbp), %rdi
callq 0xb340
movl %eax, -0x34(%rbp)
cmpl $0x7, -0x34(%rbp)
jne 0x1ecf1
movq -0x30(%rbp), %rdi
callq 0xb440
movq $0x0, -0x30(%rbp)
jmp 0x1ed04
cmpl $0x0, -0x34(%rbp)
je 0x1ed02
movq -0x30(%rbp), %rax
movl $0x4b771290, 0x5c(%rax) # imm = 0x4B771290
jmp 0x1ed04
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rdi
callq 0xb958
movl -0x34(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)