	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_select_bus_width
_mmc_select_bus_width:                  ## @mmc_select_bus_width
	.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	%rdi, %r13
	movq	8(%rdi), %r15
	callq	_mmc_can_ext_csd
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movl	(%r15), %r14d
	movq	_MMC_CAP_4_BIT_DATA@GOTPCREL(%rip), %rax
	movq	_MMC_CAP_8_BIT_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	movl	(%rax), %eax
	orl	%r12d, %eax
	testl	%r14d, %eax
	je	LBB0_12
## %bb.2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	testl	%r14d, %r12d
	sete	%r15b
	leaq	_mmc_select_bus_width.bus_widths(%rip), %rdi
	callq	_ARRAY_SIZE
	cmpl	%r15d, %eax
	jbe	LBB0_12
## %bb.3:
	xorl	%r15d, %r15d
	testl	%r14d, %r12d
	sete	%r15b
	leaq	(,%r15,4), %r14
	movq	_EXT_CSD_CMD_SET_NORMAL@GOTPCREL(%rip), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r15
	leaq	_mmc_select_bus_width.bus_widths(%rip), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$4, %r14
	cmpq	%rax, %r15
	jae	LBB0_12
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	_EXT_CSD_BUS_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	_mmc_select_bus_width.ext_csd_bits(%rip), %rax
	movl	(%r14,%rax), %ecx
	movl	(%r13), %r8d
	movq	%r13, %rdi
	callq	_mmc_switch
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	_mmc_select_bus_width.bus_widths(%rip), %rax
	movl	(%r14,%rax), %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_mmc_set_bus_width
	movq	_MMC_CAP_BUS_WIDTH_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_mmc_bus_test
	jmp	LBB0_8
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_mmc_compare_ext_csds
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mmc_hostname
	movl	$1, %edx
	movl	%r12d, %ecx
	shll	%cl, %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
	movq	_EXT_CSD_CMD_SET_NORMAL@GOTPCREL(%rip), %r12
	jmp	LBB0_11
LBB0_9:
	movl	%r12d, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @mmc_select_bus_width.ext_csd_bits
_mmc_select_bus_width.ext_csd_bits:
	.long	130                             ## 0x82
	.long	131                             ## 0x83

	.section	__DATA,__data
	.p2align	2                               ## @mmc_select_bus_width.bus_widths
_mmc_select_bus_width.bus_widths:
	.long	128                             ## 0x80
	.long	129                             ## 0x81

	.comm	_MMC_CAP_4_BIT_DATA,4,2         ## @MMC_CAP_4_BIT_DATA
	.comm	_MMC_CAP_8_BIT_DATA,4,2         ## @MMC_CAP_8_BIT_DATA
	.comm	_EXT_CSD_CMD_SET_NORMAL,4,2     ## @EXT_CSD_CMD_SET_NORMAL
	.comm	_EXT_CSD_BUS_WIDTH,4,2          ## @EXT_CSD_BUS_WIDTH
	.comm	_MMC_CAP_BUS_WIDTH_TEST,4,2     ## @MMC_CAP_BUS_WIDTH_TEST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: switch to bus width %d failed\n"

	.no_dead_strip	_mmc_select_bus_width
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_select_bus_width
_mmc_select_bus_width:                  ; @mmc_select_bus_width
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x20, [x0, #8]
	bl	_mmc_can_ext_csd
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _MMC_CAP_4_BIT_DATA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_CAP_4_BIT_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x9]
Lloh3:
	adrp	x9, _MMC_CAP_8_BIT_DATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MMC_CAP_8_BIT_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w10, w9, w10
	tst	w10, w8
	b.eq	LBB0_4
; %bb.2:
	ands	w22, w9, w8
	cset	w23, eq
Lloh6:
	adrp	x21, _mmc_select_bus_width.bus_widths@PAGE
Lloh7:
	add	x21, x21, _mmc_select_bus_width.bus_widths@PAGEOFF
	mov	x0, x21
	bl	_ARRAY_SIZE
	cmp	w0, w23
	b.ls	LBB0_4
; %bb.3:
	cmp	w22, #0
Lloh8:
	adrp	x25, _EXT_CSD_CMD_SET_NORMAL@GOTPAGE
Lloh9:
	ldr	x25, [x25, _EXT_CSD_CMD_SET_NORMAL@GOTPAGEOFF]
Lloh10:
	adrp	x26, _EXT_CSD_BUS_WIDTH@GOTPAGE
Lloh11:
	ldr	x26, [x26, _EXT_CSD_BUS_WIDTH@GOTPAGEOFF]
Lloh12:
	adrp	x27, _mmc_select_bus_width.ext_csd_bits@PAGE
Lloh13:
	add	x27, x27, _mmc_select_bus_width.ext_csd_bits@PAGEOFF
	cset	w28, eq
Lloh14:
	adrp	x22, l_.str@PAGE
Lloh15:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_9
LBB0_4:
	mov	w23, #0
LBB0_5:
	mov	x0, x23
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_6:                                 ;   in Loop: Header=BB0_9 Depth=1
	bl	_mmc_compare_ext_csds
	mov	x24, x0
	cbz	w0, LBB0_5
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	bl	_mmc_hostname
	mov	x1, x0
	mov	w8, #1
	lsl	w2, w8, w23
	mov	x0, x22
	bl	_pr_warn
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x28, x28, #1
	mov	x0, x21
	bl	_ARRAY_SIZE
	cmp	x28, w0, uxtw
	mov	x23, x24
	b.hs	LBB0_5
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	ldr	w2, [x26]
	ldr	w3, [x27, x28, lsl #2]
	ldr	w4, [x19]
	mov	x0, x19
	bl	_mmc_switch
	mov	x24, x0
	cbnz	w0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w23, [x21, x28, lsl #2]
	mov	x0, x20
	mov	x1, x23
	bl	_mmc_set_bus_width
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _MMC_CAP_BUS_WIDTH_TEST@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MMC_CAP_BUS_WIDTH_TEST@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	mov	x0, x19
	mov	x1, x23
	tst	w9, w8
	b.eq	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_mmc_bus_test
	mov	x24, x0
	cbnz	w0, LBB0_7
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @mmc_select_bus_width.ext_csd_bits
_mmc_select_bus_width.ext_csd_bits:
	.long	130                             ; 0x82
	.long	131                             ; 0x83

	.section	__DATA,__data
	.p2align	2                               ; @mmc_select_bus_width.bus_widths
_mmc_select_bus_width.bus_widths:
	.long	128                             ; 0x80
	.long	129                             ; 0x81

	.comm	_MMC_CAP_4_BIT_DATA,4,2         ; @MMC_CAP_4_BIT_DATA
	.comm	_MMC_CAP_8_BIT_DATA,4,2         ; @MMC_CAP_8_BIT_DATA
	.comm	_EXT_CSD_CMD_SET_NORMAL,4,2     ; @EXT_CSD_CMD_SET_NORMAL
	.comm	_EXT_CSD_BUS_WIDTH,4,2          ; @EXT_CSD_BUS_WIDTH
	.comm	_MMC_CAP_BUS_WIDTH_TEST,4,2     ; @MMC_CAP_BUS_WIDTH_TEST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: switch to bus width %d failed\n"

	.no_dead_strip	_mmc_select_bus_width
.subsections_via_symbols
