	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_gem_submit                ## -- Begin function lima_gem_submit
	.p2align	4, 0x90
_lima_gem_submit:                       ## @lima_gem_submit
	.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
	callq	_to_lima_drm_priv
	movq	(%rax), %r14
	movq	40(%r13), %rsi
	movq	48(%r13), %r12
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.7:
	movq	%rbx, %rdi
	callq	_drm_syncobj_find
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_2
## %bb.8:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_42
LBB0_1:
	xorl	%r15d, %r15d
LBB0_2:
	movl	(%r13), %esi
	testl	%esi, %esi
	jle	LBB0_13
## %bb.3:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movl	4(%rax,%r15,8), %esi
	movq	%rbx, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_5
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r12
	movq	%r13, %r14
	movq	%rax, %rdi
	callq	_to_lima_bo
	movq	%rax, %r13
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_lima_vm_bo_add
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r13, (%r12,%r15,8)
	incq	%r15
	movq	%r14, %r13
	movslq	(%r14), %rsi
	cmpq	%rsi, %r15
	jl	LBB0_4
## %bb.12:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_13:
	leaq	-72(%rbp), %rdx
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_lima_gem_lock_bos
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_23
## %bb.14:
	movl	(%r13), %ecx
	movl	8(%r13), %edi
	movq	32(%r13), %rax
	movq	24(%r13), %rsi
	addq	(%rax), %rsi
	movq	%r12, %rdx
	movq	%r14, %r8
	callq	_lima_sched_task_init
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_22
## %bb.15:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_lima_gem_add_deps
	testl	%eax, %eax
	je	LBB0_16
LBB0_21:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r13), %edi
	callq	_lima_sched_task_fini
LBB0_22:
	movl	(%r13), %esi
	leaq	-72(%rbp), %rdx
	movq	%r12, %rdi
	callq	_lima_gem_unlock_bos
	jmp	LBB0_23
LBB0_5:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_10:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	%r14, %r13
LBB0_6:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
LBB0_23:
	cmpl	$0, (%r13)
	jle	LBB0_27
## %bb.24:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r14, %rdi
	callq	_lima_vm_bo_del
	movq	(%r12,%rbx,8), %rdi
	callq	_drm_gem_object_put_unlocked
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_25
LBB0_27:
	testq	%r15, %r15
	je	LBB0_29
## %bb.28:
	movq	%r15, %rdi
	callq	_drm_syncobj_put
LBB0_29:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_42:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r13)
	movq	%r13, %rbx
	jle	LBB0_30
## %bb.17:
	xorl	%r15d, %r15d
	movq	_LIMA_SUBMIT_BO_WRITE@GOTPCREL(%rip), %r14
	movq	_LIMA_SUBMIT_FLAG_EXPLICIT_FENCE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %edi
	movq	16(%rbx), %rax
	movl	(%r14), %edx
	andl	(%rax,%r15,8), %edx
	movq	(%r12,%r15,8), %rsi
	movl	(%r13), %ecx
	andl	4(%rbx), %ecx
	callq	_lima_gem_sync_bo
	testl	%eax, %eax
	jne	LBB0_20
## %bb.18:                              ##   in Loop: Header=BB0_19 Depth=1
	incq	%r15
	movslq	(%rbx), %rax
	cmpq	%rax, %r15
	jl	LBB0_19
LBB0_30:
	movq	32(%rbx), %rax
	movq	24(%rbx), %rdi
	addq	(%rax), %rdi
	movl	8(%rbx), %esi
	callq	_lima_sched_context_queue_task
	movq	%rax, %r14
	movl	(%rbx), %esi
	testl	%esi, %esi
	movq	%rbx, %r13
	jle	LBB0_36
## %bb.31:
	xorl	%r15d, %r15d
	movq	_LIMA_SUBMIT_BO_WRITE@GOTPCREL(%rip), %rbx
	jmp	LBB0_32
