	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_sd_setup_card              ## -- Begin function mmc_sd_setup_card
	.p2align	4, 0x90
_mmc_sd_setup_card:                     ## @mmc_sd_setup_card
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	testl	%edx, %edx
	je	LBB0_6
## %bb.1:
	movq	%r15, %rdi
	callq	_mmc_host_is_spi
	testq	%rax, %rax
	je	LBB0_11
LBB0_2:
	movq	_use_spi_crc@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mmc_spi_set_crc
	movl	%eax, %ebx
	orl	%eax, %r12d
	jne	LBB0_12
LBB0_3:
	movq	%r15, %rdi
	callq	_mmc_sd_get_ro
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:
	movq	%r14, %rdi
	callq	_mmc_card_set_readonly
	jmp	LBB0_12
LBB0_6:
	movq	%r14, %rdi
	callq	_mmc_app_send_scr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.7:
	movq	%r14, %rdi
	callq	_mmc_decode_scr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	%r14, %rdi
	callq	_mmc_read_ssr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.9:
	movq	%r14, %rdi
	callq	_mmc_init_erase
	movq	%r14, %rdi
	callq	_mmc_read_switch
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.10:
	movq	%r15, %rdi
	callq	_mmc_host_is_spi
	testq	%rax, %rax
	jne	LBB0_2
	jmp	LBB0_3
LBB0_13:
	movq	%r15, %rdi
	callq	_mmc_hostname
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
LBB0_11:
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_use_spi_crc,4,2                ## @use_spi_crc
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: host does not support reading read-only switch, assuming write-enable\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_sd_setup_card              ; -- Begin function mmc_sd_setup_card
	.p2align	2
_mmc_sd_setup_card:                     ; @mmc_sd_setup_card
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	cbz	w2, LBB0_6
; %bb.1:
	mov	x0, x20
	bl	_mmc_host_is_spi
	cbz	x0, LBB0_13
LBB0_2:
Lloh0:
	adrp	x8, _use_spi_crc@GOTPAGE
Lloh1:
	ldr	x8, [x8, _use_spi_crc@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_mmc_spi_set_crc
	orr	w8, w0, w21
	cbnz	w8, LBB0_13
LBB0_3:
	mov	x0, x20
	bl	_mmc_sd_get_ro
	tbnz	w0, #31, LBB0_11
; %bb.4:
	cbz	w0, LBB0_13
; %bb.5:
	mov	x0, x19
	bl	_mmc_card_set_readonly
	b	LBB0_12
LBB0_6:
	mov	x0, x19
	bl	_mmc_app_send_scr
	cbnz	w0, LBB0_13
; %bb.7:
	mov	x0, x19
	bl	_mmc_decode_scr
	cbnz	w0, LBB0_13
; %bb.8:
	mov	x0, x19
	bl	_mmc_read_ssr
	cbnz	w0, LBB0_13
; %bb.9:
	mov	x0, x19
	bl	_mmc_init_erase
	mov	x0, x19
	bl	_mmc_read_switch
	cbnz	w0, LBB0_13
; %bb.10:
	mov	x0, x20
	bl	_mmc_host_is_spi
	cbnz	x0, LBB0_2
	b	LBB0_3
LBB0_11:
	mov	x0, x20
	bl	_mmc_hostname
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_12:
	mov	w0, #0
LBB0_13:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_use_spi_crc,4,2                ; @use_spi_crc
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: host does not support reading read-only switch, assuming write-enable\n"

.subsections_via_symbols
