// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: unixOpen
static int unixOpen(
  sqlite3_vfs *pVfs,           /* The VFS for which this is the xOpen method */
  const char *zPath,           /* Pathname of file to be opened */
  sqlite3_file *pFile,         /* The file descriptor to be filled in */
  int flags,                   /* Input flags to control the opening */
  int *pOutFlags               /* Output flags returned to SQLite core */
){
  unixFile *p = (unixFile *)pFile;
  int fd = -1;                   /* File descriptor returned by open() */
  int openFlags = 0;             /* Flags to pass to open() */
  int eType = flags&0x0FFF00;  /* Type of file to open */
  int noLock;                    /* True to omit locking primitives */
  int rc = SQLITE_OK;            /* Function Return Code */
  int ctrlFlags = 0;             /* UNIXFILE_* flags */

  int isExclusive  = (flags & SQLITE_OPEN_EXCLUSIVE);
  int isDelete     = (flags & SQLITE_OPEN_DELETEONCLOSE);
  int isCreate     = (flags & SQLITE_OPEN_CREATE);
  int isReadonly   = (flags & SQLITE_OPEN_READONLY);
  int isReadWrite  = (flags & SQLITE_OPEN_READWRITE);
#if SQLITE_ENABLE_LOCKING_STYLE
  int isAutoProxy  = (flags & SQLITE_OPEN_AUTOPROXY);
#endif
#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
  struct statfs fsInfo;
#endif

  /* If creating a super- or main-file journal, this function will open
  ** a file-descriptor on the directory too. The first time unixSync()
  ** is called the directory file descriptor will be fsync()ed and close()d.
  */
  int isNewJrnl = (isCreate && (
        eType==SQLITE_OPEN_SUPER_JOURNAL
     || eType==SQLITE_OPEN_MAIN_JOURNAL
     || eType==SQLITE_OPEN_WAL
  ));

  /* If argument zPath is a NULL pointer, this function is required to open
  ** a temporary file. Use this buffer to store the file name in.
  */
  char zTmpname[MAX_PATHNAME+2];
  const char *zName = zPath;

  /* Check the following statements are true:
  **
  **   (a) Exactly one of the READWRITE and READONLY flags must be set, and
  **   (b) if CREATE is set, then READWRITE must also be set, and
  **   (c) if EXCLUSIVE is set, then CREATE must also be set.
  **   (d) if DELETEONCLOSE is set, then CREATE must also be set.
  */
  assert((isReadonly==0 || isReadWrite==0) && (isReadWrite || isReadonly));
  assert(isCreate==0 || isReadWrite);
  assert(isExclusive==0 || isCreate);
  assert(isDelete==0 || isCreate);

  /* The main DB, main journal, WAL file and super-journal are never
  ** automatically deleted. Nor are they ever temporary files.  */
  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_DB );
  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_MAIN_JOURNAL );
  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_SUPER_JOURNAL );
  assert( (!isDelete && zName) || eType!=SQLITE_OPEN_WAL );

  /* Assert that the upper layer has set one of the "file-type" flags. */
  assert( eType==SQLITE_OPEN_MAIN_DB      || eType==SQLITE_OPEN_TEMP_DB
       || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL
       || eType==SQLITE_OPEN_SUBJOURNAL   || eType==SQLITE_OPEN_SUPER_JOURNAL
       || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
  );

  /* Detect a pid change and reset the PRNG.  There is a race condition
  ** here such that two or more threads all trying to open databases at
  ** the same instant might all reset the PRNG.  But multiple resets
  ** are harmless.
  */
  if( randomnessPid!=osGetpid(0) ){
    randomnessPid = osGetpid(0);
    sqlite3_randomness(0,0);
  }
  memset(p, 0, sizeof(unixFile));

  if( eType==SQLITE_OPEN_MAIN_DB ){
    UnixUnusedFd *pUnused;
    pUnused = findReusableFd(zName, flags);
    if( pUnused ){
      fd = pUnused->fd;
    }else{
      pUnused = sqlite3_malloc64(sizeof(*pUnused));
      if( !pUnused ){
        return SQLITE_NOMEM_BKPT;
      }
    }
    p->pPreallocatedUnused = pUnused;

    /* Database filenames are double-zero terminated if they are not
    ** URIs with parameters.  Hence, they can always be passed into
    ** sqlite3_uri_parameter(). */
    assert( (flags & SQLITE_OPEN_URI) || zName[strlen(zName)+1]==0 );

  }else if( !zName ){
    /* If zName is NULL, the upper layer is requesting a temp file. */
    assert(isDelete && !isNewJrnl);
    rc = unixGetTempname(pVfs->mxPathname, zTmpname);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    zName = zTmpname;

    /* Generated temporary filenames are always double-zero terminated
    ** for use by sqlite3_uri_parameter(). */
    assert( zName[strlen(zName)+1]==0 );
  }

  /* Determine the value of the flags parameter passed to POSIX function
  ** open(). These must be calculated even if open() is not called, as
  ** they may be stored as part of the file handle and used by the
  ** 'conch file' locking functions later on.  */
  if( isReadonly )  openFlags |= O_RDONLY;
  if( isReadWrite ) openFlags |= O_RDWR;
  if( isCreate )    openFlags |= O_CREAT;
  if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW);
  openFlags |= (O_LARGEFILE|O_BINARY|O_NOFOLLOW);

  if( fd<0 ){
    mode_t openMode;              /* Permissions to create file with */
    uid_t uid;                    /* Userid for the file */
    gid_t gid;                    /* Groupid for the file */
    rc = findCreateFileMode(zName, flags, &openMode, &uid, &gid);
    if( rc!=SQLITE_OK ){
      assert( !p->pPreallocatedUnused );
      assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL );
      return rc;
    }
    fd = robust_open(zName, openFlags, openMode);
    OSTRACE(("OPENX   %-3d %s 0%o\n", fd, zName, openFlags));
    assert( !isExclusive || (openFlags & O_CREAT)!=0 );
    if( fd<0 ){
      if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){
        /* If unable to create a journal because the directory is not
        ** writable, change the error code to indicate that. */
        rc = SQLITE_READONLY_DIRECTORY;
      }else if( errno!=EISDIR && isReadWrite ){
        /* Failed to open the file for read/write access. Try read-only. */
        flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
        openFlags &= ~(O_RDWR|O_CREAT);
        flags |= SQLITE_OPEN_READONLY;
        openFlags |= O_RDONLY;
        isReadonly = 1;
        fd = robust_open(zName, openFlags, openMode);
      }
    }
    if( fd<0 ){
      int rc2 = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName);
      if( rc==SQLITE_OK ) rc = rc2;
      goto open_finished;
    }

    /* The owner of the rollback journal or WAL file should always be the
    ** same as the owner of the database file.  Try to ensure that this is
    ** the case.  The chown() system call will be a no-op if the current
    ** process lacks root privileges, be we should at least try.  Without
    ** this step, if a root process opens a database file, it can leave
    ** behinds a journal/WAL that is owned by root and hence make the
    ** database inaccessible to unprivileged processes.
    **
    ** If openMode==0, then that means uid and gid are not set correctly
    ** (probably because SQLite is configured to use 8+3 filename mode) and
    ** in that case we do not want to attempt the chown().
    */
    if( openMode && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))!=0 ){
      robustFchown(fd, uid, gid);
    }
  }
  assert( fd>=0 );
  if( pOutFlags ){
    *pOutFlags = flags;
  }

  if( p->pPreallocatedUnused ){
    p->pPreallocatedUnused->fd = fd;
    p->pPreallocatedUnused->flags =
                          flags & (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);
  }

  if( isDelete ){
#if OS_VXWORKS
    zPath = zName;
#elif defined(SQLITE_UNLINK_AFTER_CLOSE)
    zPath = sqlite3_mprintf("%s", zName);
    if( zPath==0 ){
      robust_close(p, fd, __LINE__);
      return SQLITE_NOMEM_BKPT;
    }
#else
    osUnlink(zName);
#endif
  }
#if SQLITE_ENABLE_LOCKING_STYLE
  else{
    p->openFlags = openFlags;
  }
#endif

#if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE
  if( fstatfs(fd, &fsInfo) == -1 ){
    storeLastErrno(p, errno);
    robust_close(p, fd, __LINE__);
    return SQLITE_IOERR_ACCESS;
  }
  if (0 == strncmp("msdos", fsInfo.f_fstypename, 5)) {
    ((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS;
  }
  if (0 == strncmp("exfat", fsInfo.f_fstypename, 5)) {
    ((unixFile*)pFile)->fsFlags |= SQLITE_FSFLAGS_IS_MSDOS;
  }
#endif

  /* Set up appropriate ctrlFlags */
  if( isDelete )                ctrlFlags |= UNIXFILE_DELETE;
  if( isReadonly )              ctrlFlags |= UNIXFILE_RDONLY;
  noLock = eType!=SQLITE_OPEN_MAIN_DB;
  if( noLock )                  ctrlFlags |= UNIXFILE_NOLOCK;
  if( isNewJrnl )               ctrlFlags |= UNIXFILE_DIRSYNC;
  if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI;

#if SQLITE_ENABLE_LOCKING_STYLE
#if SQLITE_PREFER_PROXY_LOCKING
  isAutoProxy = 1;
#endif
  if( isAutoProxy && (zPath!=NULL) && (!noLock) && pVfs->xOpen ){
    char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING");
    int useProxy = 0;

    /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, 0 means
    ** never use proxy, NULL means use proxy for non-local files only.  */
    if( envforce!=NULL ){
      useProxy = atoi(envforce)>0;
    }else{
      useProxy = !(fsInfo.f_flags&MNT_LOCAL);
    }
    if( useProxy ){
      rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);
      if( rc==SQLITE_OK ){
        rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:");
        if( rc!=SQLITE_OK ){
          /* Use unixClose to clean up the resources added in fillInUnixFile
          ** and clear all the structure's references.  Specifically,
          ** pFile->pMethods will be NULL so sqlite3OsClose will be a no-op
          */
          unixClose(pFile);
          return rc;
        }
      }
      goto open_finished;
    }
  }
#endif

  assert( zPath==0 || zPath[0]=='/'
      || eType==SQLITE_OPEN_SUPER_JOURNAL || eType==SQLITE_OPEN_MAIN_JOURNAL
  );
  rc = fillInUnixFile(pVfs, fd, pFile, zPath, ctrlFlags);

open_finished:
  if( rc!=SQLITE_OK ){
    sqlite3_free(p->pPreallocatedUnused);
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4f8, %rsp            # imm = 0x4F8
movq %r8, 0x48(%rsp)
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
movl %ecx, %r15d
andl $0xfff00, %r15d         # imm = 0xFFF00
andl $0x4, %ecx
movq %rcx, 0x18(%rsp)
jne 0x27eaf4
xorl %eax, %eax
movl %eax, 0x14(%rsp)
movl 0x24b34b(%rip), %ebp    # 0x4c9da8
callq 0x17af0
cmpl %eax, %ebp
je 0x27ea81
callq 0x17af0
movl %eax, 0x24b337(%rip)    # 0x4c9da8
callq 0x27bed9
testl %eax, %eax
jne 0x27ea81
movb $0x0, 0x24b13f(%rip)    # 0x4c9bc0
pxor %xmm0, %xmm0
movdqu %xmm0, 0x60(%rbx)
movdqu %xmm0, 0x50(%rbx)
movdqu %xmm0, 0x40(%rbx)
movdqu %xmm0, 0x30(%rbx)
movdqu %xmm0, 0x20(%rbx)
movdqu %xmm0, 0x10(%rbx)
movdqu %xmm0, (%rbx)
movq $0x0, 0x70(%rbx)
cmpl $0x100, %r15d           # imm = 0x100
movl %r14d, 0x4(%rsp)
movl %r15d, 0x24(%rsp)
jne 0x27eb22
cmpq $0x0, 0x24b2d6(%rip)    # 0x4c9da0
je 0x27eae5
leaq 0x2f0(%rsp), %rsi
movq %r13, %rdi
callq *0x24805b(%rip)         # 0x4c6b38
testl %eax, %eax
je 0x27eb67
xorl %eax, %eax
testq %rax, %rax
je 0x27eb35
movl (%rax), %r14d
jmp 0x27ebbf
movb $0x1, %al
cmpl $0x800, %r15d           # imm = 0x800
je 0x27ea53
cmpl $0x4000, %r15d          # imm = 0x4000
je 0x27ea53
cmpl $0x80000, %r15d         # imm = 0x80000
jne 0x27ea51
jmp 0x27ea53
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %r13, %r13
je 0x27eb42
movq %r13, %rdx
jmp 0x27ebd6
callq 0x27bed9
testl %eax, %eax
je 0x27eba6
xorl %eax, %eax
jmp 0x27ebb0
movl 0x8(%r12), %edi
leaq 0x2f0(%rsp), %r15
movq %r15, %rsi
callq 0x28e04a
movq %r15, %rdx
movl %eax, %r15d
testl %eax, %eax
jne 0x27f1b8
jmp 0x27ebd6
movq 0x24b232(%rip), %rcx    # 0x4c9da0
testq %rcx, %rcx
je 0x27eae5
movq 0x2f0(%rsp), %rdx
movq 0x2f8(%rsp), %rsi
xorl %eax, %eax
cmpq %rdx, (%rcx)
jne 0x27eb98
cmpq %rsi, 0x8(%rcx)
je 0x27efe9
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
jne 0x27eb89
jmp 0x27eae7
movl $0x10, %edi
callq 0x27c381
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x27edae
movq %rax, 0x30(%rbx)
movb $0x1, %al
movl $0x7, %r15d
movq %r13, %rdx
testb %al, %al
je 0x27f1b8
movl 0x4(%rsp), %eax
movl %eax, %ebp
andl $0x8, %ebp
movl %eax, %ecx
andl $0x1, %ecx
testl %r14d, %r14d
movl %ecx, 0x10(%rsp)
js 0x27ed21
movq 0x48(%rsp), %rax
testq %rax, %rax
movl 0x4(%rsp), %r15d
je 0x27ec03
movl %r15d, (%rax)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x27ec18
movl %r14d, (%rax)
movl %r15d, %ecx
andl $0x3, %ecx
movl %ecx, 0x4(%rax)
testl %ebp, %ebp
je 0x27ec25
movq %rdx, %rdi
callq *0x248033(%rip)         # 0x4c6c58
leal (,%rbp,4), %eax
cmpl $0x0, 0x10(%rsp)
leal 0x2(,%rbp,4), %ecx
cmovel %eax, %ecx
leal 0x80(%rcx), %eax
cmpl $0x100, 0x24(%rsp)      # imm = 0x100
cmovel %ecx, %eax
movl %eax, %ebp
orl $0x8, %ebp
cmpb $0x0, 0x14(%rsp)
cmovel %eax, %ebp
andl $0x40, %r15d
orl %ebp, %r15d
movl %r14d, 0x18(%rbx)
movq %r12, 0x8(%rbx)
movq %r13, 0x38(%rbx)
movzbl %r15b, %eax
movw %ax, 0x1e(%rbx)
movq 0x247b0d(%rip), %rcx    # 0x4c6788
movq %rcx, 0x60(%rbx)
xorl %edi, %edi
testb $0x40, %al
cmovneq %r13, %rdi
leaq 0x1606ef(%rip), %rsi    # 0x3df37d
movl $0x1, %edx
callq 0x28bf29
testl %eax, %eax
je 0x27eca0
orb $0x10, 0x1e(%rbx)
movq 0x18(%r12), %rdi
leaq 0x160370(%rip), %rsi    # 0x3df01c
callq 0x17a40
testl %eax, %eax
jne 0x27ecb9
orb $0x1, 0x1e(%rbx)
movl %r14d, (%rsp)
testb %bpl, %bpl
js 0x27ecd4
movq 0x20(%r12), %rax
movq %r13, %rdi
movq %rbx, %rsi
callq *(%rax)
movq %rax, %r14
jmp 0x27ecdb
leaq 0x242d15(%rip), %r14    # 0x4c19f0
leaq 0x242c76(%rip), %rax    # 0x4c1958
cmpq %rax, %r14
je 0x27ed65
xorl %r12d, %r12d
leaq 0x242d97(%rip), %rax    # 0x4c1a88
cmpq %rax, %r14
jne 0x27f15a
movq %r13, %rbp
movq %r13, %rdi
callq 0x172f0
movq %rax, %r15
addl $0x6, %r15d
callq 0x27bed9
testl %eax, %eax
je 0x27ee87
xorl %r13d, %r13d
jmp 0x27ee92
testl $0x80800, %eax          # imm = 0x80800
movq %rdx, 0x8(%rsp)
movq %r13, 0x40(%rsp)
movl %r14d, (%rsp)
movq %r12, 0x30(%rsp)
movq %rbp, 0x38(%rsp)
je 0x27ed91
testq %rdx, %rdx
je 0x27edf4
movq %rdx, %rdi
callq 0x172f0
movq 0x8(%rsp), %rdx
movq %rax, %r14
andl $0x3fffffff, %r14d      # imm = 0x3FFFFFFF
jmp 0x27edf7
movl 0x18(%rbx), %edi
leaq 0xe0(%rsp), %rsi
callq *0x247dda(%rip)         # 0x4c6b50
testl %eax, %eax
je 0x27edb5
callq 0x17060
movl (%rax), %eax
movl %eax, 0x20(%rbx)
movl $0xa, %r12d
xorl %eax, %eax
jmp 0x27f11f
testl %ebp, %ebp
jne 0x27ee7a
xorl %r15d, %r15d
testb $0x40, 0x4(%rsp)
jne 0x27f03a
xorl %ebp, %ebp
jmp 0x27ee82
xorl %eax, %eax
jmp 0x27ebc5
movdqu 0xe0(%rsp), %xmm0
movdqa %xmm0, 0x50(%rsp)
movq 0x24afd5(%rip), %rax    # 0x4c9da0
testq %rax, %rax
je 0x27ee66
movdqu (%rax), %xmm0
pcmpeqb 0x50(%rsp), %xmm0
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x27f09e
movq 0x40(%rax), %rax
jmp 0x27edcb
xorl %r14d, %r14d
decq %r14
xorl %r15d, %r15d
movl $0x0, %ebp
movl $0x0, %r13d
movl $0x0, %r12d
movb (%rdx,%r14), %al
cmpb $0x2d, %al
je 0x27ee25
subq $0x1, %r14
jb 0x27eda7
cmpb $0x2e, %al
jne 0x27ee0e
jmp 0x27eed9
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x17660
movb $0x0, 0xe0(%rsp,%r14)
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq *0x247ce6(%rip)         # 0x4c6b38
testl %eax, %eax
je 0x27eec2
movl $0x70a, %r12d           # imm = 0x70A
xorl %r15d, %r15d
xorl %ebp, %ebp
xorl %r13d, %r13d
jmp 0x27eed9
callq 0x27bed9
testl %eax, %eax
je 0x27f0a3
xorl %eax, %eax
jmp 0x27f0ad
xorl %ebp, %ebp
movl $0x180, %r15d           # imm = 0x180
xorl %r13d, %r13d
jmp 0x27eed6
movslq %r15d, %rdi
callq 0x27c381
movq %rax, %r13
testq %r13, %r13
je 0x27eeb3
leaq 0x1604e4(%rip), %rdx    # 0x3df382
xorl %r12d, %r12d
movl %r15d, %edi
movq %r13, %rsi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x27e570
jmp 0x27eeb9
movl $0x7, %r12d
movq %r13, 0x28(%rbx)
jmp 0x27f15a
movl $0x1ff, %r15d           # imm = 0x1FF
andl 0x68(%rsp), %r15d
movl 0x6c(%rsp), %ebp
movl 0x70(%rsp), %r13d
xorl %r12d, %r12d
movl $0x1, %r14d
testl %r12d, %r12d
je 0x27ef17
movl %r12d, %r15d
cmpl $0x2, %r14d
movq 0x40(%rsp), %r13
movq 0x38(%rsp), %rbp
je 0x27f1a7
testl %r14d, %r14d
movl (%rsp), %r14d
movq 0x30(%rsp), %r12
movq 0x8(%rsp), %rdx
je 0x27ebf1
jmp 0x27f1b8
movq 0x18(%rsp), %rdx
shll $0x4, %edx
movl 0x4(%rsp), %ecx
movl %ecx, %eax
andl $0x10, %eax
movl %ecx, %r14d
andl $0x2, %r14d
leal (%rdx,%rax,8), %eax
leal (%r14,%rax), %esi
addl $0x20000, %esi          # imm = 0x20000
movq 0x8(%rsp), %rdi
movl %esi, 0x18(%rsp)
movl %r15d, %edx
callq 0x28dd65
xorl %edx, %edx
movl $0xe, %r12d
movl %eax, (%rsp)
testl %eax, %eax
js 0x27ef64
movl (%rsp), %eax
jmp 0x27f1dd
movq %r14, 0x28(%rsp)
movl 0x18(%rsp), %r14d
cmpb $0x0, 0x14(%rsp)
je 0x27ef9d
callq 0x17060
cmpl $0xd, (%rax)
jne 0x27ef9d
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq *0x247b7c(%rip)         # 0x4c6b08
testl %eax, %eax
je 0x27ef9d
movl $0x608, %r12d           # imm = 0x608
movl $0x608, %edx            # imm = 0x608
jmp 0x27ef5c
callq 0x17060
cmpl $0x0, 0x28(%rsp)
je 0x27f1d8
cmpl $0x15, (%rax)
movl (%rsp), %eax
je 0x27f1db
movl 0x4(%rsp), %eax
andl $-0x8, %eax
movl %r14d, %esi
andl $0x20080, %esi          # imm = 0x20080
incl %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rdi
movl %r15d, %edx
callq 0x28dd65
movl $0x1, 0x10(%rsp)
jmp 0x27f1db
movq 0x28(%rcx), %rax
testq %rax, %rax
sete %dl
je 0x27eae7
andl $0x3, %r14d
cmpl %r14d, 0x4(%rax)
jne 0x27f009
addq $0x28, %rcx
jmp 0x27f026
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
sete %dl
je 0x27eae7
cmpl %r14d, 0x4(%rax)
jne 0x27f009
addq $0x8, %rcx
testb %dl, %dl
jne 0x27eae7
movq 0x8(%rax), %rdx
movq %rdx, (%rcx)
jmp 0x27eae7
leaq 0x160335(%rip), %rsi    # 0x3df376
movq %rdx, %rdi
callq 0x28bdcd
movl $0x0, %ebp
movl $0x0, %r13d
movl $0x0, %r12d
testq %rax, %rax
je 0x27eed9
leaq 0xe0(%rsp), %rsi
movq %rax, %rdi
callq *0x247ac4(%rip)         # 0x4c6b38
testl %eax, %eax
jne 0x27ee56
movl $0x1ff, %r15d           # imm = 0x1FF
andl 0xf8(%rsp), %r15d
movl 0xfc(%rsp), %ebp
movl 0x100(%rsp), %r13d
jmp 0x27eed6
incl 0x30(%rax)
jmp 0x27f116
movl $0x50, %edi
callq 0x27c381
testq %rax, %rax
je 0x27f1cd
pxor %xmm0, %xmm0
movdqu %xmm0, 0x40(%rax)
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqa 0x50(%rsp), %xmm0
movdqu %xmm0, (%rax)
cmpb $0x0, 0x247585(%rip)    # 0x4c6664
je 0x27f0ec
leaq 0x10(%rax), %rcx
movq $0x8, (%rcx)
movl $0x1, 0x30(%rax)
movq 0x24aca6(%rip), %rcx    # 0x4c9da0
movq %rcx, 0x40(%rax)
movq $0x0, 0x48(%rax)
testq %rcx, %rcx
je 0x27f10f
movq %rax, 0x48(%rcx)
movq %rax, 0x24ac8a(%rip)    # 0x4c9da0
movq %rax, 0x10(%rbx)
xorl %r12d, %r12d
movb $0x1, %al
testb %al, %al
jne 0x27f15a
movl (%rsp), %edi
callq *0x2479c4(%rip)         # 0x4c6af0
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x27f15a
testq %rbx, %rbx
je 0x27f142
movq 0x38(%rbx), %rdx
jmp 0x27f144
xorl %edx, %edx
leaq 0x152eb9(%rip), %rsi    # 0x3d2004
movl $0x100a, %edi           # imm = 0x100A
movl $0x98f4, %ecx           # imm = 0x98F4
callq 0x28de48
movl $0x0, 0x20(%rbx)
testl %r12d, %r12d
je 0x27f182
movl (%rsp), %edi
testl %edi, %edi
js 0x27f1a7
callq *0x24797d(%rip)         # 0x4c6af0
testl %eax, %eax
je 0x27f1a7
testq %rbx, %rbx
je 0x27f18f
movq 0x38(%rbx), %rdx
jmp 0x27f191
movq %r14, (%rbx)
movq %rbx, %rdi
callq 0x28db57
jmp 0x27f1a7
xorl %edx, %edx
leaq 0x152e6c(%rip), %rsi    # 0x3d2004
movl $0x100a, %edi           # imm = 0x100A
movl $0x9949, %ecx           # imm = 0x9949
callq 0x28de48
testl %r12d, %r12d
je 0x27f1b5
movq 0x30(%rbx), %rdi
callq 0x27c490
movl %r12d, %r15d
movl %r15d, %eax
addq $0x4f8, %rsp            # imm = 0x4F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x7, %r12d
jmp 0x27ed8a
movl (%rsp), %eax
xorl %edx, %edx
movl %eax, (%rsp)
testl %eax, %eax
js 0x27f22a
testl %r15d, %r15d
sete %al
testl $0x80800, 0x4(%rsp)     # imm = 0x80800
sete %cl
xorl %r14d, %r14d
orb %al, %cl
movl $0x7, %r15d
movl %edx, %r12d
jne 0x27eee7
callq *0x247ac1(%rip)         # 0x4c6cd0
testl %eax, %eax
jne 0x27eee7
movl (%rsp), %edi
movl %ebp, %esi
movl %r13d, %edx
callq *0x247a93(%rip)         # 0x4c6cb8
jmp 0x27eee7
leaq 0x1600ee(%rip), %rsi    # 0x3df31f
leaq 0x1600d6(%rip), %rdx    # 0x3df30e
leaq 0x15ff46(%rip), %r8     # 0x3df185
movl $0xe, %edi
movl $0x9ae7, %ecx           # imm = 0x9AE7
xorl %eax, %eax
callq 0x27e637
leaq 0xf47dd(%rip), %rsi     # 0x373a34
movl $0xe, %edi
movq 0x8(%rsp), %rdx
movl $0x9ae7, %ecx           # imm = 0x9AE7
callq 0x28de48
movl $0x7, %r15d
movl $0x2, %r14d
jmp 0x27eee7