	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_spi_set_ios
_mmc_spi_set_ios:                       ## @mmc_spi_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	%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	%rsi, %r13
	callq	_mmc_priv
	movq	%rax, %r14
	movl	(%r13), %edi
	cmpl	%edi, (%rax)
	je	LBB0_20
## %bb.1:
	movq	%rax, %r15
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	(%rax), %r12
	addq	$8, %r15
	movq	8(%r14), %rbx
	addq	$16, %rbx
	callq	_mmc_powerstring
	movl	16(%r13), %ecx
	testq	%r12, %r12
	je	LBB0_4
## %bb.5:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.1(%rip), %r8
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%r13), %eax
	andl	$-2, %eax
	movb	$1, %r12b
	cmpl	$128, %eax
	jne	LBB0_8
## %bb.6:
	movq	8(%r14), %rdi
	movq	16(%r14), %rax
	addq	$16, %rdi
	movl	16(%r13), %esi
	callq	*(%rax)
	cmpl	$128, (%r13)
	jne	LBB0_8
## %bb.7:
	movl	4(%r14), %edi
	callq	_msleep
	jmp	LBB0_8
LBB0_2:
	addq	$8, %r15
	movq	8(%r14), %rbx
	addq	$16, %rbx
	callq	_mmc_powerstring
	movl	16(%r13), %ecx
LBB0_4:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.2(%rip), %r8
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_8:
	movl	(%r13), %eax
	movq	_MMC_POWER_ON@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_mmc_spi_initsequence
LBB0_10:
	testb	%r12b, %r12b
	je	LBB0_19
## %bb.11:
	cmpl	$129, (%r13)
	jne	LBB0_19
## %bb.12:
	movl	$0, -44(%rbp)
	movq	_SPI_CPOL@GOTPCREL(%rip), %rcx
	movq	_SPI_CPHA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	notl	%eax
	movq	(%r15), %rdi
	andl	%eax, (%rdi)
	callq	_spi_setup
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_14
## %bb.13:
	movq	(%r15), %rdi
	addq	$16, %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_14:
	movq	(%r15), %rdi
	leaq	-44(%rbp), %rsi
	movl	$1, %edx
	callq	_spi_write
	testq	%rax, %rax
	jns	LBB0_16
## %bb.15:
	movq	(%r15), %rdi
	addq	$16, %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_16:
	movl	$10, %edi
	callq	_msleep
	testl	%r12d, %r12d
	jne	LBB0_19
## %bb.17:
	movl	(%rbx), %eax
	movq	_SPI_CPOL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	(%r15), %rdi
	orl	%eax, (%rdi)
	callq	_spi_setup
	testl	%eax, %eax
	jns	LBB0_19
## %bb.18:
	movq	(%r15), %rdi
	addq	$16, %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_19:
	movl	(%r13), %eax
	movl	%eax, (%r14)
LBB0_20:
	movq	8(%r14), %rdi
	movq	8(%r13), %rax
	cmpq	%rax, 8(%rdi)
	je	LBB0_23
## %bb.21:
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	movq	%rax, 8(%rdi)
	callq	_spi_setup
	movq	8(%r14), %rdi
	movq	8(%rdi), %rdx
	addq	$16, %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmc_spi: power %s (%d)%s\n"

L_.str.1:                               ## @.str.1
	.asciz	", can switch"

L_.str.2:                               ## @.str.2
	.space	1

	.comm	_MMC_POWER_ON,4,2               ## @MMC_POWER_ON
	.comm	_SPI_CPOL,4,2                   ## @SPI_CPOL
	.comm	_SPI_CPHA,4,2                   ## @SPI_CPHA
L_.str.3:                               ## @.str.3
	.asciz	"switch to SPI mode 0 failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"put spi signals to low failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"switch back to SPI mode 3 failed\n"

L_.str.6:                               ## @.str.6
	.asciz	"mmc_spi:  clock to %d Hz, %d\n"

	.no_dead_strip	_mmc_spi_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_spi_set_ios
_mmc_spi_set_ios:                       ; @mmc_spi_set_ios
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	bl	_mmc_priv
	mov	x19, x0
	ldr	w8, [x0]
	ldr	w0, [x20]
	cmp	w8, w0
	b.eq	LBB0_22
