// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: renameParentFunc
static void renameParentFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  char *zOutput = 0;
  char *zResult;
  unsigned char const *zInput = sqlite3_value_text(argv[0]);
  unsigned char const *zOld = sqlite3_value_text(argv[1]);
  unsigned char const *zNew = sqlite3_value_text(argv[2]);

  unsigned const char *z;         /* Pointer to token */
  int n;                          /* Length of token z */
  int token;                      /* Type of token */

  UNUSED_PARAMETER(NotUsed);
  if( zInput==0 || zOld==0 ) return;
  for(z=zInput; *z; z=z+n){
    n = sqlite3GetToken(z, &token);
    if( token==TK_REFERENCES ){
      char *zParent;
      do {
        z += n;
        n = sqlite3GetToken(z, &token);
      }while( token==TK_SPACE );

      if( token==TK_ILLEGAL ) break;
      zParent = sqlite3DbStrNDup(db, (const char *)z, n);
      if( zParent==0 ) break;
      sqlite3Dequote(zParent);
      if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
        char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", 
            (zOutput?zOutput:""), (int)(z-zInput), zInput, (const char *)zNew
        );
        sqlite3DbFree(db, zOutput);
        zOutput = zOut;
        zInput = &z[n];
      }
      sqlite3DbFree(db, zParent);
    }
  }

  zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), 
  sqlite3_result_text(context, zResult, -1, SQLITE_DYNAMIC);
  sqlite3DbFree(db, zOutput);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x28(%rax), %r13
movq (%rdx), %rdi
movl $0x1, %esi
callq 0x118a2
movq %rax, %r15
movq 0x8(%r14), %rdi
movl $0x1, %esi
callq 0x118a2
movq %rax, %r12
movq 0x10(%r14), %rdi
movl $0x1, %esi
callq 0x118a2
testq %r15, %r15
sete %dl
testq %r12, %r12
sete %cl
orb %dl, %cl
je 0x7584b
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, (%r15)
movq %r15, -0x40(%rbp)
je 0x75982
movq %rax, -0x58(%rbp)
movq %r12, -0x60(%rbp)
leaq -0x34(%rbp), %r14
movq $0x0, -0x30(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e414
cmpl $0x69, -0x34(%rbp)
jne 0x7596e
movq %r15, %r12
movslq %eax, %r15
addq %r12, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3e414
movl -0x34(%rbp), %ecx
cmpl $0x9f, %ecx
je 0x75882
cmpl $0xa0, %ecx
je 0x7598a
testq %r12, %r12
je 0x7598a
movq %rbx, -0x48(%rbp)
movslq %eax, %r12
leaq 0x1(%r12), %rsi
movq %r13, %rbx
movq %r13, %rdi
callq 0x145aa
testq %rax, %rax
je 0x759e6
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xa320
movb $0x0, (%r13,%r12)
movq %r13, %rdi
callq 0x54ebe
movq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0xa400
testl %eax, %eax
jne 0x7595a
movq -0x30(%rbp), %rdx
movq %rdx, -0x30(%rbp)
testq %rdx, %rdx
leaq 0x878a(%rip), %rax      # 0x7e0a1
cmoveq %rax, %rdx
movl %r15d, %ecx
movq -0x40(%rbp), %r8
subl %r8d, %ecx
movq %rbx, %rdi
leaq 0x9784(%rip), %rsi      # 0x7f0b3
movq -0x58(%rbp), %r9
xorl %eax, %eax
callq 0x1494e
movq %rax, -0x50(%rbp)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0xb752
leaq (%r15,%r12), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0xb752
movq %rbx, %r13
movq -0x48(%rbp), %rbx
jmp 0x75971
movslq %eax, %r12
cmpb $0x0, (%r15,%r12)
leaq (%r15,%r12), %r15
jne 0x7586d
jmp 0x7598a
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %r14
testq %r14, %r14
leaq 0x8709(%rip), %rdx      # 0x7e0a1
cmovneq %r14, %rdx
leaq 0x8242(%rip), %rsi      # 0x7dbe5
movq %r13, %rdi
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x1494e
leaq -0x69707(%rip), %r8     # 0xc2b1
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq 0x11a77
movq %r13, %rdi
movq %r14, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb752
movq %rbx, %r13
movq -0x48(%rbp), %rbx
jmp 0x7598a