	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_erase                      ## -- Begin function mmc_erase
	.p2align	4, 0x90
_mmc_erase:                             ## @mmc_erase
	.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
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	%esi, -48(%rbp)
	leal	(%r15,%rbx), %eax
	movl	%eax, -44(%rbp)
	movq	24(%rdi), %rax
	movq	_MMC_CAP_ERASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.1:
	movq	%rdi, %r12
	movq	_CCC_ERASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%rdi)
	je	LBB0_6
## %bb.2:
	cmpl	$0, (%r12)
	je	LBB0_6
## %bb.3:
	movq	%r12, %rdi
	callq	_mmc_card_sd
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	_SD_ERASE_ARG@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_10
## %bb.5:
	movq	_SD_DISCARD_ARG@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_10
LBB0_6:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ecx, %ecx
LBB0_8:
	subl	(%rax), %ecx
LBB0_9:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%r12, %rdi
	callq	_mmc_card_mmc
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	_MMC_SECURE_ARGS@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_EXT_CSD_SEC_ER_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	je	LBB0_6
LBB0_13:
	movq	%r12, %rdi
	callq	_mmc_card_mmc
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	_MMC_TRIM_ARGS@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_16
## %bb.15:
	movq	_EXT_CSD_SEC_GB_CL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	je	LBB0_6
LBB0_16:
	movq	_MMC_SECURE_ERASE_ARG@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_20
## %bb.17:
	movl	(%r12), %esi
	xorl	%ecx, %ecx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%esi
	testl	%edx, %edx
	jne	LBB0_19
## %bb.18:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%esi
	testl	%edx, %edx
	je	LBB0_20
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_20:
	movq	_MMC_ERASE_ARG@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_22
## %bb.21:
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	%r15d, %ecx
	callq	_mmc_align_erase_size
	movl	%eax, %r15d
LBB0_22:
	testl	%r15d, %r15d
	je	LBB0_29
## %bb.23:
	movl	-44(%rbp), %ebx
	movl	-48(%rbp), %esi
	cmpl	%esi, %ebx
	jbe	LBB0_30
## %bb.24:
	decl	%ebx
	movl	%ebx, -44(%rbp)
	movl	(%r12), %r13d
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%r13d
	movq	_MMC_TRIM_ARGS@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_33
## %bb.25:
	cmpq	$0, 8(%r12)
	je	LBB0_33
## %bb.26:
	subl	%edx, %r13d
	cmpl	%r13d, %r15d
	jbe	LBB0_33
## %bb.27:
	leal	(%rsi,%r13), %edx
	decl	%edx
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r14d, %ecx
	callq	_mmc_do_erase
	movl	%eax, %ecx
	addl	-48(%rbp), %r13d
	movl	%r13d, -48(%rbp)
	testl	%eax, %eax
	jne	LBB0_9
## %bb.28:
	movl	-44(%rbp), %ebx
	cmpl	%r13d, %ebx
	ja	LBB0_34
	jmp	LBB0_9
LBB0_29:
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_30:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_33:
	movl	%esi, %r13d
LBB0_34:
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	callq	_mmc_do_erase
	movl	%eax, %ecx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_CAP_ERASE,4,2              ## @MMC_CAP_ERASE
	.comm	_CCC_ERASE,4,2                  ## @CCC_ERASE
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SD_ERASE_ARG,4,2               ## @SD_ERASE_ARG
	.comm	_SD_DISCARD_ARG,4,2             ## @SD_DISCARD_ARG
	.comm	_MMC_SECURE_ARGS,4,2            ## @MMC_SECURE_ARGS
	.comm	_EXT_CSD_SEC_ER_EN,4,2          ## @EXT_CSD_SEC_ER_EN
	.comm	_MMC_TRIM_ARGS,4,2              ## @MMC_TRIM_ARGS
	.comm	_EXT_CSD_SEC_GB_CL_EN,4,2       ## @EXT_CSD_SEC_GB_CL_EN
	.comm	_MMC_SECURE_ERASE_ARG,4,2       ## @MMC_SECURE_ERASE_ARG
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MMC_ERASE_ARG,4,2              ## @MMC_ERASE_ARG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_erase                      ; -- Begin function mmc_erase
	.p2align	2
