	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5227_card_power_off
_rts5227_card_power_off:                ## @rts5227_card_power_off
	.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
	cmpq	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_rtsx_pci_disable_ocp
LBB0_2:
	movq	_CARD_PWR_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SD_POWER_MASK@GOTPCREL(%rip), %rax
	movq	_PMOS_STRG_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_SD_POWER_OFF@GOTPCREL(%rip), %rax
	movq	_PMOS_STRG_400mA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%rbx, %rdi
	callq	_rtsx_pci_write_register
	movq	_PWR_GATE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LDO3318_PWR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_rtsx_pci_write_register
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_PWR_CTL,4,2               ## @CARD_PWR_CTL
	.comm	_SD_POWER_MASK,4,2              ## @SD_POWER_MASK
	.comm	_PMOS_STRG_MASK,4,2             ## @PMOS_STRG_MASK
	.comm	_SD_POWER_OFF,4,2               ## @SD_POWER_OFF
	.comm	_PMOS_STRG_400mA,4,2            ## @PMOS_STRG_400mA
	.comm	_PWR_GATE_CTRL,4,2              ## @PWR_GATE_CTRL
	.comm	_LDO3318_PWR_MASK,4,2           ## @LDO3318_PWR_MASK
	.no_dead_strip	_rts5227_card_power_off
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rts5227_card_power_off
_rts5227_card_power_off:                ; @rts5227_card_power_off
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_rtsx_pci_disable_ocp
LBB0_2:
Lloh0:
	adrp	x8, _CARD_PWR_CTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CARD_PWR_CTL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _SD_POWER_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SD_POWER_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _PMOS_STRG_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PMOS_STRG_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _SD_POWER_OFF@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SD_POWER_OFF@GOTPAGEOFF]
	orr	w2, w9, w8
Lloh11:
	ldr	w8, [x10]
Lloh12:
	adrp	x9, _PMOS_STRG_400mA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PMOS_STRG_400mA@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x19
	bl	_rtsx_pci_write_register
Lloh15:
	adrp	x8, _PWR_GATE_CTRL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PWR_GATE_CTRL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _LDO3318_PWR_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LDO3318_PWR_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_rtsx_pci_write_register
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_PWR_CTL,4,2               ; @CARD_PWR_CTL
	.comm	_SD_POWER_MASK,4,2              ; @SD_POWER_MASK
	.comm	_PMOS_STRG_MASK,4,2             ; @PMOS_STRG_MASK
	.comm	_SD_POWER_OFF,4,2               ; @SD_POWER_OFF
	.comm	_PMOS_STRG_400mA,4,2            ; @PMOS_STRG_400mA
	.comm	_PWR_GATE_CTRL,4,2              ; @PWR_GATE_CTRL
	.comm	_LDO3318_PWR_MASK,4,2           ; @LDO3318_PWR_MASK
	.no_dead_strip	_rts5227_card_power_off
.subsections_via_symbols
