	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_wait_voltage_stable_1
_sd_wait_voltage_stable_1:              ## @sd_wait_voltage_stable_1
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rbx
	movl	$1, %edi
	callq	_mdelay
	movq	_SD_BUS_STAT@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_rtsx_pci_read_register
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movq	_SD_CMD_STATUS@GOTPCREL(%rip), %rax
	movq	_SD_DAT3_STATUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SD_DAT2_STATUS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SD_DAT1_STATUS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SD_DAT0_STATUS@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%ecx, -20(%rbp)
	je	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_3:
	movl	(%r14), %esi
	movq	_SD_CLK_FORCE_STOP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	$255, %edx
	callq	_rtsx_pci_write_register
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_BUS_STAT,4,2                ## @SD_BUS_STAT
	.comm	_SD_CMD_STATUS,4,2              ## @SD_CMD_STATUS
	.comm	_SD_DAT3_STATUS,4,2             ## @SD_DAT3_STATUS
	.comm	_SD_DAT2_STATUS,4,2             ## @SD_DAT2_STATUS
	.comm	_SD_DAT1_STATUS,4,2             ## @SD_DAT1_STATUS
	.comm	_SD_DAT0_STATUS,4,2             ## @SD_DAT0_STATUS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SD_CLK_FORCE_STOP,4,2          ## @SD_CLK_FORCE_STOP
	.no_dead_strip	_sd_wait_voltage_stable_1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_wait_voltage_stable_1
_sd_wait_voltage_stable_1:              ; @sd_wait_voltage_stable_1
	.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
	ldr	x19, [x0]
	mov	w0, #1
	bl	_mdelay
Lloh0:
	adrp	x20, _SD_BUS_STAT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SD_BUS_STAT@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_rtsx_pci_read_register
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _SD_CMD_STATUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SD_CMD_STATUS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _SD_DAT3_STATUS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SD_DAT3_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _SD_DAT2_STATUS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SD_DAT2_STATUS@GOTPAGEOFF]
	ldr	w10, [sp, #12]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh11:
	adrp	x9, _SD_DAT1_STATUS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SD_DAT1_STATUS@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh14:
	adrp	x9, _SD_DAT0_STATUS@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SD_DAT0_STATUS@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w8, w8, w9
	tst	w8, w10
	b.eq	LBB0_3
; %bb.2:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_3:
	ldr	w1, [x20]
Lloh20:
	adrp	x8, _SD_CLK_FORCE_STOP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SD_CLK_FORCE_STOP@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w2, #255
	bl	_rtsx_pci_write_register
	cmp	w0, #0
	csel	w0, w0, wzr, lt
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_BUS_STAT,4,2                ; @SD_BUS_STAT
	.comm	_SD_CMD_STATUS,4,2              ; @SD_CMD_STATUS
	.comm	_SD_DAT3_STATUS,4,2             ; @SD_DAT3_STATUS
	.comm	_SD_DAT2_STATUS,4,2             ; @SD_DAT2_STATUS
	.comm	_SD_DAT1_STATUS,4,2             ; @SD_DAT1_STATUS
	.comm	_SD_DAT0_STATUS,4,2             ; @SD_DAT0_STATUS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SD_CLK_FORCE_STOP,4,2          ; @SD_CLK_FORCE_STOP
	.no_dead_strip	_sd_wait_voltage_stable_1
.subsections_via_symbols
