// File: /workspace/github_c_makefile_star2_O0/skeeto[P]flappy/sqlite3.c
// Function: sqlite3OpenTableAndIndices
SQLITE_PRIVATE int sqlite3OpenTableAndIndices(
  Parse *pParse,   /* Parsing context */
  Table *pTab,     /* Table to be opened */
  int op,          /* OP_OpenRead or OP_OpenWrite */
  int iBase,       /* Use this for the table cursor, if there is one */
  u8 *aToOpen,     /* If not NULL: boolean for each table and index */
  int *piDataCur,  /* Write the database source cursor number here */
  int *piIdxCur    /* Write the first index cursor number here */
){
  int i;
  int iDb;
  int iDataCur;
  Index *pIdx;
  Vdbe *v;

  assert( op==OP_OpenRead || op==OP_OpenWrite );
  if( IsVirtual(pTab) ){
    assert( aToOpen==0 );
    *piDataCur = 0;
    *piIdxCur = 1;
    return 0;
  }
  iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );
  if( iBase<0 ) iBase = pParse->nTab;
  iDataCur = iBase++;
  if( piDataCur ) *piDataCur = iDataCur;
  if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
    sqlite3OpenTable(pParse, iDataCur, iDb, pTab, op);
  }else{
    sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName);
  }
  if( piIdxCur ) *piIdxCur = iBase;
  for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
    int iIdxCur = iBase++;
    assert( pIdx->pSchema==pTab->pSchema );
    if( pIdx->autoIndex==2 && !HasRowid(pTab) && piDataCur ){
      *piDataCur = iIdxCur;
    }
    if( aToOpen==0 || aToOpen[i+1] ){
      sqlite3VdbeAddOp3(v, op, iIdxCur, pIdx->tnum, iDb);
      sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
      VdbeComment((v, "%s", pIdx->zName));
    }
  }
  if( iBase>pParse->nTab ) pParse->nTab = iBase;
  return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x48(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x83bd2
movq -0x30(%rbp), %rax
movl $0x0, (%rax)
movq 0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x83d72
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x16b60
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x638c0
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x83c06
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, -0x3c(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x83c24
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movzbl 0x48(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x83c60
cmpq $0x0, -0x28(%rbp)
je 0x83c47
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x83c60
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl -0x38(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
callq 0x63dd0
jmp 0x83c89
movq -0x10(%rbp), %rdi
movl -0x38(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %edx
cmpl $0x33, -0x1c(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movq (%rcx), %r8
movzbl %al, %ecx
callq 0x63f00
cmpq $0x0, 0x10(%rbp)
je 0x83c99
movl -0x20(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x83d56
movl -0x20(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rax
movb 0x63(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x83cf6
movq -0x18(%rbp), %rax
movzbl 0x48(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x83cf6
cmpq $0x0, -0x30(%rbp)
je 0x83cf6
movl -0x54(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x83d13
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x83d3a
movq -0x50(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x54(%rbp), %edx
movq -0x48(%rbp), %rax
movl 0x58(%rax), %ecx
movl -0x38(%rbp), %r8d
callq 0x639b0
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x64100
jmp 0x83d3c
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x83cac
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x54(%rcx), %eax
jle 0x83d6c
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x54(%rax)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)