	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hidma_post_completed
_hidma_post_completed:                  ## @hidma_post_completed
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	leaq	16(%rdi), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movq	(%rbx), %r14
	movq	32(%rbx), %rcx
	movq	_HIDMA_TRE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_3
LBB0_1:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_3:
	movq	(%rcx,%rax,8), %r15
	testq	%r15, %r15
	je	LBB0_4
## %bb.8:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movq	$0, (%rcx,%rax,8)
	leaq	24(%rbx), %r12
	movq	%r12, %rdi
	callq	_atomic_dec_return
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:
	movl	28(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
LBB0_10:
	movq	_HIDMA_TRE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	20(%rbx), %edx
	movq	%r14, %rdi
	callq	_HIDMA_INCREMENT_ITERATOR
	movq	%r14, (%rbx)
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%r15)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 16(%r15)
	movq	$0, 8(%r15)
	leaq	12(%rbx), %rdi
	movq	%r15, %rsi
	callq	_kfifo_put
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_tasklet_schedule
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_4:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movl	28(%rbx), %edi
	movq	_HIDMA_TRE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%r14, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rdx
	jmp	LBB0_7
LBB0_5:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %edx
LBB0_7:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HIDMA_TRE_SIZE,8,3             ## @HIDMA_TRE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tre_index [%d] and tre out of sync\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"tre count mismatch on completion"

	.no_dead_strip	_hidma_post_completed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hidma_post_completed
_hidma_post_completed:                  ; @hidma_post_completed
	.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
	mov	x19, x0
	add	x22, x0, #16
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x23, [x19]
	ldr	x8, [x19, #32]
Lloh0:
	adrp	x26, _HIDMA_TRE_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _HIDMA_TRE_SIZE@GOTPAGEOFF]
	ldr	x9, [x26]
	udiv	x9, x23, x9
	ldr	x24, [x8, x9, lsl #3]
	cbz	x24, LBB0_4
; %bb.1:
	ldr	x9, [x24]
	str	xzr, [x8, x9, lsl #3]
	add	x25, x19, #24
	mov	x0, x25
	bl	_atomic_dec_return
	tbz	x0, #63, LBB0_3
; %bb.2:
	ldr	w0, [x19, #28]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	mov	x0, x25
	mov	w1, #0
	bl	_atomic_set
LBB0_3:
	ldr	x1, [x26]
	ldr	w2, [x19, #20]
	mov	x0, x23
	bl	_HIDMA_INCREMENT_ITERATOR
	str	x23, [x19]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	stp	x20, x21, [x24, #16]
	add	x0, x19, #12
	str	xzr, [x24, #8]
	mov	x1, x24
	bl	_kfifo_put
	add	x0, x19, #8
	bl	_tasklet_schedule
	mov	w0, #0
	b	LBB0_5
LBB0_4:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19, #28]
	ldr	x8, [x26]
	udiv	x8, x23, x8
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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 AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_HIDMA_TRE_SIZE,8,3             ; @HIDMA_TRE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tre_index [%d] and tre out of sync\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"tre count mismatch on completion"

	.no_dead_strip	_hidma_post_completed
.subsections_via_symbols
