	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nlmeans_prefilter
_nlmeans_prefilter:                     ## @nlmeans_prefilter
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	56(%rdi), %edi
	callq	_hb_lock
	cmpl	$1, (%rbx)
	je	LBB0_39
## %bb.1:
	movq	_NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_7
## %bb.2:
	movq	_NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_7
## %bb.3:
	movq	_NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_7
## %bb.4:
	movq	_NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_7
## %bb.5:
	movq	_NLMEANS_PREFILTER_MODE_CSM3X3@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_NLMEANS_PREFILTER_MODE_CSM5X5@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_38
LBB0_7:
	movl	%r14d, -72(%rbp)                ## 4-byte Spill
	movq	8(%rbx), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	16(%rbx), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movslq	24(%rbx), %r14
	movl	28(%rbx), %eax
	movq	%rbx, -136(%rbp)                ## 8-byte Spill
	movl	32(%rbx), %ebx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	(%rax,%r14,2), %r13d
	leal	(%rbx,%r14,2), %eax
	movl	%r13d, %edi
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	imull	%eax, %edi
	shll	$2, %edi
	callq	_malloc
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%r14,4), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%r13d, %eax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	imull	%r14d, %eax
	cltq
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	movslq	%r13d, %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.8:
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	(,%rax,4), %r14
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	-112(%rbp), %r15                ## 8-byte Reload
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_memcpy
	addq	%r14, %r12
	addq	%r14, %r15
	decq	%rbx
	jne	LBB0_9
