	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aw_mmc_update_clock
_aw_mmc_update_clock:                   ## @aw_mmc_update_clock
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_AW_MMC_CKCR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_AW_MMC_READ_4
	movq	_AW_MMC_CKCR_ENB@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_AW_MMC_CKCR_LOW_POWER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	%ecx, %esi
	movq	_AW_MMC_CKCR_MASK_DATA0@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	orl	%edi, %esi
	notl	%esi
	andl	%eax, %esi
	testl	%ebx, %ebx
	cmovel	%ebx, %ecx
	movq	(%r14), %rax
	xorl	%edx, %edx
	cmpq	$0, (%rax)
	cmovnel	%edi, %edx
	orl	%ecx, %edx
	orl	%esi, %edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_AW_MMC_WRITE_4
	movq	_AW_MMC_CMDR_LOAD@GOTPCREL(%rip), %r13
	movq	_AW_MMC_CMDR_PRG_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	(%r13), %ebx
	movq	_AW_MMC_CMDR_WAIT_PRE_OVER@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_AW_MMC_CMDR@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_AW_MMC_WRITE_4
	testl	%ebx, (%r13)
	je	LBB0_4
## %bb.1:
	movl	$1048575, %r15d                 ## imm = 0xFFFFF
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_AW_MMC_READ_4
	movl	%eax, %ebx
	movl	$10, %edi
	callq	_DELAY
	testl	%ebx, (%r13)
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%r15), %eax
	cmpl	$2, %r15d
	movl	%eax, %r15d
	ja	LBB0_2
LBB0_4:
	movq	_AW_MMC_RISR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	callq	_AW_MMC_WRITE_4
	testl	%ebx, (%r13)
	je	LBB0_6
## %bb.5:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_8
LBB0_6:
	movq	(%r14), %rax
	xorl	%ebx, %ebx
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	_AW_MMC_CKCR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_AW_MMC_READ_4
	movq	_AW_MMC_CKCR_MASK_DATA0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_AW_MMC_WRITE_4
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AW_MMC_CKCR,4,2                ## @AW_MMC_CKCR
	.comm	_AW_MMC_CKCR_ENB,4,2            ## @AW_MMC_CKCR_ENB
	.comm	_AW_MMC_CKCR_LOW_POWER,4,2      ## @AW_MMC_CKCR_LOW_POWER
	.comm	_AW_MMC_CKCR_MASK_DATA0,4,2     ## @AW_MMC_CKCR_MASK_DATA0
	.comm	_AW_MMC_CMDR_LOAD,4,2           ## @AW_MMC_CMDR_LOAD
	.comm	_AW_MMC_CMDR_PRG_CLK,4,2        ## @AW_MMC_CMDR_PRG_CLK
	.comm	_AW_MMC_CMDR_WAIT_PRE_OVER,4,2  ## @AW_MMC_CMDR_WAIT_PRE_OVER
	.comm	_AW_MMC_CMDR,4,2                ## @AW_MMC_CMDR
	.comm	_AW_MMC_RISR,4,2                ## @AW_MMC_RISR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout updating clock\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_aw_mmc_update_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aw_mmc_update_clock
_aw_mmc_update_clock:                   ; @aw_mmc_update_clock
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _AW_MMC_CKCR@GOTPAGE
Lloh1:
	ldr	x21, [x21, _AW_MMC_CKCR@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_AW_MMC_READ_4
Lloh2:
	adrp	x8, _AW_MMC_CKCR_ENB@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AW_MMC_CKCR_ENB@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _AW_MMC_CKCR_LOW_POWER@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AW_MMC_CKCR_LOW_POWER@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w9, w9, w8
Lloh8:
	adrp	x22, _AW_MMC_CKCR_MASK_DATA0@GOTPAGE
Lloh9:
	ldr	x22, [x22, _AW_MMC_CKCR_MASK_DATA0@GOTPAGEOFF]
	ldr	w10, [x22]
	orr	w9, w9, w10
	bic	w9, w0, w9
	cmp	w20, #0
	csel	w8, wzr, w8, eq
	orr	w8, w9, w8
	ldr	x9, [x19]
	ldr	x9, [x9]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
Lloh10:
	adrp	x23, _AW_MMC_CMDR_LOAD@GOTPAGE
Lloh11:
	ldr	x23, [x23, _AW_MMC_CMDR_LOAD@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh12:
	adrp	x9, _AW_MMC_CMDR_PRG_CLK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _AW_MMC_CMDR_PRG_CLK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _AW_MMC_CMDR_WAIT_PRE_OVER@GOTPAGE
Lloh16:
	ldr	x10, [x10, _AW_MMC_CMDR_WAIT_PRE_OVER@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh17:
	ldr	w9, [x10]
	orr	w20, w8, w9
Lloh18:
	adrp	x24, _AW_MMC_CMDR@GOTPAGE
Lloh19:
	ldr	x24, [x24, _AW_MMC_CMDR@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	mov	x2, x20
	bl	_AW_MMC_WRITE_4
	ldr	w8, [x23]
	tst	w8, w20
	b.eq	LBB0_3
; %bb.1:
	mov	w25, #1048575
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	w26, w25, #1
	ldr	w1, [x24]
	mov	x0, x19
	bl	_AW_MMC_READ_4
	mov	x20, x0
	mov	w0, #10
	bl	_DELAY
	ldr	w8, [x23]
	and	w8, w8, w20
	cmp	w8, #0
	ccmp	w25, #2, #0, ne
	mov	x25, x26
	b.hi	LBB0_2
LBB0_3:
Lloh20:
	adrp	x8, _AW_MMC_RISR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AW_MMC_RISR@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #-1
	bl	_AW_MMC_WRITE_4
	ldr	w8, [x23]
	tst	w8, w20
	b.eq	LBB0_5
; %bb.4:
	ldr	w0, [x19, #8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
Lloh25:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	b	LBB0_8
LBB0_5:
	ldr	x8, [x19]
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_AW_MMC_READ_4
	ldr	w8, [x22]
	bic	w2, w0, w8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_AW_MMC_WRITE_4
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh18, Lloh19
	.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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_AW_MMC_CKCR,4,2                ; @AW_MMC_CKCR
	.comm	_AW_MMC_CKCR_ENB,4,2            ; @AW_MMC_CKCR_ENB
	.comm	_AW_MMC_CKCR_LOW_POWER,4,2      ; @AW_MMC_CKCR_LOW_POWER
	.comm	_AW_MMC_CKCR_MASK_DATA0,4,2     ; @AW_MMC_CKCR_MASK_DATA0
	.comm	_AW_MMC_CMDR_LOAD,4,2           ; @AW_MMC_CMDR_LOAD
	.comm	_AW_MMC_CMDR_PRG_CLK,4,2        ; @AW_MMC_CMDR_PRG_CLK
	.comm	_AW_MMC_CMDR_WAIT_PRE_OVER,4,2  ; @AW_MMC_CMDR_WAIT_PRE_OVER
	.comm	_AW_MMC_CMDR,4,2                ; @AW_MMC_CMDR
	.comm	_AW_MMC_RISR,4,2                ; @AW_MMC_RISR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout updating clock\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_aw_mmc_update_clock
.subsections_via_symbols
