	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sky2_test_msi
_sky2_test_msi:                         ## @sky2_test_msi
	.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	%rdi, %r12
	movq	8(%rdi), %r14
	addq	$4, %rdi
	callq	_init_waitqueue_head
	movl	(%r14), %edi
	movq	_sky2_test_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DRV_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	movq	%r12, %r8
	callq	_request_irq
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	(%r14), %edx
	addq	$4, %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movl	%ebx, %r15d
	jmp	LBB0_5
LBB0_2:
	movq	_B0_IMSK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_Y2_IS_IRQ_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sky2_write32
	movq	_B0_CTST@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_CS_ST_SW_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sky2_write8
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_sky2_read8
	movl	4(%r12), %edi
	movq	_SKY2_HW_USE_MSI@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	andl	(%r12), %esi
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rdx         ## imm = 0x66666667
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$34, %rdx
	addl	%eax, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_wait_event_timeout
	movl	(%r13), %eax
	testl	%eax, (%r12)
	jne	LBB0_4
## %bb.3:
	leaq	4(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movl	(%rbx), %esi
	movq	_CS_CL_SW_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_sky2_write8
LBB0_4:
	movq	_B0_IMSK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_sky2_write32
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_sky2_read32
	movl	(%r14), %edi
	movq	%r12, %rsi
	callq	_free_irq
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sky2_test_intr,4,2             ## @sky2_test_intr
	.comm	_DRV_NAME,4,2                   ## @DRV_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot assign irq %d\n"

	.comm	_B0_IMSK,4,2                    ## @B0_IMSK
	.comm	_Y2_IS_IRQ_SW,4,2               ## @Y2_IS_IRQ_SW
	.comm	_B0_CTST,4,2                    ## @B0_CTST
	.comm	_CS_ST_SW_IRQ,4,2               ## @CS_ST_SW_IRQ
	.comm	_SKY2_HW_USE_MSI,4,2            ## @SKY2_HW_USE_MSI
	.comm	_HZ,4,2                         ## @HZ
L_.str.1:                               ## @.str.1
	.asciz	"No interrupt generated using MSI, switching to INTx mode.\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_CS_CL_SW_IRQ,4,2               ## @CS_CL_SW_IRQ
	.no_dead_strip	_sky2_test_msi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sky2_test_msi
_sky2_test_msi:                         ; @sky2_test_msi
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	ldr	x19, [x0, #8]
	add	x0, x0, #4
	bl	_init_waitqueue_head
	ldr	w0, [x19]
Lloh0:
	adrp	x8, _sky2_test_intr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sky2_test_intr@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _DRV_NAME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRV_NAME@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	w2, #0
	mov	x4, x20
	bl	_request_irq
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	w2, [x19], #4
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_6
LBB0_2:
Lloh8:
	adrp	x22, _B0_IMSK@GOTPAGE
Lloh9:
	ldr	x22, [x22, _B0_IMSK@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh10:
	adrp	x8, _Y2_IS_IRQ_SW@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Y2_IS_IRQ_SW@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_sky2_write32
Lloh13:
	adrp	x23, _B0_CTST@GOTPAGE
Lloh14:
	ldr	x23, [x23, _B0_CTST@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh15:
	adrp	x8, _CS_ST_SW_IRQ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CS_ST_SW_IRQ@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_sky2_write8
	ldr	w1, [x23]
	mov	x0, x20
	bl	_sky2_read8
	ldp	w8, w0, [x20]
Lloh18:
	adrp	x21, _SKY2_HW_USE_MSI@GOTPAGE
Lloh19:
	ldr	x21, [x21, _SKY2_HW_USE_MSI@GOTPAGEOFF]
	ldr	w9, [x21]
	and	w1, w9, w8
Lloh20:
	adrp	x8, _HZ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh22:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w2, w8, w9
	bl	_wait_event_timeout
	ldr	w8, [x20]
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	w21, #0
	b	LBB0_5
LBB0_4:
	add	x0, x19, #4
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
Lloh25:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	w1, [x23]
Lloh28:
	adrp	x8, _CS_CL_SW_IRQ@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CS_CL_SW_IRQ@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_sky2_write8
LBB0_5:
	ldr	w1, [x22]
	mov	x0, x20
	mov	w2, #0
	bl	_sky2_write32
	ldr	w1, [x22]
	mov	x0, x20
	bl	_sky2_read32
	ldr	w0, [x19]
	mov	x1, x20
	bl	_free_irq
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_sky2_test_intr,4,2             ; @sky2_test_intr
	.comm	_DRV_NAME,4,2                   ; @DRV_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot assign irq %d\n"

	.comm	_B0_IMSK,4,2                    ; @B0_IMSK
	.comm	_Y2_IS_IRQ_SW,4,2               ; @Y2_IS_IRQ_SW
	.comm	_B0_CTST,4,2                    ; @B0_CTST
	.comm	_CS_ST_SW_IRQ,4,2               ; @CS_ST_SW_IRQ
	.comm	_SKY2_HW_USE_MSI,4,2            ; @SKY2_HW_USE_MSI
	.comm	_HZ,4,2                         ; @HZ
l_.str.1:                               ; @.str.1
	.asciz	"No interrupt generated using MSI, switching to INTx mode.\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_CS_CL_SW_IRQ,4,2               ; @CS_CL_SW_IRQ
	.no_dead_strip	_sky2_test_msi
.subsections_via_symbols
