// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DropIndex
SQLITE_PRIVATE void sqlite3DropIndex(Parse *pParse, SrcList *pName, int ifExists){
  Index *pIndex;
  Vdbe *v;
  sqlite3 *db = pParse->db;
  int iDb;

  assert( pParse->nErr==0 );   /* Never called with prior errors */
  if( db->mallocFailed ){
    goto exit_drop_index;
  }
  assert( pName->nSrc==1 );
  if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
    goto exit_drop_index;
  }
  pIndex = sqlite3FindIndex(db, pName->a[0].zName, pName->a[0].zDatabase);
  if( pIndex==0 ){
    if( !ifExists ){
      sqlite3ErrorMsg(pParse, "no such index: %S", pName, 0);
    }else{
      sqlite3CodeVerifyNamedSchema(pParse, pName->a[0].zDatabase);
    }
    pParse->checkSchema = 1;
    goto exit_drop_index;
  }
  if( pIndex->autoIndex ){
    sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
      "or PRIMARY KEY constraint cannot be dropped", 0);
    goto exit_drop_index;
  }
  iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
#ifndef SQLITE_OMIT_AUTHORIZATION
  {
    int code = SQLITE_DROP_INDEX;
    Table *pTab = pIndex->pTable;
    const char *zDb = db->aDb[iDb].zName;
    const char *zTab = SCHEMA_TABLE(iDb);
    if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
      goto exit_drop_index;
    }
    if( !OMIT_TEMPDB && iDb ) code = SQLITE_DROP_TEMP_INDEX;
    if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){
      goto exit_drop_index;
    }
  }
#endif

  /* Generate code to remove the index and from the master table */
  v = sqlite3GetVdbe(pParse);
  if( v ){
    sqlite3BeginWriteOperation(pParse, 1, iDb);
    sqlite3NestedParse(pParse,
       "DELETE FROM %Q.%s WHERE name=%Q AND type='index'",
       db->aDb[iDb].zName, SCHEMA_TABLE(iDb), pIndex->zName
    );
    sqlite3ClearStatTables(pParse, iDb, "idx", pIndex->zName);
    sqlite3ChangeCookie(pParse, iDb);
    destroyRootPage(pParse, pIndex->tnum, iDb);
    sqlite3VdbeAddOp4(v, OP_DropIndex, iDb, 0, 0, pIndex->zName, 0);
  }

exit_drop_index:
  sqlite3SrcListDelete(db, pName);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x5813d
jmp 0x58365
movq -0x8(%rbp), %rdi
callq 0x4ab20
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x58153
jmp 0x58365
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x465f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x581b5
cmpl $0x0, -0x14(%rbp)
jne 0x58197
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x58890(%rip), %rsi     # 0xb0a1c
xorl %ecx, %ecx
movb $0x0, %al
callq 0x136f0
jmp 0x581a8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x6b6a0
movq -0x8(%rbp), %rax
movb $0x1, 0x1d(%rax)
jmp 0x58365
movq -0x20(%rbp), %rax
movb 0x57(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x581df
movq -0x8(%rbp), %rdi
leaq 0x5885d(%rip), %rsi     # 0xb0a2e
xorl %edx, %edx
movb $0x0, %al
callq 0x136f0
jmp 0x58365
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x13940
movl %eax, -0x34(%rbp)
movl $0xa, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %edx
leaq 0x567fe(%rip), %rax     # 0xaea28
leaq 0x567e4(%rip), %rcx     # 0xaea15
cmpl $0x1, %edx
cmoveq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %r8
movl $0x9, %esi
xorl %eax, %eax
movl %eax, %ecx
callq 0x5e720
cmpl $0x0, %eax
je 0x58260
jmp 0x58365
cmpl $0x0, -0x34(%rbp)
je 0x5826d
movl $0xc, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rdx
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %r8
callq 0x5e720
cmpl $0x0, %eax
je 0x58295
jmp 0x58365
movq -0x8(%rbp), %rdi
callq 0x5e000
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x58363
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
movl $0x1, %esi
callq 0x5ec70
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movl -0x34(%rbp), %esi
leaq 0x56746(%rip), %rcx     # 0xaea28
leaq 0x5672c(%rip), %rax     # 0xaea15
cmpl $0x1, %esi
cmoveq %rax, %rcx
movq -0x20(%rbp), %rax
movq (%rax), %r8
leaq 0x58779(%rip), %rsi     # 0xb0a77
movb $0x0, %al
callq 0x5f320
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rcx
leaq 0x5878e(%rip), %rdx     # 0xb0aa8
callq 0x6b730
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x5f4a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x50(%rax), %esi
movl -0x34(%rbp), %edx
callq 0x6bfc0
movq -0x28(%rbp), %rdi
movl -0x34(%rbp), %edx
movq -0x20(%rbp), %rax
movq (%rax), %r9
movl $0x73, %esi
xorl %r8d, %r8d
movl %r8d, %ecx
movl $0x0, (%rsp)
callq 0x5e1b0
jmp 0x58365
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x475c0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)