	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___mmc_switch                   ## -- Begin function __mmc_switch
	.p2align	4, 0x90
___mmc_switch:                          ## @__mmc_switch
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, %ebx
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movl	16(%rbp), %r12d
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
	movl	$0, -60(%rbp)
	movq	$0, -68(%rbp)
	movb	8(%r15), %al
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	movq	%r15, %rdi
	callq	_mmc_retune_hold
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movl	%r12d, %ecx
	movl	(%r15), %eax
	xorl	%r12d, %r12d
	cmpl	%ebx, %eax
	cmovael	%ecx, %r12d
	testl	%eax, %eax
	cmovel	%ecx, %r12d
LBB0_2:
	movq	_MMC_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_MMC_SWITCH_MODE_WRITE_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$24, %eax
	movl	%r13d, %ecx
	shll	$16, %ecx
	shll	$8, %r14d
	orl	-52(%rbp), %ecx                 ## 4-byte Folded Reload
	orl	%r14d, %ecx
	orl	%eax, %ecx
	movl	%ecx, -72(%rbp)
	movq	_MMC_CMD_AC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.3:
	movq	_MMC_RSP_SPI_R1B@GOTPCREL(%rip), %rcx
	movq	_MMC_RSP_R1B@GOTPCREL(%rip), %rdx
	orl	(%rcx), %eax
	orl	(%rdx), %eax
	movl	%eax, -68(%rbp)
	movl	%ebx, -64(%rbp)
	jmp	LBB0_5
LBB0_4:
	movq	_MMC_RSP_SPI_R1@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_MMC_RSP_R1@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, -68(%rbp)
LBB0_5:
	movl	%ebx, %r14d
	movq	_EXT_CSD_SANITIZE_START@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	$1, -60(%rbp)
LBB0_7:
	movq	_MMC_CMD_RETRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	callq	_mmc_wait_for_cmd
	movl	%eax, %r13d
	cmpl	$0, 16(%rbp)
	je	LBB0_20
## %bb.8:
	testl	%r13d, %r13d
	jne	LBB0_20
## %bb.9:
	movl	24(%rbp), %ebx
	testl	%r12d, %r12d
	je	LBB0_11
## %bb.10:
	movq	_MMC_CAP_WAIT_WHILE_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r15), %eax
	jne	LBB0_13
LBB0_11:
	movq	%r15, %rdi
	callq	_mmc_host_is_spi
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movl	32(%rbp), %ecx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_mmc_poll_for_busy
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_20
LBB0_13:
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	testb	%r14b, %r14b
	je	LBB0_15
## %bb.14:
	movzbl	%r14b, %esi
	movq	%r15, %rdi
	callq	_mmc_set_timing
LBB0_15:
	testl	%ebx, %ebx
	je	LBB0_16
## %bb.17:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_mmc_switch_status
	movl	%eax, %r13d
	testb	%r14b, %r14b
	je	LBB0_20
## %bb.18:
	testl	%r13d, %r13d
	je	LBB0_20
## %bb.19:
	movzbl	-41(%rbp), %esi                 ## 1-byte Folded Reload
	movq	%r15, %rdi
	callq	_mmc_set_timing
	jmp	LBB0_20
LBB0_16:
	xorl	%r13d, %r13d
LBB0_20:
	movq	%r15, %rdi
	callq	_mmc_retune_release
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_SWITCH,4,2                 ## @MMC_SWITCH
	.comm	_MMC_SWITCH_MODE_WRITE_BYTE,4,2 ## @MMC_SWITCH_MODE_WRITE_BYTE
	.comm	_MMC_CMD_AC,4,2                 ## @MMC_CMD_AC
	.comm	_MMC_RSP_SPI_R1B,4,2            ## @MMC_RSP_SPI_R1B
	.comm	_MMC_RSP_R1B,4,2                ## @MMC_RSP_R1B
	.comm	_MMC_RSP_SPI_R1,4,2             ## @MMC_RSP_SPI_R1
	.comm	_MMC_RSP_R1,4,2                 ## @MMC_RSP_R1
	.comm	_EXT_CSD_SANITIZE_START,4,2     ## @EXT_CSD_SANITIZE_START
	.comm	_MMC_CMD_RETRIES,4,2            ## @MMC_CMD_RETRIES
	.comm	_MMC_CAP_WAIT_WHILE_BUSY,4,2    ## @MMC_CAP_WAIT_WHILE_BUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___mmc_switch                   ; -- Begin function __mmc_switch
	.p2align	2
___mmc_switch:                          ; @__mmc_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x22, x7
	mov	x21, x6
	mov	x20, x5
	mov	x24, x4
	mov	x27, x3
	mov	x26, x2
	mov	x28, x1
	mov	x23, x0
	ldr	x19, [x0]
	str	wzr, [sp, #20]
	stur	xzr, [sp, #12]
	ldrb	w8, [x19, #8]
	str	w8, [sp, #4]                    ; 4-byte Folded Spill
	mov	x0, x19
	bl	_mmc_retune_hold
	mov	x25, x21
	cbz	w24, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, w24
	ccmp	w8, #0, #4, lo
	csel	w25, wzr, w21, ne
LBB0_2:
Lloh0:
	adrp	x8, _MMC_SWITCH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MMC_SWITCH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MMC_SWITCH_MODE_WRITE_BYTE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_SWITCH_MODE_WRITE_BYTE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w10, w28, w26, lsl #16
	orr	w10, w10, w27, lsl #8
	orr	w9, w10, w9, lsl #24
	str	w8, [sp, #24]
	str	w9, [sp, #8]
Lloh6:
	adrp	x8, _MMC_CMD_AC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MMC_CMD_AC@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cbz	w25, LBB0_4
; %bb.3:
Lloh9:
	adrp	x9, _MMC_RSP_SPI_R1B@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MMC_RSP_SPI_R1B@GOTPAGEOFF]
Lloh11:
	adrp	x10, _MMC_RSP_R1B@GOTPAGE
Lloh12:
	ldr	x10, [x10, _MMC_RSP_R1B@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w8, w8, w10
	stp	w8, w24, [sp, #12]
	b	LBB0_5
LBB0_4:
Lloh15:
	adrp	x9, _MMC_RSP_SPI_R1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MMC_RSP_SPI_R1@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _MMC_RSP_R1@GOTPAGE
Lloh19:
	ldr	x10, [x10, _MMC_RSP_R1@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w8, w9, w8
	orr	w8, w8, w10
	str	w8, [sp, #12]
LBB0_5:
Lloh21:
	adrp	x8, _EXT_CSD_SANITIZE_START@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EXT_CSD_SANITIZE_START@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, w26
	b.ne	LBB0_7
; %bb.6:
	mov	w8, #1
	str	w8, [sp, #20]
LBB0_7:
Lloh24:
	adrp	x8, _MMC_CMD_RETRIES@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MMC_CMD_RETRIES@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_mmc_wait_for_cmd
	mov	x26, x0
	cbz	w21, LBB0_20
; %bb.8:
	cbnz	w26, LBB0_20
; %bb.9:
	cbz	w25, LBB0_11
; %bb.10:
	ldr	w8, [x19, #4]
Lloh27:
	adrp	x9, _MMC_CAP_WAIT_WHILE_BUSY@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MMC_CAP_WAIT_WHILE_BUSY@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbnz	w8, LBB0_13
LBB0_11:
	mov	x0, x19
	bl	_mmc_host_is_spi
	cbnz	x0, LBB0_13
; %bb.12:
	ldr	w3, [x29, #16]
	mov	x0, x23
	mov	x1, x24
	mov	x2, x22
	bl	_mmc_poll_for_busy
	mov	x26, x0
	cbnz	w0, LBB0_20
LBB0_13:
	cbz	w20, LBB0_15
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	bl	_mmc_set_timing
LBB0_15:
	cbz	w22, LBB0_19
; %bb.16:
	mov	x0, x23
	bl	_mmc_switch_status
	mov	x26, x0
	cbz	w20, LBB0_20
; %bb.17:
	cbz	w26, LBB0_20
; %bb.18:
	mov	x0, x19
	ldr	w1, [sp, #4]                    ; 4-byte Folded Reload
	bl	_mmc_set_timing
	b	LBB0_20
LBB0_19:
	mov	w26, #0
LBB0_20:
	mov	x0, x19
	bl	_mmc_retune_release
	mov	x0, x26
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_SWITCH,4,2                 ; @MMC_SWITCH
	.comm	_MMC_SWITCH_MODE_WRITE_BYTE,4,2 ; @MMC_SWITCH_MODE_WRITE_BYTE
	.comm	_MMC_CMD_AC,4,2                 ; @MMC_CMD_AC
	.comm	_MMC_RSP_SPI_R1B,4,2            ; @MMC_RSP_SPI_R1B
	.comm	_MMC_RSP_R1B,4,2                ; @MMC_RSP_R1B
	.comm	_MMC_RSP_SPI_R1,4,2             ; @MMC_RSP_SPI_R1
	.comm	_MMC_RSP_R1,4,2                 ; @MMC_RSP_R1
	.comm	_EXT_CSD_SANITIZE_START,4,2     ; @EXT_CSD_SANITIZE_START
	.comm	_MMC_CMD_RETRIES,4,2            ; @MMC_CMD_RETRIES
	.comm	_MMC_CAP_WAIT_WHILE_BUSY,4,2    ; @MMC_CAP_WAIT_WHILE_BUSY
.subsections_via_symbols
