	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rts5209_card_power_on
_rts5209_card_power_on:                 ## @rts5209_card_power_on
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_SD_POWER_MASK@GOTPCREL(%rip), %rax
	movq	_SD_PARTIAL_POWER_ON@GOTPCREL(%rip), %rcx
	movq	_SD_POWER_ON@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	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	%r13b
	andb	%dl, %r13b
	movq	_MS_POWER_ON@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmovneq	_MS_POWER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	cmovneq	_MS_PARTIAL_POWER_ON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	movq	_WRITE_REG_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_CARD_PWR_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r14), %esi
	movq	_PWR_GATE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_LDO3318_PWR_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movl	$4, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%rbx, %rdi
	movl	$100, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	testb	%r13b, %r13b
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	cmovnel	-44(%rbp), %r13d                ## 4-byte Folded Reload
	movl	$150, %edi
	callq	_udelay
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	movq	_WRITE_REG_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_CARD_PWR_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r14), %esi
	movq	_PWR_GATE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%rbx, %rdi
	movl	$100, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rtsx_pci_send_cmd              ## TAILCALL
LBB0_1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_POWER_MASK,4,2              ## @SD_POWER_MASK
	.comm	_SD_PARTIAL_POWER_ON,4,2        ## @SD_PARTIAL_POWER_ON
	.comm	_SD_POWER_ON,4,2                ## @SD_POWER_ON
	.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_PARTIAL_POWER_ON,4,2        ## @MS_PARTIAL_POWER_ON
	.comm	_MS_POWER_ON,4,2                ## @MS_POWER_ON
	.comm	_WRITE_REG_CMD,4,2              ## @WRITE_REG_CMD
	.comm	_CARD_PWR_CTL,4,2               ## @CARD_PWR_CTL
	.comm	_PWR_GATE_CTRL,4,2              ## @PWR_GATE_CTRL
	.comm	_LDO3318_PWR_MASK,4,2           ## @LDO3318_PWR_MASK
	.no_dead_strip	_rts5209_card_power_on
.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_on
_rts5209_card_power_on:                 ; @rts5209_card_power_on
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _SD_POWER_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SD_POWER_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x9, _SD_PARTIAL_POWER_ON@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SD_PARTIAL_POWER_ON@GOTPAGEOFF]
Lloh4:
	adrp	x10, _SD_POWER_ON@GOTPAGE
Lloh5:
	ldr	x10, [x10, _SD_POWER_ON@GOTPAGEOFF]
	ldr	w11, [x0]
Lloh6:
	adrp	x12, _PCR_MS_PMOS@GOTPAGE
Lloh7:
	ldr	x12, [x12, _PCR_MS_PMOS@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	tst	w12, w11
	cset	w11, ne
Lloh9:
	adrp	x12, _RTSX_MS_CARD@GOTPAGE
Lloh10:
	ldr	x12, [x12, _RTSX_MS_CARD@GOTPAGEOFF]
Lloh11:
	ldr	w12, [x12]
	cmp	w12, w1
	cset	w12, eq
	ands	w23, w11, w12
Lloh12:
	adrp	x11, _MS_POWER_MASK@GOTPAGE
Lloh13:
	ldr	x11, [x11, _MS_POWER_MASK@GOTPAGEOFF]
Lloh14:
	adrp	x12, _MS_PARTIAL_POWER_ON@GOTPAGE
Lloh15:
	ldr	x12, [x12, _MS_PARTIAL_POWER_ON@GOTPAGEOFF]
Lloh16:
	adrp	x13, _MS_POWER_ON@GOTPAGE
Lloh17:
	ldr	x13, [x13, _MS_POWER_ON@GOTPAGEOFF]
Lloh18:
	ldr	w24, [x10]
Lloh19:
	ldr	w25, [x13]
	csel	x8, x11, x8, ne
	ldr	w20, [x8]
	csel	x8, x12, x9, ne
	ldr	w21, [x8]
	bl	_rtsx_pci_init_cmd
Lloh20:
	adrp	x22, _WRITE_REG_CMD@GOTPAGE
Lloh21:
	ldr	x22, [x22, _WRITE_REG_CMD@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh22:
	adrp	x26, _CARD_PWR_CTL@GOTPAGE
Lloh23:
	ldr	x26, [x26, _CARD_PWR_CTL@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x19
	mov	x3, x20
	mov	x4, x21
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x22]
Lloh24:
	adrp	x27, _PWR_GATE_CTRL@GOTPAGE
Lloh25:
	ldr	x27, [x27, _PWR_GATE_CTRL@GOTPAGEOFF]
	ldr	w2, [x27]
Lloh26:
	adrp	x28, _LDO3318_PWR_MASK@GOTPAGE
Lloh27:
	ldr	x28, [x28, _LDO3318_PWR_MASK@GOTPAGEOFF]
	ldr	w3, [x28]
	mov	x0, x19
	mov	w4, #4
	bl	_rtsx_pci_add_cmd
	mov	x0, x19
	mov	w1, #100
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_2
; %bb.1:
	tst	w23, #0x1
	csel	w21, w25, w24, ne
	mov	w0, #150
	bl	_udelay
	mov	x0, x19
	bl	_rtsx_pci_init_cmd
	ldr	w1, [x22]
	ldr	w2, [x26]
	mov	x0, x19
	mov	x3, x20
	mov	x4, x21
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x22]
	ldr	w2, [x27]
	ldr	w3, [x28]
	mov	x0, x19
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	mov	x0, x19
	mov	w1, #100
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_rtsx_pci_send_cmd
LBB0_2:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh18
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_POWER_MASK,4,2              ; @SD_POWER_MASK
	.comm	_SD_PARTIAL_POWER_ON,4,2        ; @SD_PARTIAL_POWER_ON
	.comm	_SD_POWER_ON,4,2                ; @SD_POWER_ON
	.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_PARTIAL_POWER_ON,4,2        ; @MS_PARTIAL_POWER_ON
	.comm	_MS_POWER_ON,4,2                ; @MS_POWER_ON
	.comm	_WRITE_REG_CMD,4,2              ; @WRITE_REG_CMD
	.comm	_CARD_PWR_CTL,4,2               ; @CARD_PWR_CTL
	.comm	_PWR_GATE_CTRL,4,2              ; @PWR_GATE_CTRL
	.comm	_LDO3318_PWR_MASK,4,2           ; @LDO3318_PWR_MASK
	.no_dead_strip	_rts5209_card_power_on
.subsections_via_symbols
