	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pxamci_set_ios
_pxamci_set_ios:                        ## @pxamci_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
	callq	_mmc_priv
	movq	%rax, %rbx
	movslq	(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.1:
	movq	(%rbx), %r15
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r12
	jmp	LBB0_4
LBB0_12:
	movq	%rbx, %rdi
	callq	_pxamci_stop_clock
	movq	_CLKRT_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, 8(%rbx)
	je	LBB0_14
## %bb.13:
	movq	%rax, 8(%rbx)
	movl	28(%rbx), %edi
	callq	_clk_disable
	jmp	LBB0_14
LBB0_2:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r12d
LBB0_4:
	movq	8(%rbx), %rax
	movq	_CLKRT_OFF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_6
## %bb.5:
	movl	28(%rbx), %edi
	callq	_clk_enable
	movl	(%r14), %ecx
LBB0_6:
	movl	$7, %eax
	cmpl	$26000000, %ecx                 ## imm = 0x18CBA80
	je	LBB0_11
## %bb.7:
	testl	%r12d, %r12d
	movl	$1, %edi
	cmovnel	%r12d, %edi
	movq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.9:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_10
LBB0_8:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $eax killed $eax def $rax
LBB0_10:
	movslq	%ecx, %rcx
	cmpq	%rcx, %rax
	seta	%cl
	shll	%cl, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_fls
	decl	%eax
	cltq
LBB0_11:
	movq	%rax, 8(%rbx)
LBB0_14:
	movq	8(%r14), %rax
	cmpq	%rax, 16(%rbx)
	je	LBB0_17
## %bb.15:
	movq	%rax, 16(%rbx)
	movl	24(%r14), %esi
	movq	%rbx, %rdi
	callq	_pxamci_set_power
	movq	8(%r14), %rax
	movq	_MMC_POWER_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.16:
	movq	_CMDAT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 24(%rbx)
LBB0_17:
	movq	16(%r14), %rax
	movq	_MMC_BUS_WIDTH_4@GOTPCREL(%rip), %rcx
	movq	_CMDAT_SD_4DAT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	orl	24(%rbx), %edx
	jmp	LBB0_20
LBB0_19:
	notl	%edx
	andl	24(%rbx), %edx
LBB0_20:
	movl	%edx, 24(%rbx)
	movq	8(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_debug                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_CLKRT_OFF,8,3                  ## @CLKRT_OFF
	.comm	_MMC_POWER_ON,8,3               ## @MMC_POWER_ON
	.comm	_CMDAT_INIT,4,2                 ## @CMDAT_INIT
	.comm	_MMC_BUS_WIDTH_4,8,3            ## @MMC_BUS_WIDTH_4
	.comm	_CMDAT_SD_4DAT,4,2              ## @CMDAT_SD_4DAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PXAMCI: clkrt = %x cmdat = %x\n"

	.no_dead_strip	_pxamci_set_ios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pxamci_set_ios
_pxamci_set_ios:                        ; @pxamci_set_ios
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	bl	_mmc_priv
	mov	x19, x0
	ldr	w22, [x20]
	cbz	w22, LBB0_3
; %bb.1:
	ldp	x21, x8, [x19]
Lloh0:
	adrp	x9, _CLKRT_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CLKRT_OFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	ldr	w0, [x19, #28]
	bl	_clk_enable
	ldr	w8, [x20]
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_pxamci_stop_clock
	ldr	x9, [x19, #8]
Lloh3:
	adrp	x8, _CLKRT_OFF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CLKRT_OFF@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x9, x8
	b.eq	LBB0_10
; %bb.4:
	str	x8, [x19, #8]
	ldr	w0, [x19, #28]
	bl	_clk_disable
	b	LBB0_10
LBB0_5:
	mov	x8, x22
LBB0_6:
	mov	w9, #47744
	movk	w9, #396, lsl #16
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.7:
	mov	w8, #7
	b	LBB0_9
LBB0_8:
	sxtw	x9, w22
	udiv	x9, x21, x9
	cmp	w9, #0
	csinc	w9, w9, wzr, ne
	udiv	x10, x21, x9
	cmp	x10, w8, sxtw
	cset	w8, hi
	lsl	w0, w9, w8
	bl	_fls
	sub	w8, w0, #1
	sxtw	x8, w8
LBB0_9:
	str	x8, [x19, #8]
LBB0_10:
	ldr	x9, [x19, #16]
	ldr	x8, [x20, #8]
	cmp	x9, x8
	b.eq	LBB0_13
; %bb.11:
	str	x8, [x19, #16]
	ldr	w1, [x20, #24]
	mov	x0, x19
	bl	_pxamci_set_power
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x9, _MMC_POWER_ON@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MMC_POWER_ON@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.12:
Lloh9:
	adrp	x8, _CMDAT_INIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMDAT_INIT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x19, #24]
	orr	w8, w9, w8
	str	w8, [x19, #24]
LBB0_13:
Lloh12:
	adrp	x8, _MMC_BUS_WIDTH_4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MMC_BUS_WIDTH_4@GOTPAGEOFF]
	ldr	x9, [x20, #16]
Lloh14:
	ldr	x10, [x8]
Lloh15:
	adrp	x8, _CMDAT_SD_4DAT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CMDAT_SD_4DAT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	x9, x10
	b.ne	LBB0_15
; %bb.14:
	ldr	w9, [x19, #24]
	orr	w2, w9, w8
	b	LBB0_16
LBB0_15:
	ldr	w9, [x19, #24]
	bic	w2, w9, w8
LBB0_16:
	str	w2, [x19, #24]
	ldr	x1, [x19, #8]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_pr_debug
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_CLKRT_OFF,8,3                  ; @CLKRT_OFF
	.comm	_MMC_POWER_ON,8,3               ; @MMC_POWER_ON
	.comm	_CMDAT_INIT,4,2                 ; @CMDAT_INIT
	.comm	_MMC_BUS_WIDTH_4,8,3            ; @MMC_BUS_WIDTH_4
	.comm	_CMDAT_SD_4DAT,4,2              ; @CMDAT_SD_4DAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PXAMCI: clkrt = %x cmdat = %x\n"

	.no_dead_strip	_pxamci_set_ios
.subsections_via_symbols
