	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idmac_tx_submit
_idmac_tx_submit:                       ## @idmac_tx_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_to_tx_desc
	movq	%rax, %r12
	movq	8(%r15), %rdi
	callq	_to_idmac_chan
	movq	%rax, %r13
	movq	8(%r15), %rax
	movl	(%rax), %edi
	callq	_to_idmac
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_to_ipu
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	24(%r13), %r14
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	leaq	8(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_async_tx_clear_ack
	movq	(%r13), %rax
	movq	_IPU_CHANNEL_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r15, %r14
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r13, %rbx
	jge	LBB0_9
## %bb.3:
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rdi
	callq	_sg_is_last
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	8(%r15), %rdi
	addq	$4, %rdi
	callq	_sg_dma_address
	movl	%eax, %r14d
LBB0_5:
	movq	40(%rbx), %rax
	movl	$1, %edi
	cmpq	$0, (%rax)
	jne	LBB0_7
## %bb.6:
	xorl	%edi, %edi
	cmpq	$0, 8(%rax)
	setne	%dil
LBB0_7:
	callq	_WARN_ON
	movl	60(%rbx), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	56(%rbx), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	48(%rbx), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	52(%rbx), %r12d
	movq	_IPU_ROTATE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rdi
	callq	_sg_dma_address
                                        ## kill: def $eax killed $eax def $rax
	movq	%rbx, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%r12d, %ecx
	movl	-68(%rbp), %r8d                 ## 4-byte Reload
	movl	%r13d, %r9d
	pushq	%r14
	pushq	%rax
	callq	_ipu_init_channel_buffer
	addq	$16, %rsp
	testq	%rax, %rax
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	js	LBB0_8
LBB0_9:
	movq	8(%r15), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_dbg
	movq	16(%rbx), %rax
	leaq	1(%rax), %rcx
	cmpq	$-1, %rax
	movl	$1, %r13d
	cmovgeq	%rcx, %r13
	movq	%r13, 16(%rbx)
	movq	%r13, (%r14)
	leaq	32(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%rbx, %rsi
	addq	$36, %rsi
	movq	%r15, %rdi
	callq	_list_add_tail
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ipu_submit_channel_buffers
	movl	%eax, %r15d
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	testl	%r15d, %r15d
	js	LBB0_13
## %bb.10:
	movq	(%rbx), %rax
	movq	_IPU_CHANNEL_ENABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_16
## %bb.11:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_ipu_enable_channel
	testl	%eax, %eax
	js	LBB0_12
LBB0_16:
	movq	-104(%rbp), %rdi                ## 8-byte Reload
	callq	_dump_idmac_reg
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subq	(%rax), %r13
	jmp	LBB0_15
LBB0_8:
	movq	%rax, %r13
	jmp	LBB0_14
LBB0_12:
	movl	%eax, %r15d
LBB0_13:
	movslq	%r15d, %r13
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_list_del_init
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r13, (%r14)
	movq	%r13, 16(%rbx)
LBB0_14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
LBB0_15:
	movq	%r13, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Descriptor %p not prepared!\n"

	.comm	_EBUSY,8,3                      ## @EBUSY
	.comm	_IPU_CHANNEL_READY,8,3          ## @IPU_CHANNEL_READY
	.comm	_IPU_ROTATE_NONE,4,2            ## @IPU_ROTATE_NONE
L_.str.1:                               ## @.str.1
	.asciz	"Submitting sg %p\n"

	.comm	_IPU_CHANNEL_ENABLED,8,3        ## @IPU_CHANNEL_ENABLED
	.no_dead_strip	_idmac_tx_submit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idmac_tx_submit
_idmac_tx_submit:                       ; @idmac_tx_submit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x0
	bl	_to_tx_desc
	mov	x21, x0
	ldr	x0, [x19, #8]
	bl	_to_idmac_chan
	mov	x20, x0
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_to_idmac
	mov	x24, x0
	bl	_to_ipu
	mov	x23, x0
	ldr	x25, [x20, #24]
	mov	x0, x21
	bl	_list_empty
	cbz	w0, LBB0_4
; %bb.1:
	add	x22, x20, #8
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x19
	bl	_async_tx_clear_ack
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _IPU_CHANNEL_READY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IPU_CHANNEL_READY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.2:
	ldr	x0, [x21, #8]
	bl	_sg_is_last
	cbz	x0, LBB0_5
; %bb.3:
	str	wzr, [sp, #12]                  ; 4-byte Folded Spill
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	mov	x2, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	neg	x26, x8
	b	LBB0_18
LBB0_5:
	ldr	x8, [x21, #8]
	add	x0, x8, #4
	bl	_sg_dma_address
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
LBB0_6:
	ldr	x8, [x20, #40]
	ldr	x9, [x8]
	stp	x23, x22, [sp, #16]             ; 16-byte Folded Spill
	cbz	x9, LBB0_8
; %bb.7:
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	ldr	x8, [x8, #8]
	cmp	x8, #0
	cset	w0, ne
LBB0_9:
	bl	_WARN_ON
	ldp	w28, w27, [x20, #56]
	ldp	w26, w23, [x20, #48]
Lloh8:
	adrp	x8, _IPU_ROTATE_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IPU_ROTATE_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w22, [x8]
	ldr	x0, [x21, #8]
	bl	_sg_dma_address
	mov	x6, x0
	mov	x0, x20
	mov	x1, x27
	mov	x2, x28
	mov	x3, x23
	mov	x4, x26
	mov	x5, x22
	ldr	w7, [sp, #12]                   ; 4-byte Folded Reload
	bl	_ipu_init_channel_buffer
	ldp	x23, x22, [sp, #16]             ; 16-byte Folded Reload
	tbnz	x0, #63, LBB0_14
LBB0_10:
	ldr	x2, [x21, #8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x25
	bl	_dev_dbg
	ldr	x8, [x20, #16]
	cmn	x8, #1
	mov	w9, #1
	csinc	x26, x9, x8, lt
	str	x26, [x20, #16]
	str	x26, [x19]
	add	x25, x20, #32
	mov	x0, x25
	bl	_spin_lock_irqsave
	add	x1, x20, #36
	mov	x0, x21
	bl	_list_add_tail
	mov	x0, x20
	mov	x1, x21
	bl	_ipu_submit_channel_buffers
	mov	x27, x0
	mov	x0, x25
	bl	_spin_unlock_irqrestore
	tbnz	w27, #31, LBB0_16
; %bb.11:
	ldr	x8, [x20]
Lloh13:
	adrp	x9, _IPU_CHANNEL_ENABLED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IPU_CHANNEL_ENABLED@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_13
; %bb.12:
	mov	x0, x24
	mov	x1, x20
	bl	_ipu_enable_channel
	tbnz	w0, #31, LBB0_15
LBB0_13:
	mov	x0, x23
	bl	_dump_idmac_reg
	b	LBB0_17
LBB0_14:
	mov	x26, x0
	b	LBB0_17
LBB0_15:
	mov	x27, x0
LBB0_16:
	sxtw	x26, w27
	mov	x0, x25
	bl	_spin_lock_irqsave
	mov	x0, x21
	bl	_list_del_init
	mov	x0, x25
	bl	_spin_unlock_irqrestore
	str	x26, [x19]
	str	x26, [x20, #16]
LBB0_17:
	mov	x0, x22
	bl	_mutex_unlock
LBB0_18:
	mov	x0, x26
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Descriptor %p not prepared!\n"

	.comm	_EBUSY,8,3                      ; @EBUSY
	.comm	_IPU_CHANNEL_READY,8,3          ; @IPU_CHANNEL_READY
	.comm	_IPU_ROTATE_NONE,4,2            ; @IPU_ROTATE_NONE
l_.str.1:                               ; @.str.1
	.asciz	"Submitting sg %p\n"

	.comm	_IPU_CHANNEL_ENABLED,8,3        ; @IPU_CHANNEL_ENABLED
	.no_dead_strip	_idmac_tx_submit
.subsections_via_symbols
