	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function channel_submit
_channel_submit:                        ## @channel_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	48(%rdi), %r12
	movl	32(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r12), %rax
	movl	(%rax), %edi
	callq	_dev_get_drvdata
	movslq	(%rbx), %r13
	shlq	$3, %r13
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	addq	(%rax), %r13
	movq	8(%r12), %rdi
	callq	_dev_name
	movl	40(%rbx), %esi
	movl	36(%rbx), %edx
	movl	(%rbx), %ecx
	movl	32(%rbx), %r8d
	movl	%eax, %edi
	callq	_trace_host1x_channel_submit
	movq	%r13, %rdi
	callq	_host1x_syncpt_read_max
	movl	%eax, %r14d
	movl	%eax, 16(%rbx)
	movq	%r12, %rdi
	callq	_mutex_lock_interruptible
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r15d
	xorl	%r14d, %r14d
LBB0_6:
	movq	%r14, %rdi
	callq	_kfree
LBB0_14:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_host1x_channel_set_streamid
	leaq	16(%r12), %r13
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_host1x_cdma_begin
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_mutex_unlock
	jmp	LBB0_6
LBB0_3:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_6
LBB0_7:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	cmpq	$0, 24(%rbx)
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	je	LBB0_9
## %bb.8:
	movq	_HOST1X_CLASS_HOST1X@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	xorl	%eax, %eax
	callq	_host1x_uclass_wait_syncpt_r
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	$1, %edx
	callq	_host1x_opcode_setclass
	movl	%eax, %r13d
	movl	(%rbx), %r15d
	movq	%r12, %rdi
	callq	_host1x_syncpt_read_max
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_host1x_class_host_wait_syncpt
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_host1x_cdma_push
LBB0_9:
	cmpq	$0, (%r12)
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_synchronize_syncpt_base
LBB0_11:
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_host1x_syncpt_incr_max
	movl	%eax, %r15d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_host1x_hw_syncpt_assign_to_channel
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r15d, 16(%rbx)
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_13
## %bb.12:
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_host1x_opcode_setclass
	movq	_HOST1X_OPCODE_NOP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_host1x_cdma_push
LBB0_13:
	movq	%rbx, %rdi
	callq	_submit_gathers
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_host1x_cdma_end
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	8(%r13), %rdi
	callq	_dev_name
	movl	%eax, %edi
	movl	%r15d, %esi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_trace_host1x_channel_submitted
	movq	_HOST1X_INTR_ACTION_SUBMIT_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	$0, (%rsp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	%ebx, %edx
	movq	%r13, %r8
	movq	%r14, %r9
	callq	_host1x_intr_add_action
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_WARN
	movq	%r13, %rdi
	callq	_mutex_unlock
	xorl	%r15d, %r15d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_HOST1X_CLASS_HOST1X,8,3        ## @HOST1X_CLASS_HOST1X
	.comm	_HOST1X_OPCODE_NOP,4,2          ## @HOST1X_OPCODE_NOP
	.comm	_HOST1X_INTR_ACTION_SUBMIT_COMPLETE,4,2 ## @HOST1X_INTR_ACTION_SUBMIT_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set submit complete interrupt"

	.no_dead_strip	_channel_submit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function channel_submit
_channel_submit:                        ; @channel_submit
	.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	x22, x0
	ldr	x19, [x0, #48]
	ldr	w25, [x0, #32]
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_dev_get_drvdata
	mov	x20, x0
	ldr	x8, [x0]
	ldrsw	x9, [x22]
	add	x21, x8, x9, lsl #3
	ldr	x0, [x19, #8]
	bl	_dev_name
	ldp	w2, w1, [x22, #36]
	ldr	w3, [x22]
	ldr	w4, [x22, #32]
	bl	_trace_host1x_channel_submit
	mov	x0, x21
	bl	_host1x_syncpt_read_max
	mov	x24, x0
	str	w0, [x22, #16]
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	w0, LBB0_4
; %bb.1:
	mov	x27, x0
	mov	x23, #0
LBB0_2:
	mov	x0, x23
	bl	_kfree
LBB0_3:
	mov	x0, x27
	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_4:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	mov	x23, x0
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_host1x_channel_set_streamid
	add	x26, x19, #16
	mov	x0, x26
	mov	x1, x22
	bl	_host1x_cdma_begin
	cbz	w0, LBB0_8
; %bb.6:
	mov	x27, x0
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_2
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_2
LBB0_8:
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_10
; %bb.9:
Lloh6:
	adrp	x8, _HOST1X_CLASS_HOST1X@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HOST1X_CLASS_HOST1X@GOTPAGEOFF]
Lloh8:
	ldr	x27, [x8]
	bl	_host1x_uclass_wait_syncpt_r
	mov	x1, x0
	mov	x0, x27
	mov	w2, #1
	bl	_host1x_opcode_setclass
	mov	x27, x0
	ldr	w28, [x22]
	mov	x0, x21
	bl	_host1x_syncpt_read_max
	mov	x1, x0
	mov	x0, x28
	bl	_host1x_class_host_wait_syncpt
	mov	x2, x0
	mov	x0, x26
	mov	x1, x27
	bl	_host1x_cdma_push
LBB0_10:
	ldr	x8, [x21]
	cbz	x8, LBB0_12
; %bb.11:
	mov	x0, x22
	bl	_synchronize_syncpt_base
LBB0_12:
	mov	x0, x21
	mov	x1, x25
	bl	_host1x_syncpt_incr_max
	mov	x25, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_host1x_hw_syncpt_assign_to_channel
	str	w25, [x22, #16]
	ldr	x0, [x22, #8]
	cbz	x0, LBB0_14
; %bb.13:
	mov	w1, #0
	mov	w2, #0
	bl	_host1x_opcode_setclass
	mov	x1, x0
Lloh9:
	adrp	x8, _HOST1X_OPCODE_NOP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HOST1X_OPCODE_NOP@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x26
	bl	_host1x_cdma_push
LBB0_14:
	mov	x0, x22
	bl	_submit_gathers
	mov	x0, x26
	mov	x1, x22
	bl	_host1x_cdma_end
	ldr	x0, [x19, #8]
	bl	_dev_name
	mov	x1, x24
	mov	x2, x25
	bl	_trace_host1x_channel_submitted
Lloh12:
	adrp	x8, _HOST1X_INTR_ACTION_SUBMIT_COMPLETE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HOST1X_INTR_ACTION_SUBMIT_COMPLETE@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x25
	mov	x4, x19
	mov	x5, x23
	mov	x6, #0
	bl	_host1x_intr_add_action
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_WARN
	mov	x0, x19
	bl	_mutex_unlock
	mov	w27, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_HOST1X_CLASS_HOST1X,8,3        ; @HOST1X_CLASS_HOST1X
	.comm	_HOST1X_OPCODE_NOP,4,2          ; @HOST1X_OPCODE_NOP
	.comm	_HOST1X_INTR_ACTION_SUBMIT_COMPLETE,4,2 ; @HOST1X_INTR_ACTION_SUBMIT_COMPLETE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set submit complete interrupt"

	.no_dead_strip	_channel_submit
.subsections_via_symbols
