	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function advk_pcie_wr_conf
_advk_pcie_wr_conf:                     ## @advk_pcie_wr_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
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	callq	_advk_pcie_valid_device
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_3
## %bb.11:
	addq	$8, %rbx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_bridge_emul_conf_write     ## TAILCALL
LBB0_1:
	movq	_PCIBIOS_DEVICE_NOT_FOUND@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_3:
	movl	%r15d, %eax
	cltd
	idivl	%r12d
	testl	%edx, %edx
	je	LBB0_5
LBB0_4:
	movq	_PCIBIOS_SET_FAILED@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	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(%r14), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_6
## %bb.7:
	movq	_PCIE_CONFIG_WR_TYPE0@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_PCIE_CONFIG_WR_TYPE1@GOTPCREL(%rip), %rax
LBB0_8:
	movq	_PIO_CTRL@GOTPCREL(%rip), %rcx
	orl	(%rax), %esi
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	callq	_advk_writel
	movq	(%r14), %rdi
	movl	%r13d, %esi
	movl	%r15d, %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
	andl	$3, %r15d
	leal	(,%r15,8), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	shll	%cl, %r13d
	decl	%r12d
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_GENMASK
	movl	%eax, %r14d
	movl	%r15d, %ecx
	shll	%cl, %r14d
	movq	_PIO_WR_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_advk_writel
	movq	_PIO_WR_DATA_STRB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %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_4
## %bb.9:
	movq	%rbx, %rdi
	callq	_advk_pcie_check_pio_status
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rax
LBB0_10:
	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	_PCIBIOS_SET_FAILED,4,2         ## @PCIBIOS_SET_FAILED
	.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_WR_TYPE0,4,2       ## @PCIE_CONFIG_WR_TYPE0
	.comm	_PCIE_CONFIG_WR_TYPE1,4,2       ## @PCIE_CONFIG_WR_TYPE1
	.comm	_PIO_ADDR_LS,4,2                ## @PIO_ADDR_LS
	.comm	_PIO_ADDR_MS,4,2                ## @PIO_ADDR_MS
	.comm	_PIO_WR_DATA,4,2                ## @PIO_WR_DATA
	.comm	_PIO_WR_DATA_STRB,4,2           ## @PIO_WR_DATA_STRB
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ## @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_advk_pcie_wr_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_wr_conf
_advk_pcie_wr_conf:                     ; @advk_pcie_wr_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	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
	ldr	x19, [x0, #16]
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	bl	_advk_pcie_valid_device
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x24]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	add	x0, x19, #8
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	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_write
LBB0_3:
Lloh0:
	adrp	x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCIBIOS_DEVICE_NOT_FOUND@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	sdiv	w8, w22, w21
	msub	w8, w8, w21, w22
	cbz	w8, LBB0_6
LBB0_5:
Lloh2:
	adrp	x8, _PCIBIOS_SET_FAILED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCIBIOS_SET_FAILED@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh4:
	adrp	x25, _PIO_START@GOTPAGE
Lloh5:
	ldr	x25, [x25, _PIO_START@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w1, #0
	bl	_advk_writel
Lloh6:
	adrp	x8, _PIO_ISR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PIO_ISR@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #1
	bl	_advk_writel
Lloh9:
	adrp	x26, _PIO_CTRL@GOTPAGE
Lloh10:
	ldr	x26, [x26, _PIO_CTRL@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x19
	bl	_advk_readl
Lloh11:
	adrp	x8, _PIO_CTRL_TYPE_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PIO_CTRL_TYPE_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	x9, [x24, #8]
Lloh14:
	adrp	x10, _PCIE_CONFIG_WR_TYPE0@GOTPAGE
Lloh15:
	ldr	x10, [x10, _PCIE_CONFIG_WR_TYPE0@GOTPAGEOFF]
Lloh16:
	adrp	x11, _PCIE_CONFIG_WR_TYPE1@GOTPAGE
Lloh17:
	ldr	x11, [x11, _PCIE_CONFIG_WR_TYPE1@GOTPAGEOFF]
	ldr	x12, [x19]
	cmp	x9, x12
	csel	x9, x10, x11, eq
	ldr	w9, [x9]
	orr	w1, w9, w8
	ldr	w2, [x26]
	mov	x0, x19
	bl	_advk_writel
	ldr	x0, [x24]
	mov	x1, x23
	mov	x2, x22
	bl	_PCIE_CONF_ADDR
	mov	x1, x0
Lloh18:
	adrp	x8, _PIO_ADDR_LS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PIO_ADDR_LS@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_advk_writel
Lloh21:
	adrp	x8, _PIO_ADDR_MS@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PIO_ADDR_MS@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_advk_writel
	and	w22, w22, #0x3
	lsl	w8, w22, #3
	lsl	w20, w20, w8
	sub	w0, w21, #1
	mov	w1, #0
	bl	_GENMASK
	lsl	w21, w0, w22
Lloh24:
	adrp	x8, _PIO_WR_DATA@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PIO_WR_DATA@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_advk_writel
Lloh27:
	adrp	x8, _PIO_WR_DATA_STRB@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PIO_WR_DATA_STRB@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_advk_writel
	ldr	w2, [x25]
	mov	x0, x19
	mov	w1, #1
	bl	_advk_writel
	mov	x0, x19
	bl	_advk_pcie_wait_pio
	tbnz	w0, #31, LBB0_5
; %bb.7:
	mov	x0, x19
	bl	_advk_pcie_check_pio_status
Lloh30:
	adrp	x8, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
LBB0_8:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIBIOS_DEVICE_NOT_FOUND,4,2   ; @PCIBIOS_DEVICE_NOT_FOUND
	.comm	_PCIBIOS_SET_FAILED,4,2         ; @PCIBIOS_SET_FAILED
	.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_WR_TYPE0,4,2       ; @PCIE_CONFIG_WR_TYPE0
	.comm	_PCIE_CONFIG_WR_TYPE1,4,2       ; @PCIE_CONFIG_WR_TYPE1
	.comm	_PIO_ADDR_LS,4,2                ; @PIO_ADDR_LS
	.comm	_PIO_ADDR_MS,4,2                ; @PIO_ADDR_MS
	.comm	_PIO_WR_DATA,4,2                ; @PIO_WR_DATA
	.comm	_PIO_WR_DATA_STRB,4,2           ; @PIO_WR_DATA_STRB
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ; @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_advk_pcie_wr_conf
.subsections_via_symbols
