// File: /workspace/github_c_makefile_star2_O3/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 0x5a0ca
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, -0x30(%rbp)
addq %rdi, %rsi
movl %ecx, %r10d
leaq -0x1(%r10), %r11
leaq -0x2(%r10), %rbx
leaq -0x3(%r10), %r14
movq %rdi, %r9
testl %ecx, %ecx
je 0x5a0a9
xorl %r15d, %r15d
movb (%r9,%r15), %r12b
movb (%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x59f31
cmpl %r15d, %r11d
je 0x5a0ac
movb 0x1(%r9,%r15), %r12b
movb 0x1(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x59f31
cmpl %r15d, %ebx
je 0x5a0ac
movb 0x2(%r9,%r15), %r12b
movb 0x2(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x59f31
cmpl %r15d, %r14d
je 0x5a0ac
movb 0x3(%r9,%r15), %r12b
movb 0x3(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x59f31
addq $0x4, %r15
cmpl %r15d, %r10d
jne 0x59ece
jmp 0x5a0ac
cmpb %r13b, %r12b
je 0x5a0ac
leaq 0x1(%r9), %r8
cmpq %rsi, %r8
ja 0x5a0c0
xorl %r12d, %r12d
movb 0x1(%r9,%r12), %r13b
movb (%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x59fae
cmpl %r12d, %r11d
je 0x5a0af
movb 0x2(%r9,%r12), %r13b
movb 0x1(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x59fae
cmpl %r12d, %ebx
je 0x5a0af
movb 0x3(%r9,%r12), %r13b
movb 0x2(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x59fae
cmpl %r12d, %r14d
je 0x5a0af
movb 0x4(%r9,%r12), %r13b
movb 0x3(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x59fae
addq $0x4, %r12
cmpl %r12d, %r10d
jne 0x59f4a
jmp 0x5a0af
cmpb %r15b, %r13b
je 0x5a0af
leaq 0x2(%r9), %r8
cmpq %rsi, %r8
ja 0x5a0c0
xorl %r12d, %r12d
movb 0x2(%r9,%r12), %r13b
movb (%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a02b
cmpl %r12d, %r11d
je 0x5a0af
movb 0x3(%r9,%r12), %r13b
movb 0x1(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a02b
cmpl %r12d, %ebx
je 0x5a0af
movb 0x4(%r9,%r12), %r13b
movb 0x2(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a02b
cmpl %r12d, %r14d
je 0x5a0af
movb 0x5(%r9,%r12), %r13b
movb 0x3(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a02b
addq $0x4, %r12
cmpl %r12d, %r10d
jne 0x59fc7
jmp 0x5a0af
cmpb %r15b, %r13b
je 0x5a0af
leaq 0x3(%r9), %r8
cmpq %rsi, %r8
ja 0x5a0c0
xorl %r12d, %r12d
movb 0x3(%r9,%r12), %r13b
movb (%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a095
cmpl %r12d, %r11d
je 0x5a0af
movb 0x4(%r9,%r12), %r13b
movb 0x1(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a095
cmpl %r12d, %ebx
je 0x5a0af
movb 0x5(%r9,%r12), %r13b
movb 0x2(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a095
cmpl %r12d, %r14d
je 0x5a0af
movb 0x6(%r9,%r12), %r13b
movb 0x3(%rdx,%r12), %r15b
cmpb %r15b, %r13b
jne 0x5a095
addq $0x4, %r12
cmpl %r12d, %r10d
jne 0x5a040
jmp 0x5a0af
cmpb %r15b, %r13b
je 0x5a0af
addq $0x4, %r9
cmpq %rsi, %r9
jbe 0x59ec3
jmp 0x5a0c0
movq %rdi, %r9
movq %r9, %r8
movq -0x30(%rbp), %rax
testq %rax, %rax
je 0x5a0be
subl %edi, %r8d
movl %r8d, (%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq