	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5260_init_from_cfg
_rts5260_init_from_cfg:                 ## @rts5260_init_from_cfg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_PCR_ASPM_SETTING_5260@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_rtsx_pci_read_config_dword
	movl	-12(%rbp), %eax
	movq	_ASPM_L1_1_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_ASPM_L1_1_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_2:
	movq	_ASPM_L1_2_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_ASPM_L1_2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_4:
	movq	_PM_L1_1_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_PM_L1_1_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_6:
	movq	_PM_L1_2_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movq	_PM_L1_2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
LBB0_8:
	movq	%rbx, %rdi
	callq	_rts5260_pwr_saving_setting
	cmpq	$0, 24(%rbx)
	je	LBB0_12
## %bb.9:
	movl	(%rbx), %edi
	movq	_PCI_EXP_DEVCTL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-16(%rbp), %rdx
	callq	_pcie_capability_read_word
	movq	_PCI_EXP_DEVCTL2_LTR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -16(%rbp)
	je	LBB0_11
## %bb.10:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%rbx)
	movl	20(%rbx), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_ltr_latency
	jmp	LBB0_12
LBB0_11:
	movl	$0, 8(%rbx)
LBB0_12:
	movq	_ASPM_L1_1_EN@GOTPCREL(%rip), %rax
	movq	_ASPM_L1_2_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_PM_L1_1_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_PM_L1_2_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_check_dev_flag
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movl	%ecx, 16(%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCR_ASPM_SETTING_5260,4,2      ## @PCR_ASPM_SETTING_5260
	.comm	_ASPM_L1_1_EN_MASK,4,2          ## @ASPM_L1_1_EN_MASK
	.comm	_ASPM_L1_1_EN,4,2               ## @ASPM_L1_1_EN
	.comm	_ASPM_L1_2_EN_MASK,4,2          ## @ASPM_L1_2_EN_MASK
	.comm	_ASPM_L1_2_EN,4,2               ## @ASPM_L1_2_EN
	.comm	_PM_L1_1_EN_MASK,4,2            ## @PM_L1_1_EN_MASK
	.comm	_PM_L1_1_EN,4,2                 ## @PM_L1_1_EN
	.comm	_PM_L1_2_EN_MASK,4,2            ## @PM_L1_2_EN_MASK
	.comm	_PM_L1_2_EN,4,2                 ## @PM_L1_2_EN
	.comm	_PCI_EXP_DEVCTL2,4,2            ## @PCI_EXP_DEVCTL2
	.comm	_PCI_EXP_DEVCTL2_LTR_EN,4,2     ## @PCI_EXP_DEVCTL2_LTR_EN
	.no_dead_strip	_rts5260_init_from_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rts5260_init_from_cfg
_rts5260_init_from_cfg:                 ; @rts5260_init_from_cfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _PCR_ASPM_SETTING_5260@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCR_ASPM_SETTING_5260@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_rtsx_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _ASPM_L1_1_EN_MASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ASPM_L1_1_EN_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x20, _ASPM_L1_1_EN@GOTPAGE
Lloh7:
	ldr	x20, [x20, _ASPM_L1_1_EN@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_2:
Lloh8:
	adrp	x9, _ASPM_L1_2_EN_MASK@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ASPM_L1_2_EN_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
Lloh11:
	adrp	x21, _ASPM_L1_2_EN@GOTPAGE
Lloh12:
	ldr	x21, [x21, _ASPM_L1_2_EN@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_4:
Lloh13:
	adrp	x9, _PM_L1_1_EN_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PM_L1_1_EN_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
Lloh16:
	adrp	x22, _PM_L1_1_EN@GOTPAGE
Lloh17:
	ldr	x22, [x22, _PM_L1_1_EN@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_6:
Lloh18:
	adrp	x9, _PM_L1_2_EN_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PM_L1_2_EN_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x23, _PM_L1_2_EN@GOTPAGE
Lloh22:
	ldr	x23, [x23, _PM_L1_2_EN@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
LBB0_8:
	mov	x0, x19
	bl	_rts5260_pwr_saving_setting
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	w0, [x19]
Lloh23:
	adrp	x8, _PCI_EXP_DEVCTL2@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PCI_EXP_DEVCTL2@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #8]
Lloh26:
	adrp	x9, _PCI_EXP_DEVCTL2_LTR_EN@GOTPAGE
Lloh27:
	ldr	x9, [x9, _PCI_EXP_DEVCTL2_LTR_EN@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	movi.2s	v0, #1
	str	d0, [x19, #8]
	ldr	w1, [x19, #20]
	mov	x0, x19
	bl	_rtsx_set_ltr_latency
	b	LBB0_12
LBB0_11:
	str	wzr, [x19, #8]
LBB0_12:
	ldr	w8, [x20]
	ldr	w9, [x21]
	orr	w8, w9, w8
	ldr	w9, [x22]
	orr	w8, w8, w9
	ldr	w9, [x23]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_rtsx_check_dev_flag
	cmp	x0, #0
	cset	w8, eq
	str	w8, [x19, #16]
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PCR_ASPM_SETTING_5260,4,2      ; @PCR_ASPM_SETTING_5260
	.comm	_ASPM_L1_1_EN_MASK,4,2          ; @ASPM_L1_1_EN_MASK
	.comm	_ASPM_L1_1_EN,4,2               ; @ASPM_L1_1_EN
	.comm	_ASPM_L1_2_EN_MASK,4,2          ; @ASPM_L1_2_EN_MASK
	.comm	_ASPM_L1_2_EN,4,2               ; @ASPM_L1_2_EN
	.comm	_PM_L1_1_EN_MASK,4,2            ; @PM_L1_1_EN_MASK
	.comm	_PM_L1_1_EN,4,2                 ; @PM_L1_1_EN
	.comm	_PM_L1_2_EN_MASK,4,2            ; @PM_L1_2_EN_MASK
	.comm	_PM_L1_2_EN,4,2                 ; @PM_L1_2_EN
	.comm	_PCI_EXP_DEVCTL2,4,2            ; @PCI_EXP_DEVCTL2
	.comm	_PCI_EXP_DEVCTL2_LTR_EN,4,2     ; @PCI_EXP_DEVCTL2_LTR_EN
	.no_dead_strip	_rts5260_init_from_cfg
.subsections_via_symbols
