	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nlmeans_filter_csm
_nlmeans_filter_csm:                    ## @nlmeans_filter_csm
	.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
                                        ## kill: def $r9d killed $r9d def $r9
                                        ## kill: def $r8d killed $r8d def $r8
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	jle	LBB0_12
## %bb.1:
	leal	1(%r9), %eax
	shrl	$31, %eax
	leal	(%r9,%rax), %esi
	incl	%esi
	sarl	%esi
	movl	%r9d, %eax
	decl	%eax
	shrl	$31, %eax
	leal	(%r9,%rax), %edi
	decl	%edi
	sarl	%edi
	negl	%edi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	leal	(%rdx,%r8,2), %eax
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movslq	%edi, %rbx
	cltq
	movl	%ecx, %ecx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	%edx, %ecx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movslq	%esi, %r12
	leaq	(,%rax,4), %rcx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	4(,%rax,4), %r13
	imulq	%rbx, %r13
	addq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	movl	%ebx, %r10d
	subl	%r12d, %r10d
	xorl	%eax, %eax
                                        ## implicit-def: $r8d
                                        ## implicit-def: $esi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	incq	%rax
	movq	-104(%rbp), %r13                ## 8-byte Reload
	addq	%rcx, %r13
	cmpq	-88(%rbp), %rax                 ## 8-byte Folded Reload
	je	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##       Child Loop BB0_5 Depth 3
                                        ##         Child Loop BB0_6 Depth 4
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	imulq	-72(%rbp), %rax                 ## 8-byte Folded Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rax,4), %rdx
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_5 Depth 3
                                        ##         Child Loop BB0_6 Depth 4
	movq	%r13, %r15
	movq	%rbx, %rax
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	cmpl	-48(%rbp), %edi                 ## 4-byte Folded Reload
	jl	LBB0_5
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%rdx,4), %eax
	movl	%r8d, %edi
	cmpl	%r8d, %eax
	jl	LBB0_22
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%esi, %edi
	cmpl	%esi, %eax
	jg	LBB0_22
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=2
	leal	(%r8,%rsi), %edi
	movl	%edi, %r15d
	shrl	$31, %r15d
	addl	%edi, %r15d
	sarl	%r15d
	leal	(%r15,%r8), %r9d
	movl	%r9d, %edi
	shrl	$31, %edi
	addl	%r9d, %edi
	sarl	%edi
	cmpl	%edi, %eax
	jl	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_4 Depth=2
	leal	(%r15,%rsi), %r9d
	movl	%r9d, %r14d
	shrl	$31, %r14d
	addl	%r9d, %r14d
	sarl	%r14d
	cmpl	%r14d, %eax
	jle	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	%r14d, %edi
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=3
	incq	%rax
	addq	$4, %r15
	cmpq	%r12, %rax
	je	LBB0_15
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ## =>    This Loop Header: Depth=3
                                        ##         Child Loop BB0_6 Depth 4
	movq	%r15, %rdi
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=4
	cmpl	%r8d, %r11d
	cmovll	%r11d, %r8d
	cmpl	%esi, %r11d
	cmovgl	%r11d, %esi
	addq	%rcx, %rdi
	cmpl	%r14d, %r10d
	je	LBB0_14
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_4 Depth=2
                                        ##       Parent Loop BB0_5 Depth=3
                                        ## =>      This Inner Loop Header: Depth=4
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=4
	cmpq	%r14, %rbx
	je	LBB0_14
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=4
	subq	$1, %r14
	setb	%r9b
	movl	(%rdi), %r11d
	cmpq	%rbx, %rax
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=4
	testb	%r9b, %r9b
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=3
	movl	%r11d, %esi
	movl	%r11d, %r8d
	jmp	LBB0_14
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=2
	addl	%r15d, %edi
	movl	%edi, %r9d
	shrl	$31, %r9d
	addl	%edi, %r9d
	sarl	%r9d
	movl	%r9d, %edi
	cmpl	%r9d, %eax
	jl	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_4 Depth=2
	addl	%r15d, %r14d
	movl	%r14d, %edi
	shrl	$31, %edi
	addl	%r14d, %edi
	sarl	%edi
	cmpl	%edi, %eax
	jle	LBB0_23
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_4 Depth=2
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movl	%edi, (%rax,%rdx,4)
LBB0_23:                                ##   in Loop: Header=BB0_4 Depth=2
	incq	%rdx
	addq	$4, %r13
	cmpq	-112(%rbp), %rdx                ## 8-byte Folded Reload
	jne	LBB0_4
	jmp	LBB0_11
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_nlmeans_filter_csm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nlmeans_filter_csm
_nlmeans_filter_csm:                    ; @nlmeans_filter_csm
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	.cfi_offset w19, -8
	.cfi_offset w20, -16
	.cfi_offset w21, -24
	.cfi_offset w22, -32
	.cfi_offset w23, -40
	.cfi_offset w24, -48
	.cfi_offset w25, -56
	.cfi_offset w26, -64
	add	w8, w5, #1
	add	w9, w5, #2
	cmp	w8, #0
	csinc	w9, w9, w5, lt
	cmp	w3, #1
	b.lt	LBB0_22
