	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AT91F_MCI_SDCard_SetBusWidth   ## -- Begin function AT91F_MCI_SDCard_SetBusWidth
	.p2align	4, 0x90
_AT91F_MCI_SDCard_SetBusWidth:          ## @AT91F_MCI_SDCard_SetBusWidth
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_AT91C_SR_READY_FOR_DATA@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_AT91F_MCI_GetStatus
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	jle	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-20(%rbp), %eax
	andl	(%r14), %eax
	je	LBB0_1
LBB0_3:
	movq	_AT91C_SEL_DESEL_CARD_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%rbx), %rax
	movl	(%rax), %edx
	shll	$16, %edx
	movq	%rbx, %rdi
	callq	_AT91F_MCI_SendCommand
	movq	(%rbx), %rax
	movq	(%rax), %rax
	movq	_AT91C_MCI_SCDBUS@GOTPCREL(%rip), %rcx
	movq	_AT91C_SDCARD_SET_BUS_WIDTH_CMD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.5:
	movq	_AT91C_BUS_WIDTH_4BITS@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_4:
	movq	_AT91C_BUS_WIDTH_1BIT@GOTPCREL(%rip), %rax
LBB0_6:
	movsbl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_AT91F_MCI_SDCard_SendAppCommand
	movq	%rax, %rcx
	movq	_AT91C_CMD_SEND_OK@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rcx
	je	LBB0_8
## %bb.7:
	movq	_AT91C_CMD_SEND_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91C_SR_READY_FOR_DATA,4,2    ## @AT91C_SR_READY_FOR_DATA
	.comm	_AT91C_SEL_DESEL_CARD_CMD,4,2   ## @AT91C_SEL_DESEL_CARD_CMD
	.comm	_AT91C_MCI_SCDBUS,8,3           ## @AT91C_MCI_SCDBUS
	.comm	_AT91C_BUS_WIDTH_4BITS,1,0      ## @AT91C_BUS_WIDTH_4BITS
	.comm	_AT91C_BUS_WIDTH_1BIT,1,0       ## @AT91C_BUS_WIDTH_1BIT
	.comm	_AT91C_SDCARD_SET_BUS_WIDTH_CMD,4,2 ## @AT91C_SDCARD_SET_BUS_WIDTH_CMD
	.comm	_AT91C_CMD_SEND_OK,8,3          ## @AT91C_CMD_SEND_OK
	.comm	_AT91C_CMD_SEND_ERROR,4,2       ## @AT91C_CMD_SEND_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AT91F_MCI_SDCard_SetBusWidth   ; -- Begin function AT91F_MCI_SDCard_SetBusWidth
	.p2align	2
_AT91F_MCI_SDCard_SetBusWidth:          ; @AT91F_MCI_SDCard_SetBusWidth
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _AT91C_SR_READY_FOR_DATA@GOTPAGE
Lloh1:
	ldr	x20, [x20, _AT91C_SR_READY_FOR_DATA@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_AT91F_MCI_GetStatus
	str	w0, [sp, #12]
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x20]
	tst	w9, w8
	b.eq	LBB0_1
LBB0_3:
Lloh2:
	adrp	x8, _AT91C_SEL_DESEL_CARD_CMD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AT91C_SEL_DESEL_CARD_CMD@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
	lsl	w2, w8, #16
	mov	x0, x19
	bl	_AT91F_MCI_SendCommand
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _AT91C_MCI_SCDBUS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AT91C_MCI_SCDBUS@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x10, _AT91C_BUS_WIDTH_4BITS@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AT91C_BUS_WIDTH_4BITS@GOTPAGEOFF]
Lloh10:
	adrp	x11, _AT91C_BUS_WIDTH_1BIT@GOTPAGE
Lloh11:
	ldr	x11, [x11, _AT91C_BUS_WIDTH_1BIT@GOTPAGEOFF]
Lloh12:
	adrp	x12, _AT91C_SDCARD_SET_BUS_WIDTH_CMD@GOTPAGE
Lloh13:
	ldr	x12, [x12, _AT91C_SDCARD_SET_BUS_WIDTH_CMD@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x12]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldrsb	w2, [x8]
	mov	x0, x19
	bl	_AT91F_MCI_SDCard_SendAppCommand
Lloh15:
	adrp	x8, _AT91C_CMD_SEND_OK@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AT91C_CMD_SEND_OK@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _AT91C_CMD_SEND_ERROR@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AT91C_CMD_SEND_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	x0, x8
	csel	w0, w8, w9, eq
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91C_SR_READY_FOR_DATA,4,2    ; @AT91C_SR_READY_FOR_DATA
	.comm	_AT91C_SEL_DESEL_CARD_CMD,4,2   ; @AT91C_SEL_DESEL_CARD_CMD
	.comm	_AT91C_MCI_SCDBUS,8,3           ; @AT91C_MCI_SCDBUS
	.comm	_AT91C_BUS_WIDTH_4BITS,1,0      ; @AT91C_BUS_WIDTH_4BITS
	.comm	_AT91C_BUS_WIDTH_1BIT,1,0       ; @AT91C_BUS_WIDTH_1BIT
	.comm	_AT91C_SDCARD_SET_BUS_WIDTH_CMD,4,2 ; @AT91C_SDCARD_SET_BUS_WIDTH_CMD
	.comm	_AT91C_CMD_SEND_OK,8,3          ; @AT91C_CMD_SEND_OK
	.comm	_AT91C_CMD_SEND_ERROR,4,2       ; @AT91C_CMD_SEND_ERROR
.subsections_via_symbols
