	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_submit_cl_ioctl            ## -- Begin function v3d_submit_cl_ioctl
	.p2align	4, 0x90
_v3d_submit_cl_ioctl:                   ## @v3d_submit_cl_ioctl
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	callq	_to_v3d_dev
	movq	%rax, %r13
	movq	(%r14), %r15
	leaq	4(%rax), %rdi
	movq	(%r12), %rsi
	movq	8(%r12), %rdx
	callq	_trace_v3d_submit_cl_ioctl
	movq	16(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %edi
	movl	$56, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r15
	movups	(%r12), %xmm0
	movups	%xmm0, (%rax)
	leaq	52(%rax), %rdi
	callq	_INIT_LIST_HEAD
	leaq	16(%r15), %rdx
	movq	_v3d_render_job_free@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	68(%r12), %r8d
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	callq	_v3d_job_init
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_27
LBB0_7:
	movq	%r13, %rcx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	24(%r12), %rax
	cmpq	32(%r12), %rax
	jne	LBB0_9
## %bb.8:
	xorl	%ebx, %ebx
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
LBB0_14:
	movl	44(%r12), %r8d
	movl	48(%r12), %ecx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_v3d_lookup_bos
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.15:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_v3d_lock_bo_reservations
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_24
## %bb.16:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_lock
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.17:
	leaq	16(%rbx), %rsi
	movq	_V3D_BIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_v3d_push_job
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.18:
	movq	%r15, %r14
	addq	$28, %r14
	movl	24(%rbx), %edi
	callq	_dma_fence_get
	movq	%r14, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_drm_gem_fence_array_add
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_23
LBB0_19:
	movq	_V3D_RENDER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_v3d_push_job
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_20
LBB0_23:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	16(%r15), %esi
	movl	20(%r15), %edi
	leaq	-48(%rbp), %rdx
	callq	_drm_gem_unlock_reservations
LBB0_24:
	testq	%rbx, %rbx
	je	LBB0_26
## %bb.25:
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_v3d_job_put
LBB0_26:
	movq	%r14, %rdi
	callq	_v3d_job_put
	jmp	LBB0_27
LBB0_9:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %edi
	movl	$56, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movq	%rax, %rbx
	movq	%rax, %rdx
	addq	$16, %rdx
	movq	_v3d_job_free@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	64(%r12), %r8d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_v3d_job_init
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r13d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_v3d_job_put
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_27
LBB0_10:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_v3d_job_put
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_27:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movups	24(%r12), %xmm0
	movups	%xmm0, (%rbx)
	movl	60(%r12), %eax
	movl	%eax, 48(%rbx)
	movl	56(%r12), %eax
	movl	%eax, 44(%rbx)
	movl	52(%r12), %eax
	movl	%eax, 40(%rbx)
	movq	%r15, 32(%rbx)
	movq	%r14, %rsi
	jmp	LBB0_14
LBB0_20:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	40(%r12), %ecx
	movl	24(%r15), %r8d
	leaq	-48(%rbp), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_v3d_attach_fences_and_unlock_reservation
	testq	%rbx, %rbx
	je	LBB0_22
## %bb.21:
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_v3d_job_put
LBB0_22:
	movq	%r14, %rdi
	callq	_v3d_job_put
	xorl	%r13d, %r13d
	jmp	LBB0_27
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pad must be zero: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_v3d_render_job_free,4,2        ## @v3d_render_job_free
	.comm	_v3d_job_free,4,2               ## @v3d_job_free
	.comm	_V3D_BIN,4,2                    ## @V3D_BIN
	.comm	_V3D_RENDER,4,2                 ## @V3D_RENDER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_submit_cl_ioctl            ; -- Begin function v3d_submit_cl_ioctl
	.p2align	2
_v3d_submit_cl_ioctl:                   ; @v3d_submit_cl_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x2
	mov	x21, x1
	mov	x26, x0
	bl	_to_v3d_dev
	mov	x22, x0
	ldr	x24, [x20]
	add	x0, x0, #4
	ldp	x1, x2, [x21]
	bl	_trace_v3d_submit_cl_ioctl
	ldr	x1, [x21, #16]
	cbz	x1, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_22
LBB0_2:
Lloh4:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	w0, #1
	mov	w1, #56
	bl	_kcalloc
	cbz	x0, LBB0_21
; %bb.3:
	mov	x23, x0
	ldr	q0, [x21]
	mov	x19, x0
	str	q0, [x19], #16
	add	x0, x0, #52
	bl	_INIT_LIST_HEAD
Lloh6:
	adrp	x8, _v3d_render_job_free@GOTPAGE
Lloh7:
	ldr	x8, [x8, _v3d_render_job_free@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	ldr	w4, [x21, #68]
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_v3d_job_init
	cbz	w0, LBB0_5
; %bb.4:
	mov	x27, x0
	mov	x0, x23
	bl	_kfree
	b	LBB0_23
LBB0_5:
	ldp	x8, x9, [x21, #24]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.6:
	mov	x25, #0
LBB0_7:
	ldp	w4, w3, [x21, #44]
	mov	x0, x26
	mov	x1, x20
	mov	x2, x19
	bl	_v3d_lookup_bos
	mov	x27, x0
	cbnz	w0, LBB0_14
; %bb.8:
	add	x1, sp, #8
	mov	x0, x19
	bl	_v3d_lock_bo_reservations
	mov	x27, x0
	cbnz	w0, LBB0_14
; %bb.9:
	mov	x0, x22
	bl	_mutex_lock
	cbz	x25, LBB0_12
; %bb.10:
	add	x1, x25, #16
Lloh9:
	adrp	x8, _V3D_BIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _V3D_BIN@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x24
	bl	_v3d_push_job
	mov	x27, x0
	cbnz	w0, LBB0_13
; %bb.11:
	add	x26, x23, #28
	ldr	w0, [x25, #24]
	bl	_dma_fence_get
	mov	x1, x0
	mov	x0, x26
	bl	_drm_gem_fence_array_add
	mov	x27, x0
	cbnz	w0, LBB0_13
LBB0_12:
Lloh12:
	adrp	x8, _V3D_RENDER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _V3D_RENDER@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x24
	mov	x1, x19
	bl	_v3d_push_job
	mov	x27, x0
	cbz	w0, LBB0_25
LBB0_13:
	mov	x0, x22
	bl	_mutex_unlock
	ldp	w1, w0, [x23, #16]
	add	x2, sp, #8
	bl	_drm_gem_unlock_reservations
LBB0_14:
	cbz	x25, LBB0_16
; %bb.15:
	add	x0, x25, #16
	bl	_v3d_job_put
LBB0_16:
	mov	x0, x19
	bl	_v3d_job_put
	b	LBB0_23
LBB0_17:
	ldr	w2, [x25]
	mov	w0, #1
	mov	w1, #56
	bl	_kcalloc
	cbz	x0, LBB0_20
; %bb.18:
	mov	x25, x0
	add	x2, x0, #16
Lloh15:
	adrp	x8, _v3d_job_free@GOTPAGE
Lloh16:
	ldr	x8, [x8, _v3d_job_free@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	ldr	w4, [x21, #64]
	mov	x0, x22
	mov	x1, x20
	bl	_v3d_job_init
	cbz	w0, LBB0_24
; %bb.19:
	mov	x27, x0
	mov	x0, x19
	bl	_v3d_job_put
	mov	x0, x25
	bl	_kfree
	b	LBB0_23
LBB0_20:
	mov	x0, x19
	bl	_v3d_job_put
LBB0_21:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_23:
	mov	x0, x27
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_24:
	ldur	q0, [x21, #24]
	str	q0, [x25]
	ldr	w8, [x21, #60]
	str	w8, [x25, #48]
	ldur	d0, [x21, #52]
	str	d0, [x25, #40]
	str	x23, [x25, #32]
	b	LBB0_7
LBB0_25:
	mov	x0, x22
	bl	_mutex_unlock
	ldr	w3, [x21, #40]
	ldr	w4, [x23, #24]
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_v3d_attach_fences_and_unlock_reservation
	cbz	x25, LBB0_27
; %bb.26:
	add	x0, x25, #16
	bl	_v3d_job_put
LBB0_27:
	mov	x0, x19
	bl	_v3d_job_put
	mov	w27, #0
	b	LBB0_23
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pad must be zero: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_v3d_render_job_free,4,2        ; @v3d_render_job_free
	.comm	_v3d_job_free,4,2               ; @v3d_job_free
	.comm	_V3D_BIN,4,2                    ; @V3D_BIN
	.comm	_V3D_RENDER,4,2                 ; @V3D_RENDER
.subsections_via_symbols
