// File: /workspace/github_c_makefile_star2_O2/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 $0x488, %rsp            # imm = 0x488
movq %r8, 0x28(%rsp)
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movl %ecx, %r13d
andl $0xfff00, %r13d         # imm = 0xFFF00
andl $0x4, %ecx
movq %rcx, 0x8(%rsp)
jne 0x221921
xorl %eax, %eax
movl %eax, 0x3c(%rsp)
movl 0x21c4d0(%rip), %r14d   # 0x43dd58
callq 0x17a90
cmpl %eax, %r14d
je 0x2218a6
callq 0x17a90
movl %eax, 0x21c4bb(%rip)    # 0x43dd58
xorl %edi, %edi
xorl %esi, %esi
callq 0x221618
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)
andq $0x0, 0x70(%rbx)
cmpl $0x100, %r13d           # imm = 0x100
jne 0x22194f
cmpq $0x0, 0x21c46e(%rip)    # 0x43dd50
je 0x2218fd
leaq 0x280(%rsp), %rsi
movq %r12, %rdi
callq *0x2191f3(%rip)         # 0x43aae8
testl %eax, %eax
je 0x221b94
pushq $0x10
popq %rdi
callq 0x21f7df
testq %rax, %rax
je 0x221b8b
movl %r13d, 0x1c(%rsp)
movq %r15, 0x40(%rsp)
pushq $-0x1
popq %rdx
movq %rax, 0x30(%rbx)
jmp 0x221965
movb $0x1, %al
cmpl $0x800, %r13d           # imm = 0x800
je 0x22187d
cmpl $0x4000, %r13d          # imm = 0x4000
je 0x22187d
cmpl $0x80000, %r13d         # imm = 0x80000
jne 0x22187b
jmp 0x22187d
movl %r13d, 0x1c(%rsp)
pushq $-0x1
popq %rdx
testq %r12, %r12
movq %r15, 0x40(%rsp)
je 0x221b5c
movq %r12, %r13
movq 0x28(%rsp), %rax
movl %ebp, %r14d
andl $0x8, %r14d
movl %ebp, %esi
andl $0x1, %esi
testl %edx, %edx
js 0x221afe
movq 0x40(%rsp), %r15
testq %rax, %rax
je 0x22198d
movl %ebp, (%rax)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x2219a0
movl %edx, (%rax)
movl %ebp, %ecx
andl $0x3, %ecx
movl %ecx, 0x4(%rax)
testl %r14d, %r14d
je 0x2219d4
movq %r13, %rdi
movl %edx, %r13d
movl %ebp, 0x28(%rsp)
movq %r15, %rbp
movq %r14, %r15
movq %r12, %r14
movl %esi, %r12d
callq *0x219247(%rip)         # 0x43ac08
movl %r12d, %esi
movq %r14, %r12
movq %r15, %r14
movq %rbp, %r15
movl 0x28(%rsp), %ebp
movl %r13d, %edx
leal (,%r14,4), %eax
testl %esi, %esi
leal 0x2(,%r14,4), %ecx
cmovel %eax, %ecx
leal 0x80(%rcx), %eax
cmpl $0x100, 0x1c(%rsp)      # imm = 0x100
cmovel %ecx, %eax
movl %eax, %r14d
orl $0x8, %r14d
cmpb $0x0, 0x3c(%rsp)
cmovel %eax, %r14d
andl $0x40, %ebp
orl %r14d, %ebp
movl %edx, 0x8(%rsp)
movl %edx, 0x18(%rbx)
movq %r15, 0x8(%rbx)
movq %r12, 0x38(%rbx)
movw %bp, 0x1e(%rbx)
movq 0x218d0e(%rip), %rax    # 0x43a738
movq %rax, 0x60(%rbx)
xorl %edi, %edi
testb $0x40, %bpl
cmovneq %r12, %rdi
leaq 0x15460a(%rip), %rsi    # 0x376049
pushq $0x1
popq %rdx
callq 0x22cd81
testl %eax, %eax
je 0x221a4f
orb $0x10, 0x1e(%rbx)
movq 0x18(%r15), %rdi
leaq 0x15428e(%rip), %rsi    # 0x375ce8
callq 0x179e0
testl %eax, %eax
jne 0x221a67
orb $0x1, 0x1e(%rbx)
testb %r14b, %r14b
js 0x221ae0
movq 0x20(%r15), %rax
movq %r12, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x213eb9(%rip), %r14    # 0x435938
cmpq %r14, %rax
je 0x221bcc
movq %r12, %rcx
leaq 0x213fd6(%rip), %r12    # 0x435a68
movq %rax, %r14
cmpq %r12, %rax
jne 0x221ae7
movq %rcx, %r14
movq %rcx, %rdi
callq 0x172d0
movq %rax, %r15
addl $0x6, %r15d
movslq %r15d, %rdi
callq 0x21f7df
testq %rax, %rax
je 0x221e66
movq %rax, %r13
leaq 0x154587(%rip), %rdx    # 0x37604e
movl %r15d, %edi
movq %rax, %rsi
movq %r14, %rcx
xorl %eax, %eax
callq 0x221418
movq %r13, 0x28(%rbx)
movq %r12, %r14
jmp 0x221ae7
leaq 0x213ee9(%rip), %r14    # 0x4359d0
andl $0x0, 0x20(%rbx)
movq %r14, (%rbx)
movq %rbx, %rdi
callq 0x22e474
xorl %r15d, %r15d
jmp 0x221e8d
andl $0x0, 0x50(%rsp)
andl $0x0, 0x24(%rsp)
andl $0x0, 0x20(%rsp)
movl %ebp, %r15d
andl $0x80800, %r15d         # imm = 0x80800
movq %r12, 0x68(%rsp)
movl %esi, 0x30(%rsp)
je 0x221c0a
movl %r15d, 0x10(%rsp)
movq %r13, %rdi
callq 0x2211ac
movl %eax, %r12d
decq %r12
xorl %r15d, %r15d
movb (%r13,%r12), %al
cmpb $0x2d, %al
je 0x221c4b
subq $0x1, %r12
jb 0x221c7e
cmpb $0x2e, %al
jne 0x221b3c
jmp 0x221c7e
movl 0x8(%r15), %edi
leaq 0x280(%rsp), %r13
movl %edx, %r14d
movq %r13, %rsi
callq 0x22e9b6
movl %r14d, %edx
movl %eax, %r15d
testl %eax, %eax
movq 0x28(%rsp), %rax
jne 0x221e8d
jmp 0x22196d
pushq $0x7
popq %r15
jmp 0x221e8d
movq 0x280(%rsp), %rax
movq 0x288(%rsp), %rdx
leaq 0x21c1a5(%rip), %rcx    # 0x43dd50
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x2218fd
cmpq %rax, (%rcx)
jne 0x221bc6
cmpq %rdx, 0x8(%rcx)
je 0x221e2d
addq $0x40, %rcx
jmp 0x221bab
movl 0x18(%rbx), %edi
leaq 0x70(%rsp), %rsi
callq *0x218f26(%rip)         # 0x43ab00
testl %eax, %eax
je 0x221dee
callq 0x17060
movl (%rax), %eax
movl %eax, 0x20(%rbx)
pushq $0xa
popq %r15
movq %rbx, %rdi
movl 0x8(%rsp), %esi
movl $0x98f4, %edx           # imm = 0x98F4
callq 0x22e7d6
andl $0x0, 0x20(%rbx)
jmp 0x221e84
movl $0x180, %edx            # imm = 0x180
testl %r14d, %r14d
jne 0x221c90
xorl %edx, %edx
testb $0x40, %bpl
je 0x221c90
leaq 0x15441f(%rip), %rsi    # 0x376042
movq %r13, %rdi
callq 0x22ccb2
xorl %edx, %edx
testq %rax, %rax
je 0x221c90
movl %r15d, 0x10(%rsp)
leaq 0x50(%rsp), %rsi
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rax, %rdi
jmp 0x221c76
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x17630
movb $0x0, 0x70(%rsp,%r12)
leaq 0x50(%rsp), %rsi
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
callq 0x22ee05
movl %eax, %r15d
testl %r15d, %r15d
jne 0x221e8d
movl 0x50(%rsp), %edx
movl 0x10(%rsp), %r15d
movl %ebp, %r12d
andl $0x2, %r12d
movq 0x8(%rsp), %rcx
shll $0x4, %ecx
movl %ebp, %eax
andl $0x10, %eax
leal (%rcx,%rax,8), %eax
leal (%r12,%rax), %esi
addl $0x20000, %esi          # imm = 0x20000
movq %r13, %rdi
movl %esi, 0x4c(%rsp)
movl %edx, 0x8(%rsp)
callq 0x22e62a
testl %eax, %eax
js 0x221d30
movl %eax, %edx
movl 0x30(%rsp), %esi
cmpl $0x0, 0x8(%rsp)
sete %al
testl %r15d, %r15d
sete %cl
orb %al, %cl
movq 0x68(%rsp), %r12
jne 0x221d21
movl 0x24(%rsp), %eax
movl %eax, 0x30(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x10(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, %r15d
callq *0x218f81(%rip)         # 0x43ac80
movl %r15d, %esi
movl 0x8(%rsp), %edx
testl %eax, %eax
jne 0x221d21
movl %edx, %edi
movl 0x30(%rsp), %esi
movl 0x10(%rsp), %edx
callq *0x218f4e(%rip)         # 0x43ac68
movl %r15d, %esi
movl 0x8(%rsp), %edx
movq 0x40(%rsp), %r15
movq 0x28(%rsp), %rax
jmp 0x221986
movq %r12, 0x30(%rsp)
movl 0x4c(%rsp), %r12d
callq 0x17060
movq %rax, %rcx
cmpb $0x0, 0x3c(%rsp)
je 0x221d77
cmpl $0xd, (%rcx)
jne 0x221d77
movl $0x0, 0x38(%rsp)
movq %r13, %rdi
xorl %esi, %esi
movq %rcx, 0x10(%rsp)
callq *0x218d52(%rip)         # 0x43aab8
movq 0x10(%rsp), %rcx
testl %eax, %eax
je 0x221d77
movl $0x608, %r15d           # imm = 0x608
jmp 0x221dbe
movl %r15d, 0x10(%rsp)
xorl %r15d, %r15d
movb $0x1, %al
movl %eax, 0x38(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x221dbe
cmpl $0x15, (%rcx)
je 0x221dbe
movl %r12d, %esi
andl $0x20080, %esi          # imm = 0x20080
movq %r13, %rdi
movl 0x8(%rsp), %edx
callq 0x22e62a
testl %eax, %eax
js 0x221dbe
movl %eax, %edx
pushq $0x1
popq %rsi
andl $-0x8, %ebp
incl %ebp
movl 0x10(%rsp), %r15d
jmp 0x221ccb
movl $0x9ae7, %edi           # imm = 0x9AE7
callq 0x22e760
movl %eax, %ebp
leaq 0xe8973(%rip), %rsi     # 0x30a744
movl %eax, %edi
movq %r13, %rdx
movl $0x9ae7, %ecx           # imm = 0x9AE7
callq 0x22e701
cmpb $0x0, 0x38(%rsp)
cmovnel %ebp, %r15d
jmp 0x221e84
movdqa 0x70(%rsp), %xmm0
movdqa %xmm0, 0x50(%rsp)
leaq 0x21bf4f(%rip), %rax    # 0x43dd50
movq (%rax), %rax
testq %rax, %rax
je 0x221ea2
movdqu (%rax), %xmm0
pcmpeqb 0x50(%rsp), %xmm0
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x221f11
addq $0x40, %rax
jmp 0x221e01
movl %ebp, %edx
andl $0x3, %edx
addq $0x28, %rcx
movq (%rcx), %rax
testq %rax, %rax
je 0x2218fd
movq %rcx, %rsi
leaq 0x8(%rax), %rcx
cmpl %edx, 0x4(%rax)
jne 0x221e36
movl %r13d, 0x1c(%rsp)
movq %r15, 0x40(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, (%rsi)
movl (%rax), %edx
jmp 0x22191b
andq $0x0, 0x28(%rbx)
pushq $0x7
popq %r15
andl $0x0, 0x20(%rbx)
movq %rbx, %rdi
movl 0x8(%rsp), %esi
movl $0x9949, %edx           # imm = 0x9949
callq 0x22e7d6
movq 0x30(%rbx), %rdi
callq 0x21f7f9
movl %r15d, %eax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x50
popq %rdi
callq 0x21f7df
testq %rax, %rax
je 0x221f1d
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, 0x21873c(%rip)    # 0x43a614
je 0x221ee8
movq %rax, %rcx
addq $0x10, %rcx
movq $0x8, (%rcx)
movl $0x1, 0x30(%rax)
movq 0x21be5a(%rip), %rcx    # 0x43dd50
movq %rcx, 0x40(%rax)
andq $0x0, 0x48(%rax)
testq %rcx, %rcx
je 0x221f08
movq %rax, 0x48(%rcx)
movq %rax, 0x21be41(%rip)    # 0x43dd50
jmp 0x221f14
incl 0x30(%rax)
movq %rax, 0x10(%rbx)
jmp 0x221ae7
pushq $0x7
jmp 0x221bee