// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: unixFileControl
static int unixFileControl(sqlite3_file *id, int op, void *pArg){
  unixFile *pFile = (unixFile*)id;
  switch( op ){
    case SQLITE_FCNTL_LOCKSTATE: {
      *(int*)pArg = pFile->eFileLock;
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_LAST_ERRNO: {
      *(int*)pArg = pFile->lastErrno;
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_CHUNK_SIZE: {
      pFile->szChunk = *(int *)pArg;
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_SIZE_HINT: {
      int rc;
      SimulateIOErrorBenign(1);
      rc = fcntlSizeHint(pFile, *(i64 *)pArg);
      SimulateIOErrorBenign(0);
      return rc;
    }
    case SQLITE_FCNTL_PERSIST_WAL: {
      unixModeBit(pFile, UNIXFILE_PERSIST_WAL, (int*)pArg);
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_POWERSAFE_OVERWRITE: {
      unixModeBit(pFile, UNIXFILE_PSOW, (int*)pArg);
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_VFSNAME: {
      *(char**)pArg = sqlite3_mprintf("%s", pFile->pVfs->zName);
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_TEMPFILENAME: {
      char *zTFile = sqlite3_malloc64( pFile->pVfs->mxPathname );
      if( zTFile ){
        unixGetTempname(pFile->pVfs->mxPathname, zTFile);
        *(char**)pArg = zTFile;
      }
      return SQLITE_OK;
    }
    case SQLITE_FCNTL_HAS_MOVED: {
      *(int*)pArg = fileHasMoved(pFile);
      return SQLITE_OK;
    }
#if SQLITE_MAX_MMAP_SIZE>0
    case SQLITE_FCNTL_MMAP_SIZE: {
      i64 newLimit = *(i64*)pArg;
      int rc = SQLITE_OK;
      if( newLimit>sqlite3GlobalConfig.mxMmap ){
        newLimit = sqlite3GlobalConfig.mxMmap;
      }
      *(i64*)pArg = pFile->mmapSizeMax;
      if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){
        pFile->mmapSizeMax = newLimit;
        if( pFile->mmapSize>0 ){
          unixUnmapfile(pFile);
          rc = unixMapfile(pFile, -1);
        }
      }
      return rc;
    }
#endif
#ifdef SQLITE_DEBUG
    /* The pager calls this method to signal that it has done
    ** a rollback and that the database is therefore unchanged and
    ** it hence it is OK for the transaction change counter to be
    ** unchanged.
    */
    case SQLITE_FCNTL_DB_UNCHANGED: {
      ((unixFile*)id)->dbUpdate = 0;
      return SQLITE_OK;
    }
#endif
#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
    case SQLITE_FCNTL_SET_LOCKPROXYFILE:
    case SQLITE_FCNTL_GET_LOCKPROXYFILE: {
      return proxyFileControl(id,op,pArg);
    }
#endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */
  }
  return SQLITE_NOTFOUND;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x13, %eax
ja 0x22a42
movq -0x50(%rbp), %rax
leaq 0x7ec8e(%rip), %rcx     # 0xa14f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x28(%rbp), %rax
movzbl 0x1c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x48(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x240e0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x4, %esi
callq 0x242f0
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x10, %esi
callq 0x242f0
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x18(%rax), %rsi
leaq 0x83390(%rip), %rdi     # 0xa5cbc
movb $0x0, %al
callq 0xb7d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movslq 0x8(%rax), %rdi
callq 0xb270
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x22984
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x8(%rax), %edi
movq -0x38(%rbp), %rsi
callq 0x24370
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x28(%rbp), %rdi
callq 0x235f0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x22a49
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x40(%rbp), %rax
cmpq 0x9cc2e(%rip), %rax     # 0xbf5f8
jle 0x229d7
movq 0x9cc25(%rip), %rax     # 0xbf5f8
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x40(%rbp)
jl 0x22a3a
movq -0x40(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x60(%rcx), %rax
je 0x22a3a
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
jne 0x22a3a
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jle 0x22a38
movq -0x28(%rbp), %rdi
callq 0x23a80
movq -0x28(%rbp), %rdi
movq $-0x1, %rsi
callq 0x24430
movl %eax, -0x44(%rbp)
jmp 0x22a3a
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22a49
movl $0xc, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)