	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_emul_cfgaddr
_pci_emul_cfgaddr:                      ## @pci_emul_cfgaddr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	cmpl	$4, %r8d
	jne	LBB0_1
## %bb.3:
	testl	%edx, %edx
	je	LBB0_7
## %bb.4:
	movq	_cfgbus@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$16, %eax
	movq	_cfgslot@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	$11, %ecx
	orl	%eax, %ecx
	movq	_cfgfunc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$8, %eax
	orl	%ecx, %eax
	movq	_cfgoff@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_cfgenable@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.5:
	movq	_CONF1_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_6:
	orl	%ecx, %eax
	movl	%eax, (%r9)
	jmp	LBB0_8
LBB0_1:
	testl	%edx, %edx
	je	LBB0_8
## %bb.2:
	cmpl	$2, %r8d
	movl	$65535, %eax                    ## imm = 0xFFFF
	movl	$255, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, (%r9)
	jmp	LBB0_8
LBB0_7:
	movl	(%r9), %eax
	movq	_CONF1_ENABLE@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	notl	%edx
	xorl	%esi, %esi
	andl	(%rcx), %edx
	sete	%sil
	movq	_cfgenable@GOTPCREL(%rip), %rcx
	movl	%esi, (%rcx)
	movq	_PCI_REGMAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_cfgoff@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movl	%eax, %ecx
	sarl	$8, %ecx
	movq	_PCI_FUNCMAX@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	movq	_cfgfunc@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movl	%eax, %ecx
	sarl	$11, %ecx
	movq	_PCI_SLOTMAX@GOTPCREL(%rip), %rdx
	andl	(%rdx), %ecx
	movq	_cfgslot@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	sarl	$16, %eax
	movq	_PCI_BUSMAX@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_cfgbus@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_8:
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cfgbus,4,2                     ## @cfgbus
	.comm	_cfgslot,4,2                    ## @cfgslot
	.comm	_cfgfunc,4,2                    ## @cfgfunc
	.comm	_cfgoff,4,2                     ## @cfgoff
	.comm	_cfgenable,4,2                  ## @cfgenable
	.comm	_CONF1_ENABLE,4,2               ## @CONF1_ENABLE
	.comm	_PCI_REGMAX,4,2                 ## @PCI_REGMAX
	.comm	_PCI_FUNCMAX,4,2                ## @PCI_FUNCMAX
	.comm	_PCI_SLOTMAX,4,2                ## @PCI_SLOTMAX
	.comm	_PCI_BUSMAX,4,2                 ## @PCI_BUSMAX
	.no_dead_strip	_pci_emul_cfgaddr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_emul_cfgaddr
_pci_emul_cfgaddr:                      ; @pci_emul_cfgaddr
	.cfi_startproc
; %bb.0:
	cmp	w4, #4
	b.ne	LBB0_3
; %bb.1:
	cbz	w2, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _cfgbus@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cfgbus@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _cfgslot@GOTPAGE
Lloh4:
	ldr	x9, [x9, _cfgslot@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w9, w9, #11
	orr	w8, w9, w8, lsl #16
Lloh6:
	adrp	x9, _cfgfunc@GOTPAGE
Lloh7:
	ldr	x9, [x9, _cfgfunc@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w8, w9, lsl #8
Lloh9:
	adrp	x9, _cfgoff@GOTPAGE
Lloh10:
	ldr	x9, [x9, _cfgoff@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _cfgenable@GOTPAGE
Lloh13:
	ldr	x9, [x9, _cfgenable@GOTPAGEOFF]
Lloh14:
	adrp	x10, _CONF1_ENABLE@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CONF1_ENABLE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	ldr	w10, [x10]
	cmp	w9, #0
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
	b	LBB0_5
LBB0_3:
	cbz	w2, LBB0_7
; %bb.4:
	mov	w8, #255
	mov	w9, #65535
	cmp	w4, #2
	csel	w8, w9, w8, eq
LBB0_5:
	str	w8, [x5]
	mov	w0, #0
	ret
LBB0_6:
	ldr	w8, [x5]
Lloh18:
	adrp	x9, _CONF1_ENABLE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CONF1_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	bics	wzr, w9, w8
Lloh21:
	adrp	x9, _cfgenable@GOTPAGE
Lloh22:
	ldr	x9, [x9, _cfgenable@GOTPAGEOFF]
	cset	w10, eq
Lloh23:
	str	w10, [x9]
Lloh24:
	adrp	x9, _PCI_REGMAX@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PCI_REGMAX@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	and	w9, w9, w8
Lloh27:
	adrp	x10, _cfgoff@GOTPAGE
Lloh28:
	ldr	x10, [x10, _cfgoff@GOTPAGEOFF]
Lloh29:
	str	w9, [x10]
Lloh30:
	adrp	x9, _PCI_FUNCMAX@GOTPAGE
Lloh31:
	ldr	x9, [x9, _PCI_FUNCMAX@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	and	w9, w9, w8, asr #8
Lloh33:
	adrp	x10, _cfgfunc@GOTPAGE
Lloh34:
	ldr	x10, [x10, _cfgfunc@GOTPAGEOFF]
Lloh35:
	str	w9, [x10]
Lloh36:
	adrp	x9, _PCI_SLOTMAX@GOTPAGE
Lloh37:
	ldr	x9, [x9, _PCI_SLOTMAX@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	and	w9, w9, w8, asr #11
Lloh39:
	adrp	x10, _cfgslot@GOTPAGE
Lloh40:
	ldr	x10, [x10, _cfgslot@GOTPAGEOFF]
Lloh41:
	adrp	x11, _PCI_BUSMAX@GOTPAGE
Lloh42:
	ldr	x11, [x11, _PCI_BUSMAX@GOTPAGEOFF]
Lloh43:
	str	w9, [x10]
Lloh44:
	ldr	w9, [x11]
	and	w8, w9, w8, asr #16
Lloh45:
	adrp	x9, _cfgbus@GOTPAGE
Lloh46:
	ldr	x9, [x9, _cfgbus@GOTPAGEOFF]
Lloh47:
	str	w8, [x9]
LBB0_7:
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh44
	.loh AdrpLdrGotStr	Lloh39, Lloh40, Lloh43
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_cfgbus,4,2                     ; @cfgbus
	.comm	_cfgslot,4,2                    ; @cfgslot
	.comm	_cfgfunc,4,2                    ; @cfgfunc
	.comm	_cfgoff,4,2                     ; @cfgoff
	.comm	_cfgenable,4,2                  ; @cfgenable
	.comm	_CONF1_ENABLE,4,2               ; @CONF1_ENABLE
	.comm	_PCI_REGMAX,4,2                 ; @PCI_REGMAX
	.comm	_PCI_FUNCMAX,4,2                ; @PCI_FUNCMAX
	.comm	_PCI_SLOTMAX,4,2                ; @PCI_SLOTMAX
	.comm	_PCI_BUSMAX,4,2                 ; @PCI_BUSMAX
	.no_dead_strip	_pci_emul_cfgaddr
.subsections_via_symbols
