// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %rdi, %r14
movq (%rdi), %rax
movq 0x28(%rax), %rbx
movq (%rdx), %rdi
movl $0x1, %esi
callq 0x278305
movq %rax, %r15
movq 0x8(%r12), %rdi
movl $0x1, %esi
callq 0x278305
movq %rax, %rbp
movq 0x20(%r12), %rdi
callq 0x27828c
movq 0x30(%rbx), %r13
movq 0x1c8(%rbx), %rsi
movq $0x0, 0x1c8(%rbx)
testq %r15, %r15
setne %cl
testq %rbp, %rbp
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2ecfef
movq %r14, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movl %eax, %r8d
callq 0x2ed106
testl %eax, %eax
je 0x2ed008
movq 0x10(%r12), %rdx
movq 0x18(%r12), %rcx
leaq 0x18(%rsp), %r8
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x2ed9da
leaq 0x18(%rsp), %rdi
callq 0x2eda6c
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 0x2ed067
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x2ed067
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 0x2c6ee7
cmpl $0x0, 0x48(%rsp)
je 0x2ecfe0
cmpl $0x0, 0x30(%rsp)
jne 0x2ecfc2
jmp 0x2ecfe0
movq 0x170(%rsp), %rax
testq %rax, %rax
je 0x2ecfe0
btl $0x1a, %r13d
jb 0x2ed099
leaq 0x18(%rsp), %rdi
callq 0x2ed2c3
testl %eax, %eax
jne 0x2ecfc2
movq 0x170(%rsp), %rax
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x2ed0bf
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 0x2ed0af
jmp 0x2ed0c4
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
movq %rbx, %rdi
movq %r15, %rsi
callq 0x280170
cmpl %eax, %ebp
jne 0x2ecfe0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testb $0x24, 0x9(%rdi)
je 0x2ed0f4
movl $0x1, %esi
callq 0x2929ee
jmp 0x2ecfe0
movq $0x1, (%rdi)
movw $0x4, 0x8(%rdi)
jmp 0x2ecfe0