	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opencl_pool_alloc
_opencl_pool_alloc:                     ## @opencl_pool_alloc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$16, %edi
	callq	_av_mallocz
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movq	%rax, %r14
	movl	8(%r15), %edi
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	leaq	-44(%rbp), %r8
	leaq	-56(%rbp), %r9
	xorl	%esi, %esi
	callq	_opencl_get_plane_format
	movl	%eax, %r12d
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	cmpl	%eax, %r12d
	je	LBB0_7
## %bb.2:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r12d, %r12d
	js	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	$0, -56(%rbp)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_CL_MEM_READ_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %r12
	movq	%r12, %rdx
	movq	%r13, %rcx
	xorl	%r8d, %r8d
	leaq	-48(%rbp), %r9
	callq	_clCreateImage
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movl	8(%r15), %edi
	movl	(%r15), %ecx
	movl	4(%r15), %edx
	movl	%ebx, %esi
	movq	%r12, %r8
	movq	%r13, %r9
	callq	_opencl_get_plane_format
	movl	%eax, %r12d
	movq	_ENOENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	cmpl	%eax, %r12d
	jne	LBB0_3
LBB0_7:
	movl	%ebx, (%r14)
	movq	_opencl_pool_free@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	movl	$16, %esi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_av_buffer_create
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_12
	jmp	LBB0_8
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%rbp), %r8d
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %ecx
	callq	_av_log
LBB0_8:
	movq	8(%r14), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	movl	$8, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	callq	_clReleaseMemObject
	movq	8(%r14), %rax
	movq	(%rax,%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	jne	LBB0_10
LBB0_11:
	movq	%r14, %rdi
	callq	_av_free
	xorl	%ebx, %ebx
LBB0_12:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_CL_MEM_READ_WRITE,4,2          ## @CL_MEM_READ_WRITE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create image for plane %d: %d.\n"

	.comm	_opencl_pool_free,4,2           ## @opencl_pool_free
	.no_dead_strip	_opencl_pool_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opencl_pool_alloc
_opencl_pool_alloc:                     ; @opencl_pool_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x23, [x8]
	mov	w0, #16
	bl	_av_mallocz
	cbz	x0, LBB0_12
; %bb.1:
	mov	x19, x0
	ldp	w2, w0, [x20, #4]
	ldr	w3, [x20]
	add	x4, sp, #8
	mov	x5, sp
	mov	w1, #0
	bl	_opencl_get_plane_format
	mov	x22, x0
Lloh0:
	adrp	x24, _ENOENT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ENOENT@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_AVERROR
	mov	w21, #0
	cmp	w22, w0
	b.eq	LBB0_6
; %bb.2:
	mov	x21, #0
Lloh2:
	adrp	x25, _CL_MEM_READ_WRITE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CL_MEM_READ_WRITE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	tbnz	w22, #31, LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	xzr, [sp]
	ldr	w0, [x23]
	ldr	w1, [x25]
	add	x2, sp, #8
	mov	x3, sp
	add	x5, sp, #12
	mov	x4, #0
	bl	_clCreateImage
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	str	x0, [x8, x21, lsl #3]
	add	x21, x21, #1
	ldp	w2, w0, [x20, #4]
	ldr	w3, [x20]
	add	x4, sp, #8
	mov	x5, sp
	mov	x1, x21
	bl	_opencl_get_plane_format
	mov	x22, x0
	ldr	w0, [x24]
	bl	_AVERROR
	cmp	w22, w0
	b.ne	LBB0_3
LBB0_6:
	str	w21, [x19]
Lloh4:
	adrp	x2, _opencl_pool_free@GOTPAGE
Lloh5:
	ldr	x2, [x2, _opencl_pool_free@GOTPAGEOFF]
	mov	x0, x19
	mov	w1, #16
	mov	x3, x20
	mov	w4, #0
	bl	_av_buffer_create
	cbnz	x0, LBB0_12
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w4, [sp, #12]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x21
	bl	_av_log
LBB0_8:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	cbz	x0, LBB0_11
; %bb.9:
	mov	w20, #8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	bl	_clReleaseMemObject
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x20]
	add	x20, x20, #8
	cbnz	x0, LBB0_10
LBB0_11:
	mov	x0, x19
	bl	_av_free
	mov	x0, #0
LBB0_12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_CL_MEM_READ_WRITE,4,2          ; @CL_MEM_READ_WRITE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create image for plane %d: %d.\n"

	.comm	_opencl_pool_free,4,2           ; @opencl_pool_free
	.no_dead_strip	_opencl_pool_alloc
.subsections_via_symbols
