// File: /workspace/github_c_makefile_star2_O0/jkbenaim[P]psfrag/sqlite3.c
// Function: sqlite3InitCallback
SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
  InitData *pData = (InitData*)pInit;
  sqlite3 *db = pData->db;
  int iDb = pData->iDb;

  assert( argc==5 );
  UNUSED_PARAMETER2(NotUsed, argc);
  assert( sqlite3_mutex_held(db->mutex) );
  DbClearProperty(db, iDb, DB_Empty);
  pData->nInitRow++;
  if( db->mallocFailed ){
    corruptSchema(pData, argv[1], 0);
    return 1;
  }

  assert( iDb>=0 && iDb<db->nDb );
  if( argv==0 ) return 0;   /* Might happen if EMPTY_RESULT_CALLBACKS are on */
  if( argv[3]==0 ){
    corruptSchema(pData, argv[1], 0);
  }else if( sqlite3_strnicmp(argv[4],"create ",7)==0 ){
    /* Call the parser to process a CREATE TABLE, INDEX or VIEW.
    ** But because db->init.busy is set to 1, no VDBE code is generated
    ** or executed.  All the parser does is build the internal data
    ** structures that describe the table, index, or view.
    */
    int rc;
    u8 saved_iDb = db->init.iDb;
    sqlite3_stmt *pStmt;
    TESTONLY(int rcp);            /* Return code from sqlite3_prepare() */

    assert( db->init.busy );
    db->init.iDb = iDb;
    db->init.newTnum = sqlite3Atoi(argv[3]);
    db->init.orphanTrigger = 0;
    db->init.azInit = argv;
    TESTONLY(rcp = ) sqlite3_prepare(db, argv[4], -1, &pStmt, 0);
    rc = db->errCode;
    assert( (rc&0xFF)==(rcp&0xFF) );
    db->init.iDb = saved_iDb;
    /* assert( saved_iDb==0 || (db->mDbFlags & DBFLAG_Vacuum)!=0 ); */
    if( SQLITE_OK!=rc ){
      if( db->init.orphanTrigger ){
        assert( iDb==1 );
      }else{
        if( rc > pData->rc ) pData->rc = rc;
        if( rc==SQLITE_NOMEM ){
          sqlite3OomFault(db);
        }else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){
          corruptSchema(pData, argv[1], sqlite3_errmsg(db));
        }
      }
    }
    sqlite3_finalize(pStmt);
  }else if( argv[1]==0 || (argv[4]!=0 && argv[4][0]!=0) ){
    corruptSchema(pData, argv[1], 0);
  }else{
    /* If the SQL column is blank it means this is an index that
    ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
    ** constraint for a CREATE TABLE.  The index should have already
    ** been created when we processed the CREATE TABLE.  All we have
    ** to do here is record the root page number for that index.
    */
    Index *pIndex;
    pIndex = sqlite3FindIndex(db, argv[1], db->aDb[iDb].zDbSName);
    if( pIndex==0
     || sqlite3GetInt32(argv[3],&pIndex->tnum)==0
     || pIndex->tnum<2
     || sqlite3IndexHasDuplicateRootPage(pIndex)
    ){
      corruptSchema(pData, argv[1], pIndex?"invalid rootpage":"orphan index");
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movzwl 0x72(%rax), %ecx
andl $-0x5, %ecx
movw %cx, 0x72(%rax)
movq -0x30(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1c(%rax)
movq -0x38(%rbp), %rax
cmpb $0x0, 0x61(%rax)
je 0x48e1e
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x56130
movl $0x1, -0x4(%rbp)
jmp 0x49080
cmpq $0x0, -0x20(%rbp)
jne 0x48e31
movl $0x0, -0x4(%rbp)
jmp 0x49080
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x48e56
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x56130
jmp 0x49079
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x750eb(%rip), %rsi     # 0xbdf50
movl $0x7, %edx
callq 0xf210
cmpl $0x0, %eax
jne 0x48fa4
movq -0x38(%rbp), %rax
movb 0xb4(%rax), %al
movb %al, -0x41(%rbp)
movl -0x3c(%rbp), %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0xb4(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x56270
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xb0(%rax)
movq -0x38(%rbp), %rax
movb 0xb6(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0xb6(%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0xb8(%rax)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x19220
movq -0x38(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x40(%rbp)
movb -0x41(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, 0xb4(%rax)
xorl %eax, %eax
cmpl -0x40(%rbp), %eax
je 0x48f96
movq -0x38(%rbp), %rax
movb 0xb6(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x48f29
jmp 0x48f94
movl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jle 0x48f3f
movl -0x40(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpl $0x7, -0x40(%rbp)
jne 0x48f50
movq -0x38(%rbp), %rdi
callq 0x13fa0
jmp 0x48f92
cmpl $0x9, -0x40(%rbp)
je 0x48f90
movl -0x40(%rbp), %eax
andl $0xff, %eax
cmpl $0x6, %eax
je 0x48f90
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rdi
callq 0x188c0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
callq 0x56130
jmp 0x48f92
jmp 0x48f94
jmp 0x48f96
movq -0x50(%rbp), %rdi
callq 0x12580
jmp 0x49077
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x48fca
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x48fe4
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x48fe4
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x56130
jmp 0x49075
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdx
callq 0x562a0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x49048
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x58(%rbp), %rsi
addq $0x58, %rsi
callq 0x56370
cmpl $0x0, %eax
je 0x49048
movq -0x58(%rbp), %rax
cmpl $0x2, 0x58(%rax)
jl 0x49048
movq -0x58(%rbp), %rdi
callq 0x56610
cmpl $0x0, %eax
je 0x49073
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x58(%rbp), %rcx
leaq 0x74f0a(%rip), %rdx     # 0xbdf69
leaq 0x74ef2(%rip), %rax     # 0xbdf58
cmpq $0x0, %rcx
cmovneq %rax, %rdx
callq 0x56130
jmp 0x49075
jmp 0x49077
jmp 0x49079
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)