	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3cmci_set_ios
_s3cmci_set_ios:                        ## @s3cmci_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_mmc_priv
	movq	%rax, %r13
	movq	_S3C2410_SDICON@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%rax), %rdi
	callq	_readl
	movl	%eax, %r15d
	movl	(%r14), %ecx
	andl	$-2, %ecx
	movq	32(%r13), %rax
	movl	(%rax), %eax
	cmpl	$128, %ecx
	jne	LBB0_7
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movl	$5, %edi
	callq	_S3C2410_GPE
	movq	%r12, %rbx
	movl	%eax, %r12d
	movl	$2, %edi
	callq	_S3C_GPIO_SFN
	movq	_S3C_GPIO_PULL_NONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r12d, %edi
	movq	%rbx, %r12
	movl	$6, %esi
	movl	%eax, %edx
	callq	_s3c_gpio_cfgall_range
LBB0_3:
	movq	16(%r13), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	(%r14), %edi
	movl	12(%r14), %esi
	callq	*%rax
LBB0_5:
	cmpl	$0, 24(%r13)
	jne	LBB0_14
## %bb.13:
	movq	_S3C2410_SDICON_FIFORESET@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
LBB0_14:
	movl	%r15d, %ebx
	jmp	LBB0_15
LBB0_7:
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movl	$5, %edi
	callq	_S3C2410_GPE
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_gpio_direction_output
LBB0_9:
	movl	24(%r13), %ebx
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.10:
	movq	_S3C2440_SDICON_SDRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_11:
	orl	%r15d, %ebx
	movq	16(%r13), %rax
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.12:
	movl	(%r14), %edi
	movl	12(%r14), %esi
	callq	*%rcx
LBB0_15:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_s3cmci_set_clk
	movq	_S3C2410_SDICON_CLOCKTYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, %eax
	orl	%ebx, %eax
	notl	%edi
	andl	%ebx, %edi
	cmpl	$0, 4(%r14)
	cmovnel	%eax, %edi
	movq	(%r12), %rsi
	addq	8(%r13), %rsi
	callq	_writel
	movl	(%r14), %eax
	andl	$-2, %eax
	movq	_dbg_conf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	cmpl	$128, %eax
	jne	LBB0_17
## %bb.16:
	movslq	(%r13), %rax
	imulq	$274877907, %rax, %rcx          ## imm = 0x10624DD3
	movq	%rcx, %rax
	shrq	$63, %rax
	sarq	$38, %rcx
	addl	%eax, %ecx
	movslq	4(%r14), %rax
	imulq	$274877907, %rax, %r8           ## imm = 0x10624DD3
	movq	%r8, %rax
	shrq	$63, %rax
	sarq	$38, %r8
	addl	%eax, %r8d
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_dbg
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_dbg
LBB0_18:
	movl	8(%r14), %eax
	movl	%eax, 4(%r13)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S3C2410_SDICON,8,3             ## @S3C2410_SDICON
	.comm	_S3C_GPIO_PULL_NONE,4,2         ## @S3C_GPIO_PULL_NONE
	.comm	_S3C2410_SDICON_FIFORESET,4,2   ## @S3C2410_SDICON_FIFORESET
	.comm	_S3C2440_SDICON_SDRESET,4,2     ## @S3C2440_SDICON_SDRESET
	.comm	_S3C2410_SDICON_CLOCKTYPE,4,2   ## @S3C2410_SDICON_CLOCKTYPE
	.comm	_dbg_conf,4,2                   ## @dbg_conf
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"running at %lukHz (requested: %ukHz).\n"

L_.str.1:                               ## @.str.1
	.asciz	"powered down.\n"

	.no_dead_strip	_s3cmci_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3cmci_set_ios
_s3cmci_set_ios:                        ; @s3cmci_set_ios
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	bl	_mmc_priv
	mov	x20, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x23, _S3C2410_SDICON@GOTPAGE
Lloh1:
	ldr	x23, [x23, _S3C2410_SDICON@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	w8, [x19]
	and	w9, w8, #0xfffffffe
	ldr	x8, [x20, #32]
	ldr	w8, [x8]
	cmp	w9, #128
	b.ne	LBB0_7
; %bb.1:
	cbnz	w8, LBB0_3
; %bb.2:
	mov	w0, #5
	bl	_S3C2410_GPE
	mov	x22, x0
	mov	w0, #2
	bl	_S3C_GPIO_SFN
	mov	x2, x0
Lloh2:
	adrp	x8, _S3C_GPIO_PULL_NONE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _S3C_GPIO_PULL_NONE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	x0, x22
	mov	w1, #6
	bl	_s3c_gpio_cfgall_range
LBB0_3:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w0, [x19]
	ldr	w1, [x19, #12]
	blr	x8
LBB0_5:
	ldr	w8, [x20, #24]
	cbnz	w8, LBB0_11
; %bb.6:
Lloh5:
	adrp	x8, _S3C2410_SDICON_FIFORESET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _S3C2410_SDICON_FIFORESET@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w21, w8, w21
	b	LBB0_11
LBB0_7:
	cbnz	w8, LBB0_9
; %bb.8:
	mov	w0, #5
	bl	_S3C2410_GPE
	mov	w1, #0
	bl	_gpio_direction_output
LBB0_9:
	ldr	w8, [x20, #24]
Lloh8:
	adrp	x9, _S3C2440_SDICON_SDRESET@GOTPAGE
Lloh9:
	ldr	x9, [x9, _S3C2440_SDICON_SDRESET@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w8, wzr, w9, eq
	orr	w21, w8, w21
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	w0, [x19]
	ldr	w1, [x19, #12]
	blr	x8
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	bl	_s3cmci_set_clk
	ldr	w8, [x19, #4]
Lloh11:
	adrp	x9, _S3C2410_SDICON_CLOCKTYPE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _S3C2410_SDICON_CLOCKTYPE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w10, w9, w21
	bic	w9, w21, w9
	cmp	w8, #0
	csel	w0, w9, w10, eq
	ldr	x8, [x20, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x19]
	and	w8, w8, #0xfffffffe
Lloh14:
	adrp	x9, _dbg_conf@GOTPAGE
Lloh15:
	ldr	x9, [x9, _dbg_conf@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.12:
	ldrsw	x8, [x20]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x10, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w10
	ldrsw	x10, [x19, #4]
	mul	x9, x10, x9
	lsr	x10, x9, #63
	asr	x9, x9, #38
	add	w9, w9, w10
	stp	x8, x9, [sp]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_14
LBB0_13:
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_14:
	mov	x0, x20
	bl	_dbg
	ldr	w8, [x19, #8]
	str	w8, [x20, #4]
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_S3C2410_SDICON,8,3             ; @S3C2410_SDICON
	.comm	_S3C_GPIO_PULL_NONE,4,2         ; @S3C_GPIO_PULL_NONE
	.comm	_S3C2410_SDICON_FIFORESET,4,2   ; @S3C2410_SDICON_FIFORESET
	.comm	_S3C2440_SDICON_SDRESET,4,2     ; @S3C2440_SDICON_SDRESET
	.comm	_S3C2410_SDICON_CLOCKTYPE,4,2   ; @S3C2410_SDICON_CLOCKTYPE
	.comm	_dbg_conf,4,2                   ; @dbg_conf
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"running at %lukHz (requested: %ukHz).\n"

l_.str.1:                               ; @.str.1
	.asciz	"powered down.\n"

	.no_dead_strip	_s3cmci_set_ios
.subsections_via_symbols
