	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_submit_tfu_ioctl           ## -- Begin function v3d_submit_tfu_ioctl
	.p2align	4, 0x90
_v3d_submit_tfu_ioctl:                  ## @v3d_submit_tfu_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	callq	_to_v3d_dev
	movq	%rax, %r13
	movq	8(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	4(%r13), %rdi
	movl	20(%r15), %esi
	callq	_trace_v3d_submit_tfu_ioctl
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movl	$1, %edi
	movl	$48, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_v3d_job_free@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%r15), %r8d
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_v3d_job_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_17
LBB0_4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rdi
	callq	_ARRAY_SIZE
	movl	(%r14), %edx
	movl	%eax, %edi
	movl	$8, %esi
	callq	_kcalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	16(%r15), %rax
	movq	%rax, 40(%r12)
	movups	(%r15), %xmm0
	movups	%xmm0, 24(%r12)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_lock
	movl	$0, (%r12)
	movq	8(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_12
## %bb.7:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	4(%rax), %r13
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movslq	(%r12), %rcx
	movl	(%rax,%rcx,4), %esi
	testl	%esi, %esi
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%r13, %rdi
	callq	_idr_find
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_drm_gem_object_get
	movq	8(%r12), %rax
	movslq	(%r12), %rcx
	movq	%r14, (%rax,%rcx,8)
	leal	1(%rcx), %ebx
	movl	%ebx, (%r12)
	movq	8(%r15), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %ebx
	jl	LBB0_8
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_v3d_lock_bo_reservations
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_V3D_TFU@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_v3d_push_job
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	je	LBB0_14
## %bb.15:
	movq	8(%r12), %rdi
	movslq	(%r12), %rsi
	leaq	-56(%rbp), %rdx
	callq	_drm_gem_unlock_reservations
	jmp	LBB0_16
LBB0_5:
	movq	%r12, %rdi
	callq	_v3d_job_put
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_10:
	movslq	(%r12), %rsi
	movq	8(%r15), %rax
	movl	(%rax,%rsi,4), %edx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock
LBB0_16:
	movq	%r12, %rdi
	callq	_v3d_job_put
LBB0_17:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	(%r15), %ecx
	movl	16(%r12), %r8d
	leaq	-56(%rbp), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_v3d_attach_fences_and_unlock_reservation
	movq	%r12, %rdi
	callq	_v3d_job_put
	xorl	%r13d, %r13d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_v3d_job_free,4,2               ## @v3d_job_free
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to look up GEM BO %d: %d\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_V3D_TFU,4,2                    ## @V3D_TFU
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_v3d_submit_tfu_ioctl           ; -- Begin function v3d_submit_tfu_ioctl
	.p2align	2
_v3d_submit_tfu_ioctl:                  ; @v3d_submit_tfu_ioctl
	.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, x2
	mov	x21, x1
	bl	_to_v3d_dev
	mov	x22, x0
	ldr	x23, [x20, #8]
	add	x0, x0, #4
	ldr	w1, [x21, #20]
	bl	_trace_v3d_submit_tfu_ioctl
Lloh0:
	adrp	x25, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x25, [x25, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	w0, #1
	mov	w1, #48
	bl	_kcalloc
	cbz	x0, LBB0_13
; %bb.1:
	mov	x19, x0
Lloh2:
	adrp	x8, _v3d_job_free@GOTPAGE
Lloh3:
	ldr	x8, [x8, _v3d_job_free@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	ldr	w4, [x21, #16]
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_v3d_job_init
	cbz	w0, LBB0_3
; %bb.2:
	mov	x24, x0
	mov	x0, x19
	bl	_kfree
	b	LBB0_17
LBB0_3:
	ldr	x0, [x21, #8]
	bl	_ARRAY_SIZE
	ldr	w2, [x25]
	mov	w1, #8
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_12
; %bb.4:
	ldr	q0, [x21]
	ldr	x8, [x21, #16]
	str	x8, [x19, #40]
	stur	q0, [x19, #24]
	mov	x0, x20
	bl	_spin_lock
	str	wzr, [x19]
	ldr	x0, [x21, #8]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.5:
	add	x24, x20, #4
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldrsw	x9, [x19]
	ldr	w1, [x8, x9, lsl #2]
	cbz	w1, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x24
	bl	_idr_find
	cbz	x0, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, x0
	bl	_drm_gem_object_get
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	str	x25, [x8, x9, lsl #3]
	add	w25, w9, #1
	str	w25, [x19]
	ldr	x0, [x21, #8]
	bl	_ARRAY_SIZE
	cmp	w25, w0
	b.lt	LBB0_6
LBB0_9:
	mov	x0, x20
	bl	_spin_unlock
	add	x1, sp, #8
	mov	x0, x19
	bl	_v3d_lock_bo_reservations
	mov	x24, x0
	cbnz	w0, LBB0_16
; %bb.10:
	mov	x0, x22
	bl	_mutex_lock
Lloh5:
	adrp	x8, _V3D_TFU@GOTPAGE
Lloh6:
	ldr	x8, [x8, _V3D_TFU@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x19
	bl	_v3d_push_job
	mov	x24, x0
	mov	x0, x22
	bl	_mutex_unlock
	cbz	w24, LBB0_15
; %bb.11:
	ldr	x0, [x19, #8]
	ldrsw	x1, [x19]
	add	x2, sp, #8
	bl	_drm_gem_unlock_reservations
	b	LBB0_16
LBB0_12:
	mov	x0, x19
	bl	_v3d_job_put
LBB0_13:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_17
LBB0_14:
	ldrsw	x1, [x19]
	ldr	x8, [x21, #8]
	ldr	w2, [x8, x1, lsl #2]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh13:
	adrp	x8, _ENOENT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w24, w8
	mov	x0, x20
	bl	_spin_unlock
	b	LBB0_16
LBB0_15:
	ldr	w3, [x21]
	ldr	w4, [x19, #16]
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_v3d_attach_fences_and_unlock_reservation
LBB0_16:
	mov	x0, x19
	bl	_v3d_job_put
LBB0_17:
	mov	x0, x24
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_v3d_job_free,4,2               ; @v3d_job_free
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to look up GEM BO %d: %d\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_V3D_TFU,4,2                    ; @V3D_TFU
.subsections_via_symbols
