// File: /workspace/github_c_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, %rbx
movq %rdi, %r13
movq (%rdi), %rax
movq 0x28(%rax), %r14
movq (%rdx), %rdi
callq 0xa830
movq %rax, %r15
movq 0x8(%rbx), %rdi
callq 0xa830
movq %rax, %r12
movq 0x10(%rbx), %rdi
callq 0xa830
testq %r15, %r15
sete %dl
testq %r12, %r12
sete %cl
orb %dl, %cl
je 0x66562
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x58(%rbp)
movq %r12, -0x68(%rbp)
movq %r14, -0x40(%rbp)
leaq -0x34(%rbp), %r14
movq %r15, -0x48(%rbp)
movq $0x0, -0x30(%rbp)
cmpb $0x0, (%r15)
je 0x66675
movq %r15, %rdi
movq %r14, %rsi
callq 0x37fd1
cmpl $0x69, -0x34(%rbp)
jne 0x66600
cltq
addq %rax, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x37fd1
movl -0x34(%rbp), %ecx
cmpl $0x9f, %ecx
je 0x66599
cmpl $0xa0, %ecx
je 0x66675
movslq %eax, %r12
movq -0x40(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x386f6
testq %rax, %rax
je 0x66675
movq %rax, %rbx
movq %r13, -0x60(%rbp)
movq %rax, %rdi
callq 0x4e83e
movq -0x68(%rbp), %rdi
movq %rbx, %rsi
callq 0xa4f0
testl %eax, %eax
je 0x66605
movq -0x40(%rbp), %r13
jmp 0x6665e
movslq %eax, %r12
jmp 0x6666d
movq -0x30(%rbp), %rdx
movq %rdx, -0x30(%rbp)
testq %rdx, %rdx
leaq 0x8a7a(%rip), %rax      # 0x6f091
cmoveq %rax, %rdx
movl %r15d, %ecx
movq -0x48(%rbp), %r8
subl %r8d, %ecx
movq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0x9a70(%rip), %rsi      # 0x700a3
movq -0x58(%rbp), %r9
xorl %eax, %eax
callq 0x13638
movq %rax, -0x50(%rbp)
movq %r13, %rdi
movq -0x30(%rbp), %rsi
callq 0xb856
leaq (%r15,%r12), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb856
movq -0x60(%rbp), %r13
addq %r12, %r15
jmp 0x6657e
movq -0x30(%rbp), %r14
testq %r14, %r14
leaq 0x8a0e(%rip), %rdx      # 0x6f091
cmovneq %r14, %rdx
leaq 0x8547(%rip), %rsi      # 0x6ebd5
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq -0x48(%rbp), %rcx
xorl %eax, %eax
callq 0x13638
leaq -0x5a3bb(%rip), %rcx    # 0xc2ec
pushq $-0x1
popq %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0xa160
movq %rbx, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb856