	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function quirk_via_vlink
_quirk_via_vlink:                       ## @quirk_via_vlink
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_via_vlink_dev_lo@GOTPCREL(%rip), %r15
	cmpl	$-1, (%r15)
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	movl	(%rdi), %r14d
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.2:
	cmpl	$15, %r14d
	jg	LBB0_8
## %bb.3:
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	jne	LBB0_8
## %bb.4:
	movl	4(%rbx), %edi
	callq	_PCI_SLOT
	movq	_via_vlink_dev_hi@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_8
## %bb.5:
	movl	4(%rbx), %edi
	callq	_PCI_SLOT
	cmpl	(%r15), %eax
	jl	LBB0_8
## %bb.6:
	movq	_PCI_INTERRUPT_LINE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	cmpl	%edx, %r14d
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %ecx
	callq	_pci_info
	movl	$15, %edi
	callq	_udelay
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_pci_write_config_byte
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_via_vlink_dev_lo,4,2           ## @via_vlink_dev_lo
	.comm	_via_vlink_dev_hi,4,2           ## @via_vlink_dev_hi
	.comm	_PCI_INTERRUPT_LINE,4,2         ## @PCI_INTERRUPT_LINE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VIA VLink IRQ fixup, from %d to %d\n"

	.no_dead_strip	_quirk_via_vlink
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function quirk_via_vlink
_quirk_via_vlink:                       ; @quirk_via_vlink
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x21, _via_vlink_dev_lo@GOTPAGE
Lloh1:
	ldr	x21, [x21, _via_vlink_dev_lo@GOTPAGEOFF]
	ldr	w8, [x21]
	cmn	w8, #1
	b.eq	LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w20, [x0]
	cmp	w20, #0
	ccmp	w20, #15, #0, ne
	b.gt	LBB0_7
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbnz	x8, LBB0_7
; %bb.3:
	ldr	w0, [x19, #4]
	bl	_PCI_SLOT
Lloh2:
	adrp	x8, _via_vlink_dev_hi@GOTPAGE
Lloh3:
	ldr	x8, [x8, _via_vlink_dev_hi@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, w8
	b.gt	LBB0_7
; %bb.4:
	ldr	w0, [x19, #4]
	bl	_PCI_SLOT
	ldr	w8, [x21]
	cmp	w0, w8
	b.lt	LBB0_7
; %bb.5:
Lloh5:
	adrp	x21, _PCI_INTERRUPT_LINE@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PCI_INTERRUPT_LINE@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_byte
	ldr	w2, [sp, #12]
	cmp	w20, w2
	b.eq	LBB0_7
; %bb.6:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_pci_info
	mov	w0, #15
	bl	_udelay
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_pci_write_config_byte
LBB0_7:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_via_vlink_dev_lo,4,2           ; @via_vlink_dev_lo
	.comm	_via_vlink_dev_hi,4,2           ; @via_vlink_dev_hi
	.comm	_PCI_INTERRUPT_LINE,4,2         ; @PCI_INTERRUPT_LINE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VIA VLink IRQ fixup, from %d to %d\n"

	.no_dead_strip	_quirk_via_vlink
.subsections_via_symbols
