	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_power_off
_sd_power_off:                          ## @sd_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	8(%rdi), %rbx
	movq	_SDMMC_POWER_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rdi)
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	movq	_WRITE_REG_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_CARD_CLK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SD_CLK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r14), %esi
	movq	_CARD_OE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SD_OUTPUT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%rbx, %rdi
	movl	$100, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	_RTSX_SD_CARD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_rtsx_pci_card_power_off
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_rtsx_pci_card_pull_ctl_disable ## TAILCALL
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDMMC_POWER_OFF,4,2            ## @SDMMC_POWER_OFF
	.comm	_WRITE_REG_CMD,4,2              ## @WRITE_REG_CMD
	.comm	_CARD_CLK_EN,4,2                ## @CARD_CLK_EN
	.comm	_SD_CLK_EN,4,2                  ## @SD_CLK_EN
	.comm	_CARD_OE,4,2                    ## @CARD_OE
	.comm	_SD_OUTPUT_EN,4,2               ## @SD_OUTPUT_EN
	.comm	_RTSX_SD_CARD,4,2               ## @RTSX_SD_CARD
	.no_dead_strip	_sd_power_off
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_power_off
_sd_power_off:                          ; @sd_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
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _SDMMC_POWER_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDMMC_POWER_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0]
	mov	x0, x19
	bl	_rtsx_pci_init_cmd
Lloh3:
	adrp	x20, _WRITE_REG_CMD@GOTPAGE
Lloh4:
	ldr	x20, [x20, _WRITE_REG_CMD@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh5:
	adrp	x8, _CARD_CLK_EN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CARD_CLK_EN@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _SD_CLK_EN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SD_CLK_EN@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x20]
Lloh11:
	adrp	x8, _CARD_OE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CARD_OE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _SD_OUTPUT_EN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SD_OUTPUT_EN@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	mov	x0, x19
	mov	w1, #100
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh17:
	adrp	x20, _RTSX_SD_CARD@GOTPAGE
Lloh18:
	ldr	x20, [x20, _RTSX_SD_CARD@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_rtsx_pci_card_power_off
	tbnz	w0, #31, LBB0_3
; %bb.2:
	ldr	w1, [x20]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_rtsx_pci_card_pull_ctl_disable
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SDMMC_POWER_OFF,4,2            ; @SDMMC_POWER_OFF
	.comm	_WRITE_REG_CMD,4,2              ; @WRITE_REG_CMD
	.comm	_CARD_CLK_EN,4,2                ; @CARD_CLK_EN
	.comm	_SD_CLK_EN,4,2                  ; @SD_CLK_EN
	.comm	_CARD_OE,4,2                    ; @CARD_OE
	.comm	_SD_OUTPUT_EN,4,2               ; @SD_OUTPUT_EN
	.comm	_RTSX_SD_CARD,4,2               ; @RTSX_SD_CARD
	.no_dead_strip	_sd_power_off
.subsections_via_symbols