; %bb.1:
	mov	x8, #0
	asr	w9, w9, #1
	sub	w10, w5, #1
	cmp	w10, #0
	csel	w10, w5, w10, lt
	neg	w16, w10, asr #1
	add	w14, w2, w4, lsl #1
	sxtw	x10, w16
	sxtw	x11, w14
	mov	w12, w3
	sxtw	x13, w9
	sbfiz	x14, x14, #2, #32
	add	x15, x14, #4
	madd	x15, x15, x10, x0
	sub	w16, w16, w9
                                        ; implicit-def: $w3
                                        ; implicit-def: $w4
	mov	w17, w2
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x8, #1
	add	x15, x15, x14
	cmp	x8, x12
	b.eq	LBB0_22
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;         Child Loop BB0_17 Depth 4
	cmp	w2, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x5, #0
	mul	x6, x8, x11
	lsl	x7, x6, #2
	add	x6, x0, x7
	add	x7, x1, x7
	mov	x19, x15
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_15 Depth 3
                                        ;         Child Loop BB0_17 Depth 4
	mov	x20, x19
	mov	x21, x10
	cmp	w10, w9
	b.lt	LBB0_15
LBB0_6:                                 ;   in Loop: Header=BB0_5 Depth=2
	add	w20, w3, w4
	cmp	w20, #0
	cinc	w20, w20, lt
	asr	w20, w20, #1
	add	w21, w20, w3
	cmp	w21, #0
	cinc	w21, w21, lt
	asr	w25, w21, #1
	add	w21, w20, w4
	cmp	w21, #0
	cinc	w21, w21, lt
	asr	w23, w21, #1
	add	w21, w25, w20
	cmp	w21, #0
	cinc	w22, w21, lt
	add	w20, w23, w20
	cmp	w20, #0
	cinc	w21, w20, lt
	ldr	w20, [x6, x5, lsl #2]
	mov	x24, x3
	cmp	w20, w3
	b.lt	LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x24, x4
	cmp	w20, w4
	b.gt	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x24, x25
	cmp	w20, w25
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x24, x23
	cmp	w20, w23
	b.gt	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	asr	w24, w22, #1
	cmp	w20, w24
	b.lt	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	asr	w24, w21, #1
	cmp	w20, w24
	b.le	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=2
	str	w24, [x7, x5, lsl #2]
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x5, x5, #1
	add	x19, x19, #4
	cmp	x5, x17
	b.ne	LBB0_5
	b	LBB0_2
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=3
	add	x21, x21, #1
	add	x20, x20, #4
	cmp	x21, x13
	b.eq	LBB0_6
LBB0_15:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Loop Header: Depth=3
                                        ;         Child Loop BB0_17 Depth 4
	mov	x22, #0
	mov	x23, x20
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=4
	cmp	w24, w3
	csel	w3, w24, w3, lt
	cmp	w24, w4
	csel	w4, w24, w4, gt
	sub	x22, x22, #1
	add	x23, x23, x14
	cmp	w16, w22
	b.eq	LBB0_14
LBB0_17:                                ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ;       Parent Loop BB0_15 Depth=3
                                        ; =>      This Inner Loop Header: Depth=4
	cbnz	x21, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=4
	cmp	x10, x22
	b.eq	LBB0_14
LBB0_19:                                ;   in Loop: Header=BB0_17 Depth=4
	ldr	w24, [x23]
	cmp	x21, x10
	b.ne	LBB0_16
; %bb.20:                               ;   in Loop: Header=BB0_17 Depth=4
	cbnz	x22, LBB0_16
; %bb.21:                               ;   in Loop: Header=BB0_15 Depth=3
	mov	x4, x24
	mov	x3, x24
	b	LBB0_14
LBB0_22:
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_nlmeans_filter_csm
.subsections_via_symbols
