// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: SyBlobSearch
JX9_PRIVATE sxi32 SyBlobSearch(const void *pBlob, sxu32 nLen, const void *pPattern, sxu32 pLen, sxu32 *pOfft)
{
	const char *zIn = (const char *)pBlob;
	const char *zEnd;
	sxi32 rc;
	if( pLen > nLen ){
		return SXERR_NOTFOUND;
	}
	zEnd = &zIn[nLen-pLen];
	for(;;){
		if( zIn > zEnd ){break;} SX_MACRO_FAST_CMP(zIn, pPattern, pLen, rc); if( rc == 0 ){ if( pOfft ){ *pOfft = (sxu32)(zIn - (const char *)pBlob);} return SXRET_OK; } zIn++;
		if( zIn > zEnd ){break;} SX_MACRO_FAST_CMP(zIn, pPattern, pLen, rc); if( rc == 0 ){ if( pOfft ){ *pOfft = (sxu32)(zIn - (const char *)pBlob);} return SXRET_OK; } zIn++;
		if( zIn > zEnd ){break;} SX_MACRO_FAST_CMP(zIn, pPattern, pLen, rc); if( rc == 0 ){ if( pOfft ){ *pOfft = (sxu32)(zIn - (const char *)pBlob);} return SXRET_OK; } zIn++;
		if( zIn > zEnd ){break;} SX_MACRO_FAST_CMP(zIn, pPattern, pLen, rc); if( rc == 0 ){ if( pOfft ){ *pOfft = (sxu32)(zIn - (const char *)pBlob);} return SXRET_OK; } zIn++;
	}
	return SXERR_NOTFOUND;
}

// Assembly:
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
subl %ecx, %esi
jb 0x5ba7a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %r8, -0x40(%rbp)
addq %rdi, %rsi
movl %ecx, %r10d
leaq -0x1(%r10), %r11
leaq -0x2(%r10), %rbx
leaq -0x3(%r10), %rax
movq %rax, -0x48(%rbp)
movq %rdi, -0x50(%rbp)
movq %rdi, %r9
movl %ecx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movb $0x1, %r15b
testl %ecx, %ecx
je 0x5b736
xorl %r13d, %r13d
movq %r14, %r12
movq %r9, %rax
movq -0x48(%rbp), %rcx
movb (%r9,%r13), %dl
cmpb (%r14,%r13), %dl
jne 0x5b73e
leaq 0x1(%rax), %r8
cmpl %r13d, %r11d
je 0x5b74d
movb 0x1(%r9,%r13), %dl
cmpb 0x1(%r14,%r13), %dl
jne 0x5b752
leaq 0x2(%rax), %r8
cmpl %r13d, %ebx
je 0x5b75b
movb 0x2(%r9,%r13), %dl
cmpb 0x2(%r14,%r13), %dl
jne 0x5b765
leaq 0x3(%rax), %r8
cmpl %r13d, %ecx
je 0x5b76b
movb 0x3(%r9,%r13), %dl
cmpb 0x3(%r14,%r13), %dl
jne 0x5b771
addq $0x4, %rax
addq $0x4, %r12
addq $0x4, %r13
cmpl %r13d, %r10d
jne 0x5b6d1
addq %r14, %r13
movq %rax, %r8
movq %r13, %r12
jmp 0x5b77c
movq %r9, %r8
movq %r14, %r12
jmp 0x5b783
leaq (%r14,%r13), %r12
addq %r9, %r13
xorl %r15d, %r15d
movq %r13, %r8
jmp 0x5b77c
incq %r12
jmp 0x5b77c
leaq (%r14,%r13), %r12
incq %r12
jmp 0x5b779
leaq (%r14,%r13), %r12
addq $0x2, %r12
jmp 0x5b77c
addq $0x2, %r12
jmp 0x5b779
addq $0x3, %r12
jmp 0x5b77c
leaq (%r14,%r13), %r12
addq $0x3, %r12
xorl %r15d, %r15d
movl -0x2c(%rbp), %ecx
movq -0x38(%rbp), %rsi
testb %r15b, %r15b
jne 0x5ba5e
movb (%r8), %al
cmpb (%r12), %al
je 0x5ba5e
leaq 0x1(%r9), %r15
cmpq %rsi, %r15
ja 0x5ba4f
movb $0x1, %r12b
testl %ecx, %ecx
je 0x5b81d
xorl %edx, %edx
movq %r14, %r13
movq %r15, %rax
movq -0x48(%rbp), %rcx
movb 0x1(%r9,%rdx), %r8b
cmpb (%r14,%rdx), %r8b
jne 0x5b829
leaq 0x1(%rax), %r8
cmpl %edx, %r11d
je 0x5b836
movb 0x2(%r9,%rdx), %dil
cmpb 0x1(%r14,%rdx), %dil
jne 0x5b83b
leaq 0x2(%rax), %r8
cmpl %edx, %ebx
je 0x5b844
movb 0x3(%r9,%rdx), %dil
cmpb 0x2(%r14,%rdx), %dil
jne 0x5b84e
leaq 0x3(%rax), %r8
cmpl %edx, %ecx
je 0x5b854
movb 0x4(%r9,%rdx), %dil
cmpb 0x3(%r14,%rdx), %dil
jne 0x5b85a
addq $0x4, %rax
addq $0x4, %r13
addq $0x4, %rdx
cmpl %edx, %r10d
jne 0x5b7b9
addq %r14, %rdx
movq %rax, %r8
movq %rdx, %r13
jmp 0x5b865
movq %r15, %r8
movq %r14, %r13
movq -0x48(%rbp), %rcx
jmp 0x5b869
leaq (%r14,%rdx), %r13
leaq (%r9,%rdx), %r8
incq %r8
jmp 0x5b862
incq %r13
jmp 0x5b865
leaq (%r14,%rdx), %r13
incq %r13
jmp 0x5b862
leaq (%r14,%rdx), %r13
addq $0x2, %r13
jmp 0x5b865
addq $0x2, %r13
jmp 0x5b862
addq $0x3, %r13
jmp 0x5b865
leaq (%r14,%rdx), %r13
addq $0x3, %r13
xorl %r12d, %r12d
movq -0x38(%rbp), %rsi
testb %r12b, %r12b
jne 0x5ba56
movb (%r8), %al
cmpb (%r13), %al
je 0x5ba56
leaq 0x2(%r9), %r15
cmpq %rsi, %r15
ja 0x5ba4f
movb $0x1, %r12b
cmpl $0x0, -0x2c(%rbp)
je 0x5b901
xorl %edx, %edx
movq %r14, %r13
movq %r15, %rax
movb 0x2(%r9,%rdx), %dil
cmpb (%r14,%rdx), %dil
jne 0x5b909
leaq 0x1(%rax), %r8
cmpl %edx, %r11d
je 0x5b917
movb 0x3(%r9,%rdx), %dil
cmpb 0x1(%r14,%rdx), %dil
jne 0x5b91c
leaq 0x2(%rax), %r8
cmpl %edx, %ebx
je 0x5b925
movb 0x4(%r9,%rdx), %dil
cmpb 0x2(%r14,%rdx), %dil
jne 0x5b92f
leaq 0x3(%rax), %r8
cmpl %edx, %ecx
je 0x5b935
movb 0x5(%r9,%rdx), %dil
cmpb 0x3(%r14,%rdx), %dil
jne 0x5b93b
addq $0x4, %rax
addq $0x4, %r13
addq $0x4, %rdx
cmpl %edx, %r10d
jne 0x5b89d
addq %r14, %rdx
movq %rax, %r8
movq %rdx, %r13
jmp 0x5b946
movq %r15, %r8
movq %r14, %r13
jmp 0x5b94a
leaq (%r14,%rdx), %r13
leaq (%r9,%rdx), %r8
addq $0x2, %r8
jmp 0x5b943
incq %r13
jmp 0x5b946
leaq (%r14,%rdx), %r13
incq %r13
jmp 0x5b943
leaq (%r14,%rdx), %r13
addq $0x2, %r13
jmp 0x5b946
addq $0x2, %r13
jmp 0x5b943
addq $0x3, %r13
jmp 0x5b946
leaq (%r14,%rdx), %r13
addq $0x3, %r13
xorl %r12d, %r12d
movq -0x38(%rbp), %rsi
testb %r12b, %r12b
jne 0x5ba56
movb (%r8), %al
cmpb (%r13), %al
je 0x5ba56
leaq 0x3(%r9), %r8
cmpq %rsi, %r8
ja 0x5ba4f
movb $0x1, %al
movl -0x2c(%rbp), %ecx
testl %ecx, %ecx
je 0x5b9ec
xorl %r13d, %r13d
movq %r14, %rdx
movq %r8, %r12
movq -0x48(%rbp), %rcx
movb 0x3(%r9,%r13), %dil
cmpb (%r14,%r13), %dil
jne 0x5b9f4
leaq 0x1(%r12), %r15
cmpl %r13d, %r11d
je 0x5ba02
movb 0x4(%r9,%r13), %dil
cmpb 0x1(%r14,%r13), %dil
jne 0x5ba07
leaq 0x2(%r12), %r15
cmpl %r13d, %ebx
je 0x5ba10
movb 0x5(%r9,%r13), %dil
cmpb 0x2(%r14,%r13), %dil
jne 0x5ba1a
leaq 0x3(%r12), %r15
cmpl %r13d, %ecx
je 0x5ba20
movb 0x6(%r9,%r13), %dil
cmpb 0x3(%r14,%r13), %dil
jne 0x5ba26
addq $0x4, %r12
addq $0x4, %rdx
addq $0x4, %r13
cmpl %r13d, %r10d
jne 0x5b983
addq %r14, %r13
movq %r12, %r15
movq %r13, %rdx
jmp 0x5ba30
movq %r8, %r15
movq %r14, %rdx
jmp 0x5ba33
leaq (%r14,%r13), %rdx
leaq (%r9,%r13), %r15
addq $0x3, %r15
jmp 0x5ba2e
incq %rdx
jmp 0x5ba30
leaq (%r14,%r13), %rdx
incq %rdx
jmp 0x5ba2e
leaq (%r14,%r13), %rdx
addq $0x2, %rdx
jmp 0x5ba30
addq $0x2, %rdx
jmp 0x5ba2e
addq $0x3, %rdx
jmp 0x5ba30
leaq (%r14,%r13), %rdx
addq $0x3, %rdx
xorl %eax, %eax
movl -0x2c(%rbp), %ecx
testb %al, %al
jne 0x5ba5b
movb (%r15), %al
cmpb (%rdx), %al
je 0x5ba5b
addq $0x4, %r9
movq -0x38(%rbp), %rsi
cmpq %rsi, %r9
jbe 0x5b6bd
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
jmp 0x5ba70
movq %r15, %r9
jmp 0x5ba5e
movq %r8, %r9
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x5ba6e
subl -0x50(%rbp), %r9d
movl %r9d, (%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq