	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_sd_init_card
_mmc_sd_init_card:                      ## @mmc_sd_init_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	%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
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	xorl	%edi, %edi
	testq	%r12, %r12
	sete	%dil
	callq	_BUG_ON
	xorl	%edi, %edi
	cmpl	$0, 24(%r12)
	sete	%dil
	callq	_WARN_ON
	leaq	-64(%rbp), %rdx
	leaq	-68(%rbp), %rcx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_mmc_sd_get_cid
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_30:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_32
## %bb.31:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	testq	%r14, %r14
	je	LBB0_4
## %bb.2:
	movl	8(%r14), %esi
	leaq	-64(%rbp), %rdi
	movl	$16, %edx
	callq	_memcmp
	movq	%r14, %r15
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_30
LBB0_4:
	movq	_sd_type@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_mmc_alloc_card
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_30
LBB0_6:
	movq	_MMC_TYPE_SD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movl	8(%r15), %edi
	leaq	-64(%rbp), %rsi
	movl	$4, %edx
	callq	_memcpy
LBB0_7:
	movq	%r12, %rdi
	callq	_mmc_host_is_spi
	testl	%eax, %eax
	je	LBB0_8
## %bb.10:
	testq	%r14, %r14
	je	LBB0_11
LBB0_13:
	movq	%r12, %rdi
	callq	_mmc_host_is_spi
	testl	%eax, %eax
	je	LBB0_14
LBB0_15:
	xorl	%edx, %edx
	testq	%r14, %r14
	setne	%dl
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_mmc_sd_setup_card
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_16
LBB0_28:
	testq	%r14, %r14
	jne	LBB0_30
## %bb.29:
	movq	%r15, %rdi
	callq	_mmc_remove_card
	jmp	LBB0_30
LBB0_8:
	leaq	4(%r15), %rsi
	movq	%r12, %rdi
	callq	_mmc_send_relative_addr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_30
## %bb.9:
	movq	_MMC_BUSMODE_PUSHPULL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_mmc_set_bus_mode
	testq	%r14, %r14
	jne	LBB0_13
LBB0_11:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_mmc_sd_get_csd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_30
## %bb.12:
	movq	%r15, %rdi
	callq	_mmc_decode_cid
	jmp	LBB0_13
LBB0_14:
	movq	%r15, %rdi
	callq	_mmc_select_card
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_30
	jmp	LBB0_15
LBB0_16:
	movq	_SD_ROCR_S18A@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -68(%rbp)
	je	LBB0_20
## %bb.17:
	movq	%r15, %rdi
	callq	_mmc_sd_init_uhs_card
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_28
## %bb.18:
	movq	%r15, %rdi
	callq	_mmc_sd_card_set_uhs
	movq	16(%r12), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_27
## %bb.19:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	*%rax
	jmp	LBB0_27
LBB0_20:
	movq	%r15, %rdi
	callq	_mmc_sd_switch_hs
	testl	%eax, %eax
	jle	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	callq	_mmc_sd_go_highspeed
LBB0_23:
	movq	%r15, %rdi
	callq	_mmc_sd_get_max_clock
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_mmc_set_clock
	movq	_MMC_CAP_4_BIT_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_27
## %bb.24:
	movq	_SD_SCR_BUS_WIDTH_4@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_27
## %bb.25:
	movq	_MMC_BUS_WIDTH_4@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_mmc_app_set_bus_width
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_28
## %bb.26:
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_mmc_set_bus_width
LBB0_27:
	movq	%r15, 8(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_30
LBB0_22:
	movl	%eax, %ebx
	jne	LBB0_28
	jmp	LBB0_23
LBB0_32:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_sd_type,4,2                    ## @sd_type
	.comm	_MMC_TYPE_SD,4,2                ## @MMC_TYPE_SD
	.comm	_MMC_BUSMODE_PUSHPULL,4,2       ## @MMC_BUSMODE_PUSHPULL
	.comm	_SD_ROCR_S18A,4,2               ## @SD_ROCR_S18A
	.comm	_MMC_CAP_4_BIT_DATA,4,2         ## @MMC_CAP_4_BIT_DATA
	.comm	_SD_SCR_BUS_WIDTH_4,4,2         ## @SD_SCR_BUS_WIDTH_4
	.comm	_MMC_BUS_WIDTH_4,4,2            ## @MMC_BUS_WIDTH_4
	.no_dead_strip	_mmc_sd_init_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_sd_init_card
_mmc_sd_init_card:                      ; @mmc_sd_init_card
	.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, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	str	wzr, [sp, #4]
	cmp	x0, #0
	cset	w0, eq
	bl	_BUG_ON
	ldr	w8, [x19, #24]
	cmp	w8, #0
	cset	w0, eq
	bl	_WARN_ON
	add	x2, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	mov	x1, x21
	bl	_mmc_sd_get_cid
	mov	x22, x0
	cbz	w0, LBB0_3
LBB0_1:
	ldr	x8, [sp, #24]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_32
; %bb.2:
	mov	x0, x22
	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
LBB0_3:
	cbz	x20, LBB0_6
; %bb.4:
	ldr	w1, [x20, #8]
	add	x0, sp, #8
	mov	w2, #16
	bl	_memcmp
	mov	x21, x20
	cbz	x0, LBB0_9
; %bb.5:
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_1
LBB0_6:
Lloh9:
	adrp	x1, _sd_type@GOTPAGE
Lloh10:
	ldr	x1, [x1, _sd_type@GOTPAGEOFF]
	mov	x0, x19
	bl	_mmc_alloc_card
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_1
LBB0_8:
Lloh11:
	adrp	x8, _MMC_TYPE_SD@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MMC_TYPE_SD@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x21, #12]
	ldr	w0, [x21, #8]
	add	x1, sp, #8
	mov	w2, #4
	bl	_memcpy
LBB0_9:
	mov	x0, x19
	bl	_mmc_host_is_spi
	cbz	w0, LBB0_15
; %bb.10:
	cbz	x20, LBB0_17
LBB0_11:
	mov	x0, x19
	bl	_mmc_host_is_spi
	cbz	w0, LBB0_19
LBB0_12:
	cmp	x20, #0
	cset	w2, ne
	mov	x0, x19
	mov	x1, x21
	bl	_mmc_sd_setup_card
	mov	x22, x0
	cbz	w0, LBB0_20
LBB0_13:
	cbnz	x20, LBB0_1
; %bb.14:
	mov	x0, x21
	bl	_mmc_remove_card
	b	LBB0_1
LBB0_15:
	add	x1, x21, #4
	mov	x0, x19
	bl	_mmc_send_relative_addr
	mov	x22, x0
	cbnz	w0, LBB0_1
; %bb.16:
Lloh14:
	adrp	x8, _MMC_BUSMODE_PUSHPULL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MMC_BUSMODE_PUSHPULL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mmc_set_bus_mode
	cbnz	x20, LBB0_11
LBB0_17:
	mov	x0, x19
	mov	x1, x21
	bl	_mmc_sd_get_csd
	mov	x22, x0
	cbnz	w0, LBB0_1
; %bb.18:
	mov	x0, x21
	bl	_mmc_decode_cid
	b	LBB0_11
LBB0_19:
	mov	x0, x21
	bl	_mmc_select_card
	mov	x22, x0
	cbnz	w0, LBB0_1
	b	LBB0_12
LBB0_20:
	ldr	w8, [sp, #4]
Lloh17:
	adrp	x9, _SD_ROCR_S18A@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SD_ROCR_S18A@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	mov	x0, x21
	tst	w9, w8
	b.eq	LBB0_24
; %bb.21:
	bl	_mmc_sd_init_uhs_card
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.22:
	mov	x0, x21
	bl	_mmc_sd_card_set_uhs
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_30
; %bb.23:
	mov	x0, x19
	mov	w1, #1
	blr	x8
	b	LBB0_30
LBB0_24:
	bl	_mmc_sd_switch_hs
	cmp	w0, #1
	b.lt	LBB0_31
; %bb.25:
	mov	x0, x21
	bl	_mmc_sd_go_highspeed
LBB0_26:
	mov	x0, x21
	bl	_mmc_sd_get_max_clock
	mov	x1, x0
	mov	x0, x19
	bl	_mmc_set_clock
	ldr	w8, [x19]
Lloh20:
	adrp	x9, _MMC_CAP_4_BIT_DATA@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MMC_CAP_4_BIT_DATA@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
; %bb.27:
	ldr	w8, [x21]
Lloh23:
	adrp	x9, _SD_SCR_BUS_WIDTH_4@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SD_SCR_BUS_WIDTH_4@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
; %bb.28:
Lloh26:
	adrp	x23, _MMC_BUS_WIDTH_4@GOTPAGE
Lloh27:
	ldr	x23, [x23, _MMC_BUS_WIDTH_4@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_mmc_app_set_bus_width
	mov	x22, x0
	cbnz	w0, LBB0_13
; %bb.29:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_mmc_set_bus_width
LBB0_30:
	mov	w22, #0
	str	x21, [x19, #8]
	b	LBB0_1
LBB0_31:
	mov	x22, x0
	cbnz	w0, LBB0_13
	b	LBB0_26
LBB0_32:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_sd_type,4,2                    ; @sd_type
	.comm	_MMC_TYPE_SD,4,2                ; @MMC_TYPE_SD
	.comm	_MMC_BUSMODE_PUSHPULL,4,2       ; @MMC_BUSMODE_PUSHPULL
	.comm	_SD_ROCR_S18A,4,2               ; @SD_ROCR_S18A
	.comm	_MMC_CAP_4_BIT_DATA,4,2         ; @MMC_CAP_4_BIT_DATA
	.comm	_SD_SCR_BUS_WIDTH_4,4,2         ; @SD_SCR_BUS_WIDTH_4
	.comm	_MMC_BUS_WIDTH_4,4,2            ; @MMC_BUS_WIDTH_4
	.no_dead_strip	_mmc_sd_init_card
.subsections_via_symbols
