	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_get_bcl
_vc4_get_bcl:                           ## @vc4_get_bcl
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	128(%rsi), %r14
	callq	_to_vc4_dev
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rdi
	movl	$16, %esi
	callq	_roundup
	cmpq	(%r14), %rax
	jl	LBB0_5
## %bb.1:
	movq	8(%r14), %r15
	testq	%r15, %r15
	js	LBB0_5
## %bb.2:
	movq	16(%r14), %r12
	testq	%r12, %r12
	js	LBB0_5
## %bb.3:
	movslq	24(%r14), %rdx
	movq	_UINT_MAX@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shrq	$2, %rcx
	cmpq	%rdx, %rcx
	jbe	LBB0_5
## %bb.4:
	addq	%rax, %r15
	addq	%r15, %r12
	leaq	(%r12,%rdx,4), %rdi
	cmpq	%r12, %rdi
	jl	LBB0_5
## %bb.7:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	callq	_kvmalloc_array
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, %rcx
	movq	%rcx, (%r13)
	leaq	(%rax,%r15), %rcx
	movq	%rcx, 8(%r13)
	movq	%rax, %rcx
	addq	%r12, %rcx
	movq	%rcx, 120(%r13)
	movl	24(%r14), %ecx
	movl	%ecx, 16(%r13)
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %r13
	movl	36(%r14), %edi
	callq	_u64_to_user_ptr
	movq	(%r14), %rdx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r13
	movl	32(%r14), %edi
	callq	_u64_to_user_ptr
	movq	8(%r14), %rdx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_10
## %bb.12:
	movq	%rbx, %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rbx
	movl	28(%r14), %edi
	callq	_u64_to_user_ptr
	movq	16(%r14), %rdx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_13
LBB0_10:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%edi, %edi
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_22:
	callq	_kvfree
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_13:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	_VC4_BO_TYPE_BCL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_vc4_bo_create
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r12, %rdi
	callq	_PTR_ERR
	jmp	LBB0_20
LBB0_15:
	movq	%r12, 56(%rbx)
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_to_vc4_bo
	leaq	112(%rbx), %rsi
	movq	%rax, %rdi
	callq	_list_add_tail
	movq	56(%rbx), %rax
	movq	(%rax), %rcx
	movq	%rcx, 104(%rbx)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 96(%rbx)
	movq	8(%rax), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	(%rsi,%rdi), %rax
	movq	%rax, 88(%rbx)
	addq	%rcx, %rdi
	movq	%rdi, 80(%rbx)
	leaq	(%rsi,%r15), %rax
	movq	%rax, 72(%rbx)
	addq	%r15, %rcx
	movq	%rcx, 64(%rbx)
	movups	8(%r14), %xmm0
	movq	%rbx, %r14
	movups	%xmm0, 24(%rbx)
	movq	%r13, %rdi
	movq	%rbx, %rcx
	callq	_vc4_validate_bin_cl
	testl	%eax, %eax
	jne	LBB0_20
## %bb.16:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_vc4_validate_shader_recs
	testl	%eax, %eax
	jne	LBB0_20
## %bb.17:
	cmpq	$0, 48(%r14)
	je	LBB0_19
## %bb.18:
	leaq	44(%r14), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_vc4_v3d_bin_bo_get
	testl	%eax, %eax
	jne	LBB0_20
LBB0_19:
	movl	40(%r14), %esi
	movq	%r13, %rdi
	movq	$-1, %rdx
	movl	$1, %ecx
	callq	_vc4_wait_for_seqno
LBB0_20:
	movl	%eax, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"overflow in exec arguments\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate storage for copying in bin/render CLs.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_VC4_BO_TYPE_BCL,4,2            ## @VC4_BO_TYPE_BCL
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't allocate BO for binning\n"

	.no_dead_strip	_vc4_get_bcl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_get_bcl
