	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_fixup_via_northbridge_bug
_pci_fixup_via_northbridge_bug:         ## @pci_fixup_via_northbridge_bug
	.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, %r15
	movq	(%rdi), %rax
	movq	_PCI_DEVICE_ID_VIA_8367_0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_PCI_LATENCY_TIMER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_pci_write_config_byte
	movl	$31, %ebx
	movl	$149, %r14d
	jmp	LBB0_4
LBB0_2:
	movq	_PCI_DEVICE_ID_VIA_8363_0@GOTPCREL(%rip), %rcx
	movl	$31, %ebx
	movl	$85, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	8(%r15), %rax
	movq	_VIA_8363_KL133_REVISION_ID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%cl
	movq	_VIA_8363_KM133_REVISION_ID@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %ebx
	shll	$5, %ebx
	orl	$31, %ebx
LBB0_4:
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %r9d
	movl	%ebx, %eax
	notl	%eax
	testl	%eax, %r9d
	je	LBB0_6
## %bb.5:
	leaq	16(%r15), %rdi
	movq	(%r15), %rdx
	movq	8(%r15), %rcx
	movl	%r9d, %eax
	andl	%ebx, %eax
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %r8d
	pushq	%rax
	pushq	%rbx
	callq	_dev_warn
	addq	$16, %rsp
	andl	-28(%rbp), %ebx
	movl	%ebx, -28(%rbp)
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_pci_write_config_byte
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_DEVICE_ID_VIA_8367_0,8,3   ## @PCI_DEVICE_ID_VIA_8367_0
	.comm	_PCI_LATENCY_TIMER,4,2          ## @PCI_LATENCY_TIMER
	.comm	_PCI_DEVICE_ID_VIA_8363_0,8,3   ## @PCI_DEVICE_ID_VIA_8363_0
	.comm	_VIA_8363_KL133_REVISION_ID,8,3 ## @VIA_8363_KL133_REVISION_ID
	.comm	_VIA_8363_KM133_REVISION_ID,8,3 ## @VIA_8363_KM133_REVISION_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disabling VIA memory write queue (PCI ID %04x, rev %02x): [%02x] %02x & %02x -> %02x\n"

	.no_dead_strip	_pci_fixup_via_northbridge_bug
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_fixup_via_northbridge_bug
_pci_fixup_via_northbridge_bug:         ; @pci_fixup_via_northbridge_bug
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PCI_DEVICE_ID_VIA_8367_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_DEVICE_ID_VIA_8367_0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _PCI_LATENCY_TIMER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_LATENCY_TIMER@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_pci_write_config_byte
	mov	w20, #31
	mov	w21, #149
	b	LBB0_5
LBB0_2:
Lloh6:
	adrp	x9, _PCI_DEVICE_ID_VIA_8363_0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PCI_DEVICE_ID_VIA_8363_0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	mov	w20, #31
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x9, _VIA_8363_KL133_REVISION_ID@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VIA_8363_KL133_REVISION_ID@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _VIA_8363_KM133_REVISION_ID@GOTPAGE
Lloh13:
	ldr	x10, [x10, _VIA_8363_KM133_REVISION_ID@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	mov	w8, #63
	csel	w20, w8, w20, eq
LBB0_4:
	mov	w21, #85
LBB0_5:
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	ldr	w5, [sp, #12]
	bics	wzr, w5, w20
	b.eq	LBB0_7
; %bb.6:
	add	x0, x19, #16
	ldp	x2, x3, [x19]
	and	w7, w5, w20
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x4, x21
	mov	x6, x20
	bl	_dev_warn
	ldr	w8, [sp, #12]
	and	w2, w8, w20
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_DEVICE_ID_VIA_8367_0,8,3   ; @PCI_DEVICE_ID_VIA_8367_0
	.comm	_PCI_LATENCY_TIMER,4,2          ; @PCI_LATENCY_TIMER
	.comm	_PCI_DEVICE_ID_VIA_8363_0,8,3   ; @PCI_DEVICE_ID_VIA_8363_0
	.comm	_VIA_8363_KL133_REVISION_ID,8,3 ; @VIA_8363_KL133_REVISION_ID
	.comm	_VIA_8363_KM133_REVISION_ID,8,3 ; @VIA_8363_KM133_REVISION_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disabling VIA memory write queue (PCI ID %04x, rev %02x): [%02x] %02x & %02x -> %02x\n"

	.no_dead_strip	_pci_fixup_via_northbridge_bug
.subsections_via_symbols
