// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: renameTableTest
static void renameTableTest(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  char const *zDb = (const char*)sqlite3_value_text(argv[0]);
  char const *zInput = (const char*)sqlite3_value_text(argv[1]);
  int bTemp = sqlite3_value_int(argv[4]);
  int isLegacy = (db->flags & SQLITE_LegacyAlter);

#ifndef SQLITE_OMIT_AUTHORIZATION
  sqlite3_xauth xAuth = db->xAuth;
  db->xAuth = 0;
#endif

  UNUSED_PARAMETER(NotUsed);
  if( zDb && zInput ){
    int rc;
    Parse sParse;
    rc = renameParseSql(&sParse, zDb, db, zInput, bTemp);
    if( rc==SQLITE_OK ){
      if( isLegacy==0 && sParse.pNewTable && sParse.pNewTable->pSelect ){
        NameContext sNC;
        memset(&sNC, 0, sizeof(sNC));
        sNC.pParse = &sParse;
        sqlite3SelectPrep(&sParse, sParse.pNewTable->pSelect, &sNC);
        if( sParse.nErr ) rc = sParse.rc;
      }

      else if( sParse.pNewTrigger ){
        if( isLegacy==0 ){
          rc = renameResolveTrigger(&sParse);
        }
        if( rc==SQLITE_OK ){
          int i1 = sqlite3SchemaToIndex(db, sParse.pNewTrigger->pTabSchema);
          int i2 = sqlite3FindDbName(db, zDb);
          if( i1==i2 ) sqlite3_result_int(context, 1);
        }
      }
    }

    if( rc!=SQLITE_OK ){
      renameColumnParseError(context, 1, argv[2], argv[3], &sParse);
    }
    renameParseCleanup(&sParse);
  }

#ifndef SQLITE_OMIT_AUTHORIZATION
  db->xAuth = xAuth;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdx, %r15
movq %rdi, %r14
movq (%rdi), %rax
movq 0x28(%rax), %rbx
movq (%rdx), %rdi
callq 0x2243e3
movq %rax, %r12
movq 0x8(%r15), %rdi
callq 0x2243e3
movq %rax, %rbp
movq 0x20(%r15), %rdi
callq 0x224451
movq 0x30(%rbx), %r13
movq 0x1c8(%rbx), %rsi
andq $0x0, 0x1c8(%rbx)
testq %r12, %r12
setne %cl
testq %rbp, %rbp
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x287ac3
movq %r14, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movl %eax, %r8d
callq 0x287ba0
testl %eax, %eax
je 0x287adc
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
pushq $0x1
popq %rsi
leaq 0x18(%rsp), %r8
movq 0x8(%rsp), %rdi
callq 0x2882a3
leaq 0x18(%rsp), %rdi
callq 0x288316
movq 0x10(%rsp), %rsi
movq %rsi, 0x1c8(%rbx)
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0x1a, %r13d
setae %cl
movq 0x160(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x287b3b
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x287b3b
xorps %xmm0, %xmm0
leaq 0x1c0(%rsp), %rdx
movups %xmm0, 0x28(%rdx)
movups %xmm0, 0x18(%rdx)
movups %xmm0, 0x8(%rdx)
movq %r14, (%rdx)
movq %r14, %rdi
callq 0x26d3a5
cmpl $0x0, 0x48(%rsp)
je 0x287ab4
cmpl $0x0, 0x30(%rsp)
jne 0x287a9a
jmp 0x287ab4
movq 0x170(%rsp), %rax
testq %rax, %rax
je 0x287ab4
btl $0x1a, %r13d
jb 0x287b6d
leaq 0x18(%rsp), %rdi
callq 0x287cf6
testl %eax, %eax
jne 0x287a9a
movq 0x170(%rsp), %rax
movq 0x30(%rax), %rsi
movq %rbx, %rdi
callq 0x226e9e
movl %eax, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22b0a8
cmpl %eax, %ebp
jne 0x287ab4
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x224920
jmp 0x287ab4