	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_pcie_check_cfg_cpld
_mtk_pcie_check_cfg_cpld:               ## @mtk_pcie_check_cfg_cpld
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_PCIE_APP_TLP_REQ@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	movq	_USEC_PER_MSEC@GOTPCREL(%rip), %rax
	imull	$100, (%rax), %r8d
	movl	$1, %edx
	movl	$10, %ecx
	callq	_readl_poll_timeout_atomic
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	movq	_APP_CPL_STATUS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
## %bb.3:
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_PCIBIOS_SET_FAILED@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIE_APP_TLP_REQ,8,3           ## @PCIE_APP_TLP_REQ
	.comm	_APP_CFG_REQ,4,2                ## @APP_CFG_REQ
	.comm	_USEC_PER_MSEC,4,2              ## @USEC_PER_MSEC
	.comm	_PCIBIOS_SET_FAILED,4,2         ## @PCIBIOS_SET_FAILED
	.comm	_APP_CPL_STATUS,4,2             ## @APP_CPL_STATUS
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ## @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_mtk_pcie_check_cfg_cpld
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_pcie_check_cfg_cpld
_mtk_pcie_check_cfg_cpld:               ; @mtk_pcie_check_cfg_cpld
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, _PCIE_APP_TLP_REQ@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PCIE_APP_TLP_REQ@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
Lloh2:
	adrp	x8, _USEC_PER_MSEC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _USEC_PER_MSEC@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	mov	w9, #100
	mul	w4, w8, w9
	mov	w2, #1
	mov	w3, #10
	bl	_readl_poll_timeout_atomic
Lloh5:
	adrp	x21, _PCIBIOS_SET_FAILED@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PCIBIOS_SET_FAILED@GOTPAGEOFF]
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh7:
	adrp	x8, _APP_CPL_STATUS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _APP_CPL_STATUS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
	tst	w8, w0
	csel	x21, x9, x21, eq
LBB0_2:
	ldr	w0, [x21]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIE_APP_TLP_REQ,8,3           ; @PCIE_APP_TLP_REQ
	.comm	_APP_CFG_REQ,4,2                ; @APP_CFG_REQ
	.comm	_USEC_PER_MSEC,4,2              ; @USEC_PER_MSEC
	.comm	_PCIBIOS_SET_FAILED,4,2         ; @PCIBIOS_SET_FAILED
	.comm	_APP_CPL_STATUS,4,2             ; @APP_CPL_STATUS
	.comm	_PCIBIOS_SUCCESSFUL,4,2         ; @PCIBIOS_SUCCESSFUL
	.no_dead_strip	_mtk_pcie_check_cfg_cpld
.subsections_via_symbols
