// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3cd2e0
cmpl $0x0, %eax
jne 0x3ccf93
movl $0x1e252, %edi          # imm = 0x1E252
callq 0x3bf6a0
movl %eax, -0x4(%rbp)
jmp 0x3cd2ca
cmpq $0x0, -0x18(%rbp)
jne 0x3ccfa5
leaq 0x1d0687(%rip), %rax    # 0x59d628
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x3c5210
xorl %eax, %eax
cmpl $0x0, -0x34(%rbp)
movb %al, -0x65(%rbp)
jne 0x3ccfcb
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0x3ccfd7
jmp 0x3cd235
movl $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x48(%rbp), %rcx
leaq -0x40(%rbp), %r8
callq 0x3cd350
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3cd013
jmp 0x3ccfb0
cmpq $0x0, -0x48(%rbp)
jne 0x3cd024
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x3ccfb0
movl $0x0, -0x54(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3c8c30
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3cd1c8
movl $0x64, %eax
cmpl -0x34(%rbp), %eax
je 0x3cd07c
movl $0x65, %eax
cmpl -0x34(%rbp), %eax
jne 0x3cd1c8
cmpl $0x0, -0x54(%rbp)
jne 0x3cd1c8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
je 0x3cd1c8
cmpl $0x0, -0x54(%rbp)
jne 0x3cd0f2
movq -0x48(%rbp), %rdi
callq 0x3c9590
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x3cd3a0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x3cd0b6
jmp 0x3cd237
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x3cd0eb
movq -0x48(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x3c99b0
movq %rax, %rdx
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x3cd0bd
movl $0x1, -0x54(%rbp)
cmpl $0x64, -0x34(%rbp)
jne 0x3cd184
movq -0x50(%rbp), %rax
movslq -0x58(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x3cd174
movq -0x48(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x3c9880
movq %rax, %rdx
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x3cd167
movq -0x48(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x3c9970
cmpl $0x5, %eax
je 0x3cd167
movq -0x10(%rbp), %rdi
callq 0x3c8ba0
jmp 0x3cd237
jmp 0x3cd169
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x3cd116
movq -0x60(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdi
movl -0x58(%rbp), %esi
movq -0x60(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
je 0x3cd1c6
movl $0x4, -0x34(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3c7330
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x3c5210
jmp 0x3cd237
jmp 0x3cd1c8
cmpl $0x64, -0x34(%rbp)
je 0x3cd216
movq -0x48(%rbp), %rdi
callq 0x3c7330
movl %eax, -0x34(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d99d6(%rip), %rax    # 0x5a6bd0
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3cd214
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3cd1ea
jmp 0x3cd21b
jmp 0x3cd02b
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3c00a0
movq $0x0, -0x50(%rbp)
jmp 0x3ccfb0
jmp 0x3cd237
cmpq $0x0, -0x48(%rbp)
je 0x3cd247
movq -0x48(%rbp), %rdi
callq 0x3c7330
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3c00a0
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x3c7380
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x3cd2b0
cmpq $0x0, -0x30(%rbp)
je 0x3cd2b0
movq -0x10(%rbp), %rdi
callq 0x3cd3f0
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x3c91a0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x3cd2ae
movl $0x7, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movl $0x7, %esi
callq 0x3c5210
jmp 0x3cd2c4
cmpq $0x0, -0x30(%rbp)
je 0x3cd2c2
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
jmp 0x3cd2c4
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)