	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5209_card_power_off
_rts5209_card_power_off:                ## @rts5209_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_SD_POWER_MASK@GOTPCREL(%rip), %rax
	movq	_SD_POWER_OFF@GOTPCREL(%rip), %rcx
	movq	_PCR_MS_PMOS@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	(%rdi), %edx
	setne	%dl
	movq	_RTSX_MS_CARD@GOTPCREL(%rip), %rdi
	cmpl	%esi, (%rdi)
	sete	%bl
	testb	%bl, %dl
	cmovneq	_MS_POWER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	cmovneq	_MS_POWER_OFF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	%r14, %rdi
	callq	_rtsx_pci_init_cmd
	movq	_WRITE_REG_CMD@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_CARD_PWR_CTL@GOTPCREL(%rip), %rax
	movq	_PMOS_STRG_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %r15d
	movl	(%rax), %edx
	movq	_PMOS_STRG_400mA@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r12), %esi
	movq	_PWR_GATE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_LDO3318_PWR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$6, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%r14, %rdi
	movl	$100, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtsx_pci_send_cmd              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_POWER_MASK,4,2              ## @SD_POWER_MASK
	.comm	_SD_POWER_OFF,4,2               ## @SD_POWER_OFF
	.comm	_PCR_MS_PMOS,4,2                ## @PCR_MS_PMOS
	.comm	_RTSX_MS_CARD,4,2               ## @RTSX_MS_CARD
	.comm	_MS_POWER_MASK,4,2              ## @MS_POWER_MASK
	.comm	_MS_POWER_OFF,4,2               ## @MS_POWER_OFF
	.comm	_WRITE_REG_CMD,4,2              ## @WRITE_REG_CMD
	.comm	_CARD_PWR_CTL,4,2               ## @CARD_PWR_CTL
	.comm	_PMOS_STRG_MASK,4,2             ## @PMOS_STRG_MASK
	.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	_rts5209_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 rts5209_card_power_off
_rts5209_card_power_off:                ; @rts5209_card_power_off
	.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
Lloh0:
	adrp	x8, _SD_POWER_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SD_POWER_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x9, _SD_POWER_OFF@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SD_POWER_OFF@GOTPAGEOFF]
Lloh4:
	adrp	x10, _PCR_MS_PMOS@GOTPAGE
Lloh5:
	ldr	x10, [x10, _PCR_MS_PMOS@GOTPAGEOFF]
	ldr	w11, [x0]
Lloh6:
	ldr	w10, [x10]
	tst	w10, w11
	cset	w10, ne
Lloh7:
	adrp	x11, _RTSX_MS_CARD@GOTPAGE
Lloh8:
	ldr	x11, [x11, _RTSX_MS_CARD@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	cmp	w11, w1
Lloh10:
	adrp	x11, _MS_POWER_MASK@GOTPAGE
Lloh11:
	ldr	x11, [x11, _MS_POWER_MASK@GOTPAGEOFF]
Lloh12:
	adrp	x12, _MS_POWER_OFF@GOTPAGE
Lloh13:
	ldr	x12, [x12, _MS_POWER_OFF@GOTPAGEOFF]
	cset	w13, eq
	tst	w10, w13
	csel	x8, x11, x8, ne
	ldr	w20, [x8]
	csel	x8, x12, x9, ne
	ldr	w21, [x8]
	bl	_rtsx_pci_init_cmd
Lloh14:
	adrp	x22, _WRITE_REG_CMD@GOTPAGE
Lloh15:
	ldr	x22, [x22, _WRITE_REG_CMD@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh16:
	adrp	x8, _CARD_PWR_CTL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CARD_PWR_CTL@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _PMOS_STRG_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PMOS_STRG_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	orr	w3, w8, w20
Lloh22:
	adrp	x8, _PMOS_STRG_400mA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PMOS_STRG_400mA@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	orr	w4, w8, w21
	mov	x0, x19
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x22]
Lloh25:
	adrp	x8, _PWR_GATE_CTRL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _PWR_GATE_CTRL@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
Lloh28:
	adrp	x8, _LDO3318_PWR_MASK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _LDO3318_PWR_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #6
	bl	_rtsx_pci_add_cmd
	mov	x0, x19
	mov	w1, #100
	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
	b	_rtsx_pci_send_cmd
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_POWER_MASK,4,2              ; @SD_POWER_MASK
	.comm	_SD_POWER_OFF,4,2               ; @SD_POWER_OFF
	.comm	_PCR_MS_PMOS,4,2                ; @PCR_MS_PMOS
	.comm	_RTSX_MS_CARD,4,2               ; @RTSX_MS_CARD
	.comm	_MS_POWER_MASK,4,2              ; @MS_POWER_MASK
	.comm	_MS_POWER_OFF,4,2               ; @MS_POWER_OFF
	.comm	_WRITE_REG_CMD,4,2              ; @WRITE_REG_CMD
	.comm	_CARD_PWR_CTL,4,2               ; @CARD_PWR_CTL
	.comm	_PMOS_STRG_MASK,4,2             ; @PMOS_STRG_MASK
	.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	_rts5209_card_power_off
.subsections_via_symbols
