	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function advk_pcie_rd_conf
_advk_pcie_rd_conf:                     ## @advk_pcie_rd_conf
	.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	%r8, %r14
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_advk_pcie_valid_device
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	(%r15), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_3
## %bb.15:
	addq	$8, %rbx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r14, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_bridge_emul_conf_read      ## TAILCALL
LBB0_1:
	movl	$-1, (%r14)
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_3:
	movq	_PIO_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_advk_writel
	movq	_PIO_ISR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_advk_writel
	movq	_PIO_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_advk_readl
	movq	_PIO_CTRL_TYPE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	movq	8(%r15), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_4
## %bb.5:
	movq	_PCIE_CONFIG_RD_TYPE0@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_PCIE_CONFIG_RD_TYPE1@GOTPCREL(%rip), %rax
LBB0_6:
	orl	(%rax), %esi
	movq	_PIO_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_advk_writel
	movq	(%r15), %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_PCIE_CONF_ADDR
	movq	_PIO_ADDR_LS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_advk_writel
	movq	_PIO_ADDR_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_advk_writel
	movq	_PIO_WR_DATA_STRB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$15, %esi
	callq	_advk_writel
	movq	_PIO_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_advk_writel
	movq	%rbx, %rdi
	callq	_advk_pcie_wait_pio
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	%rbx, %rdi
	callq	_advk_pcie_check_pio_status
	movq	_PIO_RD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_advk_readl
	movl	%eax, (%r14)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$1, %ecx
	je	LBB0_9
## %bb.10:
	cmpl	$2, %ecx
	jne	LBB0_13
## %bb.11:
	movl	$65535, %edx                    ## imm = 0xFFFF
	jmp	LBB0_12
LBB0_7:
	movq	_PCIBIOS_SET_FAILED@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_9:
	movl	$255, %edx
LBB0_12:
	shll	$3, %r12d
	movl	%r12d, %ecx
	sarl	%cl, %eax
	andl	%edx, %eax
	movl	%eax, (%r14)
LBB0_13:
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ## @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_PIO_START,4,2                  ## @PIO_START
	.comm	_PIO_ISR,4,2                    ## @PIO_ISR
	.comm	_PIO_CTRL,4,2                   ## @PIO_CTRL
	.comm	_PIO_CTRL_TYPE_MASK,4,2         ## @PIO_CTRL_TYPE_MASK
	.comm	_PCIE_CONFIG_RD_TYPE0,4,2       ## @PCIE_CONFIG_RD_TYPE0
	.comm	_PCIE_CONFIG_RD_TYPE1,4,2       ## @PCIE_CONFIG_RD_TYPE1
	.comm	_PIO_ADDR_LS,4,2                ## @PIO_ADDR_LS
	.comm	_PIO_ADDR_MS,4,2                ## @PIO_ADDR_MS
	.comm	_PIO_WR_DATA_STRB,4,2           ## @PIO_WR_DATA_STRB
	.comm	_PCIBIOS_SET_FAILED,4,2         ## @PCIBIOS_SET_FAILED
	.comm	_PIO_RD_DATA,4,2                ## @PIO_RD_DATA
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ## @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_advk_pcie_rd_conf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function advk_pcie_rd_conf
_advk_pcie_rd_conf:                     ; @advk_pcie_rd_conf
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x4
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x24, x0
	ldr	x22, [x0, #16]
	mov	x0, x22
	mov	x1, x24
	mov	x2, x23
	bl	_advk_pcie_valid_device
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x24]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	add	x0, x22, #8
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_pci_bridge_emul_conf_read
LBB0_3:
	mov	w8, #-1
	str	w8, [x19]
Lloh0:
	adrp	x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGEOFF]
	b	LBB0_12
LBB0_4:
Lloh2:
	adrp	x25, _PIO_START@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PIO_START@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x22
	mov	w1, #0
	bl	_advk_writel
