	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdmmc_set_ios
_sdmmc_set_ios:                         ## @sdmmc_set_ios
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	callq	_mmc_priv
	cmpq	$0, 32(%rax)
	jne	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	movq	24(%rax), %r14
	movq	_RTSX_SD_CARD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rtsx_pci_card_exclusive_check
	testq	%rax, %rax
	je	LBB0_2
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_rtsx_pci_start_run
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	callq	_sd_set_bus_width
	movl	8(%r15), %esi
	movq	%rbx, %rdi
	callq	_sd_set_power_mode
	movl	4(%r15), %esi
	movq	%rbx, %rdi
	callq	_sd_set_timing
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, (%rbx)
	movl	4(%r15), %eax
	addl	$-128, %eax
	cmpl	$4, %eax
	ja	LBB0_6
## %bb.3:
	movl	$26, %ecx
	btl	%eax, %ecx
	jae	LBB0_4
## %bb.5:
	movq	_RTSX_SSC_DEPTH_1M@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	movq	_RTSX_SSC_DEPTH_2M@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, 16(%rbx)
	movq	$1, (%rbx)
	xorl	%r8d, %r8d
	movl	$1, %r9d
	jmp	LBB0_8
LBB0_6:
	movq	_RTSX_SSC_DEPTH_500K@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	movl	%edx, 16(%rbx)
	movl	$1, %r8d
	xorl	%r9d, %r9d
LBB0_8:
	movl	(%r15), %esi
	xorl	%ecx, %ecx
	cmpl	$1000001, %esi                  ## imm = 0xF4241
	setl	%cl
	movl	%ecx, 8(%rbx)
	movl	%esi, 12(%rbx)
	movq	%r14, %rdi
	callq	_rtsx_pci_switch_clock
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RTSX_SD_CARD,4,2               ## @RTSX_SD_CARD
	.comm	_RTSX_SSC_DEPTH_2M,4,2          ## @RTSX_SSC_DEPTH_2M
	.comm	_RTSX_SSC_DEPTH_1M,4,2          ## @RTSX_SSC_DEPTH_1M
	.comm	_RTSX_SSC_DEPTH_500K,4,2        ## @RTSX_SSC_DEPTH_500K
	.no_dead_strip	_sdmmc_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function sdmmc_set_ios
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
lCPI0_1:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_sdmmc_set_ios:                         ; @sdmmc_set_ios
	.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	x20, x1
	bl	_mmc_priv
	ldr	x8, [x0, #32]
	cbnz	x8, LBB0_2
; %bb.1:
	mov	x21, x0
	ldr	x19, [x0, #24]
Lloh0:
	adrp	x8, _RTSX_SD_CARD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RTSX_SD_CARD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rtsx_pci_card_exclusive_check
	cbz	x0, LBB0_3
LBB0_2:
	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
	ret
LBB0_3:
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_rtsx_pci_start_run
	ldr	w1, [x20, #12]
	mov	x0, x21
	bl	_sd_set_bus_width
	ldr	w1, [x20, #8]
	mov	x0, x21
	bl	_sd_set_power_mode
	ldr	w1, [x20, #4]
	mov	x0, x21
	bl	_sd_set_timing
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x21]
	ldr	w8, [x20, #4]
	sub	w8, w8, #128
	cmp	w8, #4
	b.hi	LBB0_7
; %bb.4:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #26
	tst	w8, w9
	b.eq	LBB0_6
; %bb.5:
	mov	w5, #0
Lloh5:
	adrp	x8, _RTSX_SSC_DEPTH_1M@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RTSX_SSC_DEPTH_1M@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	mov	w4, #0
Lloh7:
	adrp	x8, _RTSX_SSC_DEPTH_2M@GOTPAGE
Lloh8:
	ldr	x8, [x8, _RTSX_SSC_DEPTH_2M@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	str	w2, [x21, #16]
Lloh10:
	adrp	x8, lCPI0_1@PAGE
Lloh11:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x21]
	mov	w5, #1
	b	LBB0_9
LBB0_7:
	mov	w5, #0
Lloh12:
	adrp	x8, _RTSX_SSC_DEPTH_500K@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RTSX_SSC_DEPTH_500K@GOTPAGEOFF]
LBB0_8:
	ldr	w2, [x8]
	str	w2, [x21, #16]
	mov	w4, #1
LBB0_9:
	ldr	w1, [x20]
	mov	w8, #16961
	movk	w8, #15, lsl #16
	cmp	w1, w8
	cset	w3, lt
	stp	w3, w1, [x21, #8]
	mov	x0, x19
	bl	_rtsx_pci_switch_clock
	mov	x0, x19
	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	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_RTSX_SD_CARD,4,2               ; @RTSX_SD_CARD
	.comm	_RTSX_SSC_DEPTH_2M,4,2          ; @RTSX_SSC_DEPTH_2M
	.comm	_RTSX_SSC_DEPTH_1M,4,2          ; @RTSX_SSC_DEPTH_1M
	.comm	_RTSX_SSC_DEPTH_500K,4,2        ; @RTSX_SSC_DEPTH_500K
	.no_dead_strip	_sdmmc_set_ios
.subsections_via_symbols
