	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function filter_sub
_filter_sub:                            ## @filter_sub
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	imull	%ecx, %edx
	movl	%ecx, %r8d
	testl	%ecx, %ecx
	je	LBB0_14
## %bb.1:
	xorl	%r11d, %r11d
	cmpl	$4, %ecx
	jb	LBB0_11
## %bb.2:
	movq	%rdi, %rax
	subq	%rsi, %rax
	cmpq	$32, %rax
	jb	LBB0_11
## %bb.3:
	movl	%r8d, %r11d
	andl	$-4, %r11d
	leaq	-4(%r11), %rax
	movq	%rax, %r10
	shrq	$2, %r10
	incq	%r10
	movl	%r10d, %r9d
	andl	$3, %r9d
	cmpq	$12, %rax
	jae	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_5:
	andq	$-4, %r10
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rsi,%rax,8), %xmm0
	movups	16(%rsi,%rax,8), %xmm1
	movups	%xmm0, (%rdi,%rax,8)
	movups	%xmm1, 16(%rdi,%rax,8)
	movups	32(%rsi,%rax,8), %xmm0
	movups	48(%rsi,%rax,8), %xmm1
	movups	%xmm0, 32(%rdi,%rax,8)
	movups	%xmm1, 48(%rdi,%rax,8)
	movups	64(%rsi,%rax,8), %xmm0
	movups	80(%rsi,%rax,8), %xmm1
	movups	%xmm0, 64(%rdi,%rax,8)
	movups	%xmm1, 80(%rdi,%rax,8)
	movdqu	96(%rsi,%rax,8), %xmm0
	movdqu	112(%rsi,%rax,8), %xmm1
	movdqu	%xmm0, 96(%rdi,%rax,8)
	movdqu	%xmm1, 112(%rdi,%rax,8)
	addq	$16, %rax
	addq	$-4, %r10
	jne	LBB0_6
LBB0_7:
	testq	%r9, %r9
	je	LBB0_10
## %bb.8:
	leaq	(%rdi,%rax,8), %r10
	addq	$16, %r10
	leaq	(%rsi,%rax,8), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-16(%rax,%rbx), %xmm0
	movdqu	(%rax,%rbx), %xmm1
	movdqu	%xmm0, -16(%r10,%rbx)
	movdqu	%xmm1, (%r10,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r9
	jne	LBB0_9
LBB0_10:
	cmpq	%r8, %r11
	je	LBB0_14
LBB0_11:
	movq	%r11, %r9
	notq	%r9
	addq	%r8, %r9
	movq	%r8, %rbx
	andq	$3, %rbx
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%r11,8), %rax
	movq	%rax, (%rdi,%r11,8)
	incq	%r11
	decq	%rbx
	jne	LBB0_12
LBB0_13:
	cmpq	$3, %r9
	jb	LBB0_14
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%r11,8), %rax
	movq	%rax, (%rdi,%r11,8)
	movq	8(%rsi,%r11,8), %rax
	movq	%rax, 8(%rdi,%r11,8)
	movq	16(%rsi,%r11,8), %rax
	movq	%rax, 16(%rdi,%r11,8)
	movq	24(%rsi,%r11,8), %rax
	movq	%rax, 24(%rdi,%r11,8)
	addq	$4, %r11
	cmpq	%r11, %r8
	jne	LBB0_32
LBB0_14:
	cmpl	%ecx, %edx
	jbe	LBB0_31
## %bb.15:
	movl	%edx, %r11d
	movq	%r11, %r9
	subq	%r8, %r9
	movq	%r8, %rbx
	cmpq	$4, %r9
	jae	LBB0_16
LBB0_26:
	movl	%r11d, %eax
	subl	%ebx, %eax
	movq	%rbx, %rcx
	notq	%rcx
	testb	$1, %al
	je	LBB0_28
## %bb.27:
	movq	(%rsi,%rbx,8), %r9
	movq	%rbx, %rax
	subq	%r8, %rax
	subq	(%rsi,%rax,8), %r9
	movq	%r9, (%rdi,%rbx,8)
	incq	%rbx
LBB0_28:
	addq	%r11, %rcx
	je	LBB0_31
## %bb.29:
	movl	$1, %eax
	subq	%r8, %rax
	leaq	(%rsi,%rax,8), %rcx
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi,%rbx,8), %rax
	subq	-8(%rcx,%rbx,8), %rax
	movq	%rax, (%rdi,%rbx,8)
	movq	8(%rsi,%rbx,8), %rax
	subq	(%rcx,%rbx,8), %rax
	movq	%rax, 8(%rdi,%rbx,8)
	addq	$2, %rbx
	cmpq	%rbx, %r11
	jne	LBB0_30
	jmp	LBB0_31
LBB0_16:
	leaq	(%rdi,%r8,8), %r10
	movq	%r10, %rcx
	subq	%rsi, %rcx
	movq	%r8, %rbx
	cmpq	$32, %rcx
	jb	LBB0_26
## %bb.17:
	leaq	(%rsi,%r8,8), %rax
	subq	%rax, %r10
	movq	%r8, %rbx
	cmpq	$32, %r10
	jb	LBB0_26