Lloh4:
	adrp	x8, _PIO_ISR@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PIO_ISR@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #1
	bl	_advk_writel
Lloh7:
	adrp	x26, _PIO_CTRL@GOTPAGE
Lloh8:
	ldr	x26, [x26, _PIO_CTRL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_advk_readl
Lloh9:
	adrp	x8, _PIO_CTRL_TYPE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PIO_CTRL_TYPE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	x9, [x24, #8]
Lloh12:
	adrp	x10, _PCIE_CONFIG_RD_TYPE0@GOTPAGE
Lloh13:
	ldr	x10, [x10, _PCIE_CONFIG_RD_TYPE0@GOTPAGEOFF]
Lloh14:
	adrp	x11, _PCIE_CONFIG_RD_TYPE1@GOTPAGE
Lloh15:
	ldr	x11, [x11, _PCIE_CONFIG_RD_TYPE1@GOTPAGEOFF]
	ldr	x12, [x22]
	cmp	x9, x12
	csel	x9, x10, x11, eq
	ldr	w9, [x9]
	orr	w1, w9, w8
	ldr	w2, [x26]
	mov	x0, x22
	bl	_advk_writel
	ldr	x0, [x24]
	mov	x1, x23
	mov	x2, x20
	bl	_PCIE_CONF_ADDR
	mov	x1, x0
Lloh16:
	adrp	x8, _PIO_ADDR_LS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PIO_ADDR_LS@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_advk_writel
Lloh19:
	adrp	x8, _PIO_ADDR_MS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PIO_ADDR_MS@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #0
	bl	_advk_writel
Lloh22:
	adrp	x8, _PIO_WR_DATA_STRB@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PIO_WR_DATA_STRB@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #15
	bl	_advk_writel
	ldr	w2, [x25]
	mov	x0, x22
	mov	w1, #1
	bl	_advk_writel
	mov	x0, x22
	bl	_advk_pcie_wait_pio
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	x0, x22
	bl	_advk_pcie_check_pio_status
Lloh25:
	adrp	x8, _PIO_RD_DATA@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PIO_RD_DATA@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_advk_readl
	str	w0, [x19]
	cmp	w21, #1
	b.eq	LBB0_9
; %bb.6:
	cmp	w21, #2
	b.ne	LBB0_11
; %bb.7:
	mov	w8, #65535
	b	LBB0_10
LBB0_8:
Lloh28:
	adrp	x8, _PCIBIOS_SET_FAILED@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PCIBIOS_SET_FAILED@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	mov	w8, #255
LBB0_10:
	ubfiz	w9, w20, #3, #2
	asr	w9, w0, w9
	and	w8, w9, w8
	str	w8, [x19]
LBB0_11:
Lloh30:
	adrp	x8, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ; @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_PIO_START,4,2                  ; @PIO_START
	.comm	_PIO_ISR,4,2                    ; @PIO_ISR
	.comm	_PIO_CTRL,4,2                   ; @PIO_CTRL
	.comm	_PIO_CTRL_TYPE_MASK,4,2         ; @PIO_CTRL_TYPE_MASK
	.comm	_PCIE_CONFIG_RD_TYPE0,4,2       ; @PCIE_CONFIG_RD_TYPE0
	.comm	_PCIE_CONFIG_RD_TYPE1,4,2       ; @PCIE_CONFIG_RD_TYPE1
	.comm	_PIO_ADDR_LS,4,2                ; @PIO_ADDR_LS
	.comm	_PIO_ADDR_MS,4,2                ; @PIO_ADDR_MS
	.comm	_PIO_WR_DATA_STRB,4,2           ; @PIO_WR_DATA_STRB
	.comm	_PCIBIOS_SET_FAILED,4,2         ; @PCIBIOS_SET_FAILED
	.comm	_PIO_RD_DATA,4,2                ; @PIO_RD_DATA
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ; @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_advk_pcie_rd_conf
.subsections_via_symbols