_vc4_get_bcl:                           ; @vc4_get_bcl
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x20, x0
	ldr	x26, [x1, #128]
	bl	_to_vc4_dev
	mov	x22, x0
	ldr	x0, [x26]
	mov	w1, #16
	bl	_roundup
	ldr	x8, [x26]
	cmp	x0, x8
	b.lt	LBB0_4
; %bb.1:
	ldr	x8, [x26, #8]
	tbnz	x8, #63, LBB0_4
; %bb.2:
	ldr	x9, [x26, #16]
	tbnz	x9, #63, LBB0_4
; %bb.3:
	mov	x23, x0
	add	x27, x8, x0
	add	x24, x27, x9
	ldrsw	x8, [x26, #24]
	add	x0, x24, x8, lsl #2
Lloh0:
	adrp	x9, _UINT_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UINT_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x9, [x9]
	cmp	x8, x9, lsr #2
	ccmp	x0, x24, #8, lo
	b.ge	LBB0_7
LBB0_4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	x19, #0
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_6:
	mov	x0, x19
	bl	_kvfree
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	w1, #1
	bl	_kvmalloc_array
	mov	x19, x0
	cbz	x0, LBB0_12
; %bb.8:
	add	x8, x19, x23
	add	x9, x19, x27
	stp	x8, x9, [x21]
	add	x8, x19, x24
	str	x8, [x21, #120]
	ldr	w8, [x26, #24]
	str	w8, [x21, #16]
	ldr	w0, [x26, #36]
	bl	_u64_to_user_ptr
	mov	x1, x0
	ldr	x2, [x26]
	mov	x0, x19
	bl	_copy_from_user
	cbnz	x0, LBB0_11
; %bb.9:
	ldr	x25, [x21]
	ldr	w0, [x26, #32]
	bl	_u64_to_user_ptr
	mov	x1, x0
	ldr	x2, [x26, #8]
	mov	x0, x25
	bl	_copy_from_user
	cbnz	x0, LBB0_11
; %bb.10:
	ldr	x25, [x21, #8]
	ldr	w0, [x26, #28]
	bl	_u64_to_user_ptr
	mov	x1, x0
	ldr	x2, [x26, #16]
	mov	x0, x25
	bl	_copy_from_user
	cbz	x0, LBB0_13
LBB0_11:
Lloh10:
	adrp	x8, _EFAULT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_5
LBB0_12:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_13:
Lloh16:
	adrp	x8, _VC4_BO_TYPE_BCL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VC4_BO_TYPE_BCL@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x24
	mov	w2, #1
	bl	_vc4_bo_create
	mov	x24, x0
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.14:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x24
	bl	_PTR_ERR
	b	LBB0_20
LBB0_15:
	str	x24, [x21, #56]
	add	x0, x24, #16
	bl	_to_vc4_bo
	add	x1, x21, #112
	bl	_list_add_tail
	ldr	x8, [x21, #56]
	ldp	x9, x1, [x8]
	stp	x19, x9, [x21, #96]
	add	x8, x1, x23
	add	x10, x9, x23
	stp	x10, x8, [x21, #80]
	add	x8, x1, x27
	add	x9, x9, x27
	stp	x9, x8, [x21, #64]
	ldur	q0, [x26, #8]
	stur	q0, [x21, #24]
	mov	x0, x20
	mov	x2, x19
	mov	x3, x21
	bl	_vc4_validate_bin_cl
	cbnz	w0, LBB0_20
; %bb.16:
	mov	x0, x20
	mov	x1, x21
	bl	_vc4_validate_shader_recs
	cbnz	w0, LBB0_20
; %bb.17:
	ldr	x8, [x21, #48]
	cbz	x8, LBB0_19
; %bb.18:
	add	x1, x21, #44
	mov	x0, x22
	bl	_vc4_v3d_bin_bo_get
	cbnz	w0, LBB0_20
LBB0_19:
	ldr	w1, [x21, #40]
	mov	x0, x20
	mov	x2, #-1
	mov	w3, #1
	bl	_vc4_wait_for_seqno
LBB0_20:
	mov	x23, x0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"overflow in exec arguments\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate storage for copying in bin/render CLs.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_VC4_BO_TYPE_BCL,4,2            ; @VC4_BO_TYPE_BCL
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't allocate BO for binning\n"

	.no_dead_strip	_vc4_get_bcl
.subsections_via_symbols
