// File: /workspace/github_c_makefile_star2_O0/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
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb580
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xb960
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xb960
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xb960
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x9e22b
cmpq $0x0, -0x40(%rbp)
jne 0x9e230
jmp 0x9e3e7
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpb $0x0, (%rax)
je 0x9e374
movq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x56050
movl %eax, -0x54(%rbp)
cmpl $0x69, -0x58(%rbp)
jne 0x9e35e
jmp 0x9e261
movl -0x54(%rbp), %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x56050
movl %eax, -0x54(%rbp)
cmpl $0x9f, -0x58(%rbp)
je 0x9e261
cmpl $0xa0, -0x58(%rbp)
jne 0x9e299
jmp 0x9e374
movq -0x20(%rbp), %rdi
movq -0x50(%rbp), %rsi
movslq -0x54(%rbp), %rdx
callq 0x56e90
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x9e2ba
jmp 0x9e374
movq -0x60(%rbp), %rdi
callq 0x735c0
movq -0x40(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xb5c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x9e351
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9e2f1
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x9e2fe
leaq 0xa6e7(%rip), %rax      # 0xa89df
movq %rax, -0x78(%rbp)
jmp 0x9e2fe
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movq -0x50(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x38(%rbp), %r8
movq -0x48(%rbp), %r9
leaq 0xb6dc(%rip), %rsi      # 0xa99fe
movb $0x0, %al
callq 0x17940
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd260
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xd260
jmp 0x9e360
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
jmp 0x9e238
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9e390
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x9e3a0
leaq 0xa648(%rip), %rax      # 0xa89df
movq %rax, -0x88(%rbp)
jmp 0x9e3a0
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0xa16d(%rip), %rsi      # 0xa8523
movb $0x0, %al
callq 0x17940
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq -0x906c5(%rip), %rcx    # 0xdd10
callq 0xb1b0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd260
addq $0x90, %rsp
popq %rbp
retq