LBB0_10:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rax,%rcx,4), %r14
	movq	_NLMEANS_PREFILTER_MODE_CSM5X5@GOTPCREL(%rip), %rax
	movl	-72(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, (%rax)
	je	LBB0_12
## %bb.11:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$5, %r9d
	callq	_nlmeans_filter_csm
	jmp	LBB0_23
LBB0_12:
	movq	_NLMEANS_PREFILTER_MODE_CSM3X3@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_14
## %bb.13:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$3, %r9d
	callq	_nlmeans_filter_csm
	jmp	LBB0_23
LBB0_14:
	movq	_NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_16
## %bb.15:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$5, %r9d
	callq	_nlmeans_filter_median
	jmp	LBB0_23
LBB0_16:
	movq	_NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$3, %r9d
	callq	_nlmeans_filter_median
	jmp	LBB0_23
LBB0_18:
	movq	_NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_20
## %bb.19:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$5, %r9d
	jmp	LBB0_22
LBB0_20:
	movq	_NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_23
## %bb.21:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movl	$3, %r9d
LBB0_22:
	callq	_nlmeans_filter_mean
LBB0_23:
	movq	_NLMEANS_PREFILTER_MODE_EDGEBOOST@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_25
## %bb.24:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_nlmeans_filter_edgeboost
LBB0_25:
	movq	_NLMEANS_PREFILTER_MODE_REDUCE50@GOTPCREL(%rip), %rcx
	movq	_NLMEANS_PREFILTER_MODE_REDUCE25@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ebx, (%rcx)
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_27
## %bb.26:
	xorl	%ecx, %ecx
	testl	%ebx, %eax
	setne	%cl
	leal	(%rcx,%rcx), %r15d
	incl	%r15d
	movl	$1, %esi
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jg	LBB0_30
	jmp	LBB0_36
LBB0_27:
	testl	%ebx, %eax
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	je	LBB0_36
## %bb.28:
	movl	$1, %r15d
	movl	$3, %esi
	testl	%eax, %eax
	jle	LBB0_36
LBB0_30:
	leal	(%r15,%rsi), %edi
	movl	%eax, %r9d
	movl	%r13d, %r8d
	movl	%r8d, %r10d
	andl	$-2, %r10d
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leaq	4(%rax), %rbx
	movq	-104(%rbp), %rax                ## 8-byte Reload
	leaq	(,%rax,4), %r11
	movq	-112(%rbp), %rax                ## 8-byte Reload
	leaq	4(%rax), %rcx
	xorl	%r12d, %r12d
	movl	%r13d, -116(%rbp)               ## 4-byte Spill
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_31 Depth=1
	incq	%r12
	addq	%r11, %rbx
	addq	%r11, %rcx
	cmpq	%r9, %r12
	je	LBB0_36
LBB0_31:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_40 Depth 2
	testl	%r13d, %r13d
	jle	LBB0_35
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	xorl	%r14d, %r14d
	cmpl	$1, %r13d
	je	LBB0_33
	.p2align	4, 0x90
LBB0_40:                                ##   Parent Loop BB0_31 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-4(%rbx,%r14,4), %edx
	imull	%esi, %edx
	movl	-4(%rcx,%r14,4), %eax
	imull	%r15d, %eax
	addl	%edx, %eax
	cltd
	idivl	%edi
	movl	%eax, -4(%rbx,%r14,4)
	movl	(%rbx,%r14,4), %edx
	imull	%esi, %edx
	movl	(%rcx,%r14,4), %eax
	imull	%r15d, %eax
	addl	%edx, %eax
	cltd
	idivl	%edi
	movl	%eax, (%rbx,%r14,4)
	addq	$2, %r14
	cmpq	%r14, %r10
	jne	LBB0_40
LBB0_33:                                ##   in Loop: Header=BB0_31 Depth=1
	testb	$1, %r8b
	je	LBB0_35
## %bb.34:                              ##   in Loop: Header=BB0_31 Depth=1
	movq	%r12, %rax
	imulq	-104(%rbp), %rax                ## 8-byte Folded Reload
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	movq	%r9, %r13
	movq	%r8, %r9
	leaq	(%rdx,%rax,4), %r8
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	leaq	(%rdx,%rax,4), %rax
	movl	(%r8,%r14,4), %edx
	imull	%esi, %edx
	movl	(%rax,%r14,4), %eax
	imull	%r15d, %eax
	addl	%edx, %eax
	cltd
	idivl	%edi
	movl	%eax, (%r8,%r14,4)
	movq	%r9, %r8
	movq	%r13, %r9
	movl	-116(%rbp), %r13d               ## 4-byte Reload
	jmp	LBB0_35
LBB0_36:
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_nlmeans_border
	movq	-136(%rbp), %rbx                ## 8-byte Reload
	movq	%r14, 40(%rbx)
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 48(%rbx)
	movq	_NLMEANS_PREFILTER_MODE_PASSTHRU@GOTPCREL(%rip), %rax
	movl	-72(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, (%rax)
	je	LBB0_38
## %bb.37:
	movq	%r14, 8(%rbx)
	movq	%rdx, 16(%rbx)
LBB0_38:
	movl	$1, (%rbx)
LBB0_39:
	movl	56(%rbx), %edi
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hb_unlock                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NLMEANS_PREFILTER_MODE_MEAN3X3,4,2 ## @NLMEANS_PREFILTER_MODE_MEAN3X3
	.comm	_NLMEANS_PREFILTER_MODE_MEAN5X5,4,2 ## @NLMEANS_PREFILTER_MODE_MEAN5X5
	.comm	_NLMEANS_PREFILTER_MODE_MEDIAN3X3,4,2 ## @NLMEANS_PREFILTER_MODE_MEDIAN3X3
	.comm	_NLMEANS_PREFILTER_MODE_MEDIAN5X5,4,2 ## @NLMEANS_PREFILTER_MODE_MEDIAN5X5
	.comm	_NLMEANS_PREFILTER_MODE_CSM3X3,4,2 ## @NLMEANS_PREFILTER_MODE_CSM3X3
	.comm	_NLMEANS_PREFILTER_MODE_CSM5X5,4,2 ## @NLMEANS_PREFILTER_MODE_CSM5X5
	.comm	_NLMEANS_PREFILTER_MODE_EDGEBOOST,4,2 ## @NLMEANS_PREFILTER_MODE_EDGEBOOST
	.comm	_NLMEANS_PREFILTER_MODE_REDUCE50,4,2 ## @NLMEANS_PREFILTER_MODE_REDUCE50
	.comm	_NLMEANS_PREFILTER_MODE_REDUCE25,4,2 ## @NLMEANS_PREFILTER_MODE_REDUCE25
	.comm	_NLMEANS_PREFILTER_MODE_PASSTHRU,4,2 ## @NLMEANS_PREFILTER_MODE_PASSTHRU
	.no_dead_strip	_nlmeans_prefilter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nlmeans_prefilter
_nlmeans_prefilter:                     ; @nlmeans_prefilter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #56]
	bl	_hb_lock
	ldr	w8, [x19]
	cmp	w8, #1
	b.eq	LBB0_36
; %bb.1:
Lloh0:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _NLMEANS_PREFILTER_MODE_CSM5X5@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NLMEANS_PREFILTER_MODE_CSM5X5@GOTPAGEOFF]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.2:
Lloh5:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPAGE
Lloh6:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.4:
Lloh11:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.5:
Lloh14:
	adrp	x8, _NLMEANS_PREFILTER_MODE_CSM3X3@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_CSM3X3@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x9]
	tst	w8, w20
	b.eq	LBB0_35
