SYSTEM_INDEXQWORD$formal$INT64$QWORD$$INT64:
; Temps allocated between rsp+32 and rsp+56
; [377] begin
		sub	rsp,104
; Var buf located in register rcx
; Var len located in register rdx
; Var b located in register r8
; Var $result located in register rax
; Var psrc located in register rbx
; Var pend located in register rsi
		mov	qword ptr [rsp+32],rbx
		mov	qword ptr [rsp+40],rdi
		mov	qword ptr [rsp+48],rsi
; [378] psrc:=@buf;
		mov	rbx,rcx
; [381] if (len < 0) or
		mov	rax,rdx
		cmp	rax,0
		jl	@@j373
; [382] (len > high(PtrInt) div 4) or
		mov	rax,rdx
		mov	rsi,2305843009213693951
		cmp	rax,rsi
		jg	@@j373
; [383] (psrc+len < psrc) then
		mov	rax,rdx
		shl	rax,3
		add	rax,rbx
		cmp	rax,rbx
		jnb	@@j374
@@j373:
; [384] pend:=pqword(high(PtrUInt)-sizeof(qword))
		mov	rsi,-9
		jmp	@@j383
@@j374:
; [386] pend:=psrc+len;
		shl	rdx,3
		add	rdx,rbx
		mov	rsi,rdx
; [400] while psrc<pend do
		jmp	@@j383
	ALIGN 8
@@j382:
; [402] if psrc^=b then
		mov	rdx,qword ptr [rbx]
		cmp	rdx,r8
		jne	@@j386
; [404] result:=psrc-pqword(@buf);
		mov	rdx,rcx
		mov	rdi,rbx
		sub	rdi,rdx
		mov	rdx,rdi
		mov	rdi,rdx
		sar	rdi,63
		and	rdi,7
		add	rdx,rdi
		sar	rdx,3
		mov	rax,rdx
; [405] exit;
		jmp	@@j369
@@j386:
; [407] inc(psrc);
		add	rbx,8
@@j383:
		mov	rdx,rbx
		cmp	rdx,rsi
		jb	@@j382
; [409] result:=-1;
		mov	rax,-1
@@j369:
; [410] end;
		mov	rbx,qword ptr [rsp+32]
		mov	rdi,qword ptr [rsp+40]
		mov	rsi,qword ptr [rsp+48]
		add	rsp,104
		ret
_TEXT		ENDS
