	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_cl_lookup_bos
_vc4_cl_lookup_bos:                     ## @vc4_cl_lookup_bos
	.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
	movq	16(%rdx), %rbx
	movl	(%rbx), %edi
	movl	%edi, (%rdx)
	testl	%edi, %edi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movq	___GFP_ZERO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%r14), %edx
	movl	$8, %esi
	callq	_kvmalloc_array
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%r15), %edi
	movl	(%r14), %edx
	movl	$8, %esi
	callq	_kvmalloc_array
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movl	4(%rbx), %edi
	callq	_u64_to_user_ptr
	movl	(%r15), %edx
	shll	$3, %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_29
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_29
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	callq	_DRM_ERROR
LBB0_7:
	movq	%r14, %rdi
	callq	_kvfree
	movq	8(%r15), %rdi
	callq	_kvfree
	movq	$0, 8(%r15)
LBB0_29:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_spin_lock
	cmpl	$0, (%r15)
	jle	LBB0_14
## %bb.11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	4(%rax), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%rbx,8), %rsi
	movq	%r13, %rdi
	callq	_idr_find
	testq	%rax, %rax
	je	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_drm_gem_object_get
	movq	8(%r15), %rax
	movq	%r12, (%rax,%rbx,8)
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_12
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
LBB0_15:
	cmpl	$0, (%r15)
	jle	LBB0_28
## %bb.16:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_to_vc4_bo
	movl	%eax, %edi
	callq	_vc4_bo_inc_usecnt
	testl	%eax, %eax
	jne	LBB0_18
## %bb.27:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_17
LBB0_28:
	movq	%r14, %rdi
	callq	_kvfree
	xorl	%r12d, %r12d
	jmp	LBB0_29
LBB0_21:
	movq	(%r14,%rbx,8), %rdx
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	testl	%r12d, %r12d
	je	LBB0_15
## %bb.22:
	negl	%r12d
	jmp	LBB0_23
LBB0_18:
	movl	%eax, %r12d
	testl	%ebx, %ebx
	je	LBB0_23
## %bb.19:
	incq	%rbx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_to_vc4_bo
	movl	%eax, %edi
	callq	_vc4_bo_dec_usecnt
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_20
LBB0_23:
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.24:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	callq	_drm_gem_object_put_unlocked
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_25
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Rendering requires BOs to validate\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate validated BO pointers\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Failed to allocate incoming GEM handles\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.3:                               ## @.str.3
	.asciz	"Failed to copy in GEM handles\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to look up GEM BO %d: %d\n"

	.no_dead_strip	_vc4_cl_lookup_bos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_cl_lookup_bos
_vc4_cl_lookup_bos:                     ; @vc4_cl_lookup_bos
	.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
	ldr	x22, [x2, #16]
	ldr	w0, [x22]
	str	w0, [x2]
	cbz	w0, LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x21, x1
Lloh0:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh3:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w1, #8
	bl	_kvmalloc_array
	str	x0, [x19, #8]
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w0, [x19]
	ldr	w2, [x20]
	mov	w1, #8
	bl	_kvmalloc_array
	mov	x20, x0
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w0, [x22, #4]
	bl	_u64_to_user_ptr
	mov	x1, x0
	ldr	w8, [x19]
	lsl	w2, w8, #3
	mov	x0, x20
	bl	_copy_from_user
	cbz	x0, LBB0_12
; %bb.4:
Lloh5:
	adrp	x0, l_.str.3@PAGE
Lloh6:
	add	x0, x0, l_.str.3@PAGEOFF
Lloh7:
	adrp	x8, _EFAULT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_8:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
	bl	_DRM_ERROR
LBB0_10:
	mov	x0, x20
	bl	_kvfree
	ldr	x0, [x19, #8]
	bl	_kvfree
	str	xzr, [x19, #8]
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
LBB0_12:
	mov	x0, x21
	bl	_spin_lock
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.13:
	mov	x24, #0
	add	x22, x21, #4
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x20, x24, lsl #3]
	mov	x0, x22
	bl	_idr_find
	cbz	x0, LBB0_22
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x23, x0
	bl	_drm_gem_object_get
	ldr	x8, [x19, #8]
	str	x23, [x8, x24, lsl #3]
	add	x24, x24, #1
	ldrsw	x8, [x19]
	cmp	x24, x8
	b.lt	LBB0_14
LBB0_16:
	mov	x0, x21
	bl	_spin_unlock
LBB0_17:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.18:
	mov	x22, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x22, lsl #3]
	bl	_to_vc4_bo
	bl	_vc4_bo_inc_usecnt
	cbnz	w0, LBB0_24
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.lt	LBB0_19
LBB0_21:
	mov	x0, x20
	bl	_kvfree
	mov	w21, #0
	b	LBB0_11
LBB0_22:
	ldr	x8, [x20, x24, lsl #3]
	stp	x24, x8, [sp]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_DEBUG
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_spin_unlock
	cbz	w22, LBB0_17
; %bb.23:
	neg	w21, w22
	b	LBB0_27
LBB0_24:
	mov	x21, x0
	cbz	w22, LBB0_27
; %bb.25:
	sub	x22, x22, #1
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x22, lsl #3]
	bl	_to_vc4_bo
	bl	_vc4_bo_dec_usecnt
	add	x8, x22, #1
	sub	x22, x22, #1
	cmp	x8, #1
	b.gt	LBB0_26
LBB0_27:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.28:
	mov	x22, #0
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x22, lsl #3]
	cbz	x0, LBB0_10
; %bb.30:                               ;   in Loop: Header=BB0_29 Depth=1
	bl	_drm_gem_object_put_unlocked
	add	x22, x22, #1
	ldrsw	x8, [x19]
	cmp	x22, x8
	b.lt	LBB0_29
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Rendering requires BOs to validate\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate validated BO pointers\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Failed to allocate incoming GEM handles\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.3:                               ; @.str.3
	.asciz	"Failed to copy in GEM handles\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to look up GEM BO %d: %d\n"

	.no_dead_strip	_vc4_cl_lookup_bos
.subsections_via_symbols
