	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alcor_irq_thread
_alcor_irq_thread:                      ## @alcor_irq_thread
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	4(%rsi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	sete	%al
	movq	_AU6601_INT_ALL_MASK@GOTPCREL(%rip), %rcx
	cmpl	%r13d, (%rcx)
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	8(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_dbg
	movq	_IRQ_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_13
LBB0_2:
	movq	_AU6601_INT_CMD_MASK@GOTPCREL(%rip), %rax
	movq	_AU6601_INT_DATA_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	andl	%r13d, %ebx
	je	LBB0_7
## %bb.3:
	movq	_AU6601_INT_ERROR_MASK@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_alcor_err_irq
	jmp	LBB0_6
LBB0_5:
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_alcor_cmd_irq_thread
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_alcor_data_irq_thread
LBB0_6:
	movq	_AU6601_INT_DATA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AU6601_INT_CMD_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, %r13d
LBB0_7:
	movq	_AU6601_INT_CARD_INSERT@GOTPCREL(%rip), %rcx
	movq	_AU6601_INT_CARD_REMOVE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	testl	%r13d, %eax
	je	LBB0_9
## %bb.8:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_alcor_cd_irq
	movl	(%rbx), %eax
	movq	_AU6601_INT_CARD_INSERT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	notl	%eax
	andl	%eax, %r13d
LBB0_9:
	movq	_AU6601_INT_OVER_CURRENT_ERR@GOTPCREL(%rip), %rbx
	testl	%r13d, (%rbx)
	je	LBB0_11
## %bb.10:
	movl	8(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movl	(%rbx), %eax
	notl	%eax
	andl	%eax, %r13d
LBB0_11:
	testl	%r13d, %r13d
	je	LBB0_13
## %bb.12:
	movl	8(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_dbg
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_alcor_unmask_sd_irqs
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_AU6601_INT_ALL_MASK,4,2        ## @AU6601_INT_ALL_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unexpected IRQ: 0x%04x\n"

	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.comm	_AU6601_INT_CMD_MASK,4,2        ## @AU6601_INT_CMD_MASK
	.comm	_AU6601_INT_DATA_MASK,4,2       ## @AU6601_INT_DATA_MASK
	.comm	_AU6601_INT_ERROR_MASK,4,2      ## @AU6601_INT_ERROR_MASK
	.comm	_AU6601_INT_CARD_INSERT,4,2     ## @AU6601_INT_CARD_INSERT
	.comm	_AU6601_INT_CARD_REMOVE,4,2     ## @AU6601_INT_CARD_REMOVE
	.comm	_AU6601_INT_OVER_CURRENT_ERR,4,2 ## @AU6601_INT_OVER_CURRENT_ERR
L_.str.1:                               ## @.str.1
	.asciz	"warning: over current detected!\n"

L_.str.2:                               ## @.str.2
	.asciz	"got not handled IRQ: 0x%04x\n"

	.no_dead_strip	_alcor_irq_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alcor_irq_thread
_alcor_irq_thread:                      ; @alcor_irq_thread
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
Lloh0:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	add	x20, x1, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w22, [x19]
	cmp	w22, #0
Lloh3:
	adrp	x8, _AU6601_INT_ALL_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AU6601_INT_ALL_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ccmp	w8, w22, #4, ne
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
Lloh8:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	b	LBB0_13
LBB0_2:
Lloh11:
	adrp	x24, _AU6601_INT_CMD_MASK@GOTPAGE
Lloh12:
	ldr	x24, [x24, _AU6601_INT_CMD_MASK@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh13:
	adrp	x25, _AU6601_INT_DATA_MASK@GOTPAGE
Lloh14:
	ldr	x25, [x25, _AU6601_INT_DATA_MASK@GOTPAGEOFF]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ands	w23, w8, w22
	b.eq	LBB0_7
; %bb.3:
Lloh15:
	adrp	x8, _AU6601_INT_ERROR_MASK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AU6601_INT_ERROR_MASK@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	mov	x0, x19
	tst	w8, w23
	b.eq	LBB0_5
; %bb.4:
	mov	x1, x23
	bl	_alcor_err_irq
	b	LBB0_6
LBB0_5:
	mov	x1, x23
	bl	_alcor_cmd_irq_thread
	mov	x0, x19
	mov	x1, x23
	bl	_alcor_data_irq_thread
LBB0_6:
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	bic	w22, w22, w8
LBB0_7:
Lloh18:
	adrp	x23, _AU6601_INT_CARD_INSERT@GOTPAGE
Lloh19:
	ldr	x23, [x23, _AU6601_INT_CARD_INSERT@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh20:
	adrp	x24, _AU6601_INT_CARD_REMOVE@GOTPAGE
Lloh21:
	ldr	x24, [x24, _AU6601_INT_CARD_REMOVE@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w9, w8
	tst	w8, w22
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x22
	bl	_alcor_cd_irq
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	bic	w22, w22, w8
LBB0_9:
Lloh22:
	adrp	x23, _AU6601_INT_OVER_CURRENT_ERR@GOTPAGE
Lloh23:
	ldr	x23, [x23, _AU6601_INT_OVER_CURRENT_ERR@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w22
	b.eq	LBB0_11
; %bb.10:
	ldr	w0, [x19, #8]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
	ldr	w8, [x23]
	bic	w22, w22, w8
LBB0_11:
	cbz	w22, LBB0_13
; %bb.12:
	ldr	w0, [x19, #8]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_dev_dbg
LBB0_13:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_alcor_unmask_sd_irqs
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_AU6601_INT_ALL_MASK,4,2        ; @AU6601_INT_ALL_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unexpected IRQ: 0x%04x\n"

	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.comm	_AU6601_INT_CMD_MASK,4,2        ; @AU6601_INT_CMD_MASK
	.comm	_AU6601_INT_DATA_MASK,4,2       ; @AU6601_INT_DATA_MASK
	.comm	_AU6601_INT_ERROR_MASK,4,2      ; @AU6601_INT_ERROR_MASK
	.comm	_AU6601_INT_CARD_INSERT,4,2     ; @AU6601_INT_CARD_INSERT
	.comm	_AU6601_INT_CARD_REMOVE,4,2     ; @AU6601_INT_CARD_REMOVE
	.comm	_AU6601_INT_OVER_CURRENT_ERR,4,2 ; @AU6601_INT_OVER_CURRENT_ERR
l_.str.1:                               ; @.str.1
	.asciz	"warning: over current detected!\n"

l_.str.2:                               ; @.str.2
	.asciz	"got not handled IRQ: 0x%04x\n"

	.no_dead_strip	_alcor_irq_thread
.subsections_via_symbols
