	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmci_set_ios
_atmci_set_ios:                         ## @atmci_set_ios
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_mmc_priv
	movq	%rax, %r15
	movq	_MCI_SDCBUS_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	16(%r15), %eax
	movq	24(%r15), %r13
	movl	%eax, 16(%r15)
	movl	(%r14), %ecx
	cmpl	$130, %ecx
	je	LBB0_1
## %bb.2:
	cmpl	$129, %ecx
	jne	LBB0_5
## %bb.3:
	movq	_MCI_SDCBUS_4BIT@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_1:
	movq	_MCI_SDCBUS_1BIT@GOTPCREL(%rip), %rcx
LBB0_4:
	orl	(%rcx), %eax
	movl	%eax, 16(%r15)
LBB0_5:
	movq	8(%r14), %rbx
	leaq	12(%r13), %r12
	movq	%r12, %rdi
	callq	_spin_lock_bh
	testq	%rbx, %rbx
	je	LBB0_29
## %bb.6:
	cmpl	$0, (%r13)
	jne	LBB0_8
## %bb.7:
	movl	16(%r13), %edi
	callq	_clk_enable
	movq	_CR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_MCI_CR_SWRST@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_mci_writel
	movl	(%rbx), %esi
	movq	_MCI_CR_MCIEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_mci_writel
LBB0_8:
	movq	8(%r14), %rax
	movq	%rax, 8(%r15)
	movq	_ATMEL_MCI_MAX_NR_SLOTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testq	%rax, %rax
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.10:
	movq	24(%r13), %rcx
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.11:
	movl	$-1, %r12d
	xorl	%edx, %edx
LBB0_18:
	testb	$1, %al
	je	LBB0_21
## %bb.19:
	movq	(%rcx,%rdx,8), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movl	(%rax), %eax
	cmpl	%r12d, %eax
	movl	%r12d, %ecx
	cmovbl	%eax, %ecx
	testl	%eax, %eax
	cmovel	%r12d, %ecx
	movl	%ecx, %r12d
	jmp	LBB0_21
LBB0_29:
	movq	$0, 8(%r15)
	movq	_ATMEL_MCI_MAX_NR_SLOTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testq	%rax, %rax
	je	LBB0_34
## %bb.30:
	movq	24(%r13), %rcx
	xorl	%edx, %edx
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_31 Depth=1
	incq	%rdx
	cmpq	%rdx, %rax
	je	LBB0_34
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	cmpl	$0, (%rsi)
	je	LBB0_33
	jmp	LBB0_37
LBB0_34:
	movq	_CR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MCI_CR_MCIDIS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_mci_writel
	cmpl	$0, (%r13)
	je	LBB0_36
## %bb.35:
	movq	_MR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_mci_readl
	movl	16(%r13), %edi
	callq	_clk_disable
LBB0_36:
	movl	$0, (%r13)
	jmp	LBB0_37
LBB0_9:
	movl	$-1, %r12d
LBB0_21:
	movl	4(%r13), %edi
	leal	(%r12,%r12), %esi
	callq	_DIV_ROUND_UP
	cmpl	$257, %eax                      ## imm = 0x101
	jl	LBB0_22
