// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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) );
  db->mDbFlags |= DBFLAG_EncodingFixed;
  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;
    if( sqlite3GetUInt32(argv[3], &db->init.newTnum)==0
     || (db->init.newTnum>pData->mxPage && pData->mxPage>0)
    ){
      if( sqlite3Config.bExtraSchemaChecks ){
        corruptSchema(pData, argv[1], "invalid rootpage");
      }
    }
    db->init.orphanTrigger = 0;
    db->init.azInit = argv;
    pStmt = 0;
    TESTONLY(rcp = ) sqlite3Prepare(db, argv[4], -1, 0, 0, &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 ){
      corruptSchema(pData, argv[1], "orphan index");
    }else
    if( sqlite3GetUInt32(argv[3],&pIndex->tnum)==0
     || pIndex->tnum<2
     || pIndex->tnum>pData->mxPage
     || sqlite3IndexHasDuplicateRootPage(pIndex)
    ){
      if( sqlite3Config.bExtraSchemaChecks ){
        corruptSchema(pData, argv[1], "invalid rootpage");
      }
    }
  }
  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
movl 0x2c(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x2c(%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 0x3fdf89
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x40b380
movl $0x1, -0x4(%rbp)
jmp 0x3fe265
cmpq $0x0, -0x20(%rbp)
jne 0x3fdf9c
movl $0x0, -0x4(%rbp)
jmp 0x3fe265
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3fdfc1
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x40b380
jmp 0x3fe25e
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x1adbaa(%rip), %rsi    # 0x5abb7a
movl $0x7, %edx
callq 0x3c3ef0
cmpl $0x0, %eax
jne 0x3fe165
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
movq -0x38(%rbp), %rsi
addq $0xb0, %rsi
callq 0x40b4c0
cmpl $0x0, %eax
je 0x3fe039
movq -0x38(%rbp), %rax
movl 0xb0(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jbe 0x3fe05c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jbe 0x3fe05c
cmpb $0x0, 0x241819(%rip)    # 0x63f859
je 0x3fe05a
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x1adb2d(%rip), %rdx    # 0x5abb82
callq 0x40b380
jmp 0x3fe05c
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 $0x0, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x50(%rbp), %r9
movq $0x0, (%rsp)
callq 0x40b590
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 0x3fe157
movq -0x38(%rbp), %rax
movb 0xb6(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3fe0ea
jmp 0x3fe155
movl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jle 0x3fe100
movl -0x40(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpl $0x7, -0x40(%rbp)
jne 0x3fe111
movq -0x38(%rbp), %rdi
callq 0x3c8ba0
jmp 0x3fe153
cmpl $0x9, -0x40(%rbp)
je 0x3fe151
movl -0x40(%rbp), %eax
andl $0xff, %eax
cmpl $0x6, %eax
je 0x3fe151
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 0x3cd3f0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
callq 0x40b380
jmp 0x3fe153
jmp 0x3fe155
jmp 0x3fe157
movq -0x50(%rbp), %rdi
callq 0x3c7180
jmp 0x3fe25c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3fe18b
movq -0x20(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3fe1a5
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x3fe1a5
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x40b380
jmp 0x3fe25a
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 0x40b960
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x3fe1f1
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x1ad9a9(%rip), %rdx    # 0x5abb93
callq 0x40b380
jmp 0x3fe258
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x58(%rbp), %rsi
addq $0x58, %rsi
callq 0x40b4c0
cmpl $0x0, %eax
je 0x3fe233
movq -0x58(%rbp), %rax
cmpl $0x2, 0x58(%rax)
jb 0x3fe233
movq -0x58(%rbp), %rax
movl 0x58(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x20(%rcx), %eax
ja 0x3fe233
movq -0x58(%rbp), %rdi
callq 0x40ba30
cmpl $0x0, %eax
je 0x3fe256
cmpb $0x0, 0x24161f(%rip)    # 0x63f859
je 0x3fe254
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x1ad933(%rip), %rdx    # 0x5abb82
callq 0x40b380
jmp 0x3fe256
jmp 0x3fe258
jmp 0x3fe25a
jmp 0x3fe25c
jmp 0x3fe25e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop