	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdio_select_driver_type
_sdio_select_driver_type:               ## @sdio_select_driver_type
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, (%rdi)
	movq	_SD_DRIVER_TYPE_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	8(%rdi), %edx
	movl	12(%rdi), %esi
	leaq	-32(%rbp), %rcx
	callq	_mmc_select_drive_strength
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %r14d
	movq	_SDIO_CCCR_DRIVE_STRENGTH@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	leaq	-25(%rbp), %r9
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_mmc_io_rw_direct
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	_SDIO_DRIVE_DTSx_MASK@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	movq	_SDIO_DRIVE_DTSx_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	notb	%al
	andb	%al, -25(%rbp)
	movl	%r14d, %edi
	callq	_host_drive_to_sdio_drive
	orb	-25(%rbp), %al
	movb	%al, -25(%rbp)
	movl	(%r15), %ecx
	movzbl	%al, %r8d
	movq	%rbx, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_mmc_io_rw_direct
	testl	%eax, %eax
	jne	LBB0_6
## %bb.3:
	movl	%r14d, (%rbx)
LBB0_4:
	movl	-32(%rbp), %esi
	testl	%esi, %esi
	je	LBB0_6
## %bb.5:
	movl	4(%rbx), %edi
	callq	_mmc_set_driver_type
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_DRIVER_TYPE_B,4,2           ## @SD_DRIVER_TYPE_B
	.comm	_SDIO_CCCR_DRIVE_STRENGTH,4,2   ## @SDIO_CCCR_DRIVE_STRENGTH
	.comm	_SDIO_DRIVE_DTSx_MASK,1,0       ## @SDIO_DRIVE_DTSx_MASK
	.comm	_SDIO_DRIVE_DTSx_SHIFT,1,0      ## @SDIO_DRIVE_DTSx_SHIFT
	.no_dead_strip	_sdio_select_driver_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdio_select_driver_type
_sdio_select_driver_type:               ; @sdio_select_driver_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	str	wzr, [x0]
Lloh0:
	adrp	x8, _SD_DRIVER_TYPE_B@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SD_DRIVER_TYPE_B@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w9, w1, [x0, #8]
	orr	w2, w8, w9
	add	x3, sp, #12
	bl	_mmc_select_drive_strength
	cbz	w0, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x21, _SDIO_CCCR_DRIVE_STRENGTH@GOTPAGE
Lloh4:
	ldr	x21, [x21, _SDIO_CCCR_DRIVE_STRENGTH@GOTPAGEOFF]
	ldr	w3, [x21]
	add	x5, sp, #11
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w4, #0
	bl	_mmc_io_rw_direct
	cbnz	w0, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _SDIO_DRIVE_DTSx_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SDIO_DRIVE_DTSx_MASK@GOTPAGEOFF]
Lloh7:
	adrp	x9, _SDIO_DRIVE_DTSx_SHIFT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SDIO_DRIVE_DTSx_SHIFT@GOTPAGEOFF]
	ldrb	w8, [x8]
	ldrb	w9, [x9]
	lsl	w8, w8, w9
	ldrb	w9, [sp, #11]
	bic	w8, w9, w8
	strb	w8, [sp, #11]
	mov	x0, x20
	bl	_host_drive_to_sdio_drive
	ldrb	w8, [sp, #11]
	orr	w8, w8, w0
	strb	w8, [sp, #11]
	ldr	w3, [x21]
	and	w4, w8, #0xff
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	x5, #0
	bl	_mmc_io_rw_direct
	cbnz	w0, LBB0_6
; %bb.3:
	str	w20, [x19]
LBB0_4:
	ldr	w1, [sp, #12]
	cbz	w1, LBB0_6
; %bb.5:
	ldr	w0, [x19, #4]
	bl	_mmc_set_driver_type
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_DRIVER_TYPE_B,4,2           ; @SD_DRIVER_TYPE_B
	.comm	_SDIO_CCCR_DRIVE_STRENGTH,4,2   ; @SDIO_CCCR_DRIVE_STRENGTH
	.comm	_SDIO_DRIVE_DTSx_MASK,1,0       ; @SDIO_DRIVE_DTSx_MASK
	.comm	_SDIO_DRIVE_DTSx_SHIFT,1,0      ; @SDIO_DRIVE_DTSx_SHIFT
	.no_dead_strip	_sdio_select_driver_type
.subsections_via_symbols
