	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nlmeans_opencl_init
_nlmeans_opencl_init:                   ## @nlmeans_opencl_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movl	4(%r12), %eax
	movl	8(%r12), %ecx
	addl	%eax, %eax
	leal	(%rax,%rax,4), %eax
	movl	%eax, (%r12)
	testb	$1, %cl
	jne	LBB0_2
## %bb.1:
	orl	$1, %ecx
	movl	%ecx, 8(%r12)
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
LBB0_2:
	movl	12(%r12), %ecx
	testb	$1, %cl
	je	LBB0_3
## %bb.4:
	cmpl	$0, 16(%r12)
	je	LBB0_5
LBB0_6:
	cmpl	$0, 20(%r12)
	je	LBB0_7
LBB0_8:
	movq	_ff_opencl_source_nlmeans@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_ff_opencl_filter_load_program
	testl	%eax, %eax
	js	LBB0_10
## %bb.9:
	imull	%r15d, %r13d
	leal	(,%r13,4), %ebx
	movq	96(%r12), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	leaq	-44(%rbp), %r15
	xorl	%edx, %edx
	movq	%r15, %rcx
	callq	_clCreateCommandQueue
	movl	%eax, 28(%r12)
	movq	_EIO@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movl	104(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdx
	callq	_clCreateKernel
	movq	%rax, 88(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movl	104(%r12), %edi
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdx
	callq	_clCreateKernel
	movq	%rax, 80(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movl	104(%r12), %edi
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdx
	callq	_clCreateKernel
	movq	%rax, 72(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.8(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movl	104(%r12), %edi
	leaq	L_.str.9(%rip), %rsi
	movq	%r15, %rdx
	callq	_clCreateKernel
	movq	%rax, 64(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.10(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movq	96(%r12), %rax
	movl	(%rax), %edi
	shll	$4, %r13d
	xorl	%esi, %esi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_clCreateBuffer
	movq	%rax, 56(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.11(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movq	96(%r12), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_clCreateBuffer
	movq	%rax, 48(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.12(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movq	96(%r12), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	movl	%ebx, %edx
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_clCreateBuffer
	movq	%rax, 40(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.13(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movq	96(%r12), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_clCreateBuffer
	movq	%rax, 32(%r12)
	movl	(%r14), %edi
	callq	_AVERROR
	movl	-44(%rbp), %edx
	leaq	L_.str.14(%rip), %rsi
	movl	%eax, %edi
	callq	_CL_FAIL_ON_ERROR
	movl	$1, 24(%r12)
	jmp	LBB0_11
LBB0_3:
	orl	$1, %ecx
	movl	%ecx, 12(%r12)
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	cmpl	$0, 16(%r12)
	jne	LBB0_6
LBB0_5:
	movl	8(%r12), %eax
	movl	%eax, 16(%r12)
	cmpl	$0, 20(%r12)
	jne	LBB0_8
LBB0_7:
	movl	12(%r12), %eax
	movl	%eax, 20(%r12)
	jmp	LBB0_8
LBB0_10:
	movl	%eax, %ebx
	movq	88(%r12), %rdi
	callq	_CL_RELEASE_KERNEL
	movq	80(%r12), %rdi
	callq	_CL_RELEASE_KERNEL
	movq	72(%r12), %rdi
	callq	_CL_RELEASE_KERNEL
	movq	64(%r12), %rdi
	callq	_CL_RELEASE_KERNEL
	movq	56(%r12), %rdi
	callq	_CL_RELEASE_MEMORY
	movq	48(%r12), %rdi
	callq	_CL_RELEASE_MEMORY
	movq	40(%r12), %rdi
	callq	_CL_RELEASE_MEMORY
	movq	32(%r12), %rdi
	callq	_CL_RELEASE_MEMORY
	movl	28(%r12), %edi
	callq	_CL_RELEASE_QUEUE
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"research_size should be odd, set to %d"

L_.str.1:                               ## @.str.1
	.asciz	"patch_size should be odd, set to %d"

	.comm	_ff_opencl_source_nlmeans,4,2   ## @ff_opencl_source_nlmeans
	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Failed to create OpenCL command queue %d.\n"

L_.str.3:                               ## @.str.3
	.asciz	"vert_sum"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to create vert_sum kernel %d.\n"

L_.str.5:                               ## @.str.5
	.asciz	"horiz_sum"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to create horiz_sum kernel %d.\n"

L_.str.7:                               ## @.str.7
	.asciz	"weight_accum"

L_.str.8:                               ## @.str.8
	.asciz	"Failed to create accum kernel %d.\n"

L_.str.9:                               ## @.str.9
	.asciz	"average"

L_.str.10:                              ## @.str.10
	.asciz	"Failed to create average kernel %d.\n"

L_.str.11:                              ## @.str.11
	.asciz	"Failed to create integral image %d.\n"

L_.str.12:                              ## @.str.12
	.asciz	"Failed to create weight buffer %d.\n"

L_.str.13:                              ## @.str.13
	.asciz	"Failed to create sum buffer %d.\n"

L_.str.14:                              ## @.str.14
	.asciz	"Failed to create overflow buffer %d.\n"

	.no_dead_strip	_nlmeans_opencl_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nlmeans_opencl_init
_nlmeans_opencl_init:                   ; @nlmeans_opencl_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0]
	ldp	w9, w8, [x22, #4]
	add	w9, w9, w9, lsl #2
	lsl	w9, w9, #1
	str	w9, [x22]
	tbz	w8, #0, LBB0_6
; %bb.1:
	ldr	w8, [x22, #12]
	tbz	w8, #0, LBB0_7
LBB0_2:
	ldr	w8, [x22, #16]
	cbz	w8, LBB0_8
LBB0_3:
	ldr	w8, [x22, #20]
	cbz	w8, LBB0_9
LBB0_4:
Lloh0:
	adrp	x1, _ff_opencl_source_nlmeans@GOTPAGE
Lloh1:
	ldr	x1, [x1, _ff_opencl_source_nlmeans@GOTPAGEOFF]
	mov	w23, #1
	mov	x0, x21
	mov	w2, #1
	bl	_ff_opencl_filter_load_program
	tbnz	w0, #31, LBB0_10
; %bb.5:
	mul	w21, w20, w19
	lsl	w19, w21, #2
	ldr	x8, [x22, #96]
	ldp	w0, w1, [x8]
	add	x3, sp, #12
	mov	w2, #0
	bl	_clCreateCommandQueue
	str	w0, [x22, #28]
Lloh2:
	adrp	x20, _EIO@GOTPAGE
Lloh3:
	ldr	x20, [x20, _EIO@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	w0, [x22, #104]
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #12
	bl	_clCreateKernel
	str	x0, [x22, #88]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	w0, [x22, #104]
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x2, sp, #12
	bl	_clCreateKernel
	str	x0, [x22, #80]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	w0, [x22, #104]
Lloh14:
	adrp	x1, l_.str.7@PAGE
Lloh15:
	add	x1, x1, l_.str.7@PAGEOFF
	add	x2, sp, #12
	bl	_clCreateKernel
	str	x0, [x22, #72]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh16:
	adrp	x1, l_.str.8@PAGE
Lloh17:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	w0, [x22, #104]
Lloh18:
	adrp	x1, l_.str.9@PAGE
Lloh19:
	add	x1, x1, l_.str.9@PAGEOFF
	add	x2, sp, #12
	bl	_clCreateKernel
	str	x0, [x22, #64]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh20:
	adrp	x1, l_.str.10@PAGE
Lloh21:
	add	x1, x1, l_.str.10@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	x8, [x22, #96]
	ldr	w0, [x8]
	lsl	w2, w21, #4
	add	x4, sp, #12
	mov	w1, #0
	mov	x3, #0
	bl	_clCreateBuffer
	str	x0, [x22, #56]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh22:
	adrp	x1, l_.str.11@PAGE
Lloh23:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	x8, [x22, #96]
	ldr	w0, [x8]
	add	x4, sp, #12
	mov	w1, #0
	mov	x2, x19
	mov	x3, #0
	bl	_clCreateBuffer
	str	x0, [x22, #48]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh24:
	adrp	x1, l_.str.12@PAGE
Lloh25:
	add	x1, x1, l_.str.12@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	x8, [x22, #96]
	ldr	w0, [x8]
	add	x4, sp, #12
	mov	w1, #0
	mov	x2, x19
	mov	x3, #0
	bl	_clCreateBuffer
	str	x0, [x22, #40]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh26:
	adrp	x1, l_.str.13@PAGE
Lloh27:
	add	x1, x1, l_.str.13@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	ldr	x8, [x22, #96]
	ldr	w0, [x8]
	add	x4, sp, #12
	mov	w1, #0
	mov	w2, #4
	mov	x3, #0
	bl	_clCreateBuffer
	str	x0, [x22, #32]
	ldr	w0, [x20]
	bl	_AVERROR
	ldr	w2, [sp, #12]
Lloh28:
	adrp	x1, l_.str.14@PAGE
Lloh29:
	add	x1, x1, l_.str.14@PAGEOFF
	bl	_CL_FAIL_ON_ERROR
	mov	w21, #0
	str	w23, [x22, #24]
	b	LBB0_11
LBB0_6:
	orr	w3, w8, #0x1
	str	w3, [x22, #8]
Lloh30:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x2, l_.str@PAGE
Lloh34:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
	ldr	w8, [x22, #12]
	tbnz	w8, #0, LBB0_2
LBB0_7:
	orr	w3, w8, #0x1
	str	w3, [x22, #12]
Lloh35:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
Lloh38:
	adrp	x2, l_.str.1@PAGE
Lloh39:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_av_log
	ldr	w8, [x22, #16]
	cbnz	w8, LBB0_3
LBB0_8:
	ldr	w8, [x22, #8]
	str	w8, [x22, #16]
	ldr	w8, [x22, #20]
	cbnz	w8, LBB0_4
LBB0_9:
	ldr	w8, [x22, #12]
	str	w8, [x22, #20]
	b	LBB0_4
LBB0_10:
	mov	x21, x0
	ldr	x0, [x22, #88]
	bl	_CL_RELEASE_KERNEL
	ldr	x0, [x22, #80]
	bl	_CL_RELEASE_KERNEL
	ldr	x0, [x22, #72]
	bl	_CL_RELEASE_KERNEL
	ldr	x0, [x22, #64]
	bl	_CL_RELEASE_KERNEL
	ldr	x0, [x22, #56]
	bl	_CL_RELEASE_MEMORY
	ldr	x0, [x22, #48]
	bl	_CL_RELEASE_MEMORY
	ldr	x0, [x22, #40]
	bl	_CL_RELEASE_MEMORY
	ldr	x0, [x22, #32]
	bl	_CL_RELEASE_MEMORY
	ldr	w0, [x22, #28]
	bl	_CL_RELEASE_QUEUE
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"research_size should be odd, set to %d"

l_.str.1:                               ; @.str.1
	.asciz	"patch_size should be odd, set to %d"

	.comm	_ff_opencl_source_nlmeans,4,2   ; @ff_opencl_source_nlmeans
	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Failed to create OpenCL command queue %d.\n"

l_.str.3:                               ; @.str.3
	.asciz	"vert_sum"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to create vert_sum kernel %d.\n"

l_.str.5:                               ; @.str.5
	.asciz	"horiz_sum"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to create horiz_sum kernel %d.\n"

l_.str.7:                               ; @.str.7
	.asciz	"weight_accum"

l_.str.8:                               ; @.str.8
	.asciz	"Failed to create accum kernel %d.\n"

l_.str.9:                               ; @.str.9
	.asciz	"average"

l_.str.10:                              ; @.str.10
	.asciz	"Failed to create average kernel %d.\n"

l_.str.11:                              ; @.str.11
	.asciz	"Failed to create integral image %d.\n"

l_.str.12:                              ; @.str.12
	.asciz	"Failed to create weight buffer %d.\n"

l_.str.13:                              ; @.str.13
	.asciz	"Failed to create sum buffer %d.\n"

l_.str.14:                              ; @.str.14
	.asciz	"Failed to create overflow buffer %d.\n"

	.no_dead_strip	_nlmeans_opencl_init
.subsections_via_symbols
