// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3GetCollSeq
SQLITE_PRIVATE CollSeq *sqlite3GetCollSeq(
  Parse *pParse,        /* Parsing context */
  u8 enc,               /* The desired encoding for the collating sequence */
  CollSeq *pColl,       /* Collating sequence with native encoding, or NULL */
  const char *zName     /* Collating sequence name */
){
  CollSeq *p;
  sqlite3 *db = pParse->db;

  p = pColl;
  if( !p ){
    p = sqlite3FindCollSeq(db, enc, zName, 0);
  }
  if( !p || !p->xCmp ){
    /* No collation sequence of this type for this encoding is registered.
    ** Call the collation factory to see if it can supply us with one.
    */
    callCollNeeded(db, enc, zName);
    p = sqlite3FindCollSeq(db, enc, zName, 0);
  }
  if( p && !p->xCmp && synthCollSeq(db, p) ){
    p = 0;
  }
  assert( !p || p->xCmp );
  if( p==0 ){
    sqlite3ErrorMsg(pParse, "no such collation sequence: %s", zName);
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %r14
movq (%rdi), %r15
testq %rdx, %rdx
jne 0x4b2f7
movzbl %r13b, %esi
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4b4a6
movq %rax, %r12
testq %r12, %r12
je 0x4b308
cmpq $0x0, 0x18(%r12)
jne 0x4b401
movzbl %r13b, %r12d
cmpq $0x0, 0x118(%r15)
je 0x4b34f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1010d
testq %rax, %rax
je 0x4b3ee
movq %rax, %r13
movq 0x128(%r15), %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %rax, %rcx
callq *0x118(%r15)
movq %r15, %rdi
movq %r13, %rsi
callq 0x9c3a
cmpq $0x0, 0x120(%r15)
je 0x4b3ee
movq %r15, %rdi
movl $0x38, %esi
callq 0x115e9
movq %rax, %r13
testq %rax, %rax
je 0x4b3b4
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movups %xmm0, (%r13)
movups %xmm0, 0x10(%r13)
movq $0x0, 0x30(%r13)
movw $0x1, 0x24(%r13)
movb $0x5, 0x26(%r13)
movq %r15, (%r13)
movq %r13, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xeff4
movq %r13, %rdi
movl $0x2, %esi
callq 0xee49
testq %rax, %rax
je 0x4b3e6
movq 0x20(%r15), %rcx
movq 0x128(%r15), %rdi
movq 0x18(%rcx), %rcx
movzbl 0x71(%rcx), %edx
movq %r15, %rsi
movq %rax, %rcx
callq *0x120(%r15)
movq %r13, %rdi
callq 0x14350
movq %r15, %rdi
movl %r12d, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4b4a6
movq %rax, %r12
testq %r12, %r12
je 0x4b44a
cmpq $0x0, 0x18(%r12)
jne 0x4b47b
movq %r14, -0x30(%rbp)
movq %rbx, -0x38(%rbp)
movq (%r12), %r13
leaq 0x2d44b(%rip), %r14     # 0x7886c
xorl %ebx, %ebx
movzbl (%rbx,%r14), %esi
movq %r15, %rdi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4b4a6
cmpq $0x0, 0x18(%rax)
jne 0x4b44f
incq %rbx
cmpq $0x3, %rbx
jne 0x4b423
xorl %r12d, %r12d
jmp 0x4b473
xorl %r12d, %r12d
jmp 0x4b47b
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%r12)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movq $0x0, 0x20(%r12)
movq -0x38(%rbp), %rbx
movq -0x30(%rbp), %r14
testq %r12, %r12
jne 0x4b494
leaq 0x2fdf1(%rip), %rsi     # 0x7b278
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x11724
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq