// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3_exec
SQLITE_API int sqlite3_exec(
  sqlite3 *db,                /* The database on which the SQL executes */
  const char *zSql,           /* The SQL to be executed */
  sqlite3_callback xCallback, /* Invoke this callback routine */
  void *pArg,                 /* First argument to xCallback() */
  char **pzErrMsg             /* Write error messages here */
){
  int rc = SQLITE_OK;         /* Return code */
  const char *zLeftover;      /* Tail of unprocessed SQL */
  sqlite3_stmt *pStmt = 0;    /* The current SQL statement */
  char **azCols = 0;          /* Names of result columns */
  int callbackIsInit;         /* True if callback data is initialized */

  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
  if( zSql==0 ) zSql = "";

  sqlite3_mutex_enter(db->mutex);
  sqlite3Error(db, SQLITE_OK);
  while( rc==SQLITE_OK && zSql[0] ){
    int nCol = 0;
    char **azVals = 0;

    pStmt = 0;
    rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
    assert( rc==SQLITE_OK || pStmt==0 );
    if( rc!=SQLITE_OK ){
      continue;
    }
    if( !pStmt ){
      /* this happens for a comment or white-space */
      zSql = zLeftover;
      continue;
    }
    callbackIsInit = 0;

    while( 1 ){
      int i;
      rc = sqlite3_step(pStmt);

      /* Invoke the callback function if required */
      if( xCallback && (SQLITE_ROW==rc ||
          (SQLITE_DONE==rc && !callbackIsInit
                           && db->flags&SQLITE_NullCallback)) ){
        if( !callbackIsInit ){
          nCol = sqlite3_column_count(pStmt);
          azCols = sqlite3DbMallocRaw(db, (2*nCol+1)*sizeof(const char*));
          if( azCols==0 ){
            goto exec_out;
          }
          for(i=0; i<nCol; i++){
            azCols[i] = (char *)sqlite3_column_name(pStmt, i);
            /* sqlite3VdbeSetColName() installs column names as UTF8
            ** strings so there is no way for sqlite3_column_name() to fail. */
            assert( azCols[i]!=0 );
          }
          callbackIsInit = 1;
        }
        if( rc==SQLITE_ROW ){
          azVals = &azCols[nCol];
          for(i=0; i<nCol; i++){
            azVals[i] = (char *)sqlite3_column_text(pStmt, i);
            if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
              sqlite3OomFault(db);
              goto exec_out;
            }
          }
          azVals[i] = 0;
        }
        if( xCallback(pArg, nCol, azVals, azCols) ){
          /* EVIDENCE-OF: R-38229-40159 If the callback function to
          ** sqlite3_exec() returns non-zero, then sqlite3_exec() will
          ** return SQLITE_ABORT. */
          rc = SQLITE_ABORT;
          sqlite3VdbeFinalize((Vdbe *)pStmt);
          pStmt = 0;
          sqlite3Error(db, SQLITE_ABORT);
          goto exec_out;
        }
      }

      if( rc!=SQLITE_ROW ){
        rc = sqlite3VdbeFinalize((Vdbe *)pStmt);
        pStmt = 0;
        zSql = zLeftover;
        while( sqlite3Isspace(zSql[0]) ) zSql++;
        break;
      }
    }

    sqlite3DbFree(db, azCols);
    azCols = 0;
  }

exec_out:
  if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
  sqlite3DbFree(db, azCols);

  rc = sqlite3ApiExit(db, rc);
  if( rc!=SQLITE_OK && pzErrMsg ){
    *pzErrMsg = sqlite3DbStrDup(0, sqlite3_errmsg(db));
    if( *pzErrMsg==0 ){
      rc = SQLITE_NOMEM_BKPT;
      sqlite3Error(db, SQLITE_NOMEM);
    }
  }else if( pzErrMsg ){
    *pzErrMsg = 0;
  }

  assert( (rc&db->errMask)==rc );
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r14
movq %rcx, 0x50(%rsp)
movq %rdx, 0x40(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movq $0x0, 0x10(%rsp)
callq 0x2863de
testl %eax, %eax
je 0x2862f3
movq %r14, 0x48(%rsp)
testq %rbx, %rbx
leaq 0x14d904(%rip), %r13    # 0x3d3890
cmovneq %rbx, %r13
movl $0x0, 0x50(%r15)
cmpq $0x0, 0x160(%r15)
je 0x285fac
movq %r15, %rdi
xorl %esi, %esi
callq 0x28e696
movq $0x0, 0x18(%rsp)
leaq 0x28(%rsp), %rbx
leaq 0x154bff(%rip), %r14    # 0x3dabc0
movq %r15, 0x30(%rsp)
cmpb $0x0, (%r13)
je 0x286323
movq $0x0, 0x10(%rsp)
movq %rbx, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x80, %ecx
xorl %r8d, %r8d
leaq 0x10(%rsp), %r9
callq 0x286af6
movl $0x2, %ecx
testl %eax, %eax
je 0x28601a
testl %ecx, %ecx
je 0x286011
cmpl $0x2, %ecx
jne 0x286327
testl %eax, %eax
je 0x285fc6
jmp 0x286330
cmpq $0x0, 0x10(%rsp)
je 0x2862dd
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x10(%rsp), %rdi
callq 0x282502
cmpq $0x0, 0x40(%rsp)
je 0x286190
cmpl $0x64, %eax
jne 0x2860d7
testl %ebx, %ebx
movl %eax, 0x24(%rsp)
je 0x2860f6
movq %r15, %rbx
movl %r12d, %r15d
cmpl $0x64, %eax
jne 0x28612e
movq 0x18(%rsp), %rax
leaq (%rax,%r15,8), %rbp
movl %r12d, 0x38(%rsp)
testl %r12d, %r12d
jle 0x286111
xorl %r12d, %r12d
movq 0x10(%rsp), %rdi
movl %r12d, %esi
callq 0x283756
movq %rax, (%rbp,%r12,8)
testq %rax, %rax
jne 0x2860cd
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x283602
movq %rbp, %r14
movl 0x8(%rax), %ebp
movq %rbx, %rdi
callq 0x28364d
movabsq $-0x5555555555555556, %rax # imm = 0xAAAAAAAAAAAAAAAA
btq %rbp, %rax
movq %r14, %rbp
jae 0x28627a
incq %r12
cmpq %r12, %r15
jne 0x286081
jmp 0x286114
movl %eax, %ecx
xorl $0x65, %ecx
orl %ebx, %ecx
jne 0x286190
testb $0x1, 0x31(%r15)
jne 0x28604c
xorl %ebx, %ebx
jmp 0x286190
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x2861da
movzwl 0xc0(%rcx), %r12d
jmp 0x2861dd
xorl %r12d, %r12d
movq $0x0, (%rbp,%r12,8)
movq 0x30(%rsp), %rbx
leaq 0x154a97(%rip), %r14    # 0x3dabc0
movl 0x38(%rsp), %r12d
movq 0x50(%rsp), %rdi
movl %r12d, %esi
movq %rbp, %rdx
movq 0x18(%rsp), %rcx
callq *0x40(%rsp)
testl %eax, %eax
je 0x286184
movq 0x10(%rsp), %rdi
callq 0x281916
movq $0x0, 0x10(%rsp)
movl $0x4, 0x50(%rbx)
movq %rbx, %rdi
movl $0x4, %esi
callq 0x28e696
movl $0x4, %eax
movl $0x6, %ecx
movl %r15d, %r12d
movq %rbx, %r15
movl $0x1, %ebx
jmp 0x2861cd
movl 0x24(%rsp), %eax
movq %rbx, %r15
movl $0x1, %ebx
cmpl $0x64, %eax
jne 0x28619e
xorl %ecx, %ecx
movl $0x64, %eax
jmp 0x2861cd
movq 0x10(%rsp), %rdi
callq 0x281916
movq $0x0, 0x10(%rsp)
movq 0x28(%rsp), %r13
decq %r13
movzbl 0x1(%r13), %ecx
incq %r13
testb $0x1, (%rcx,%r14)
jne 0x2861b9
movl $0x5, %ecx
testl %ecx, %ecx
je 0x28602d
jmp 0x2862a8
xorl %r12d, %r12d
movl %r12d, %esi
shll $0x4, %esi
orl $0x8, %esi
testq %r15, %r15
je 0x2861f5
movq %r15, %rdi
callq 0x28c518
jmp 0x2861fd
movq %rsi, %rdi
callq 0x27c381
movq %rax, 0x18(%rsp)
testq %rax, %rax
movl 0x24(%rsp), %eax
je 0x28625a
movq %r15, %rcx
movl %r12d, %r15d
testl %r12d, %r12d
je 0x28626f
movq %rbp, 0x38(%rsp)
movq 0x10(%rsp), %rbx
xorl %r12d, %r12d
movq 0x18(%rsp), %rbp
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x283822
movq %rax, (%rbp,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x286228
movl %r15d, %r12d
movq 0x30(%rsp), %r15
movl 0x24(%rsp), %eax
movq 0x38(%rsp), %rbp
jmp 0x286058
movl $0x6, %ecx
movq $0x0, 0x18(%rsp)
xorl %ebx, %ebx
jmp 0x2861cd
movl %r15d, %r12d
movq %rcx, %r15
jmp 0x286058
movq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x2824bb
movl $0x6, %ecx
movl $0x1, %ebx
movl $0x64, %eax
movl %r15d, %r12d
movq %r14, %r15
leaq 0x15491d(%rip), %r14    # 0x3dabc0
jmp 0x2861cd
cmpl $0x5, %ecx
jne 0x2862e9
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
leaq 0x28(%rsp), %rbx
je 0x2862cd
movl %eax, %ebx
movq %r15, %rdi
callq 0x28c3e7
movl %ebx, %eax
leaq 0x28(%rsp), %rbx
movq $0x0, 0x18(%rsp)
xorl %ecx, %ecx
jmp 0x286004
xorl %eax, %eax
movq 0x28(%rsp), %r13
jmp 0x286004
leaq 0x28(%rsp), %rbx
jmp 0x286004
leaq 0x159025(%rip), %rsi    # 0x3df31f
leaq 0x15d89b(%rip), %rdx    # 0x3e3b9c
leaq 0x158e7d(%rip), %r8     # 0x3df185
movl $0x15, %edi
movl $0x1e252, %ecx          # imm = 0x1E252
xorl %eax, %eax
callq 0x27e637
movl $0x15, %ecx
jmp 0x2863cd
xorl %eax, %eax
jmp 0x286330
cmpl $0x6, %ecx
jne 0x2863cd
movl %eax, %ebp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x286341
callq 0x281916
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
movq 0x48(%rsp), %rbx
je 0x286358
movq %r15, %rdi
callq 0x28c3e7
cmpl $0xc0a, %ebp            # imm = 0xC0A
je 0x28636f
cmpb $0x0, 0x61(%r15)
jne 0x28636f
movl %ebp, %ecx
andl 0x54(%r15), %ecx
jmp 0x28637c
movq %r15, %rdi
callq 0x299b1a
movl $0x7, %ecx
testq %rbx, %rbx
je 0x2863bf
testl %ecx, %ecx
je 0x2863bf
movl %ecx, %ebp
movq %r15, %rdi
callq 0x286451
xorl %edi, %edi
movq %rax, %rsi
callq 0x283365
movl %ebp, %ecx
movq %rax, (%rbx)
testq %rax, %rax
jne 0x2863cd
movl $0x7, 0x50(%r15)
movq %r15, %rdi
movl $0x7, %esi
callq 0x28e696
movl $0x7, %ecx
jmp 0x2863cd
testq %rbx, %rbx
je 0x2863cd
movq $0x0, (%rbx)
jmp 0x2863cd
movl %ecx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq