// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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() */
  int i;                          /* Loop counter */

#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

  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_SUPER_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
#ifdef SQLITE_ENABLE_MULTITHREADED_CHECKS
   || sqlite3GlobalConfig.bCoreMutex
#endif
  ){
    db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
    if( db->mutex==0 ){
      sqlite3_free(db);
      db = 0;
      goto opendb_out;
    }
    if( isThreadsafe==0 ){
      sqlite3MutexWarnOnContention(db->mutex);
    }
  }
  sqlite3_mutex_enter(db->mutex);
  db->errMask = 0xff;
  db->nDb = 2;
  db->magic = SQLITE_MAGIC_BUSY;
  db->aDb = db->aDbStatic;
  db->lookaside.bDisable = 1;
  db->lookaside.sz = 0;

  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_EnableView
                 | SQLITE_CacheSpill
#if !defined(SQLITE_TRUSTED_SCHEMA) || SQLITE_TRUSTED_SCHEMA+0!=0
                 | SQLITE_TrustedSchema
#endif
/* The SQLITE_DQS compile-time option determines the default settings
** for SQLITE_DBCONFIG_DQS_DDL and SQLITE_DBCONFIG_DQS_DML.
**
**    SQLITE_DQS     SQLITE_DBCONFIG_DQS_DDL    SQLITE_DBCONFIG_DQS_DML
**    ----------     -----------------------    -----------------------
**     undefined               on                          on
**         3                   on                          on
**         2                   on                         off
**         1                  off                          on
**         0                  off                         off
**
** Legacy behavior is 3 (double-quoted string literals are allowed anywhere)
** and so that is the default.  But developers are encouranged to use
** -DSQLITE_DQS=0 (best) or -DSQLITE_DQS=1 (second choice) if possible.
*/
#if !defined(SQLITE_DQS)
# define SQLITE_DQS 3
#endif
#if (SQLITE_DQS&1)==1
                 | SQLITE_DqsDML
#endif
#if (SQLITE_DQS&2)==2
                 | SQLITE_DqsDDL
#endif

#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
#if defined(SQLITE_ENABLE_FTS3_TOKENIZER)
                 | SQLITE_Fts3Tokenizer
#endif
#if defined(SQLITE_ENABLE_QPSG)
                 | SQLITE_EnableQPSG
#endif
#if defined(SQLITE_DEFAULT_DEFENSIVE)
                 | SQLITE_Defensive
#endif
#if defined(SQLITE_DEFAULT_LEGACY_ALTER_TABLE)
                 | SQLITE_LegacyAlter
#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, 0, rtrimCollFunc, 0);
  if( db->mallocFailed ){
    goto opendb_out;
  }

  /* Parse the filename/URI argument
  **
  ** 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
  */
  db->openFlags = flags;
  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 ){
    rc = SQLITE_MISUSE_BKPT;  /* IMP: R-18321-05872 */
  }else{
    rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
  }
  if( rc!=SQLITE_OK ){
    if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
    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_BKPT;
    }
    sqlite3Error(db, rc);
    goto opendb_out;
  }
  sqlite3BtreeEnter(db->aDb[0].pBt);
  db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
  if( !db->mallocFailed ){
    sqlite3SetTextEncoding(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 OFF. This matches the pager layer defaults.
  */
  db->aDb[0].zDbSName = "main";
  db->aDb[0].safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
  db->aDb[1].zDbSName = "temp";
  db->aDb[1].safety_level = PAGER_SYNCHRONOUS_OFF;

  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);
  sqlite3RegisterPerConnectionBuiltinFunctions(db);
  rc = sqlite3_errcode(db);


  /* Load compiled-in extensions */
  for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
    rc = sqlite3BuiltinExtensions[i](db);
  }

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

#ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS
  /* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time
  ** option gives access to internal functions by default.
  ** Testing use only!!! */
  db->mDbFlags |= DBFLAG_InternalFunc;
#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
  sqlite3_free_filename(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 0x3c01b0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3d298b
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3d2ef7
movzbl 0x26cec2(%rip), %eax    # 0x63f854
cmpl $0x0, %eax
jne 0x3d29a0
movl $0x0, -0x38(%rbp)
jmp 0x3d29da
movl -0x1c(%rbp), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x3d29b6
movl $0x0, -0x38(%rbp)
jmp 0x3d29d8
movl -0x1c(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0x3d29cc
movl $0x1, -0x38(%rbp)
jmp 0x3d29d6
movzbl 0x26ce82(%rip), %eax    # 0x63f855
movl %eax, -0x38(%rbp)
jmp 0x3d29d8
jmp 0x3d29da
movl -0x1c(%rbp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0x3d29f4
movl -0x1c(%rbp), %eax
andl $0xfffdffff, %eax       # imm = 0xFFFDFFFF
movl %eax, -0x1c(%rbp)
jmp 0x3d2a0a
cmpl $0x0, 0x26cfa1(%rip)    # 0x63f99c
je 0x3d2a08
movl -0x1c(%rbp), %eax
orl $0x20000, %eax          # imm = 0x20000
movl %eax, -0x1c(%rbp)
jmp 0x3d2a0a
movl -0x1c(%rbp), %eax
andl $0xfff600e7, %eax       # imm = 0xFFF600E7
movl %eax, -0x1c(%rbp)
movl $0x300, %edi            # imm = 0x300
callq 0x3c51d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3d2a2f
jmp 0x3d2e97
cmpl $0x0, -0x38(%rbp)
je 0x3d2a6d
movq -0x30(%rbp), %rax
movl $0x8, %ecx
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3d2a63
movq -0x30(%rbp), %rdi
callq 0x3c0800
movq $0x0, -0x30(%rbp)
jmp 0x3d2e97
cmpl $0x0, -0x38(%rbp)
jne 0x3d2a6b
jmp 0x3d2a6b
jmp 0x3d2a6d
movq -0x30(%rbp), %rax
movl $0xff, 0x54(%rax)
movq -0x30(%rbp), %rax
movl $0x2, 0x28(%rax)
movq -0x30(%rbp), %rax
movl $0xf03b7906, 0x70(%rax) # imm = 0xF03B7906
movq -0x30(%rbp), %rcx
addq $0x268, %rcx            # imm = 0x268
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movl $0x1, 0x170(%rax)
movq -0x30(%rbp), %rax
movw $0x0, 0x174(%rax)
movq -0x30(%rbp), %rdi
addq $0x7c, %rdi
leaq 0x1d47a5(%rip), %rsi    # 0x5a7270
movl $0x30, %edx
callq 0x19610
movq -0x30(%rbp), %rax
movl $0x0, 0xa8(%rax)
movq -0x30(%rbp), %rax
movb $0x1, 0x5f(%rax)
movq -0x30(%rbp), %rax
movb $-0x1, 0x64(%rax)
movq 0x26ce7e(%rip), %rcx    # 0x63f978
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x6c(%rax)
movq -0x30(%rbp), %rax
movl $0x7fffffff, 0xac(%rax) # imm = 0x7FFFFFFF
movq -0x30(%rbp), %rax
movabsq $0xe00480e0, %rcx       # imm = 0xE00480E0
orq 0x30(%rax), %rcx
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
callq 0x40a9e0
movq -0x30(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
callq 0x40a9e0
movq -0x30(%rbp), %rdi
leaq 0x1d4179(%rip), %rsi    # 0x5a6cd5
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x75ad3(%rip), %r8      # 0x448640
movq %r9, %rcx
callq 0x3d30f0
movq -0x30(%rbp), %rdi
leaq 0x1d4155(%rip), %rsi    # 0x5a6cd5
movl $0x3, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x75aaf(%rip), %r8      # 0x448640
movq %r9, %rcx
callq 0x3d30f0
movq -0x30(%rbp), %rdi
leaq 0x1d4131(%rip), %rsi    # 0x5a6cd5
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x75a8b(%rip), %r8      # 0x448640
movq %r9, %rcx
callq 0x3d30f0
movq -0x30(%rbp), %rdi
leaq 0x1db20f(%rip), %rsi    # 0x5addd7
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x9bd67(%rip), %r8      # 0x46e940
movq %r9, %rcx
callq 0x3d30f0
movq -0x30(%rbp), %rdi
leaq 0x1dce26(%rip), %rsi    # 0x5afa12
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x9bdb3(%rip), %r8      # 0x46e9b0
movq %r9, %rcx
callq 0x3d30f0
movq -0x30(%rbp), %rax
cmpb $0x0, 0x61(%rax)
je 0x3d2c14
jmp 0x3d2e97
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4c(%rax)
movl -0x1c(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %eax
shll %cl, %eax
andl $0x46, %eax
cmpl $0x0, %eax
jne 0x3d2c42
movl $0x281a8, %edi          # imm = 0x281A8
callq 0x3bf6a0
movl %eax, -0x34(%rbp)
jmp 0x3d2c62
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 0x463980
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3d2cae
cmpl $0x7, -0x34(%rbp)
jne 0x3d2c77
movq -0x30(%rbp), %rdi
callq 0x3c8ba0
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x48(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x1c9394(%rip), %rax    # 0x59c021
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq -0x48(%rbp), %rcx
movb $0x0, %al
callq 0x3c50b0
movq -0x48(%rbp), %rdi
callq 0x3c0800
jmp 0x3d2e97
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 0x3da3e0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3d2d06
cmpl $0xc0a, -0x34(%rbp)     # imm = 0xC0A
jne 0x3d2cf5
movl $0x7, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x3c5210
jmp 0x3d2e97
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x3c5aa0
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x464280
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x61(%rax)
jne 0x3d2d5e
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movzbl 0x71(%rax), %esi
callq 0x40aaf0
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x464280
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
leaq 0x159374(%rip), %rcx    # 0x52c0fd
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x3, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
leaq 0x17380b(%rip), %rcx    # 0x5465b2
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movb $0x1, 0x30(%rax)
movq -0x30(%rbp), %rax
movl $0xa029a697, 0x70(%rax) # imm = 0xA029A697
movq -0x30(%rbp), %rax
cmpb $0x0, 0x61(%rax)
je 0x3d2dd1
jmp 0x3d2e97
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x3c5210
movq -0x30(%rbp), %rdi
callq 0x46ea70
movq -0x30(%rbp), %rdi
callq 0x3d2770
movl %eax, -0x34(%rbp)
movl $0x0, -0x4c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x4d(%rbp)
jne 0x3d2e0d
cmpl $0x1, -0x4c(%rbp)
setl %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x3d2e16
jmp 0x3d2e39
movslq -0x4c(%rbp), %rcx
leaq 0x268537(%rip), %rax    # 0x63b358
movq (%rax,%rcx,8), %rax
movq -0x30(%rbp), %rdi
callq *%rax
movl %eax, -0x34(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x3d2df8
cmpl $0x0, -0x34(%rbp)
jne 0x3d2e5e
movq -0x30(%rbp), %rdi
callq 0x46eab0
movq -0x30(%rbp), %rdi
callq 0x3d2770
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3d2e5c
jmp 0x3d2e97
jmp 0x3d2e5e
cmpl $0x0, -0x34(%rbp)
je 0x3d2e70
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x3c5210
movq -0x30(%rbp), %rdi
movl 0x26c9ea(%rip), %edx    # 0x63f864
movl 0x26c9e8(%rip), %ecx    # 0x63f868
xorl %eax, %eax
movl %eax, %esi
callq 0x3d0e10
movq -0x30(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x3d21c0
cmpq $0x0, -0x30(%rbp)
je 0x3d2ea0
jmp 0x3d2ea0
movq -0x30(%rbp), %rdi
callq 0x3d2770
movl %eax, -0x34(%rbp)
cmpl $0x7, -0x34(%rbp)
jne 0x3d2ec5
movq -0x30(%rbp), %rdi
callq 0x3d1230
movq $0x0, -0x30(%rbp)
jmp 0x3d2ed8
cmpl $0x0, -0x34(%rbp)
je 0x3d2ed6
movq -0x30(%rbp), %rax
movl $0x4b771290, 0x70(%rax) # imm = 0x4B771290
jmp 0x3d2ed8
movq -0x30(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rdi
callq 0x3d5310
movl -0x34(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq