// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %r8, %r14
movq %rcx, 0x40(%rsp)
movq %rdx, 0x38(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
movq $0x0, 0x8(%rsp)
callq 0x27c8e8
testl %eax, %eax
je 0x27c7bb
movq %r14, 0x18(%rsp)
testq %rbx, %rbx
leaq 0x14dbf1(%rip), %r14    # 0x3ca170
cmovneq %rbx, %r14
movl $0x0, 0x50(%r13)
cmpq $0x0, 0x160(%r13)
je 0x27c59f
movq %r13, %rdi
xorl %esi, %esi
callq 0x284b1f
leaq 0x28(%rsp), %rbx
leaq 0x8(%rsp), %r15
movq %r13, 0x20(%rsp)
cmpb $0x0, (%r14)
je 0x27c836
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x80, %ecx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x27d0b1
testl %eax, %eax
jne 0x27c83b
cmpq $0x0, 0x8(%rsp)
je 0x27c7a5
xorl %r15d, %r15d
xorl %ebx, %ebx
movl $0x0, 0x14(%rsp)
xorl %r14d, %r14d
movq 0x8(%rsp), %rdi
callq 0x278b63
movl %eax, %r12d
cmpq $0x0, 0x38(%rsp)
je 0x27c74c
cmpl $0x64, %r12d
jne 0x27c62d
testl %ebx, %ebx
jne 0x27c6b5
jmp 0x27c64a
cmpl $0x65, %r12d
jne 0x27c756
testl %ebx, %ebx
jne 0x27c756
testb $0x1, 0x31(%r13)
je 0x27c756
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x27c65d
movzwl 0xc0(%rax), %ebx
jmp 0x27c65f
xorl %ebx, %ebx
movl %ebx, %esi
shll $0x4, %esi
orl $0x8, %esi
movq %r13, %rdi
callq 0x282a35
testq %rax, %rax
je 0x27c83e
movq %rax, %r15
movl %ebx, 0x14(%rsp)
testl %ebx, %ebx
je 0x27c6aa
movl 0x14(%rsp), %ebp
movq 0x8(%rsp), %rbx
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x279de0
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %rbp
jne 0x27c68f
cmpl $0x64, %r12d
movq 0x20(%rsp), %r13
jne 0x27c72c
movl %r12d, 0x34(%rsp)
movl 0x14(%rsp), %eax
movl %eax, %ebp
leaq (%r15,%rbp,8), %r14
testl %eax, %eax
jle 0x27c718
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x279d14
movq %rax, (%r14,%rbx,8)
testq %rax, %rax
jne 0x27c70e
movq 0x8(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
callq 0x279bc0
movl 0x8(%rax), %r12d
movq %r13, %rdi
callq 0x279c0b
movabsq $-0x5555555555555556, %rax # imm = 0xAAAAAAAAAAAAAAAA
btq %r12, %rax
jae 0x27c7ec
incq %rbx
cmpq %rbx, %rbp
jne 0x27c6ca
jmp 0x27c71a
xorl %ebp, %ebp
movq $0x0, (%r14,%rbp,8)
movq 0x20(%rsp), %r13
movl 0x34(%rsp), %r12d
movq 0x40(%rsp), %rdi
movl 0x14(%rsp), %esi
movq %r14, %rdx
movq %r15, %rcx
callq *0x38(%rsp)
movl $0x1, %ebx
testl %eax, %eax
jne 0x27c806
cmpl $0x64, %r12d
je 0x27c604
movq 0x8(%rsp), %rdi
callq 0x277f75
movl %eax, %r12d
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %r14
decq %r14
leaq 0x154cc5(%rip), %rcx    # 0x3d1440
movzbl 0x1(%r14), %eax
incq %r14
testb $0x1, (%rax,%rcx)
jne 0x27c77b
testq %r15, %r15
leaq 0x28(%rsp), %rbx
je 0x27c79e
movq %r13, %rdi
movq %r15, %rsi
callq 0x282904
leaq 0x8(%rsp), %r15
jmp 0x27c7ad
xorl %r12d, %r12d
movq 0x28(%rsp), %r14
testl %r12d, %r12d
je 0x27c5ae
jmp 0x27c83e
leaq 0x159409(%rip), %rsi    # 0x3d5bcb
leaq 0x15dc7e(%rip), %rdx    # 0x3da447
leaq 0x159261(%rip), %r8     # 0x3d5a31
movl $0x15, %r12d
movl $0x15, %edi
movl $0x1e252, %ecx          # imm = 0x1E252
xorl %eax, %eax
callq 0x274d08
jmp 0x27c8d6
movq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x278b1c
movl $0x64, %r12d
movq 0x18(%rsp), %rbx
jmp 0x27c846
movq 0x8(%rsp), %rdi
callq 0x277f75
movq $0x0, 0x8(%rsp)
movl $0x4, 0x50(%r13)
movl $0x4, %r12d
movq %r13, %rdi
movl $0x4, %esi
callq 0x284b1f
jmp 0x27c7ff
xorl %r12d, %r12d
jmp 0x27c83e
movl %eax, %r12d
movq 0x18(%rsp), %rbx
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x27c855
callq 0x277f75
testq %r15, %r15
je 0x27c865
movq %r13, %rdi
movq %r15, %rsi
callq 0x282904
cmpl $0xc0a, %r12d           # imm = 0xC0A
je 0x27c87b
cmpb $0x0, 0x61(%r13)
jne 0x27c87b
andl 0x54(%r13), %r12d
jmp 0x27c889
movq %r13, %rdi
callq 0x28fd56
movl $0x7, %r12d
testq %rbx, %rbx
je 0x27c8ca
testl %r12d, %r12d
je 0x27c8ca
movq %r13, %rdi
callq 0x27c968
xorl %edi, %edi
movq %rax, %rsi
callq 0x279928
movq %rax, (%rbx)
testq %rax, %rax
jne 0x27c8d6
movl $0x7, 0x50(%r13)
movl $0x7, %r12d
movq %r13, %rdi
movl $0x7, %esi
callq 0x284b1f
jmp 0x27c8d6
testq %rbx, %rbx
je 0x27c8d6
movq $0x0, (%rbx)
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq