// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %r8, %r14
movq %rcx, 0x30(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
andq $0x0, (%rsp)
callq 0x228052
testl %eax, %eax
je 0x227fdf
testq %rbx, %rbx
leaq 0x1427ed(%rip), %r13    # 0x36a570
cmovneq %rbx, %r13
movq %r15, %rdi
xorl %esi, %esi
callq 0x222800
pushq $-0x1
popq %rbx
movq %rsp, %rbp
xorl %r12d, %r12d
testl %r12d, %r12d
jne 0x227f82
cmpb $0x0, (%r13)
je 0x227f82
andq $0x0, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %rbp, %rcx
leaq 0x28(%rsp), %r8
callq 0x228088
movl %eax, %r12d
testl %eax, %eax
jne 0x227d9a
movq (%rsp), %rbp
testq %rbp, %rbp
je 0x227f72
movq %r15, 0x10(%rsp)
xorl %ebx, %ebx
xorl %r15d, %r15d
movl $0x0, 0xc(%rsp)
xorl %r13d, %r13d
movq %r14, 0x18(%rsp)
movq %rbp, %rdi
callq 0x224bf7
movl %eax, %r12d
cmpq $0x0, 0x20(%rsp)
je 0x227f20
cmpl $0x64, %r12d
jne 0x227e26
testl %r15d, %r15d
movq 0x10(%rsp), %r15
je 0x227e49
movl 0xc(%rsp), %eax
movl %eax, %r14d
jmp 0x227ea3
cmpl $0x65, %r12d
jne 0x227f2a
testl %r15d, %r15d
jne 0x227f2a
movq 0x10(%rsp), %r15
testb $0x1, 0x31(%r15)
je 0x227f2a
testq %rbp, %rbp
je 0x227e57
movzwl 0xc0(%rbp), %ebx
jmp 0x227e59
xorl %ebx, %ebx
movl %ebx, %esi
shll $0x4, %esi
orl $0x8, %esi
movq %r15, %rdi
callq 0x22809f
testq %rax, %rax
je 0x227f86
movl %ebx, %ecx
movq %rax, %rbx
movl %ecx, 0xc(%rsp)
movl %ecx, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x227e9a
movq %rbp, %rdi
movl %r15d, %esi
callq 0x225b4c
movq %rax, (%rbx,%r15,8)
incq %r15
jmp 0x227e81
cmpl $0x64, %r12d
jne 0x227ef8
movl %r14d, %eax
leaq (%rbx,%r14,8), %r13
testl %eax, %eax
movl $0x0, %r14d
movl %eax, 0xc(%rsp)
cmovgl %eax, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x227ef2
movq (%rsp), %rdi
movl %r15d, %esi
callq 0x225a90
movq %rax, (%r13,%r15,8)
testq %rax, %rax
jne 0x227eed
movq (%rsp), %rbp
movq %rbp, %rdi
movl %r15d, %esi
callq 0x225b1e
cmpl $0x5, %eax
jne 0x228011
incq %r15
jmp 0x227eba
andq $0x0, (%r13,%r14,8)
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %esi
movq %r13, %rdx
movq %rbx, %rcx
callq *0x20(%rsp)
movq (%rsp), %rbp
testl %eax, %eax
movq 0x18(%rsp), %r14
jne 0x22802c
pushq $0x1
popq %r15
cmpl $0x64, %r12d
je 0x227df6
movq %rbp, %rdi
callq 0x224149
andq $0x0, (%rsp)
movl %eax, %r12d
movq 0x28(%rsp), %r13
decq %r13
leaq 0x149907(%rip), %rcx    # 0x371850
movzbl 0x1(%r13), %eax
incq %r13
testb $0x1, (%rax,%rcx)
jne 0x227f49
movq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21f26b
pushq $-0x1
popq %rbx
movq %rsp, %rbp
jmp 0x227d9a
movq 0x28(%rsp), %r13
xorl %r12d, %r12d
movq %rsp, %rbp
jmp 0x227d9a
movq (%rsp), %rbp
xorl %ebx, %ebx
testq %rbp, %rbp
je 0x227f95
movq %rbp, %rdi
callq 0x224149
movq %r15, %rdi
movq %rbx, %rsi
callq 0x21f26b
movq %r15, %rdi
movl %r12d, %esi
callq 0x22417d
movl %eax, %ebx
testq %r14, %r14
je 0x227ff7
testl %ebx, %ebx
je 0x227ff7
movq %r15, %rdi
callq 0x2280b1
xorl %edi, %edi
movq %rax, %rsi
callq 0x22572a
movq %rax, (%r14)
testq %rax, %rax
jne 0x228000
pushq $0x7
popq %rbx
movq %r15, %rdi
movl %ebx, %esi
callq 0x222800
jmp 0x228000
movl $0x1e252, %edi          # imm = 0x1E252
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21ec3c
testq %r14, %r14
je 0x228000
andq $0x0, (%r14)
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x224bb1
pushq $0x64
popq %r12
movq 0x18(%rsp), %r14
jmp 0x227f88
movq %rbp, %rdi
callq 0x224149
andq $0x0, (%rsp)
pushq $0x4
popq %r12
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl %r12d, %esi
callq 0x222800
jmp 0x227f95