	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function quirk_vialatency
_quirk_vialatency:                      ## @quirk_vialatency
	.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	%rdi, %r14
	movq	_PCI_VENDOR_ID_VIA@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_PCI_DEVICE_ID_VIA_82C686@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	movl	(%rax), %eax
	addl	$-67, %eax
	cmpl	$-3, %eax
	jae	LBB0_4
	jmp	LBB0_5
LBB0_2:
	movl	(%r15), %edi
	movq	_PCI_DEVICE_ID_VIA_8231@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movl	(%rax), %ecx
	addl	$-19, %ecx
	movq	%rax, %rbx
	cmpl	$-3, %ecx
	jb	LBB0_5
LBB0_4:
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	movl	$118, %esi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	andl	$-49, %edx
	orl	$16, %edx
	movl	%edx, -28(%rbp)
	movq	%r14, %rdi
	movl	$118, %esi
	callq	_pci_write_config_byte
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_pci_info
LBB0_5:
	movq	%rbx, %rdi
	callq	_pci_dev_put
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_VENDOR_ID_VIA,4,2          ## @PCI_VENDOR_ID_VIA
	.comm	_PCI_DEVICE_ID_VIA_82C686,4,2   ## @PCI_DEVICE_ID_VIA_82C686
	.comm	_PCI_DEVICE_ID_VIA_8231,4,2     ## @PCI_DEVICE_ID_VIA_8231
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Applying VIA southbridge workaround\n"

	.no_dead_strip	_quirk_vialatency
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function quirk_vialatency
_quirk_vialatency:                      ; @quirk_vialatency
	.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
	mov	x19, x0
Lloh0:
	adrp	x21, _PCI_VENDOR_ID_VIA@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PCI_VENDOR_ID_VIA@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _PCI_DEVICE_ID_VIA_82C686@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DEVICE_ID_VIA_82C686@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_pci_get_device
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	sub	w8, w8, #67
	cmn	w8, #3
	b.hs	LBB0_4
	b	LBB0_5
LBB0_2:
	ldr	w0, [x21]
Lloh5:
	adrp	x8, _PCI_DEVICE_ID_VIA_8231@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PCI_DEVICE_ID_VIA_8231@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_pci_get_device
	mov	x20, x0
	cbz	x0, LBB0_5
; %bb.3:
	ldr	w8, [x20]
	sub	w8, w8, #19
	cmn	w8, #3
	b.lo	LBB0_5
LBB0_4:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #118
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	and	w8, w8, #0xffffffcf
	orr	w2, w8, #0x10
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #118
	bl	_pci_write_config_byte
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_pci_info
LBB0_5:
	mov	x0, x20
	bl	_pci_dev_put
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_VENDOR_ID_VIA,4,2          ; @PCI_VENDOR_ID_VIA
	.comm	_PCI_DEVICE_ID_VIA_82C686,4,2   ; @PCI_DEVICE_ID_VIA_82C686
	.comm	_PCI_DEVICE_ID_VIA_8231,4,2     ; @PCI_DEVICE_ID_VIA_8231
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Applying VIA southbridge workaround\n"

	.no_dead_strip	_quirk_vialatency
.subsections_via_symbols