_mmc_erase:                             ; @mmc_erase
	.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
	add	w8, w2, w1
	stp	w8, w1, [sp, #8]
	ldr	x8, [x0, #24]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _MMC_CAP_ERASE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_CAP_ERASE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0, #20]
Lloh3:
	adrp	x9, _CCC_ERASE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CCC_ERASE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	ldr	w8, [x20]
	cbz	w8, LBB0_5
; %bb.3:
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x0, x20
	bl	_mmc_card_sd
	cbz	x0, LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _SD_ERASE_ARG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SD_ERASE_ARG@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _SD_DISCARD_ARG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SD_DISCARD_ARG@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, w19
	ccmp	w9, w19, #4, ne
	b.eq	LBB0_8
LBB0_5:
Lloh12:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
	mov	x0, x20
	bl	_mmc_card_mmc
	cbz	x0, LBB0_11
; %bb.9:
Lloh14:
	adrp	x8, _MMC_SECURE_ARGS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MMC_SECURE_ARGS@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_11
; %bb.10:
	ldr	w8, [x20, #16]
Lloh17:
	adrp	x9, _EXT_CSD_SEC_ER_EN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _EXT_CSD_SEC_ER_EN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
LBB0_11:
	mov	x0, x20
	bl	_mmc_card_mmc
	cbz	x0, LBB0_14
; %bb.12:
Lloh20:
	adrp	x8, _MMC_TRIM_ARGS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MMC_TRIM_ARGS@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_14
; %bb.13:
	ldr	w8, [x20, #16]
Lloh23:
	adrp	x9, _EXT_CSD_SEC_GB_CL_EN@GOTPAGE
Lloh24:
	ldr	x9, [x9, _EXT_CSD_SEC_GB_CL_EN@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
LBB0_14:
Lloh26:
	adrp	x8, _MMC_SECURE_ERASE_ARG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MMC_SECURE_ERASE_ARG@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_17
; %bb.15:
	ldr	w8, [x20]
	udiv	w9, w22, w8
	msub	w9, w9, w8, w22
	cbnz	w9, LBB0_26
; %bb.16:
	udiv	w9, w21, w8
	msub	w8, w9, w8, w21
	cbnz	w8, LBB0_26
LBB0_17:
Lloh29:
	adrp	x8, _MMC_ERASE_ARG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MMC_ERASE_ARG@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_19
; %bb.18:
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x20
	mov	x3, x21
	bl	_mmc_align_erase_size
	mov	x21, x0
LBB0_19:
	cbz	w21, LBB0_27
; %bb.20:
	ldp	w8, w1, [sp, #8]
	cmp	w8, w1
	b.ls	LBB0_26
; %bb.21:
	sub	w2, w8, #1
	str	w2, [sp, #8]
Lloh32:
	adrp	x8, _MMC_TRIM_ARGS@GOTPAGE
Lloh33:
	ldr	x8, [x8, _MMC_TRIM_ARGS@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_25
; %bb.22:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_25
; %bb.23:
	ldr	w8, [x20]
	udiv	w9, w1, w8
	neg	w10, w1
	madd	w9, w9, w8, w10
	add	w22, w8, w9
	cmp	w21, w22
	b.ls	LBB0_25
; %bb.24:
	add	w8, w1, w22
	sub	w2, w8, #1
	mov	x0, x20
	mov	x3, x19
	bl	_mmc_do_erase
	ldp	w2, w8, [sp, #8]
	add	w1, w8, w22
	str	w1, [sp, #12]
	cmp	w0, #0
	ccmp	w2, w1, #0, eq
	b.ls	LBB0_7
LBB0_25:
	mov	x0, x20
	mov	x3, x19
	bl	_mmc_do_erase
	b	LBB0_7
LBB0_26:
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_27:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_CAP_ERASE,4,2              ; @MMC_CAP_ERASE
	.comm	_CCC_ERASE,4,2                  ; @CCC_ERASE
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SD_ERASE_ARG,4,2               ; @SD_ERASE_ARG
	.comm	_SD_DISCARD_ARG,4,2             ; @SD_DISCARD_ARG
	.comm	_MMC_SECURE_ARGS,4,2            ; @MMC_SECURE_ARGS
	.comm	_EXT_CSD_SEC_ER_EN,4,2          ; @EXT_CSD_SEC_ER_EN
	.comm	_MMC_TRIM_ARGS,4,2              ; @MMC_TRIM_ARGS
	.comm	_EXT_CSD_SEC_GB_CL_EN,4,2       ; @EXT_CSD_SEC_GB_CL_EN
	.comm	_MMC_SECURE_ERASE_ARG,4,2       ; @MMC_SECURE_ERASE_ARG
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MMC_ERASE_ARG,4,2              ; @MMC_ERASE_ARG
.subsections_via_symbols
