	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmio_mmc_set_clock
_tmio_mmc_set_clock:                    ## @tmio_mmc_set_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
	movq	%rdi, %r12
	testl	%esi, %esi
	je	LBB0_4
## %bb.1:
	movq	8(%r12), %rcx
	movl	(%rcx), %eax
	xorl	%r14d, %r14d
	xorl	%edx, %edx
	divl	%esi
	xorl	%r15d, %r15d
	cmpl	$2, %eax
	setb	%r15b
	jb	LBB0_3
## %bb.2:
	movl	%eax, %edi
	callq	_roundup_pow_of_two
	movl	%eax, %r14d
	sarl	$2, %r14d
	movq	8(%r12), %rcx
LBB0_3:
	movl	(%r12), %edi
	movl	%r15d, %esi
	callq	*8(%rcx)
	movq	_CTL_SD_CARD_CLK_CTL@GOTPCREL(%rip), %r13
	movl	(%r13), %r15d
	movq	_CLK_CTL_SCLKEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_sd_ctrl_read16
	andl	%eax, %ebx
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_sd_ctrl_write16
	movl	(%r13), %esi
	movq	_CLK_CTL_DIV_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r14d
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_sd_ctrl_write16
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$11000, %esi                    ## imm = 0x2AF8
	callq	_usleep_range
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tmio_mmc_clk_start             ## TAILCALL
LBB0_4:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tmio_mmc_clk_stop              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CTL_SD_CARD_CLK_CTL,4,2        ## @CTL_SD_CARD_CLK_CTL
	.comm	_CLK_CTL_SCLKEN,4,2             ## @CLK_CTL_SCLKEN
	.comm	_CLK_CTL_DIV_MASK,4,2           ## @CLK_CTL_DIV_MASK
	.no_dead_strip	_tmio_mmc_set_clock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmio_mmc_set_clock
_tmio_mmc_set_clock:                    ; @tmio_mmc_set_clock
	.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	x19, x0
	cbz	w1, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	w9, [x8]
	udiv	w0, w9, w1
	cmp	w0, #2
	cset	w20, lo
	b.hs	LBB0_4
; %bb.2:
	mov	w21, #0
	b	LBB0_5
LBB0_3:
	mov	x0, 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	_tmio_mmc_clk_stop
LBB0_4:
	bl	_roundup_pow_of_two
	asr	w21, w0, #2
	ldr	x8, [x19, #8]
LBB0_5:
	ldr	x8, [x8, #8]
	ldr	w0, [x19]
	mov	x1, x20
	blr	x8
Lloh0:
	adrp	x22, _CTL_SD_CARD_CLK_CTL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CTL_SD_CARD_CLK_CTL@GOTPAGEOFF]
	ldr	w20, [x22]
Lloh2:
	adrp	x8, _CLK_CTL_SCLKEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CLK_CTL_SCLKEN@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_sd_ctrl_read16
	bic	w2, w0, w23
	mov	x0, x19
	mov	x1, x20
	bl	_sd_ctrl_write16
	ldr	w1, [x22]
Lloh5:
	adrp	x8, _CLK_CTL_DIV_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CLK_CTL_DIV_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	and	w2, w8, w21
	mov	x0, x19
	bl	_sd_ctrl_write16
	mov	w0, #10000
	mov	w1, #11000
	bl	_usleep_range
	mov	x0, 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	_tmio_mmc_clk_start
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_CTL_SD_CARD_CLK_CTL,4,2        ; @CTL_SD_CARD_CLK_CTL
	.comm	_CLK_CTL_SCLKEN,4,2             ; @CLK_CTL_SCLKEN
	.comm	_CLK_CTL_DIV_MASK,4,2           ; @CLK_CTL_DIV_MASK
	.no_dead_strip	_tmio_mmc_set_clock
.subsections_via_symbols
