	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5249_init_from_cfg
_rts5249_init_from_cfg:                 ## @rts5249_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	_PID_524A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_CHK_PCI_PID
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_PCR_ASPM_SETTING_REG2@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_PCR_ASPM_SETTING_REG1@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_rtsx_pci_read_config_dword
	movl	-12(%rbp), %eax
	movq	_ASPM_L1_1_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_ASPM_L1_1_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_5:
	movq	_ASPM_L1_2_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_ASPM_L1_2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_7:
	movq	_PM_L1_1_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.8:
	movq	_PM_L1_1_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
	movl	-12(%rbp), %eax
LBB0_9:
	movq	_PM_L1_2_EN_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movq	_PM_L1_2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_dev_flag
LBB0_11:
	cmpq	$0, 24(%rbx)
	je	LBB0_15
## %bb.12:
	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_14
## %bb.13:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 8(%rbx)
	movl	16(%rbx), %esi
	movq	%rbx, %rdi
	callq	_rtsx_set_ltr_latency
	jmp	LBB0_15
LBB0_14:
	movl	$0, 8(%rbx)
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PID_524A,4,2                   ## @PID_524A
	.comm	_PCR_ASPM_SETTING_REG1,4,2      ## @PCR_ASPM_SETTING_REG1
	.comm	_PCR_ASPM_SETTING_REG2,4,2      ## @PCR_ASPM_SETTING_REG2
	.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	_rts5249_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 rts5249_init_from_cfg
_rts5249_init_from_cfg:                 ; @rts5249_init_from_cfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _PID_524A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PID_524A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_CHK_PCI_PID
Lloh3:
	adrp	x8, _PCR_ASPM_SETTING_REG2@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCR_ASPM_SETTING_REG2@GOTPAGEOFF]
Lloh5:
	adrp	x9, _PCR_ASPM_SETTING_REG1@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCR_ASPM_SETTING_REG1@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_rtsx_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh7:
	adrp	x9, _ASPM_L1_1_EN_MASK@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ASPM_L1_1_EN_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh10:
	adrp	x8, _ASPM_L1_1_EN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ASPM_L1_1_EN@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_2:
Lloh13:
	adrp	x9, _ASPM_L1_2_EN_MASK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _ASPM_L1_2_EN_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh16:
	adrp	x8, _ASPM_L1_2_EN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ASPM_L1_2_EN@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_4:
Lloh19:
	adrp	x9, _PM_L1_1_EN_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PM_L1_1_EN_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh22:
	adrp	x8, _PM_L1_1_EN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PM_L1_1_EN@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
	ldr	w8, [sp, #12]
LBB0_6:
Lloh25:
	adrp	x9, _PM_L1_2_EN_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PM_L1_2_EN_MASK@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
Lloh28:
	adrp	x8, _PM_L1_2_EN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _PM_L1_2_EN@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtsx_set_dev_flag
LBB0_8:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	w0, [x19]
Lloh31:
	adrp	x8, _PCI_EXP_DEVCTL2@GOTPAGE
Lloh32:
	ldr	x8, [x8, _PCI_EXP_DEVCTL2@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_pcie_capability_read_word
	ldr	w8, [sp, #8]
Lloh34:
	adrp	x9, _PCI_EXP_DEVCTL2_LTR_EN@GOTPAGE
Lloh35:
	ldr	x9, [x9, _PCI_EXP_DEVCTL2_LTR_EN@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
	movi.2s	v0, #1
	str	d0, [x19, #8]
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_rtsx_set_ltr_latency
	b	LBB0_12
LBB0_11:
	str	wzr, [x19, #8]
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_PID_524A,4,2                   ; @PID_524A
	.comm	_PCR_ASPM_SETTING_REG1,4,2      ; @PCR_ASPM_SETTING_REG1
	.comm	_PCR_ASPM_SETTING_REG2,4,2      ; @PCR_ASPM_SETTING_REG2
	.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	_rts5249_init_from_cfg
.subsections_via_symbols
