	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_mx_mmc_add_host
_meson_mx_mmc_add_host:                 ## @meson_mx_mmc_add_host
	.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	%rdi, %r15
	movq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_mmc_dev
	movq	%rax, %r12
	movl	(%rax), %edi
	leaq	8(%r15), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_of_property_read_u32
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_2
LBB0_3:
	movl	(%rbx), %edx
	movq	_MESON_MX_SDIO_MAX_SLOTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jge	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_mmc_regulator_get_supply
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_MESON_MX_SDIO_BOUNCE_REQ_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	movl	%eax, 44(%r14)
	movq	_MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-1, %esi
	callq	_FIELD_GET
	movq	%rax, 32(%r14)
	movq	_MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$-1, %esi
	callq	_FIELD_GET
	movl	%eax, (%r14)
	movq	_MESON_MX_SDIO_RESPONSE_CRC16_BITS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	$2, %ecx
	subl	%ecx, %eax
	movl	%eax, (%r14)
	movq	_BITS_PER_BYTE@GOTPCREL(%rip), %rcx
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%rcx)
	movl	%eax, (%r14)
	movl	4(%r15), %edi
	movl	$1, %esi
	callq	_clk_round_rate
	movq	%rax, 24(%r14)
	movl	(%r15), %edi
	movl	4(%r15), %ebx
	callq	_clk_get_rate
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_clk_round_rate
	movq	%rax, 16(%r14)
	movq	_MMC_CAP_ERASE@GOTPCREL(%rip), %rax
	movq	_MMC_CAP_CMD23@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	%ecx, 4(%r14)
	movq	_meson_mx_mmc_ops@GOTPCREL(%rip), %rax
	movq	%rax, 8(%r14)
	movq	%r14, %rdi
	callq	_mmc_of_parse
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mmc_add_host                   ## TAILCALL
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

L_.str.1:                               ## @.str.1
	.asciz	"missing 'reg' property\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MESON_MX_SDIO_MAX_SLOTS,4,2    ## @MESON_MX_SDIO_MAX_SLOTS
L_.str.2:                               ## @.str.2
	.asciz	"invalid 'reg' property value %d\n"

	.comm	_MESON_MX_SDIO_BOUNCE_REQ_SIZE,4,2 ## @MESON_MX_SDIO_BOUNCE_REQ_SIZE
	.comm	_MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK,4,2 ## @MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK
	.comm	_MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK,4,2 ## @MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK
	.comm	_MESON_MX_SDIO_RESPONSE_CRC16_BITS,4,2 ## @MESON_MX_SDIO_RESPONSE_CRC16_BITS
	.comm	_BITS_PER_BYTE,4,2              ## @BITS_PER_BYTE
	.comm	_MMC_CAP_ERASE,4,2              ## @MMC_CAP_ERASE
	.comm	_MMC_CAP_CMD23,4,2              ## @MMC_CAP_CMD23
	.comm	_meson_mx_mmc_ops,4,2           ## @meson_mx_mmc_ops
	.no_dead_strip	_meson_mx_mmc_add_host
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_mx_mmc_add_host
_meson_mx_mmc_add_host:                 ; @meson_mx_mmc_add_host
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x0
	ldr	x19, [x0, #16]
	mov	x0, x19
	bl	_mmc_dev
	mov	x21, x0
	ldr	w0, [x0]
	add	x22, x20, #8
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_of_property_read_u32
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_2:
	ldr	w8, [x22]
Lloh4:
	adrp	x9, _MESON_MX_SDIO_MAX_SLOTS@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MESON_MX_SDIO_MAX_SLOTS@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_mmc_regulator_get_supply
	cbnz	w0, LBB0_8
; %bb.4:
Lloh7:
	adrp	x8, _MESON_MX_SDIO_BOUNCE_REQ_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MESON_MX_SDIO_BOUNCE_REQ_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	stp	w8, w8, [x19, #40]
Lloh10:
	adrp	x8, _MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	w1, #-1
	bl	_FIELD_GET
	str	x0, [x19, #32]
Lloh13:
	adrp	x8, _MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	w1, #-1
	bl	_FIELD_GET
	str	w0, [x19]
Lloh16:
	adrp	x8, _MESON_MX_SDIO_RESPONSE_CRC16_BITS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MESON_MX_SDIO_RESPONSE_CRC16_BITS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	sub	w8, w0, w8, lsl #2
	str	w8, [x19]
Lloh19:
	adrp	x9, _BITS_PER_BYTE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _BITS_PER_BYTE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	str	w8, [x19]
	ldr	w0, [x20, #4]
	mov	w1, #1
	bl	_clk_round_rate
	str	x0, [x19, #24]
	ldp	w0, w21, [x20]
	bl	_clk_get_rate
	mov	x1, x0
	mov	x0, x21
	bl	_clk_round_rate
Lloh22:
	adrp	x8, _MMC_CAP_ERASE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MMC_CAP_ERASE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _MMC_CAP_CMD23@GOTPAGE
Lloh26:
	ldr	x9, [x9, _MMC_CAP_CMD23@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #4]
	orr	w8, w8, w9
	str	w8, [x19, #4]
Lloh28:
	adrp	x8, _meson_mx_mmc_ops@GOTPAGE
Lloh29:
	ldr	x8, [x8, _meson_mx_mmc_ops@GOTPAGEOFF]
	stp	x8, x0, [x19, #8]
	mov	x0, x19
	bl	_mmc_of_parse
	cbnz	w0, LBB0_8
; %bb.5:
	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
	add	sp, sp, #64
	b	_mmc_add_host
LBB0_6:
	str	x8, [sp]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	mov	x0, x21
	bl	_dev_err
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

l_.str.1:                               ; @.str.1
	.asciz	"missing 'reg' property\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MESON_MX_SDIO_MAX_SLOTS,4,2    ; @MESON_MX_SDIO_MAX_SLOTS
l_.str.2:                               ; @.str.2
	.asciz	"invalid 'reg' property value %d\n"

	.comm	_MESON_MX_SDIO_BOUNCE_REQ_SIZE,4,2 ; @MESON_MX_SDIO_BOUNCE_REQ_SIZE
	.comm	_MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK,4,2 ; @MESON_MX_SDIO_SEND_REPEAT_PACKAGE_TIMES_MASK
	.comm	_MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK,4,2 ; @MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK
	.comm	_MESON_MX_SDIO_RESPONSE_CRC16_BITS,4,2 ; @MESON_MX_SDIO_RESPONSE_CRC16_BITS
	.comm	_BITS_PER_BYTE,4,2              ; @BITS_PER_BYTE
	.comm	_MMC_CAP_ERASE,4,2              ; @MMC_CAP_ERASE
	.comm	_MMC_CAP_CMD23,4,2              ; @MMC_CAP_CMD23
	.comm	_meson_mx_mmc_ops,4,2           ; @meson_mx_mmc_ops
	.no_dead_strip	_meson_mx_mmc_add_host
.subsections_via_symbols
