	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_select_powerclass
_mmc_select_powerclass:                 ## @mmc_select_powerclass
	.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, %rbx
	movq	8(%rdi), %r14
	callq	_mmc_can_ext_csd
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	(%r14), %r12d
	movq	_MMC_BUS_WIDTH_1@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_4
## %bb.2:
	movq	_EXT_CSD_CARD_TYPE_DDR_52@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	(%rbx), %r15d
	movq	_EXT_CSD_DDR_BUS_WIDTH_8@GOTPCREL(%rip), %rax
	cmoveq	_EXT_CSD_BUS_WIDTH_8@GOTPCREL(%rip), %rax
	movq	_EXT_CSD_DDR_BUS_WIDTH_4@GOTPCREL(%rip), %rcx
	cmoveq	_EXT_CSD_BUS_WIDTH_4@GOTPCREL(%rip), %rcx
	movq	_MMC_BUS_WIDTH_8@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %r12d
	cmoveq	%rax, %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	callq	___mmc_select_powerclass
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_mmc_hostname
	movl	$1, %edx
	movl	%r12d, %ecx
	shll	%cl, %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %ecx
	callq	_pr_warn
	movl	%ebx, %r13d
LBB0_4:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_BUS_WIDTH_1,4,2            ## @MMC_BUS_WIDTH_1
	.comm	_EXT_CSD_CARD_TYPE_DDR_52,4,2   ## @EXT_CSD_CARD_TYPE_DDR_52
	.comm	_MMC_BUS_WIDTH_8,4,2            ## @MMC_BUS_WIDTH_8
	.comm	_EXT_CSD_DDR_BUS_WIDTH_8,4,2    ## @EXT_CSD_DDR_BUS_WIDTH_8
	.comm	_EXT_CSD_DDR_BUS_WIDTH_4,4,2    ## @EXT_CSD_DDR_BUS_WIDTH_4
	.comm	_EXT_CSD_BUS_WIDTH_8,4,2        ## @EXT_CSD_BUS_WIDTH_8
	.comm	_EXT_CSD_BUS_WIDTH_4,4,2        ## @EXT_CSD_BUS_WIDTH_4
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: power class selection to bus width %d ddr %d failed\n"

	.no_dead_strip	_mmc_select_powerclass
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_select_powerclass
_mmc_select_powerclass:                 ; @mmc_select_powerclass
	.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, x0
	ldr	x19, [x0, #8]
	bl	_mmc_can_ext_csd
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w22, [x19]
Lloh0:
	adrp	x8, _MMC_BUS_WIDTH_1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MMC_BUS_WIDTH_1@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_3
LBB0_2:
	mov	w21, #0
	b	LBB0_5
LBB0_3:
	ldr	w8, [x21]
Lloh3:
	adrp	x9, _EXT_CSD_CARD_TYPE_DDR_52@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXT_CSD_CARD_TYPE_DDR_52@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ands	w20, w9, w8
Lloh6:
	adrp	x8, _MMC_BUS_WIDTH_8@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MMC_BUS_WIDTH_8@GOTPAGEOFF]
Lloh8:
	adrp	x9, _EXT_CSD_BUS_WIDTH_8@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EXT_CSD_BUS_WIDTH_8@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x10, _EXT_CSD_DDR_BUS_WIDTH_8@GOTPAGE
Lloh12:
	ldr	x10, [x10, _EXT_CSD_DDR_BUS_WIDTH_8@GOTPAGEOFF]
	csel	x9, x9, x10, eq
Lloh13:
	adrp	x10, _EXT_CSD_BUS_WIDTH_4@GOTPAGE
Lloh14:
	ldr	x10, [x10, _EXT_CSD_BUS_WIDTH_4@GOTPAGEOFF]
Lloh15:
	adrp	x11, _EXT_CSD_DDR_BUS_WIDTH_4@GOTPAGE
Lloh16:
	ldr	x11, [x11, _EXT_CSD_DDR_BUS_WIDTH_4@GOTPAGEOFF]
	csel	x10, x10, x11, eq
	cmp	w22, w8
	csel	x8, x9, x10, eq
	ldr	w1, [x8]
	mov	x0, x21
	bl	___mmc_select_powerclass
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_mmc_hostname
	mov	x1, x0
	mov	w8, #1
	lsl	w2, w8, w22
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x3, x20
	bl	_pr_warn
LBB0_5:
	mov	x0, x21
	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 AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_BUS_WIDTH_1,4,2            ; @MMC_BUS_WIDTH_1
	.comm	_EXT_CSD_CARD_TYPE_DDR_52,4,2   ; @EXT_CSD_CARD_TYPE_DDR_52
	.comm	_MMC_BUS_WIDTH_8,4,2            ; @MMC_BUS_WIDTH_8
	.comm	_EXT_CSD_DDR_BUS_WIDTH_8,4,2    ; @EXT_CSD_DDR_BUS_WIDTH_8
	.comm	_EXT_CSD_DDR_BUS_WIDTH_4,4,2    ; @EXT_CSD_DDR_BUS_WIDTH_4
	.comm	_EXT_CSD_BUS_WIDTH_8,4,2        ; @EXT_CSD_BUS_WIDTH_8
	.comm	_EXT_CSD_BUS_WIDTH_4,4,2        ; @EXT_CSD_BUS_WIDTH_4
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: power class selection to bus width %d ddr %d failed\n"

	.no_dead_strip	_mmc_select_powerclass
.subsections_via_symbols