## %bb.23:
	movl	4(%r13), %eax
	leal	511(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$9, %ecx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	callq	_dev_warn
	movl	$255, %eax
	jmp	LBB0_24
LBB0_22:
	decl	%eax
LBB0_24:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%eax, %edi
	callq	_MCI_MR_CLKDIV
	movl	%eax, (%r13)
	xorl	%eax, %eax
	callq	_mci_has_rwproof
	testq	%rax, %rax
	je	LBB0_26
## %bb.25:
	movq	_MCI_MR_WRPROOF@GOTPCREL(%rip), %rax
	movq	_MCI_MR_RDPROOF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, (%r13)
LBB0_26:
	leaq	32(%r13), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_28
## %bb.27:
	movq	_MR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r13, %rdi
	callq	_mci_writel
	jmp	LBB0_37
LBB0_28:
	movl	$1, 8(%r13)
LBB0_37:
	movq	%r12, %rdi
	callq	_spin_unlock_bh
	cmpl	$128, 4(%r14)
	jne	LBB0_38
## %bb.39:
	movq	_ATMCI_CARD_NEED_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_bit                        ## TAILCALL
LBB0_38:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%eax, %esi
	andl	$-2, %esi
	movl	$-1, %r12d
	xorl	%edx, %edx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	addq	$2, %rdx
	cmpq	%rdx, %rsi
	je	LBB0_18
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%rdi), %edi
	cmpl	%r12d, %edi
	movl	%r12d, %ebx
	cmovbl	%edi, %ebx
	testl	%edi, %edi
	cmovnel	%ebx, %r12d
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	8(%rcx,%rdx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	(%rdi), %edi
	cmpl	%r12d, %edi
	movl	%r12d, %ebx
	cmovbl	%edi, %ebx
	testl	%edi, %edi
	cmovnel	%ebx, %r12d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_MCI_SDCBUS_MASK,4,2            ## @MCI_SDCBUS_MASK
	.comm	_MCI_SDCBUS_1BIT,4,2            ## @MCI_SDCBUS_1BIT
	.comm	_MCI_SDCBUS_4BIT,4,2            ## @MCI_SDCBUS_4BIT
	.comm	_CR,4,2                         ## @CR
	.comm	_MCI_CR_SWRST,4,2               ## @MCI_CR_SWRST
	.comm	_MCI_CR_MCIEN,4,2               ## @MCI_CR_MCIEN
	.comm	_ATMEL_MCI_MAX_NR_SLOTS,4,2     ## @ATMEL_MCI_MAX_NR_SLOTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"clock %u too slow; using %lu\n"

	.comm	_MCI_MR_WRPROOF,4,2             ## @MCI_MR_WRPROOF
	.comm	_MCI_MR_RDPROOF,4,2             ## @MCI_MR_RDPROOF
	.comm	_MR,4,2                         ## @MR
	.comm	_MCI_CR_MCIDIS,4,2              ## @MCI_CR_MCIDIS
	.comm	_ATMCI_CARD_NEED_INIT,4,2       ## @ATMCI_CARD_NEED_INIT
	.no_dead_strip	_atmci_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmci_set_ios
_atmci_set_ios:                         ; @atmci_set_ios
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x23, x0
	bl	_mmc_priv
	mov	x19, x0
	ldr	x21, [x0, #24]
Lloh0:
	adrp	x8, _MCI_SDCBUS_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MCI_SDCBUS_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0, #16]
	bic	w8, w9, w8
	str	w8, [x0, #16]
	ldr	w9, [x20]
	cmp	w9, #130
	b.eq	LBB0_3
; %bb.1:
	cmp	w9, #129
	b.ne	LBB0_5
; %bb.2:
Lloh3:
	adrp	x9, _MCI_SDCBUS_4BIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MCI_SDCBUS_4BIT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x9, _MCI_SDCBUS_1BIT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MCI_SDCBUS_1BIT@GOTPAGEOFF]
LBB0_4:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #16]
LBB0_5:
	ldr	x24, [x20, #8]
	add	x22, x21, #12
	mov	x0, x22
	bl	_spin_lock_bh
	cbz	x24, LBB0_13
; %bb.6:
	ldr	w8, [x21]
	cbnz	w8, LBB0_8
; %bb.7:
	ldr	w0, [x21, #16]
	bl	_clk_enable
Lloh7:
	adrp	x24, _CR@GOTPAGE
Lloh8:
	ldr	x24, [x24, _CR@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh9:
	adrp	x8, _MCI_CR_SWRST@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCI_CR_SWRST@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_mci_writel
	ldr	w1, [x24]
Lloh12:
	adrp	x8, _MCI_CR_MCIEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCI_CR_MCIEN@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_mci_writel
LBB0_8:
	ldr	x8, [x20, #8]
	str	x8, [x19, #8]
Lloh15:
	adrp	x8, _ATMEL_MCI_MAX_NR_SLOTS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATMEL_MCI_MAX_NR_SLOTS@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cbz	w8, LBB0_21
; %bb.9:
	ldr	x9, [x21, #24]
	mov	w24, #-1
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_22
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x10, LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w10, [x10]
	cmp	w10, w24
	ccmp	w10, #0, #4, lo
	csel	w24, w10, w24, ne
	b	LBB0_10
LBB0_13:
	str	xzr, [x19, #8]
Lloh18:
	adrp	x8, _ATMEL_MCI_MAX_NR_SLOTS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ATMEL_MCI_MAX_NR_SLOTS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cbz	w8, LBB0_18
; %bb.14:
	ldr	x9, [x21, #24]
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_18
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x10, LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w10, [x10]
	cbz	w10, LBB0_15
	b	LBB0_30
LBB0_18:
Lloh21:
	adrp	x8, _CR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _MCI_CR_MCIDIS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MCI_CR_MCIDIS@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_mci_writel
	ldr	w8, [x21]
	cbz	w8, LBB0_20
; %bb.19:
Lloh27:
	adrp	x8, _MR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_mci_readl
	ldr	w0, [x21, #16]
	bl	_clk_disable
LBB0_20:
	str	wzr, [x21]
	b	LBB0_30
LBB0_21:
	mov	w24, #-1
LBB0_22:
	ldr	w0, [x21, #4]
	lsl	w1, w24, #1
	bl	_DIV_ROUND_UP
	cmp	w0, #257
	b.lt	LBB0_24
; %bb.23:
	ldr	w8, [x21, #4]
	add	w9, w8, #511
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w3, w8, #9
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x2, x24
	bl	_dev_warn
	mov	w0, #255
	b	LBB0_25
LBB0_24:
	sub	w0, w0, #1
LBB0_25:
	bl	_MCI_MR_CLKDIV
	str	w0, [x21]
	bl	_mci_has_rwproof
	cbz	x0, LBB0_27
; %bb.26:
Lloh32:
	adrp	x8, _MCI_MR_WRPROOF@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MCI_MR_WRPROOF@GOTPAGEOFF]
Lloh34:
	adrp	x9, _MCI_MR_RDPROOF@GOTPAGE
Lloh35:
	ldr	x9, [x9, _MCI_MR_RDPROOF@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x21]
	orr	w8, w8, w9
	str	w8, [x21]
LBB0_27:
	add	x0, x21, #32
	bl	_list_empty
	cbz	x0, LBB0_29
; %bb.28:
Lloh38:
	adrp	x8, _MR@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MR@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x21
	bl	_mci_writel
	b	LBB0_30
LBB0_29:
	mov	w8, #1
	str	w8, [x21, #8]
LBB0_30:
	mov	x0, x22
	bl	_spin_unlock_bh
	ldr	w8, [x20, #4]
	cmp	w8, #128
	b.ne	LBB0_32
; %bb.31:
Lloh41:
	adrp	x8, _ATMCI_CARD_NEED_INIT@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ATMCI_CARD_NEED_INIT@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	mov	x1, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_set_bit
LBB0_32:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh36
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_MCI_SDCBUS_MASK,4,2            ; @MCI_SDCBUS_MASK
	.comm	_MCI_SDCBUS_1BIT,4,2            ; @MCI_SDCBUS_1BIT
	.comm	_MCI_SDCBUS_4BIT,4,2            ; @MCI_SDCBUS_4BIT
	.comm	_CR,4,2                         ; @CR
	.comm	_MCI_CR_SWRST,4,2               ; @MCI_CR_SWRST
	.comm	_MCI_CR_MCIEN,4,2               ; @MCI_CR_MCIEN
	.comm	_ATMEL_MCI_MAX_NR_SLOTS,4,2     ; @ATMEL_MCI_MAX_NR_SLOTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clock %u too slow; using %lu\n"

	.comm	_MCI_MR_WRPROOF,4,2             ; @MCI_MR_WRPROOF
	.comm	_MCI_MR_RDPROOF,4,2             ; @MCI_MR_RDPROOF
	.comm	_MR,4,2                         ; @MR
	.comm	_MCI_CR_MCIDIS,4,2              ; @MCI_CR_MCIDIS
	.comm	_ATMCI_CARD_NEED_INIT,4,2       ; @ATMCI_CARD_NEED_INIT
	.no_dead_strip	_atmci_set_ios
.subsections_via_symbols
