	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hsu_dma_do_irq                 ## -- Begin function hsu_dma_do_irq
	.p2align	4, 0x90
_hsu_dma_do_irq:                        ## @hsu_dma_do_irq
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rcx
	xorl	%eax, %eax
	cmpw	%si, (%rcx)
	jbe	LBB0_8
## %bb.1:
	movl	%edx, %r15d
	movq	8(%rcx), %r12
	movzwl	%si, %ebx
	shlq	$4, %rbx
	leaq	(%r12,%rbx), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r12,%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.2:
	movq	_HSU_CH_SR_CHE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_DMA_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	jmp	LBB0_7
LBB0_4:
	movq	(%rbx), %rax
	cmpq	8(%rbx), %rax
	jge	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_hsu_dma_start_channel
	jmp	LBB0_7
LBB0_6:
	leaq	20(%rbx), %rdi
	callq	_vchan_cookie_complete
	movq	_DMA_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	%r14, %rdi
	callq	_hsu_dma_start_transfer
LBB0_7:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	$1, %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HSU_CH_SR_CHE,4,2              ## @HSU_CH_SR_CHE
	.comm	_DMA_ERROR,4,2                  ## @DMA_ERROR
	.comm	_DMA_COMPLETE,4,2               ## @DMA_COMPLETE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hsu_dma_do_irq                 ; -- Begin function hsu_dma_do_irq
	.p2align	2
_hsu_dma_do_irq:                        ; @hsu_dma_do_irq
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	ldrh	w9, [x8]
	cmp	w9, w1
	b.ls	LBB0_4
; %bb.1:
	mov	x20, x2
	ldr	x8, [x8, #8]
	add	x19, x8, w1, uxtw #4
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x21, [x19, #8]
	cbz	x21, LBB0_8
; %bb.2:
Lloh0:
	adrp	x8, _HSU_CH_SR_CHE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HSU_CH_SR_CHE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _DMA_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x21, #16]
	b	LBB0_8
LBB0_4:
	mov	w0, #0
	b	LBB0_9
LBB0_5:
	ldp	x8, x9, [x21]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_hsu_dma_start_channel
	b	LBB0_8
LBB0_7:
	add	x0, x21, #20
	bl	_vchan_cookie_complete
Lloh6:
	adrp	x8, _DMA_COMPLETE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_COMPLETE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x21, #16]
	mov	x0, x19
	bl	_hsu_dma_start_transfer
LBB0_8:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #1
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HSU_CH_SR_CHE,4,2              ; @HSU_CH_SR_CHE
	.comm	_DMA_ERROR,4,2                  ; @DMA_ERROR
	.comm	_DMA_COMPLETE,4,2               ; @DMA_COMPLETE
.subsections_via_symbols
