// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %esi
callq 0x281c96
movq %rax, %r12
movq 0x8(%r15), %rdi
movl $0x1, %esi
callq 0x281c96
movq %rax, %rbp
movq 0x20(%r15), %rdi
callq 0x281c1d
movq 0x30(%rbx), %r13
movq 0x1c8(%rbx), %rsi
movq $0x0, 0x1c8(%rbx)
testq %r12, %r12
setne %cl
testq %rbp, %rbp
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2f62fd
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 0x2f641b
testl %eax, %eax
je 0x2f6316
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
leaq 0x18(%rsp), %r8
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x2f6cd0
leaq 0x18(%rsp), %rdi
callq 0x2f6d62
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 0x2f637e
cmpq $0x0, 0x18(%rax)
je 0x2f637e
xorps %xmm0, %xmm0
leaq 0x1c0(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movq $0x0, 0x30(%rdx)
movq %r14, (%rdx)
movq 0x18(%rax), %rsi
movq %r14, %rdi
callq 0x2d0563
cmpl $0x0, 0x48(%rsp)
je 0x2f62ee
cmpl $0x0, 0x30(%rsp)
jne 0x2f62d2
jmp 0x2f62ee
cmpq $0x0, 0x170(%rsp)
je 0x2f62ee
btl $0x1a, %r13d
jb 0x2f63a6
leaq 0x18(%rsp), %rdi
callq 0x2f65d4
testl %eax, %eax
jne 0x2f62d2
movq 0x170(%rsp), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x2f63d4
movq 0x20(%rbx), %rcx
addq $0x18, %rcx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
leaq 0x20(%rcx), %rdx
cmpq %rax, (%rcx)
movq %rdx, %rcx
jne 0x2f63c4
jmp 0x2f63d9
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
movq %rbx, %rdi
movq %r12, %rsi
callq 0x289cd9
cmpl %eax, %ebp
jne 0x2f62ee
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testb $0x24, 0x9(%rdi)
je 0x2f6409
movl $0x1, %esi
callq 0x29c706
jmp 0x2f62ee
movq $0x1, (%rdi)
movw $0x4, 0x8(%rdi)
jmp 0x2f62ee