## %bb.18:
	movq	%r9, %rbx
	andq	$-4, %rbx
	leaq	-4(%rbx), %rcx
	movq	%rcx, %r10
	shrq	$2, %r10
	incq	%r10
	testq	%rcx, %rcx
	je	LBB0_19
## %bb.20:
	movabsq	$9223372036854775804, %rax      ## imm = 0x7FFFFFFFFFFFFFFC
	orq	$2, %rax
	andq	%r10, %rax
	leaq	(%rdi,%r8,8), %r14
	addq	$48, %r14
	leaq	(%rsi,%r8,8), %r15
	addq	$48, %r15
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movdqu	-48(%r15,%rcx,8), %xmm0
	movdqu	-32(%r15,%rcx,8), %xmm1
	movdqu	(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm0
	movdqu	16(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm1
	movdqu	%xmm0, -48(%r14,%rcx,8)
	movdqu	%xmm1, -32(%r14,%rcx,8)
	movdqu	-16(%r15,%rcx,8), %xmm0
	movdqu	(%r15,%rcx,8), %xmm1
	movdqu	32(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm0
	movdqu	48(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm1
	movdqu	%xmm0, -16(%r14,%rcx,8)
	movdqu	%xmm1, (%r14,%rcx,8)
	addq	$8, %rcx
	addq	$-2, %rax
	jne	LBB0_21
## %bb.22:
	testb	$1, %r10b
	je	LBB0_24
LBB0_23:
	leaq	(%rcx,%r8), %rax
	movdqu	(%rsi,%rax,8), %xmm0
	movdqu	16(%rsi,%rax,8), %xmm1
	movdqu	(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm0
	movdqu	16(%rsi,%rcx,8), %xmm2
	psubq	%xmm2, %xmm1
	movdqu	%xmm0, (%rdi,%rax,8)
	movdqu	%xmm1, 16(%rdi,%rax,8)
LBB0_24:
	cmpq	%rbx, %r9
	jne	LBB0_25
LBB0_31:
	movl	%edx, %esi
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_count_sad                      ## TAILCALL
LBB0_25:
	addq	%r8, %rbx
	jmp	LBB0_26
LBB0_19:
	xorl	%ecx, %ecx
	testb	$1, %r10b
	jne	LBB0_23
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_filter_sub
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function filter_sub
_filter_sub:                            ; @filter_sub
	.cfi_startproc
; %bb.0:
	mov	x8, x1
	mul	w1, w3, w2
	cbz	w3, LBB0_8
; %bb.1:
	mov	x10, #0
	mov	w9, w3
	cmp	w3, #8
	b.lo	LBB0_6
; %bb.2:
	sub	x11, x0, x8
	cmp	x11, #64
	b.lo	LBB0_6
; %bb.3:
	and	x10, x9, #0xfffffff8
	add	x11, x0, #32
	add	x12, x8, #32
	mov	x13, x10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x13, x13, #8
	b.ne	LBB0_4
; %bb.5:
	cmp	x10, x9
	b.eq	LBB0_8
LBB0_6:
	lsl	x12, x10, #3
	add	x11, x8, x12
	add	x12, x0, x12
	sub	x9, x9, x10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x11], #8
	str	x10, [x12], #8
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_8:
	cmp	w1, w3
	b.ls	LBB0_17
; %bb.9:
	mov	w9, w3
	sub	x10, x1, x9
	mov	x11, x9
	cmp	x10, #8
	b.lo	LBB0_15
; %bb.10:
	lsl	x12, x9, #3
	add	x13, x12, x0
	sub	x14, x13, x8
	mov	x11, x9
	cmp	x14, #64
	b.lo	LBB0_15
; %bb.11:
	add	x11, x12, x8
	sub	x13, x13, x11
	mov	x11, x9
	cmp	x13, #64
	b.lo	LBB0_15
; %bb.12:
	and	x13, x10, #0xfffffffffffffff8
	add	x11, x13, x9
	add	x14, x0, x9, lsl #3
	add	x14, x14, #32
	add	x15, x8, #32
	mov	x16, x13
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	add	x17, x15, x12
	ldp	q0, q1, [x17, #-32]
	ldp	q2, q3, [x17]
	ldp	q4, q5, [x15, #-32]
	ldp	q6, q7, [x15], #64
	sub.2d	v0, v0, v4
	sub.2d	v1, v1, v5
	sub.2d	v2, v2, v6
	sub.2d	v3, v3, v7
	stp	q0, q1, [x14, #-32]
	stp	q2, q3, [x14], #64
	subs	x16, x16, #8
	b.ne	LBB0_13
; %bb.14:
	cmp	x10, x13
	b.eq	LBB0_17
LBB0_15:
	neg	x9, x9, lsl #3
	lsl	x10, x11, #3
	add	x8, x8, x10
	add	x10, x0, x10
	sub	x11, x1, x11
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x8, x9]
	ldr	x13, [x8], #8
	sub	x12, x13, x12
	str	x12, [x10], #8
	subs	x11, x11, #1
	b.ne	LBB0_16
LBB0_17:
                                        ; kill: def $w1 killed $w1 killed $x1
	b	_count_sad
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_filter_sub
.subsections_via_symbols
