// File: /workspace/github_c_makefile_star2_O2/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 0x4da02
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
addq %rdi, %rsi
movl %ecx, %r9d
leaq -0x3(%r9), %r10
leaq -0x2(%r9), %r11
leaq -0x1(%r9), %rbx
movq %rdi, %rcx
cmpq %rsi, %rcx
ja 0x4d9f8
xorl %r14d, %r14d
cmpl %r14d, %r9d
je 0x4d9ec
movb (%rcx,%r14), %r15b
movb (%rdx,%r14), %r12b
cmpb %r12b, %r15b
jne 0x4d879
cmpl %r14d, %ebx
je 0x4d9ec
movb 0x1(%rcx,%r14), %r15b
movb 0x1(%rdx,%r14), %r12b
cmpb %r12b, %r15b
jne 0x4d879
cmpl %r14d, %r11d
je 0x4d9ec
movb 0x2(%rcx,%r14), %r15b
movb 0x2(%rdx,%r14), %r12b
cmpb %r12b, %r15b
jne 0x4d879
cmpl %r14d, %r10d
je 0x4d9ec
movb 0x3(%rcx,%r14), %r15b
movb 0x3(%rdx,%r14), %r12b
cmpb %r12b, %r15b
jne 0x4d879
addq $0x4, %r14
jmp 0x4d815
cmpb %r12b, %r15b
je 0x4d9ec
leaq 0x1(%rcx), %r14
cmpq %rsi, %r14
ja 0x4d9f8
xorl %r15d, %r15d
cmpl %r15d, %r9d
je 0x4d9e9
movb 0x1(%rcx,%r15), %r12b
movb (%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d8f7
cmpl %r15d, %ebx
je 0x4d9e9
movb 0x2(%rcx,%r15), %r12b
movb 0x1(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d8f7
cmpl %r15d, %r11d
je 0x4d9e9
movb 0x3(%rcx,%r15), %r12b
movb 0x2(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d8f7
cmpl %r15d, %r10d
je 0x4d9e9
movb 0x4(%rcx,%r15), %r12b
movb 0x3(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d8f7
addq $0x4, %r15
jmp 0x4d892
cmpb %r13b, %r12b
je 0x4d9e9
leaq 0x2(%rcx), %r14
cmpq %rsi, %r14
ja 0x4d9f8
xorl %r15d, %r15d
cmpl %r15d, %r9d
je 0x4d9e9
movb 0x2(%rcx,%r15), %r12b
movb (%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d975
cmpl %r15d, %ebx
je 0x4d9e9
movb 0x3(%rcx,%r15), %r12b
movb 0x1(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d975
cmpl %r15d, %r11d
je 0x4d9e9
movb 0x4(%rcx,%r15), %r12b
movb 0x2(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d975
cmpl %r15d, %r10d
je 0x4d9e9
movb 0x5(%rcx,%r15), %r12b
movb 0x3(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d975
addq $0x4, %r15
jmp 0x4d910
cmpb %r13b, %r12b
je 0x4d9e9
leaq 0x3(%rcx), %r14
cmpq %rsi, %r14
ja 0x4d9f8
xorl %r15d, %r15d
cmpl %r15d, %r9d
je 0x4d9e9
movb 0x3(%rcx,%r15), %r12b
movb (%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d9db
cmpl %r15d, %ebx
je 0x4d9e9
movb 0x4(%rcx,%r15), %r12b
movb 0x1(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d9db
cmpl %r15d, %r11d
je 0x4d9e9
movb 0x5(%rcx,%r15), %r12b
movb 0x2(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d9db
cmpl %r15d, %r10d
je 0x4d9e9
movb 0x6(%rcx,%r15), %r12b
movb 0x3(%rdx,%r15), %r13b
cmpb %r13b, %r12b
jne 0x4d9db
addq $0x4, %r15
jmp 0x4d986
cmpb %r13b, %r12b
je 0x4d9e9
addq $0x4, %rcx
jmp 0x4d809
movq %r14, %rcx
testq %r8, %r8
je 0x4d9f6
subl %edi, %ecx
movl %ecx, (%r8)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq