// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq (%rdi), %rax
movq 0x28(%rax), %r14
movq (%rdx), %rdi
movl $0x1, %esi
callq 0x11820
movq %rax, %r12
movq 0x8(%rbx), %rdi
movl $0x1, %esi
callq 0x11820
movq %rax, %r13
movq 0x10(%rbx), %rdi
movl $0x1, %esi
callq 0x11820
testq %r12, %r12
sete %dl
movq %r13, -0x70(%rbp)
testq %r13, %r13
sete %cl
orb %dl, %cl
je 0x76eef
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, -0x68(%rbp)
movq %r14, -0x40(%rbp)
cmpb $0x0, (%r12)
movq %r12, -0x48(%rbp)
je 0x77039
movq %rax, -0x50(%rbp)
leaq -0x34(%rbp), %r14
movq $0x0, -0x30(%rbp)
movq %r12, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f446
movl %eax, %r12d
cmpl $0x69, -0x34(%rbp)
jne 0x77025
movq %r15, %rbx
movslq %r12d, %r15
addq %rbx, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x3f446
movl %eax, %r12d
movl -0x34(%rbp), %eax
cmpl $0x9f, %eax
je 0x76f31
cmpl $0xa0, %eax
je 0x76fb0
movslq %r12d, %r13
testq %rbx, %rbx
je 0x76f8b
leaq 0x1(%r13), %rsi
movq -0x40(%rbp), %rdi
callq 0x144ee
movq %rax, %rbx
testq %rax, %rax
je 0x76f8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xa310
movb $0x0, (%rbx,%r13)
jmp 0x76f8d
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x76fb0
movq %rbx, %rdi
callq 0x56136
movq -0x70(%rbp), %rdi
movq %rbx, %rsi
callq 0xa3f0
testl %eax, %eax
je 0x76fb4
movq -0x40(%rbp), %r13
jmp 0x77014
xorl %eax, %eax
jmp 0x77021
movq -0x30(%rbp), %rdx
movq %rdx, -0x30(%rbp)
testq %rdx, %rdx
leaq 0x90cb(%rip), %rax      # 0x80091
cmoveq %rax, %rdx
movl %r15d, %ecx
movq -0x48(%rbp), %r8
subl %r8d, %ecx
movq %r13, -0x60(%rbp)
movq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0xa0bd(%rip), %rsi      # 0x810a3
movq -0x50(%rbp), %r9
xorl %eax, %eax
callq 0x148c2
movq %rax, -0x58(%rbp)
movq %r13, %rdi
movq -0x30(%rbp), %rsi
callq 0xb6df
movq -0x60(%rbp), %rax
addq %r15, %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0xb6df
movb $0x1, %al
testb %al, %al
je 0x77041
movslq %r12d, %rax
cmpb $0x0, (%r15,%rax)
leaq (%r15,%rax), %r15
jne 0x76f19
jmp 0x77041
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %r14
testq %r14, %r14
leaq 0x9042(%rip), %rdx      # 0x80091
cmovneq %r14, %rdx
leaq 0x8b7b(%rip), %rsi      # 0x7fbd5
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq -0x48(%rbp), %rcx
xorl %eax, %eax
callq 0x148c2
leaq -0x6af09(%rip), %r8     # 0xc16a
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq 0x119e9
movq %rbx, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb6df