; %bb.1:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.2:
	ldr	x23, [x8]
	mov	x22, x19
	ldr	x8, [x22, #8]!
	add	x21, x8, #16
	bl	_mmc_powerstring
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x20, #16]
	cbz	x23, LBB0_8
; %bb.3:
Lloh0:
	adrp	x9, l_.str.1@PAGE
Lloh1:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [sp, #8]
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	ldr	w8, [x20]
	and	w8, w8, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.4:
	ldp	x9, x8, [x19, #8]
	ldr	x8, [x8]
	add	x0, x9, #16
	ldr	w1, [x20, #16]
	blr	x8
	ldr	w8, [x20]
	cmp	w8, #128
	b.ne	LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_msleep
LBB0_6:
	mov	w21, #1
	b	LBB0_10
LBB0_7:
	mov	x22, x19
	ldr	x8, [x22, #8]!
	add	x21, x8, #16
	bl	_mmc_powerstring
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x20, #16]
	b	LBB0_9
LBB0_8:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
LBB0_9:
Lloh4:
	adrp	x9, l_.str.2@PAGE
Lloh5:
	add	x9, x9, l_.str.2@PAGEOFF
	stp	x8, x9, [sp, #8]
	str	x0, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_dbg
	mov	w21, #0
LBB0_10:
	ldr	w8, [x20]
Lloh8:
	adrp	x9, _MMC_POWER_ON@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MMC_POWER_ON@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_mmc_spi_initsequence
LBB0_12:
	cbz	w21, LBB0_21
; %bb.13:
	ldr	w8, [x20]
	cmp	w8, #129
	b.ne	LBB0_21
; %bb.14:
	str	wzr, [sp, #28]
Lloh11:
	adrp	x23, _SPI_CPOL@GOTPAGE
Lloh12:
	ldr	x23, [x23, _SPI_CPOL@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh13:
	adrp	x24, _SPI_CPHA@GOTPAGE
Lloh14:
	ldr	x24, [x24, _SPI_CPHA@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w8, w9, w8
	ldr	x0, [x22]
	ldr	w9, [x0]
	bic	w8, w9, w8
	str	w8, [x0]
	bl	_spi_setup
	mov	x21, x0
	tbz	w0, #31, LBB0_16
; %bb.15:
	ldr	x8, [x22]
	add	x0, x8, #16
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
LBB0_16:
	ldr	x0, [x22]
	add	x1, sp, #28
	mov	w2, #1
	bl	_spi_write
	tbz	x0, #63, LBB0_18
; %bb.17:
	ldr	x8, [x22]
	add	x0, x8, #16
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
LBB0_18:
	mov	w0, #10
	bl	_msleep
	cbnz	w21, LBB0_21
; %bb.19:
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w8, w9, w8
	ldr	x0, [x22]
	ldr	w9, [x0]
	orr	w8, w8, w9
	str	w8, [x0]
	bl	_spi_setup
	tbz	w0, #31, LBB0_21
; %bb.20:
	ldr	x8, [x22]
	add	x0, x8, #16
Lloh19:
	adrp	x1, l_.str.5@PAGE
Lloh20:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_dbg
LBB0_21:
	ldr	w8, [x20]
	str	w8, [x19]
LBB0_22:
	ldr	x0, [x19, #8]
	ldr	x9, [x0, #8]
	ldr	x8, [x20, #8]
	cmp	x9, x8
	ccmp	x8, #0, #4, ne
	b.eq	LBB0_24
; %bb.23:
	str	x8, [x0, #8]
	bl	_spi_setup
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x9, [x19, #8]
	add	x8, x9, #16
	ldr	x9, [x9, #8]
	stp	x9, x0, [sp]
Lloh21:
	adrp	x1, l_.str.6@PAGE
Lloh22:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x8
	bl	_dev_dbg
LBB0_24:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmc_spi: power %s (%d)%s\n"

l_.str.1:                               ; @.str.1
	.asciz	", can switch"

l_.str.2:                               ; @.str.2
	.space	1

	.comm	_MMC_POWER_ON,4,2               ; @MMC_POWER_ON
	.comm	_SPI_CPOL,4,2                   ; @SPI_CPOL
	.comm	_SPI_CPHA,4,2                   ; @SPI_CPHA
l_.str.3:                               ; @.str.3
	.asciz	"switch to SPI mode 0 failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"put spi signals to low failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"switch back to SPI mode 3 failed\n"

l_.str.6:                               ; @.str.6
	.asciz	"mmc_spi:  clock to %d Hz, %d\n"

	.no_dead_strip	_mmc_spi_set_ios
.subsections_via_symbols
