	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ssim_4x4xn_16bit
_ssim_4x4xn_16bit:                      ## @ssim_4x4xn_16bit
	.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	%r13
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%r9d, %r9d
	jle	LBB0_3
## %bb.1:
	sarl	%ecx
	sarl	%esi
	movslq	%esi, %rsi
	movslq	%ecx, %rax
	movl	%r9d, %ecx
	addq	$12, %r8
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	(,%rax,4), %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rsi,4), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movl	(%rdi), %esi
	movl	4(%rdi), %r11d
	movl	8(%rdi), %r9d
	movl	12(%rdi), %r10d
	movl	12(%rdx), %r13d
	movl	8(%rdx), %eax
	movl	(%rdx), %r12d
	movl	4(%rdx), %ecx
	movdqu	(%rdx), %xmm0
	movd	%r10d, %xmm1
	pinsrd	$1, %r9d, %xmm1
	pinsrd	$2, %r11d, %xmm1
	pinsrd	$3, %esi, %xmm1
	pmulld	%xmm1, %xmm1
	pmulld	%xmm0, %xmm0
	paddd	%xmm1, %xmm0
	leal	(%rcx,%r12), %ebx
	imull	%esi, %r12d
	addl	%r11d, %esi
	imull	%r11d, %ecx
	addl	%r12d, %ecx
	addl	%r9d, %esi
	addl	%eax, %ebx
	imull	%r9d, %eax
	addl	%ecx, %eax
	addl	%r10d, %esi
	addl	%r13d, %ebx
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %r12d
	imull	%r10d, %r13d
	addl	%eax, %r13d
	movq	%rdi, %r8
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	(%r8,%rdi,4), %eax
	movl	4(%r8,%rdi,4), %ecx
	addl	%eax, %esi
	movl	8(%r8,%rdi,4), %r9d
	movl	12(%r8,%rdi,4), %r10d
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	(%rdx,%r15,4), %r11d
	movd	%r10d, %xmm0
	pinsrd	$1, %r9d, %xmm0
	pinsrd	$2, %ecx, %xmm0
	pinsrd	$3, %eax, %xmm0
	addl	%r11d, %ebx
	imull	%eax, %r11d
	movl	12(%rdx,%r15,4), %eax
	addl	%r13d, %r11d
	movl	4(%rdx,%r15,4), %r13d
	addl	%ecx, %esi
	addl	%r13d, %ebx
	imull	%ecx, %r13d
	movl	8(%rdx,%r15,4), %ecx
	movdqu	(%rdx,%r15,4), %xmm1
	pmulld	%xmm0, %xmm0
	pmulld	%xmm1, %xmm1
	paddd	%xmm0, %xmm1
	addl	%r11d, %r13d
	addl	%r9d, %esi
	addl	%ecx, %ebx
	imull	%r9d, %ecx
	addl	%r13d, %ecx
	addl	%r10d, %esi
	addl	%eax, %ebx
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %r13d
	addl	%r12d, %r13d
	imull	%r10d, %eax
	addl	%ecx, %eax
	movl	(%r8,%rdi,8), %ecx
	movl	4(%r8,%rdi,8), %r11d
	addl	%ecx, %esi
	movl	8(%r8,%rdi,8), %r12d
	movl	12(%r8,%rdi,8), %r10d
	movl	(%rdx,%r15,8), %r14d
	addl	%r14d, %ebx
	movd	%r10d, %xmm0
	pinsrd	$1, %r12d, %xmm0
	pinsrd	$2, %r11d, %xmm0
	pinsrd	$3, %ecx, %xmm0
	imull	%ecx, %r14d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%r8,%rcx), %r9
	addq	%rcx, %r9
	addl	%eax, %r14d
	movl	4(%rdx,%r15,8), %eax
	addl	%r11d, %esi
	addl	%eax, %ebx
	imull	%r11d, %eax
	movl	12(%rdx,%r15,8), %r11d
	addl	%r14d, %eax
	movl	8(%rdx,%r15,8), %ecx
	movdqu	(%rdx,%r15,8), %xmm1
	pmulld	%xmm0, %xmm0
	pmulld	%xmm1, %xmm1
	paddd	%xmm0, %xmm1
	addl	%r12d, %esi
	addl	%ecx, %ebx
	imull	%r12d, %ecx
	addl	%eax, %ecx
	addl	%r10d, %esi
	addl	%r11d, %ebx
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %r12d
	addl	%r13d, %r12d
	imull	%r10d, %r11d
	addl	%ecx, %r11d
	movl	(%r9,%rdi,4), %ecx
	movl	4(%r9,%rdi,4), %r14d
	addl	%ecx, %esi
	movl	8(%r9,%rdi,4), %r10d
	movl	12(%r9,%rdi,4), %r9d
	movq	%r8, %rdi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	(%rdx,%r15), %eax
	movd	%r9d, %xmm0
	pinsrd	$1, %r10d, %xmm0
	pinsrd	$2, %r14d, %xmm0
	pinsrd	$3, %ecx, %xmm0
	addl	%eax, %ebx
	imull	%ecx, %eax
	addl	%r11d, %eax
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movl	4(%rdx,%r15), %ecx
	addl	%r14d, %esi
	addl	%ecx, %ebx
	imull	%r14d, %ecx
	addl	%eax, %ecx
	movl	8(%rdx,%r15), %eax
	addl	%r10d, %esi
	addl	%eax, %ebx
	imull	%r10d, %eax
	movdqu	(%rdx,%r15), %xmm1
	pmulld	%xmm0, %xmm0
	pmulld	%xmm1, %xmm1
	paddd	%xmm0, %xmm1
	addl	%ecx, %eax
	pshufd	$238, %xmm1, %xmm0              ## xmm0 = xmm1[2,3,2,3]
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %r10d
	addl	%r12d, %r10d
	movl	12(%rdx,%r15), %ecx
	addl	%r9d, %esi
	addl	%ecx, %ebx
	imull	%r9d, %ecx
	addl	%eax, %ecx
	movl	%esi, -12(%r8)
	movl	%ebx, -8(%r8)
	movl	%r10d, -4(%r8)
	movl	%ecx, (%r8)
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	addq	$16, %rdi
	addq	$16, %rdx
	addq	$16, %r8
	decq	%rcx
	jne	LBB0_2
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ssim_4x4xn_16bit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ssim_4x4xn_16bit
_ssim_4x4xn_16bit:                      ; @ssim_4x4xn_16bit
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	cmp	w5, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x8, #0
	asr	w9, w3, #1
	asr	w11, w1, #1
	sbfiz	x9, x9, #2, #32
	add	x10, x0, #8
	sbfiz	x11, x11, #2, #32
	mov	w12, w5
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	mov	w15, #0
	mov	w13, #0
	mov	w14, #0
	mov	w1, #0
	mov	x16, x10
	mov	w17, #4
	mov	x0, x2
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	w3, w5, [x16, #-8]
	ldp	w6, w7, [x16]
	ldr	q0, [x0]
	add	w1, w3, w1
	add	w1, w5, w1
	add	w1, w6, w1
	add	w1, w7, w1
	fmov	s1, w7
	mov.s	v1[1], w6
	mov.s	v1[2], w5
	mul.4s	v2, v0, v0
	mov.s	w19, v0[1]
	mov.s	w20, v0[2]
	mov.s	w21, v0[3]
	fmov	w22, s0
	mov.s	v1[3], w3
	madd	w15, w22, w3, w15
	madd	w15, w19, w5, w15
	madd	w15, w20, w6, w15
	madd	w15, w21, w7, w15
	add	w14, w22, w14
	add	w14, w19, w14
	add	w14, w20, w14
	add	w14, w21, w14
	mla.4s	v2, v1, v1
	addv.4s	s0, v2
	fmov	w3, s0
	add	w13, w3, w13
	add	x0, x0, x9
	add	x16, x16, x11
	subs	x17, x17, #1
	b.ne	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x16, x4, x8, lsl #4
	stp	w1, w14, [x16]
	stp	w13, w15, [x16, #8]
	add	x2, x2, #16
	add	x8, x8, #1
	add	x10, x10, #16
	cmp	x8, x12
	b.ne	LBB0_2
LBB0_5:
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ssim_4x4xn_16bit
.subsections_via_symbols
