// File: /workspace/github_c_makefile_star2_O3/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 $0x508, %rsp            # imm = 0x508
movq %r8, 0x30(%rsp)
movl %ecx, %r15d
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movl %ecx, %r13d
andl $0xfff00, %r13d         # imm = 0xFFF00
andl $0x4, %ecx
movq %rcx, 0x38(%rsp)
jne 0x2751d5
xorl %eax, %eax
movl %eax, 0x2c(%rsp)
movl 0x249c9a(%rip), %ebp    # 0x4beda8
callq 0x17af0
cmpl %eax, %ebp
je 0x275132
callq 0x17af0
movl %eax, 0x249c86(%rip)    # 0x4beda8
callq 0x2725a7
testl %eax, %eax
jne 0x275132
movb $0x0, 0x249a8e(%rip)    # 0x4bebc0
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, %r13d           # imm = 0x100
movl %r15d, 0x14(%rsp)
jne 0x275203
cmpq $0x0, 0x249c26(%rip)    # 0x4beda0
je 0x275195
leaq 0x300(%rsp), %rsi
movq %r14, %rdi
callq *0x2469ab(%rip)         # 0x4bbb38
testl %eax, %eax
je 0x275441
callq 0x2725a7
movl $0x7, %r15d
testl %eax, %eax
jne 0x27589c
movl %r13d, 0x10(%rsp)
movq %r12, 0x20(%rsp)
movl $0x10, %edi
callq 0x272ae6
testq %rax, %rax
je 0x27589c
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rax, 0x30(%rbx)
movq %r14, 0x50(%rsp)
jmp 0x275220
movb $0x1, %al
cmpl $0x800, %r13d           # imm = 0x800
je 0x275104
cmpl $0x4000, %r13d          # imm = 0x4000
je 0x275104
cmpl $0x80000, %r13d         # imm = 0x80000
jne 0x275102
jmp 0x275104
movl %r13d, 0x10(%rsp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
testq %r14, %r14
movq %r14, 0x50(%rsp)
movq %r12, 0x20(%rsp)
je 0x275414
movq %r14, %rdx
movl 0x14(%rsp), %r15d
movl %r15d, %r12d
andl $0x8, %r12d
movl %r15d, %edi
andl $0x1, %edi
testl %esi, %esi
js 0x2753d0
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x27524a
movl %r15d, (%rax)
movq 0x30(%rbx), %rax
testq %rax, %rax
movq 0x50(%rsp), %r13
movq 0x20(%rsp), %r14
je 0x275268
movl %esi, (%rax)
movl %r15d, %ecx
andl $0x3, %ecx
movl %ecx, 0x4(%rax)
testl %r12d, %r12d
je 0x275290
movl %esi, %ebp
movq %r14, 0x20(%rsp)
movq %r13, %r14
movl %edi, %r13d
movq %rdx, %rdi
callq *0x2469d5(%rip)         # 0x4bbc58
movl %r13d, %edi
movq %r14, %r13
movq 0x20(%rsp), %r14
movl %ebp, %esi
leal (,%r12,4), %eax
testl %edi, %edi
leal 0x2(,%r12,4), %ecx
cmovel %eax, %ecx
leal 0x80(%rcx), %eax
cmpl $0x100, 0x10(%rsp)      # imm = 0x100
cmovel %ecx, %eax
movl %eax, %ebp
orl $0x8, %ebp
cmpb $0x0, 0x2c(%rsp)
cmovel %eax, %ebp
andl $0x40, %r15d
orl %ebp, %r15d
movl %esi, %r12d
movl %esi, 0x18(%rbx)
movq %r14, 0x8(%rbx)
movq %r13, 0x38(%rbx)
movw %r15w, 0x1e(%rbx)
movq 0x2464a4(%rip), %rax    # 0x4bb788
movq %rax, 0x60(%rbx)
xorl %edi, %edi
testb $0x40, %r15b
cmovneq %r13, %rdi
leaq 0x160930(%rip), %rsi    # 0x3d5c29
movl $0x1, %edx
callq 0x2823f2
testl %eax, %eax
je 0x27530b
orb $0x10, 0x1e(%rbx)
movq 0x18(%r14), %rdi
leaq 0x1605b2(%rip), %rsi    # 0x3d58c8
callq 0x17a40
testl %eax, %eax
jne 0x275323
orb $0x1, 0x1e(%rbx)
testb %bpl, %bpl
js 0x2753af
movq 0x20(%r14), %rax
movq %r13, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x241609(%rip), %r14    # 0x4b6948
cmpq %r14, %rax
je 0x27547e
leaq 0x241729(%rip), %rbp    # 0x4b6a78
movq %rax, %r14
cmpq %rbp, %rax
jne 0x2753b6
movq %r13, %rdi
callq 0x172f0
movq %rax, %r14
callq 0x2725a7
testl %eax, %eax
je 0x275816
movq $0x0, 0x28(%rbx)
movl $0x0, 0x20(%rbx)
movl %r12d, %edi
callq *0x246769(%rip)         # 0x4bbaf0
movl $0x7, %r15d
testl %eax, %eax
je 0x275893
movq 0x38(%rbx), %rdx
leaq 0x15353c(%rip), %rsi    # 0x3c88dc
movl $0x100a, %edi           # imm = 0x100A
movl $0x9949, %ecx           # imm = 0x9949
jmp 0x275771
leaq 0x24162a(%rip), %r14    # 0x4b69e0
movl $0x0, 0x20(%rbx)
movq %r14, (%rbx)
movq %rbx, %rdi
callq 0x283ffc
xorl %r15d, %r15d
jmp 0x27589c
movl %r15d, %eax
andl $0x80800, %eax          # imm = 0x80800
movq %rdx, 0x8(%rsp)
movq %r12, 0x48(%rsp)
movl %edi, 0x18(%rsp)
movl %eax, 0x44(%rsp)
je 0x2754ac
testq %rdx, %rdx
je 0x2754cd
movq %rdx, %rdi
callq 0x172f0
movq 0x8(%rsp), %rdx
movq %rax, %rbp
andl $0x3fffffff, %ebp       # imm = 0x3FFFFFFF
jmp 0x2754cf
movl 0x8(%r12), %edi
leaq 0x300(%rsp), %r14
movq %r14, %rsi
callq 0x2844e6
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
movl %eax, %r15d
testl %eax, %eax
jne 0x27589c
jmp 0x275223
movq 0x249958(%rip), %rcx    # 0x4beda0
testq %rcx, %rcx
je 0x275195
movq 0x300(%rsp), %rax
movq 0x308(%rsp), %rdx
cmpq %rax, (%rcx)
jne 0x275470
cmpq %rdx, 0x8(%rcx)
je 0x2755a3
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
jne 0x275461
jmp 0x275195
movl 0x18(%rbx), %edi
leaq 0xf0(%rsp), %rsi
callq *0x2466c1(%rip)         # 0x4bbb50
testl %eax, %eax
je 0x275564
callq 0x17060
movl (%rax), %eax
movl %eax, 0x20(%rbx)
movl $0xa, %r15d
jmp 0x27578e
testl %r12d, %r12d
jne 0x275545
xorl %r14d, %r14d
testb $0x40, %r15b
jne 0x2757b1
xorl %r13d, %r13d
xorl %r12d, %r12d
jmp 0x275625
xorl %ebp, %ebp
decq %rbp
xorl %r12d, %r12d
movl $0x0, %r13d
movl $0x0, %r14d
movl $0x0, %r15d
movb (%rdx,%rbp), %al
cmpb $0x2d, %al
je 0x2754fd
subq $0x1, %rbp
jb 0x275556
cmpb $0x2e, %al
jne 0x2754e7
jmp 0x27561c
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rdx, %rsi
movq %rbp, %rdx
callq 0x17660
movb $0x0, 0xf0(%rsp,%rbp)
leaq 0x60(%rsp), %rsi
movq %r14, %rdi
callq *0x24660f(%rip)         # 0x4bbb38
testl %eax, %eax
je 0x2755fc
movl $0x70a, %r15d           # imm = 0x70A
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %r14d, %r14d
jmp 0x275617
movl $0x180, %r12d           # imm = 0x180
xorl %r14d, %r14d
xorl %r13d, %r13d
jmp 0x275625
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x27561c
movdqa 0xf0(%rsp), %xmm0
movdqa %xmm0, 0x60(%rsp)
movq 0x249826(%rip), %rax    # 0x4beda0
testq %rax, %rax
je 0x27577b
movdqu (%rax), %xmm0
pcmpeqb 0x60(%rsp), %xmm0
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x2758b1
movq 0x40(%rax), %rax
jmp 0x27557a
movq 0x28(%rcx), %rax
testq %rax, %rax
je 0x275195
andl $0x3, %r15d
cmpl %r15d, 0x4(%rax)
jne 0x2755ca
movl %r13d, 0x10(%rsp)
movq %r12, 0x20(%rsp)
addq $0x28, %rcx
jmp 0x2755ee
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x275195
cmpl %r15d, 0x4(%rax)
jne 0x2755ca
movl %r13d, 0x10(%rsp)
movq %r12, 0x20(%rsp)
addq $0x8, %rcx
movq 0x8(%rax), %rdx
movq %rdx, (%rcx)
movl (%rax), %esi
jmp 0x2751ca
movl $0x1ff, %r12d           # imm = 0x1FF
andl 0x78(%rsp), %r12d
movl 0x7c(%rsp), %r13d
movl 0x80(%rsp), %r14d
xorl %r15d, %r15d
movq 0x8(%rsp), %rdx
testl %r15d, %r15d
jne 0x27589c
movl 0x14(%rsp), %r15d
movl %r15d, %ebp
andl $0x2, %ebp
movq 0x38(%rsp), %rcx
shll $0x4, %ecx
movl %r15d, %eax
andl $0x10, %eax
leal (%rcx,%rax,8), %eax
leal (%rax,%rbp), %esi
addl $0x20000, %esi          # imm = 0x20000
movq %rdx, %rdi
movl %esi, 0x38(%rsp)
movl %r12d, %edx
callq 0x284201
testl %eax, %eax
js 0x27568d
movl %eax, %esi
movl 0x18(%rsp), %edi
testl %r12d, %r12d
sete %al
cmpl $0x0, 0x44(%rsp)
sete %cl
orb %al, %cl
je 0x27570b
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rdx
movq 0x48(%rsp), %r12
jmp 0x275242
movq %rbp, 0x18(%rsp)
movl 0x38(%rsp), %ebp
callq 0x17060
cmpb $0x0, 0x2c(%rsp)
je 0x2756c8
cmpl $0xd, (%rax)
jne 0x2756c8
movq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %rax, 0x58(%rsp)
callq *0x24644f(%rip)         # 0x4bbb08
movl $0x608, %r15d           # imm = 0x608
testl %eax, %eax
movq 0x58(%rsp), %rax
jne 0x275735
movl $0xe, %r15d
cmpl $0x0, 0x18(%rsp)
je 0x275735
cmpl $0x15, (%rax)
je 0x275735
movl %ebp, %esi
andl $0x20080, %esi          # imm = 0x20080
movq 0x8(%rsp), %rdi
movl %r12d, %edx
callq 0x284201
testl %eax, %eax
js 0x275735
movl %eax, %esi
movl 0x14(%rsp), %r15d
andl $-0x8, %r15d
incl %r15d
movl $0x1, %edi
jmp 0x275663
movl %edi, 0x18(%rsp)
movl %esi, %ebp
callq *0x2465b9(%rip)         # 0x4bbcd0
testl %eax, %eax
movq 0x48(%rsp), %r12
je 0x275851
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rdx
movl %ebp, %esi
jmp 0x27586b
leaq 0x16048f(%rip), %rsi    # 0x3d5bcb
leaq 0x160477(%rip), %rdx    # 0x3d5bba
leaq 0x1602e7(%rip), %r8     # 0x3d5a31
movl $0xe, %edi
movl $0x9ae7, %ecx           # imm = 0x9AE7
xorl %eax, %eax
callq 0x274d08
leaq 0xf5082(%rip), %rsi     # 0x36a7e4
movl $0xe, %edi
movq 0x8(%rsp), %rdx
movl $0x9ae7, %ecx           # imm = 0x9AE7
callq 0x2842dc
jmp 0x275893
callq 0x2725a7
movl $0x7, %r15d
testl %eax, %eax
je 0x2758b6
movl %r12d, %edi
callq *0x246359(%rip)         # 0x4bbaf0
testl %eax, %eax
je 0x27588c
testq %rbx, %rbx
je 0x275874
movq 0x38(%rbx), %rdx
jmp 0x275876
leaq 0x16046a(%rip), %rsi    # 0x3d5c22
movq %rdx, %rdi
callq 0x2822a3
movq 0x8(%rsp), %rdx
movl $0x0, %r13d
movl $0x0, %r12d
testq %rax, %rax
je 0x275625
leaq 0xf0(%rsp), %rsi
movq %rax, %rdi
callq *0x24634d(%rip)         # 0x4bbb38
testl %eax, %eax
jne 0x275531
movl $0x1ff, %r12d           # imm = 0x1FF
andl 0x108(%rsp), %r12d
movl 0x10c(%rsp), %r13d
movl 0x110(%rsp), %r14d
jmp 0x275614
addl $0x6, %r14d
movslq %r14d, %rdi
callq 0x272ae6
testq %rax, %rax
je 0x27536f
movq %rax, %r15
leaq 0x1603f9(%rip), %rdx    # 0x3d5c2e
movl %r14d, %edi
movq %rax, %rsi
movq %r13, %rcx
xorl %eax, %eax
callq 0x274c41
movq %r15, 0x28(%rbx)
movq %rbp, %r14
jmp 0x2753b6
movl %ebp, %edi
movl %r13d, %esi
movl %r14d, %edx
callq *0x246459(%rip)         # 0x4bbcb8
movl %ebp, %esi
movq 0x30(%rsp), %rax
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %edi
jmp 0x275242
xorl %edx, %edx
leaq 0x15305f(%rip), %rsi    # 0x3c88dc
movl $0x100a, %edi           # imm = 0x100A
movl $0x98f4, %ecx           # imm = 0x98F4
callq 0x2842dc
movl $0x0, 0x20(%rbx)
movq 0x30(%rbx), %rdi
callq 0x272c00
movl %r15d, %eax
addq $0x508, %rsp            # imm = 0x508
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl 0x30(%rax)
jmp 0x27592c
movl $0x50, %edi
callq 0x272ae6
testq %rax, %rax
je 0x27578e
pxor %xmm0, %xmm0
movdqu %xmm0, 0x40(%rax)
movdqu %xmm0, 0x30(%rax)
movdqu %xmm0, 0x20(%rax)
movdqu %xmm0, 0x10(%rax)
movdqa 0x60(%rsp), %xmm0
movdqu %xmm0, (%rax)
cmpb $0x0, 0x245d72(%rip)    # 0x4bb664
je 0x275902
movq %rax, %rcx
addq $0x10, %rcx
movq $0x8, (%rcx)
movl $0x1, 0x30(%rax)
movq 0x249490(%rip), %rcx    # 0x4beda0
movq %rcx, 0x40(%rax)
movq $0x0, 0x48(%rax)
testq %rcx, %rcx
je 0x275925
movq %rax, 0x48(%rcx)
movq %rax, 0x249474(%rip)    # 0x4beda0
movq %rax, 0x10(%rbx)
jmp 0x2753b6