	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dw_mci_rk3288_set_ios
_dw_mci_rk3288_set_ios:                 ## @dw_mci_rk3288_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	(%rsi), %esi
	testl	%esi, %esi
	je	LBB0_17
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%r14), %rax
	movq	_MMC_BUS_WIDTH_8@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_4
## %bb.2:
	cmpl	$130, 16(%r14)
	jne	LBB0_4
## %bb.3:
	movl	%esi, %eax
	addl	%esi, %eax
	movq	_RK3288_CLKGEN_DIV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	jmp	LBB0_5
LBB0_4:
	movq	_RK3288_CLKGEN_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	imull	%eax, %esi
	movq	24(%rbx), %r12
	movl	16(%rbx), %edi
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	20(%rbx), %edi
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_7:
	movl	16(%rbx), %edi
	callq	_clk_get_rate
	movq	_RK3288_CLKGEN_DIV@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	cmpl	(%rbx), %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, (%rbx)
	movq	$0, 8(%rbx)
LBB0_9:
	movl	8(%r12), %edi
	callq	_IS_ERR
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movl	(%r12), %esi
	movl	8(%r12), %edi
	callq	_clk_set_phase
LBB0_11:
	movl	4(%r12), %edi
	callq	_IS_ERR
	testl	%eax, %eax
	je	LBB0_12
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	16(%r14), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_13
## %bb.15:
	movl	$180, %esi
	jmp	LBB0_16
LBB0_13:
	movl	$90, %esi
	cmpl	$130, %eax
	jne	LBB0_16
## %bb.14:
	movq	8(%r14), %rax
	cmpq	(%r15), %rax
	movl	$180, %eax
	movl	$90, %esi
	cmovel	%eax, %esi
LBB0_16:
	movl	4(%r12), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clk_set_phase                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_BUS_WIDTH_8,8,3            ## @MMC_BUS_WIDTH_8
	.comm	_RK3288_CLKGEN_DIV,4,2          ## @RK3288_CLKGEN_DIV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set rate %uHz\n"

	.no_dead_strip	_dw_mci_rk3288_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dw_mci_rk3288_set_ios
_dw_mci_rk3288_set_ios:                 ; @dw_mci_rk3288_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
	ldr	w8, [x1]
	cbz	w8, LBB0_12
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x9, [x1, #8]
Lloh0:
	adrp	x21, _MMC_BUS_WIDTH_8@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MMC_BUS_WIDTH_8@GOTPAGEOFF]
	ldr	x10, [x21]
Lloh2:
	adrp	x23, _RK3288_CLKGEN_DIV@GOTPAGE
Lloh3:
	ldr	x23, [x23, _RK3288_CLKGEN_DIV@GOTPAGEOFF]
	cmp	x9, x10
	b.ne	LBB0_4
; %bb.2:
	ldr	w9, [x19, #16]
	cmp	w9, #130
	b.ne	LBB0_4
; %bb.3:
	lsl	w9, w8, #1
	ldr	w8, [x23]
	b	LBB0_5
LBB0_4:
	ldr	w9, [x23]
LBB0_5:
	ldr	x22, [x20, #24]
	mul	w1, w9, w8
	ldr	w0, [x20, #16]
	bl	_clk_set_rate
	cbz	w0, LBB0_7
; %bb.6:
	ldr	w0, [x20, #20]
	ldr	w2, [x19]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_7:
	ldr	w0, [x20, #16]
	bl	_clk_get_rate
	ldr	w8, [x23]
	sdiv	w8, w0, w8
	ldr	w9, [x20]
	cmp	w8, w9
	b.eq	LBB0_9
; %bb.8:
	str	w8, [x20]
	str	xzr, [x20, #8]
LBB0_9:
	ldr	w0, [x22, #8]
	bl	_IS_ERR
	cbnz	w0, LBB0_11
; %bb.10:
	ldr	w0, [x22, #8]
	ldr	w1, [x22]
	bl	_clk_set_phase
LBB0_11:
	ldr	w0, [x22, #4]
	bl	_IS_ERR
	cbz	w0, LBB0_13
LBB0_12:
	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
LBB0_13:
	ldr	w8, [x19, #16]
	sub	w9, w8, #128
	cmp	w9, #2
	b.hs	LBB0_15
; %bb.14:
	mov	w1, #180
	b	LBB0_18
LBB0_15:
	cmp	w8, #130
	b.ne	LBB0_17
; %bb.16:
	ldr	x8, [x19, #8]
	ldr	x9, [x21]
	cmp	x8, x9
	mov	w8, #90
	mov	w9, #180
	csel	w1, w9, w8, eq
	b	LBB0_18
LBB0_17:
	mov	w1, #90
LBB0_18:
	ldr	w0, [x22, #4]
	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	_clk_set_phase
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_BUS_WIDTH_8,8,3            ; @MMC_BUS_WIDTH_8
	.comm	_RK3288_CLKGEN_DIV,4,2          ; @RK3288_CLKGEN_DIV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set rate %uHz\n"

	.no_dead_strip	_dw_mci_rk3288_set_ios
.subsections_via_symbols
