	.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	%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, %r15
	movq	%rdi, %r14
	callq	_mmc_priv
	movq	%rax, %rbx
	movslq	(%r15), %rcx
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.1:
	movq	(%rbx), %r12
	movq	%r12, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r13
	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	24(%rbx), %edi
	callq	_clk_disable_unprepare
	jmp	LBB0_14
LBB0_2:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r13d
LBB0_4:
	movq	8(%rbx), %rax
	movq	_CLKRT_OFF@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_6
## %bb.5:
	movl	24(%rbx), %edi
	callq	_clk_prepare_enable
	movl	(%r15), %ecx
LBB0_6:
	movl	$7, %eax
	cmpl	$26000000, %ecx                 ## imm = 0x18CBA80
	je	LBB0_11
## %bb.7:
	testl	%r13d, %r13d
	movl	$1, %edi
	cmovnel	%r13d, %edi
	movq	%r12, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.9:
	movq	%r12, %rax
	xorl	%edx, %edx
	divq	%rdi
	jmp	LBB0_10
LBB0_8:
	movl	%r12d, %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:
	movl	16(%r15), %esi
	cmpl	%esi, 20(%rbx)
	jne	LBB0_15
LBB0_18:
	movq	8(%r15), %rcx
	movq	_MMC_BUS_WIDTH_4@GOTPCREL(%rip), %rdx
	movq	_CMDAT_SD_4DAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_20
## %bb.19:
	orl	%eax, 16(%rbx)
	jmp	LBB0_21
LBB0_15:
	movl	%esi, 20(%rbx)
	movl	20(%r15), %edx
	movq	%rbx, %rdi
	callq	_pxamci_set_power
	testl	%eax, %eax
	je	LBB0_16
## %bb.22:
	movq	%r14, %rdi
	callq	_mmc_dev
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_20:
	notl	%eax
	andl	%eax, 16(%rbx)
LBB0_21:
	movq	%r14, %rdi
	callq	_mmc_dev
	movq	8(%rbx), %rdx
	movl	16(%rbx), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_dbg                        ## TAILCALL
LBB0_16:
	movl	16(%r15), %eax
	movq	_MMC_POWER_ON@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_18
## %bb.17:
	movq	_CMDAT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_CLKRT_OFF,8,3                  ## @CLKRT_OFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to set power\n"

	.comm	_MMC_POWER_ON,4,2               ## @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
L_.str.1:                               ## @.str.1
	.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	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	x21, x1
	mov	x19, x0
	bl	_mmc_priv
	mov	x20, x0
	ldr	w23, [x21]
	cbz	w23, LBB0_3
; %bb.1:
	ldp	x22, x8, [x20]
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, [x20, #24]
	bl	_clk_prepare_enable
	ldr	w8, [x21]
	b	LBB0_6
LBB0_3:
	mov	x0, x20
	bl	_pxamci_stop_clock
	ldr	x9, [x20, #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, [x20, #8]
	ldr	w0, [x20, #24]
	bl	_clk_disable_unprepare
	b	LBB0_10
LBB0_5:
	mov	x8, x23
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, w23
	udiv	x9, x22, x9
	cmp	w9, #0
	csinc	w9, w9, wzr, ne
	udiv	x10, x22, 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, [x20, #8]
LBB0_10:
	ldr	w8, [x20, #20]
	ldr	w1, [x21, #16]
	cmp	w8, w1
	b.ne	LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _MMC_BUS_WIDTH_4@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MMC_BUS_WIDTH_4@GOTPAGEOFF]
	ldr	x9, [x21, #8]
Lloh8:
	ldr	x10, [x8]
Lloh9:
	adrp	x8, _CMDAT_SD_4DAT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMDAT_SD_4DAT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	x9, x10
	b.ne	LBB0_15
; %bb.12:
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	b	LBB0_16
LBB0_13:
	str	w1, [x20, #20]
	ldr	w2, [x21, #20]
	mov	x0, x20
	bl	_pxamci_set_power
	cbz	w0, LBB0_17
; %bb.14:
	mov	x0, x19
	bl	_mmc_dev
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	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	_dev_err
LBB0_15:
	ldr	w9, [x20, #16]
	bic	w8, w9, w8
LBB0_16:
	str	w8, [x20, #16]
	mov	x0, x19
	bl	_mmc_dev
	ldr	x2, [x20, #8]
	ldr	w3, [x20, #16]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	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	_dev_dbg
LBB0_17:
	ldr	w8, [x21, #16]
Lloh16:
	adrp	x9, _MMC_POWER_ON@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MMC_POWER_ON@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.18:
Lloh19:
	adrp	x8, _CMDAT_INIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CMDAT_INIT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_CLKRT_OFF,8,3                  ; @CLKRT_OFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to set power\n"

	.comm	_MMC_POWER_ON,4,2               ; @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
l_.str.1:                               ; @.str.1
	.asciz	"PXAMCI: clkrt = %x cmdat = %x\n"

	.no_dead_strip	_pxamci_set_ios
.subsections_via_symbols