LBB0_34:                                ##   in Loop: Header=BB0_32 Depth=1
	movq	%r14, %rsi
	callq	_dma_resv_add_shared_fence
LBB0_35:                                ##   in Loop: Header=BB0_32 Depth=1
	incq	%r15
	movslq	(%r13), %rsi
	cmpq	%rsi, %r15
	jge	LBB0_36
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movl	(%rbx), %ecx
	movq	(%r12,%r15,8), %rdx
	movl	(%rdx), %edi
	testl	%ecx, (%rax,%r15,8)
	je	LBB0_34
## %bb.33:                              ##   in Loop: Header=BB0_32 Depth=1
	movq	%r14, %rsi
	callq	_dma_resv_add_excl_fence
	jmp	LBB0_35
LBB0_36:
	leaq	-72(%rbp), %rdx
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_lima_gem_unlock_bos
	cmpl	$0, (%r13)
	jle	LBB0_39
## %bb.37:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_38:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdi
	callq	_drm_gem_object_put_unlocked
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_38
LBB0_39:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_41
## %bb.40:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_drm_syncobj_replace_fence
	movq	%rbx, %rdi
	callq	_drm_syncobj_put
LBB0_41:
	movq	%r14, %rdi
	callq	_dma_fence_put
	xorl	%eax, %eax
	jmp	LBB0_42
LBB0_20:
	movq	%rbx, %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_LIMA_SUBMIT_BO_WRITE,4,2       ## @LIMA_SUBMIT_BO_WRITE
	.comm	_LIMA_SUBMIT_FLAG_EXPLICIT_FENCE,4,2 ## @LIMA_SUBMIT_FLAG_EXPLICIT_FENCE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lima_gem_submit                ; -- Begin function lima_gem_submit
	.p2align	2
