// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
pushq $0xc
popq %r14
decl %esi
cmpl $0x13, %esi
ja 0x1a7ce
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x4dd06(%rip), %rax     # 0x68394
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl 0x1c(%rbx), %eax
jmp 0x1a7c8
movq (%r15), %r15
cmpl $0x0, 0x48(%rbx)
jle 0x1a847
movl 0x18(%rbx), %edi
leaq -0xc8(%rbp), %rsi
callq *0x69243(%rip)          # 0x83900
movl $0x70a, %r14d           # imm = 0x70A
testl %eax, %eax
jne 0x1a7ce
movslq 0x48(%rbx), %rcx
movq %r15, -0x30(%rbp)
leaq (%r15,%rcx), %r14
decq %r14
movq %r14, %rax
cqto
idivq %rcx
subq %rdx, %r14
movq -0x98(%rbp), %rcx
cmpq %rcx, %r14
jle 0x1a843
movslq -0x90(%rbp), %rsi
movq %rcx, %rax
cqto
idivq %rsi
movq %rdx, %r12
notq %r12
addq %rcx, %r12
leaq -0x1(%r14), %rax
movq %rax, -0x38(%rbp)
movq %rsi, %r15
leaq (%rsi,%r14), %r13
decq %r13
addq %r15, %r12
cmpq %r13, %r12
jge 0x1a843
cmpq %r14, %r12
cmovgeq -0x38(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rsi
leaq 0x54951(%rip), %rdx     # 0x6f091
pushq $0x1
popq %rcx
callq 0x1b56d
cmpl $0x1, %eax
je 0x1a71f
movl $0x30a, %r14d           # imm = 0x30A
jmp 0x1a7ce
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x51c1f(%rip), %rdi     # 0x6c383
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa6c0
movq %rax, (%r15)
jmp 0x1a7ce
movl 0x20(%rbx), %eax
jmp 0x1a7c8
pushq $0x10
jmp 0x1a7b2
movq 0x8(%rbx), %rax
movslq 0x8(%rax), %rdi
callq 0xa230
xorl %r14d, %r14d
testq %rax, %rax
je 0x1a7ce
movq %rax, %r12
movq 0x8(%rbx), %rax
movl 0x8(%rax), %edi
movq %r12, %rsi
callq 0x1b717
movq %r12, (%r15)
jmp 0x1a7ce
movl (%r15), %eax
movl %eax, 0x48(%rbx)
jmp 0x1a7cb
pushq $0x4
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b6e4
jmp 0x1a7cb
movq %rbx, %rdi
callq 0x1b21b
movl %eax, (%r15)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rcx
movq 0x68d6b(%rip), %rax     # 0x83558
cmpq %rax, %rcx
cmovlq %rcx, %rax
movq 0x60(%rbx), %rcx
movq %rcx, (%r15)
testq %rax, %rax
sets %dl
cmpq %rcx, %rax
sete %cl
xorl %r14d, %r14d
orb %dl, %cl
jne 0x1a7ce
cmpl $0x0, 0x4c(%rbx)
jne 0x1a7ce
movq %rax, 0x60(%rbx)
cmpq $0x0, 0x50(%rbx)
jle 0x1a7ce
movq %rbx, %rdi
callq 0x1b53e
pushq $-0x1
popq %rsi
movq %rbx, %rdi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1b84a
movq -0x30(%rbp), %r15
xorl %r14d, %r14d
cmpq $0x0, 0x60(%rbx)
jle 0x1a7ce
cmpq %r15, 0x50(%rbx)
jge 0x1a7ce
cmpl $0x0, 0x48(%rbx)
jle 0x1a878
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b84a
movl %eax, %r14d
jmp 0x1a7ce
movl 0x18(%rbx), %edi
movq %r15, %rsi
callq 0x1b5f7
testl %eax, %eax
je 0x1a865
callq 0xa0b0
movl (%rax), %eax
movl %eax, 0x20(%rbx)
movq 0x38(%rbx), %rdx
leaq 0x519ff(%rip), %rsi     # 0x6c29b
movl $0x60a, %r14d           # imm = 0x60A
movl $0x60a, %edi            # imm = 0x60A
movl $0x781a, %ecx           # imm = 0x781A
callq 0x1b436
jmp 0x1a7ce