// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3AuthRead
SQLITE_PRIVATE void sqlite3AuthRead(
  Parse *pParse,        /* The parser context */
  Expr *pExpr,          /* The expression to check authorization on */
  Schema *pSchema,      /* The schema of the expression */
  SrcList *pTabList     /* All table that pExpr might refer to */
){
  sqlite3 *db = pParse->db;
  Table *pTab = 0;      /* The table being read */
  const char *zCol;     /* Name of the column of the table */
  int iSrc;             /* Index in pTabList->a[] of table being read */
  int iDb;              /* The index of the database the expression refers to */
  int iCol;             /* Index of column in table */

  if( db->xAuth==0 ) return;
  iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
  if( iDb<0 ){
    /* An attempt to read a column out of a subquery or other
    ** temporary table. */
    return;
  }

  assert( pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER );
  if( pExpr->op==TK_TRIGGER ){
    pTab = pParse->pTriggerTab;
  }else{
    assert( pTabList );
    for(iSrc=0; ALWAYS(iSrc<pTabList->nSrc); iSrc++){
      if( pExpr->iTable==pTabList->a[iSrc].iCursor ){
        pTab = pTabList->a[iSrc].pTab;
        break;
      }
    }
  }
  iCol = pExpr->iColumn;
  if( NEVER(pTab==0) ) return;

  if( iCol>=0 ){
    assert( iCol<pTab->nCol );
    zCol = pTab->aCol[iCol].zName;
  }else if( pTab->iPKey>=0 ){
    assert( pTab->iPKey<pTab->nCol );
    zCol = pTab->aCol[pTab->iPKey].zName;
  }else{
    zCol = "ROWID";
  }
  assert( iDb>=0 && iDb<db->nDb );
  if( SQLITE_IGNORE==sqlite3AuthReadCol(pParse, pTab->zName, zCol, iDb) ){
    pExpr->op = TK_NULL;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x180(%rax)
jne 0x6154e
jmp 0x61686
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x13940
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jge 0x6156c
jmp 0x61686
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3c, %eax
jne 0x61589
movq -0x8(%rbp), %rax
movq 0x1e0(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x615e9
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x615e7
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x20(%rbp), %rcx
addq $0x8, %rcx
movslq -0x3c(%rbp), %rdx
imulq $0x68, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x3c(%rcx), %eax
jne 0x615da
movq -0x20(%rbp), %rax
addq $0x8, %rax
movslq -0x3c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x615e7
jmp 0x615dc
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x61590
jmp 0x615e9
movq -0x10(%rbp), %rax
movswl 0x30(%rax), %eax
movl %eax, -0x44(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x61600
jmp 0x61686
cmpl $0x0, -0x44(%rbp)
jl 0x61622
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x6165d
movq -0x30(%rbp), %rax
movswl 0x40(%rax), %eax
cmpl $0x0, %eax
jl 0x61650
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movswq 0x40(%rcx), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x6165b
leaq 0x4e4a8(%rip), %rax     # 0xafaff
movq %rax, -0x38(%rbp)
jmp 0x6165d
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq -0x38(%rbp), %rdx
movl -0x40(%rbp), %ecx
callq 0x62420
movl %eax, %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jne 0x61686
movq -0x10(%rbp), %rax
movb $0x62, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)