_lima_gem_submit:                       ; @lima_gem_submit
	.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	x19, x1
	mov	x23, x0
	bl	_to_lima_drm_priv
	ldr	x22, [x0]
	ldp	x1, x21, [x19, #40]
	cbz	x1, LBB0_3
; %bb.1:
	mov	x0, x23
	bl	_drm_syncobj_find
	mov	x20, x0
	cbnz	x0, LBB0_4
; %bb.2:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_22
LBB0_3:
	mov	x20, #0
LBB0_4:
	ldr	w1, [x19]
	cmp	w1, #1
	b.lt	LBB0_9
; %bb.5:
	mov	x27, #0
	mov	w28, #4
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w1, [x8, x28]
	mov	x0, x23
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x25, x0
	bl	_to_lima_bo
	mov	x26, x0
	mov	x0, x22
	mov	x1, x26
	mov	w2, #0
	bl	_lima_vm_bo_add
	cbnz	w0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	x26, [x21, x27, lsl #3]
	add	x27, x27, #1
	ldrsw	x1, [x19]
	add	x28, x28, #8
	cmp	x27, x1
	b.lt	LBB0_6
LBB0_9:
	add	x2, sp, #8
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_lima_gem_lock_bos
	mov	x24, x0
	cbnz	w0, LBB0_16
; %bb.10:
	ldr	w0, [x19, #8]
	ldp	x9, x8, [x19, #24]
	ldr	x8, [x8]
	add	x1, x9, x8
	ldr	w3, [x19]
	mov	x2, x21
	mov	x4, x22
	bl	_lima_sched_task_init
	mov	x24, x0
	cbnz	w0, LBB0_13
; %bb.11:
	mov	x0, x23
	mov	x1, x19
	bl	_lima_gem_add_deps
	mov	x24, x0
	cbz	w0, LBB0_23
LBB0_12:
	ldr	w0, [x19, #8]
	bl	_lima_sched_task_fini
LBB0_13:
	ldr	w1, [x19]
	add	x2, sp, #8
	mov	x0, x21
	bl	_lima_gem_unlock_bos
	b	LBB0_16
LBB0_14:
Lloh3:
	adrp	x8, _ENOENT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_16
LBB0_15:
	mov	x24, x0
	mov	x0, x25
	bl	_drm_gem_object_put_unlocked
LBB0_16:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.17:
	mov	x23, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x21, x23, lsl #3]
	cbz	x1, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x0, x22
	bl	_lima_vm_bo_del
	ldr	x0, [x21, x23, lsl #3]
	bl	_drm_gem_object_put_unlocked
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_18
LBB0_20:
	cbz	x20, LBB0_22
; %bb.21:
	mov	x0, x20
	bl	_drm_syncobj_put
LBB0_22:
	mov	x0, x24
	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_23:
	ldr	w8, [x19]
Lloh6:
	adrp	x23, _LIMA_SUBMIT_BO_WRITE@GOTPAGE
Lloh7:
	ldr	x23, [x23, _LIMA_SUBMIT_BO_WRITE@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_27
; %bb.24:
	mov	x25, #0
	mov	x26, #0
Lloh8:
	adrp	x27, _LIMA_SUBMIT_FLAG_EXPLICIT_FENCE@GOTPAGE
Lloh9:
	ldr	x27, [x27, _LIMA_SUBMIT_FLAG_EXPLICIT_FENCE@GOTPAGEOFF]
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x21, x25]
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x25]
	ldr	w9, [x23]
	and	w2, w9, w8
	ldp	w8, w0, [x19, #4]
	ldr	w9, [x27]
	and	w3, w9, w8
	bl	_lima_gem_sync_bo
	cbnz	w0, LBB0_39
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x19]
	add	x25, x25, #8
	cmp	x26, x8
	b.lt	LBB0_25
LBB0_27:
	ldp	x9, x8, [x19, #24]
	ldr	x8, [x8]
	add	x0, x9, x8
	ldr	w1, [x19, #8]
	bl	_lima_sched_context_queue_task
	mov	x22, x0
	ldr	w1, [x19]
	cmp	w1, #1
	b.lt	LBB0_33
; %bb.28:
	mov	x24, #0
	mov	x25, #0
	b	LBB0_31
LBB0_29:                                ;   in Loop: Header=BB0_31 Depth=1
	bl	_dma_resv_add_shared_fence
LBB0_30:                                ;   in Loop: Header=BB0_31 Depth=1
	add	x25, x25, #1
	ldrsw	x1, [x19]
	add	x24, x24, #8
	cmp	x25, x1
	b.ge	LBB0_33
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w8, [x8, x24]
	ldr	w9, [x23]
	ldr	x10, [x21, x24]
	ldr	w0, [x10]
	mov	x1, x22
	tst	w9, w8
	b.eq	LBB0_29
; %bb.32:                               ;   in Loop: Header=BB0_31 Depth=1
	bl	_dma_resv_add_excl_fence
	b	LBB0_30
LBB0_33:
	add	x2, sp, #8
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_lima_gem_unlock_bos
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_36
; %bb.34:
	mov	x23, #0
LBB0_35:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21, x23, lsl #3]
	bl	_drm_gem_object_put_unlocked
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_35
LBB0_36:
	cbz	x20, LBB0_38
; %bb.37:
	mov	x0, x20
	mov	x1, x22
	bl	_drm_syncobj_replace_fence
	mov	x0, x20
	bl	_drm_syncobj_put
LBB0_38:
	mov	x0, x22
	bl	_dma_fence_put
	mov	w24, #0
	b	LBB0_22
LBB0_39:
	mov	x24, x0
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_LIMA_SUBMIT_BO_WRITE,4,2       ; @LIMA_SUBMIT_BO_WRITE
	.comm	_LIMA_SUBMIT_FLAG_EXPLICIT_FENCE,4,2 ; @LIMA_SUBMIT_FLAG_EXPLICIT_FENCE
.subsections_via_symbols
