	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d40_handle_interrupt
_d40_handle_interrupt:                  ## @d40_handle_interrupt
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	(%rsi), %r15
	movq	48(%rsi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	40(%rsi), %r13d
	leaq	8(%rsi), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	testl	%r13d, %r13d
	jle	LBB0_3
## %bb.1:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	16(%rax), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	16(%r12), %rdi
	callq	_readl
	movl	%eax, (%r15,%rbx,4)
	incq	%rbx
	addq	$24, %r14
	cmpq	%rbx, %r13
	jne	LBB0_2
LBB0_3:
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	imull	%r13d, %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_find_next_bit
	movq	%rax, %rbx
	movl	(%r14), %esi
	movl	%esi, %eax
	imull	%r13d, %eax
	cltq
	cmpq	%rax, %rbx
	jne	LBB0_4
LBB0_14:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r12,%r14,8), %rax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movl	12(%r12), %edi
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	movl	%r15d, %r8d
	callq	_d40_err
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_spin_unlock
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	imull	%r14d, %esi
	incq	%rbx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%rbx, %rdx
	callq	_find_next_bit
	movq	%rax, %rbx
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, %eax
	imull	%r14d, %eax
	cltq
	cmpq	%rax, %rbx
	je	LBB0_14
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%esi, %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $eax killed $eax def $rax
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leal	-1(%rsi), %ecx
	movl	%ebx, %r15d
	andl	%ecx, %r15d
	cltq
	leaq	(%rax,%rax,2), %r14
	movl	(%rdx,%r14,8), %eax
	xorl	%ecx, %ecx
	movq	_D40_PHY_CHAN@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%cl
	movl	$0, %edx
	cmovel	%edx, %eax
	addl	%r15d, %eax
	movq	24(%r12,%rcx,8), %rcx
	cltq
	movq	(%rcx,%rax,8), %r13
	testq	%r13, %r13
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, %edi
	callq	_BIT
	movq	%r12, %rcx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12,%r14,8), %rsi
	addq	16(%rcx), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	%r13, %rdi
	callq	_spin_lock
	cmpl	$0, 4(%r12,%r14,8)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rdi
	callq	_dma_tc_handle
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_D40_PHY_CHAN,4,2               ## @D40_PHY_CHAN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"IRQ chan: %ld offset %d idx %d\n"

	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_d40_handle_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d40_handle_interrupt
_d40_handle_interrupt:                  ; @d40_handle_interrupt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	ldr	x8, [x1]
	ldr	x26, [x1, #48]
	ldr	w27, [x1, #40]
	add	x0, x1, #8
	stp	x0, x8, [sp]                    ; 16-byte Folded Spill
	bl	_spin_lock_irqsave
	cmp	w27, #1
	b.lt	LBB0_3
; %bb.1:
	add	x21, x26, #16
	mov	x22, x27
	ldr	x23, [sp, #8]                   ; 8-byte Folded Reload
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x9, [x21], #24
	add	x0, x9, x8
	bl	_readl
	str	w0, [x23], #4
	subs	x22, x22, #1
	b.ne	LBB0_2
LBB0_3:
Lloh0:
	adrp	x28, _BITS_PER_LONG@GOTPAGE
Lloh1:
	ldr	x28, [x28, _BITS_PER_LONG@GOTPAGEOFF]
	ldr	w8, [x28]
	mul	w1, w8, w27
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, #0
	bl	_find_next_bit
	ldr	w8, [x28]
	mul	w9, w8, w27
	cmp	x0, w9, sxtw
	b.ne	LBB0_5
LBB0_4:
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	bl	_spin_unlock_irqrestore
Lloh2:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_5:
	mov	x22, x0
	mov	w21, #24
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x19, #12]
	ldr	w3, [x23]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x4, x24
	bl	_d40_err
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
	bl	_spin_unlock
	ldr	w8, [x28]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	mul	w1, w8, w27
	add	x2, x22, #1
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_find_next_bit
	mov	x22, x0
	ldr	w8, [x28]
	mul	w9, w8, w27
	cmp	x0, w9, sxtw
	b.eq	LBB0_4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x9, w8
	sdiv	x9, x22, x9
	sub	w10, w8, #1
	and	w24, w10, w22
	smaddl	x23, w9, w21, x26
	ldr	w10, [x23]
Lloh7:
	adrp	x11, _D40_PHY_CHAN@GOTPAGE
Lloh8:
	ldr	x11, [x11, _D40_PHY_CHAN@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	cmp	w10, w11
	csel	w10, wzr, w10, eq
	add	w10, w24, w10
	mov	w11, #32
	csel	x11, x11, x21, eq
	ldr	x11, [x19, x11]
	ldr	x25, [x11, w10, sxtw #3]
	cbz	x25, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sxtw	x20, w9
	mov	x0, x24
	bl	_BIT
	ldr	x8, [x19, #16]
	madd	x20, x20, x21, x26
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x25
	bl	_spin_lock
	ldr	w8, [x20, #4]
	cbnz	w8, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
	bl	_dma_tc_handle
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_D40_PHY_CHAN,4,2               ; @D40_PHY_CHAN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"IRQ chan: %ld offset %d idx %d\n"

	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_d40_handle_interrupt
.subsections_via_symbols
