	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_ioctl_submit
_panfrost_ioctl_submit:                 ## @panfrost_ioctl_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 16(%rsi)
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	(%rdi), %r14
	movq	(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_PANFROST_JD_REQ_FS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	jle	LBB0_6
## %bb.9:
	movq	%r15, %rdi
	callq	_drm_syncobj_find
	testq	%rax, %rax
	jne	LBB0_7
## %bb.10:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	movq	%rax, %r13
	movq	%rax, %rdi
	addq	$40, %rdi
	callq	_kref_init
	movq	%r14, 32(%r13)
	movq	16(%rbx), %rax
	movq	%rax, 24(%r13)
	movq	(%rbx), %rax
	movq	%rax, (%r13)
	movq	%r14, %rdi
	callq	_panfrost_gpu_get_latest_flush_id
	movl	%eax, 16(%r13)
	movl	(%r15), %eax
	movl	%eax, 12(%r13)
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	%r13, %rcx
	callq	_panfrost_copy_in_sync
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.12:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	movq	%r13, %rcx
	callq	_panfrost_lookup_bos
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	%r13, %rdi
	callq	_panfrost_job_push
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
## %bb.14:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_16
## %bb.15:
	movl	8(%r13), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_syncobj_replace_fence
	xorl	%r14d, %r14d
LBB0_16:
	movq	%r13, %rdi
	callq	_panfrost_job_put
	jmp	LBB0_17
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.18:
	callq	_drm_syncobj_put
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PANFROST_JD_REQ_FS,8,3         ## @PANFROST_JD_REQ_FS
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_panfrost_ioctl_submit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_ioctl_submit
_panfrost_ioctl_submit:                 ; @panfrost_ioctl_submit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x8, [x1, #16]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x20, x1
	ldr	x8, [x1]
Lloh0:
	adrp	x9, _PANFROST_JD_REQ_FS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PANFROST_JD_REQ_FS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_5
; %bb.2:
	mov	x21, x2
	mov	x22, x0
	ldr	x24, [x0]
	ldr	x1, [x20, #8]
	cmp	x1, #1
	b.lt	LBB0_8
; %bb.3:
	mov	x0, x21
	bl	_drm_syncobj_find
	mov	x19, x0
	cbnz	x0, LBB0_9
; %bb.4:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_7:
	mov	x0, x24
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	x19, #0
LBB0_9:
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_15
; %bb.10:
	mov	x23, x0
	add	x0, x0, #40
	bl	_kref_init
	ldr	x8, [x20, #16]
	stp	x8, x24, [x23, #24]
	ldr	x8, [x20]
	str	x8, [x23]
	mov	x0, x24
	bl	_panfrost_gpu_get_latest_flush_id
	ldr	w8, [x21]
	stp	w8, w0, [x23, #12]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x23
	bl	_panfrost_copy_in_sync
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.11:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	mov	x3, x23
	bl	_panfrost_lookup_bos
	mov	x24, x0
	cbnz	w0, LBB0_14
; %bb.12:
	mov	x0, x23
	bl	_panfrost_job_push
	mov	x24, x0
	cmp	w0, #0
	ccmp	x19, #0, #4, eq
	b.eq	LBB0_14
; %bb.13:
	ldr	w1, [x23, #8]
	mov	x0, x19
	bl	_drm_syncobj_replace_fence
	mov	w24, #0
LBB0_14:
	mov	x0, x23
	bl	_panfrost_job_put
	cbnz	x19, LBB0_16
	b	LBB0_7
LBB0_15:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w24, w8
	cbz	x19, LBB0_7
LBB0_16:
	mov	x0, x19
	bl	_drm_syncobj_put
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PANFROST_JD_REQ_FS,8,3         ; @PANFROST_JD_REQ_FS
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_panfrost_ioctl_submit
.subsections_via_symbols