LBB0_7:
	ldp	x28, x8, [x19, #8]
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	ldp	w21, w9, [x19, #24]
                                        ; kill: def $w21 killed $w21 def $x21
	sxtw	x21, w21
	ldr	w22, [x19, #32]
	lsl	w8, w21, #1
	str	w9, [sp, #20]                   ; 4-byte Folded Spill
	add	w26, w9, w8
	add	w27, w22, w8
	mul	w8, w26, w27
	lsl	w0, w8, #2
	bl	_malloc
	mov	x24, x0
	add	x8, x0, x21, lsl #2
	mul	w9, w26, w21
	add	x8, x8, w9, sxtw #2
	stp	x21, x8, [sp]                   ; 16-byte Folded Spill
	mov	x21, x22
	cmp	w22, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x25, #0
	mov	x8, x26
	sbfiz	x22, x8, #2, #32
	mov	x23, x21
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x24, x25
	add	x1, x28, x25
	mov	x2, x26
	bl	_memcpy
	add	x25, x25, x22
	subs	x23, x23, #1
	b.ne	LBB0_9
LBB0_10:
Lloh17:
	adrp	x8, _NLMEANS_PREFILTER_MODE_CSM5X5@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_CSM5X5@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x1, x25
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	mov	x2, x22
	mov	x23, x21
	mov	x3, x23
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	mov	x4, x21
	mov	w5, #5
	bl	_nlmeans_filter_csm
	b	LBB0_23
LBB0_12:
Lloh20:
	adrp	x8, _NLMEANS_PREFILTER_MODE_CSM3X3@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_CSM3X3@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_14
; %bb.13:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x1, x25
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	mov	x2, x22
	mov	x23, x21
	mov	x3, x23
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	mov	x4, x21
	mov	w5, #3
	bl	_nlmeans_filter_csm
	b	LBB0_23
LBB0_14:
Lloh23:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEDIAN5X5@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_16
; %bb.15:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x1, x25
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	mov	x2, x22
	mov	x23, x21
	mov	x3, x23
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	mov	x4, x21
	mov	w5, #5
	bl	_nlmeans_filter_median
	b	LBB0_23
LBB0_16:
Lloh26:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPAGE
Lloh27:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEDIAN3X3@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w20
	ldr	w22, [sp, #20]                  ; 4-byte Folded Reload
	mov	x23, x21
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	b.eq	LBB0_18
; %bb.17:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x25
	mov	x2, x22
	mov	x3, x23
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	mov	x4, x21
	mov	w5, #3
	bl	_nlmeans_filter_median
	b	LBB0_23
LBB0_18:
Lloh29:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEAN5X5@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_20
; %bb.19:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x25
	mov	x2, x22
	mov	x3, x23
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	mov	x4, x21
	mov	w5, #5
	b	LBB0_22
LBB0_20:
Lloh32:
	adrp	x8, _NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPAGE
Lloh33:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_MEAN3X3@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	tst	w8, w20
	ldr	x21, [sp]                       ; 8-byte Folded Reload
	b.eq	LBB0_23
; %bb.21:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x25
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	mov	w5, #3
LBB0_22:
	bl	_nlmeans_filter_mean
LBB0_23:
Lloh35:
	adrp	x8, _NLMEANS_PREFILTER_MODE_EDGEBOOST@GOTPAGE
Lloh36:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_EDGEBOOST@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_25
; %bb.24:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x25
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	bl	_nlmeans_filter_edgeboost
LBB0_25:
Lloh38:
	adrp	x8, _NLMEANS_PREFILTER_MODE_REDUCE50@GOTPAGE
Lloh39:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_REDUCE50@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x8]
Lloh41:
	adrp	x8, _NLMEANS_PREFILTER_MODE_REDUCE25@GOTPAGE
Lloh42:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_REDUCE25@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	and	w8, w8, w20
	tst	w9, w20
	b.eq	LBB0_27
; %bb.26:
	cmp	w8, #0
	mov	w8, #3
	csinc	w8, w8, wzr, ne
	mov	w9, #1
	cmp	w27, #1
	b.ge	LBB0_29
	b	LBB0_33
LBB0_27:
	cbz	w8, LBB0_33
; %bb.28:
	mov	w8, #1
	mov	w9, #3
	cmp	w27, #1
	b.lt	LBB0_33
LBB0_29:
	mov	x10, #0
	add	w11, w8, w9
	mov	x12, x26
	sbfiz	x12, x12, #2, #32
	mov	x13, x24
	b	LBB0_31
LBB0_30:                                ;   in Loop: Header=BB0_31 Depth=1
	add	x10, x10, #1
	add	x28, x28, x12
	add	x13, x13, x12
	cmp	x10, x27
	b.eq	LBB0_33
LBB0_31:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_32 Depth 2
	mov	x14, x26
	mov	x15, x13
	mov	x16, x28
	cmp	w26, #1
	b.lt	LBB0_30
LBB0_32:                                ;   Parent Loop BB0_31 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w17, [x15]
	ldr	w0, [x16], #4
	mul	w17, w17, w9
	madd	w17, w0, w8, w17
	sdiv	w17, w17, w11
	str	w17, [x15], #4
	subs	x14, x14, #1
	b.ne	LBB0_32
	b	LBB0_30
LBB0_33:
	mov	x0, x24
	mov	x1, x22
	mov	x2, x23
	mov	x3, x21
	bl	_nlmeans_border
	stp	x24, x25, [x19, #40]
Lloh44:
	adrp	x8, _NLMEANS_PREFILTER_MODE_PASSTHRU@GOTPAGE
Lloh45:
	ldr	x8, [x8, _NLMEANS_PREFILTER_MODE_PASSTHRU@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_35
; %bb.34:
	stp	x24, x25, [x19, #8]
LBB0_35:
	mov	w8, #1
	str	w8, [x19]
LBB0_36:
	ldr	w0, [x19, #56]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_hb_unlock
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_NLMEANS_PREFILTER_MODE_MEAN3X3,4,2 ; @NLMEANS_PREFILTER_MODE_MEAN3X3
	.comm	_NLMEANS_PREFILTER_MODE_MEAN5X5,4,2 ; @NLMEANS_PREFILTER_MODE_MEAN5X5
	.comm	_NLMEANS_PREFILTER_MODE_MEDIAN3X3,4,2 ; @NLMEANS_PREFILTER_MODE_MEDIAN3X3
	.comm	_NLMEANS_PREFILTER_MODE_MEDIAN5X5,4,2 ; @NLMEANS_PREFILTER_MODE_MEDIAN5X5
	.comm	_NLMEANS_PREFILTER_MODE_CSM3X3,4,2 ; @NLMEANS_PREFILTER_MODE_CSM3X3
	.comm	_NLMEANS_PREFILTER_MODE_CSM5X5,4,2 ; @NLMEANS_PREFILTER_MODE_CSM5X5
	.comm	_NLMEANS_PREFILTER_MODE_EDGEBOOST,4,2 ; @NLMEANS_PREFILTER_MODE_EDGEBOOST
	.comm	_NLMEANS_PREFILTER_MODE_REDUCE50,4,2 ; @NLMEANS_PREFILTER_MODE_REDUCE50
	.comm	_NLMEANS_PREFILTER_MODE_REDUCE25,4,2 ; @NLMEANS_PREFILTER_MODE_REDUCE25
	.comm	_NLMEANS_PREFILTER_MODE_PASSTHRU,4,2 ; @NLMEANS_PREFILTER_MODE_PASSTHRU
	.no_dead_strip	_nlmeans_prefilter
.subsections_via_symbols
