// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movl $0xc, %r14d
decl %esi
cmpl $0x13, %esi
ja 0x1cd78
movq %rdx, %r15
movq %rdi, %rbx
leaq 0x5c8df(%rip), %rax     # 0x79394
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl 0x1c(%rbx), %eax
jmp 0x1cc95
movq (%r15), %r12
cmpl $0x0, 0x48(%rbx)
jle 0x1cd3f
movl 0x18(%rbx), %edi
leaq -0xd8(%rbp), %rsi
callq *0x76d1c(%rip)          # 0x93800
testl %eax, %eax
je 0x1cc9d
movl $0x70a, %r14d           # imm = 0x70A
xorl %ecx, %ecx
jmp 0x1cd3b
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rsi
leaq 0x6087b(%rip), %rdi     # 0x7d383
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xa500
movq %rax, (%r15)
jmp 0x1cd78
movl 0x20(%rbx), %eax
jmp 0x1cc95
cmpl $0x0, (%r15)
js 0x1cc57
movzwl 0x1e(%rbx), %eax
je 0x1cd65
orl $0x10, %eax
jmp 0x1cd71
movq 0x8(%rbx), %rax
movslq 0x8(%rax), %r12
callq 0xa080
xorl %r14d, %r14d
testl %eax, %eax
je 0x1cc60
xorl %r12d, %r12d
jmp 0x1cc6b
movl (%r15), %eax
movl %eax, 0x48(%rbx)
jmp 0x1cd75
cmpl $0x0, (%r15)
js 0x1cc8b
movzwl 0x1e(%rbx), %eax
je 0x1cd6c
orl $0x4, %eax
jmp 0x1cd71
xorl %r14d, %r14d
cmpq $0x0, 0x10(%rbx)
movl $0x0, %ecx
je 0x1cbc2
movq 0x38(%rbx), %rdi
leaq -0xd8(%rbp), %rsi
callq *0x76c43(%rip)          # 0x937e8
movl $0x1, %ecx
testl %eax, %eax
jne 0x1cbc2
movq -0xd0(%rbp), %rax
movq 0x10(%rbx), %rdx
xorl %ecx, %ecx
cmpq 0x8(%rdx), %rax
setne %cl
movl %ecx, (%r15)
jmp 0x1cd78
movq (%r15), %rcx
movq 0x76884(%rip), %rax     # 0x93458
cmpq %rax, %rcx
cmovlq %rcx, %rax
movq 0x60(%rbx), %rcx
movq %rcx, (%r15)
xorl %r14d, %r14d
testq %rax, %rax
js 0x1cd78
cmpq 0x60(%rbx), %rax
je 0x1cd78
cmpl $0x0, 0x4c(%rbx)
jne 0x1cd78
movq %rax, 0x60(%rbx)
cmpq $0x0, 0x50(%rbx)
jle 0x1cd78
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x1cc37
leaq 0x50(%rbx), %r14
movq 0x58(%rbx), %rsi
callq *0x76d88(%rip)          # 0x939b0
movq $0x0, 0x68(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rbx, %rdi
movq $-0x1, %rsi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1dff3
movzwl 0x1e(%rbx), %eax
shrl $0x4, %eax
jmp 0x1cc92
movq %r12, %rdi
callq 0xbf9b
movq %rax, %r12
testq %r12, %r12
je 0x1cd78
movq 0x8(%rbx), %rax
movl 0x8(%rax), %edi
movq %r12, %rsi
callq 0x1debd
movq %r12, (%r15)
jmp 0x1cd78
movzwl 0x1e(%rbx), %eax
shrl $0x2, %eax
andl $0x1, %eax
movl %eax, (%r15)
jmp 0x1cd75
movslq 0x48(%rbx), %rcx
movq %r12, -0x30(%rbp)
addq %rcx, %r12
decq %r12
movq %r12, %rax
cqto
idivq %rcx
subq %rdx, %r12
movq -0xa8(%rbp), %r13
movl $0x30a, %r14d           # imm = 0x30A
movb $0x1, %cl
cmpq %r13, %r12
jle 0x1cd37
movslq -0xa0(%rbp), %rsi
movq %r13, %rax
cqto
idivq %rsi
notq %rdx
addq %rsi, %r13
addq %rdx, %r13
movq %rsi, -0x48(%rbp)
leaq (%rsi,%r12), %rax
decq %rax
movq %rax, -0x40(%rbp)
cmpq %rax, %r13
jge 0x1cd37
leaq -0x1(%r12), %rax
movq %rax, -0x38(%rbp)
leaq 0x20(%rbx), %r15
cmpq %r12, %r13
cmovgeq -0x38(%rbp), %r13
movl 0x18(%rbx), %edi
movq %r13, %rsi
leaq 0x63379(%rip), %rdx     # 0x80091
movl $0x1, %ecx
movq %r15, %r8
callq 0x1dd7a
cmpl $0x1, %eax
sete %cl
jne 0x1cd37
addq -0x48(%rbp), %r13
cmpq -0x40(%rbp), %r13
jl 0x1cd03
movq -0x30(%rbp), %r12
testb %cl, %cl
je 0x1cd78
xorl %r14d, %r14d
cmpq $0x0, 0x60(%rbx)
jle 0x1cd78
cmpq %r12, 0x50(%rbx)
jge 0x1cd78
cmpl $0x0, 0x48(%rbx)
jle 0x1cd8d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1dff3
movl %eax, %r14d
jmp 0x1cd78
andl $0xffef, %eax           # imm = 0xFFEF
jmp 0x1cd71
andl $0xfffb, %eax           # imm = 0xFFFB
movw %ax, 0x1e(%rbx)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x18(%rbx), %r14d
movl %r14d, %edi
movq %r12, %rsi
callq *0x76a7b(%rip)          # 0x93818
movl %eax, %r15d
testl %eax, %eax
jns 0x1cdae
callq 0xa0b0
cmpl $0x4, (%rax)
je 0x1cd91
testl %r15d, %r15d
je 0x1cd55
callq 0xa0b0
movl (%rax), %ecx
movl %ecx, 0x20(%rbx)
movq 0x38(%rbx), %r9
movl (%rax), %ecx
testq %r9, %r9
leaq 0x632c4(%rip), %rax     # 0x80091
cmoveq %rax, %r9
movq %rax, (%rsp)
leaq 0x6058b(%rip), %rsi     # 0x7d367
leaq 0x604b8(%rip), %r8      # 0x7d29b
movl $0x60a, %r14d           # imm = 0x60A
movl $0x60a, %edi            # imm = 0x60A
movl $0x781a, %edx           # imm = 0x781A
xorl %eax, %eax
callq 0xa4b0
jmp 0x1cd78