	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_init_erase                 ## -- Begin function mmc_init_erase
	.p2align	4, 0x90
_mmc_init_erase:                        ## @mmc_init_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_is_power_of_2
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edi
	callq	_ffs
	decq	%rax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	movq	%rax, 24(%rbx)
	movq	%rbx, %rdi
	callq	_mmc_card_sd
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movl	16(%rbx), %edi
	testl	%edi, %edi
	je	LBB0_6
## %bb.5:
	movl	%edi, 4(%rbx)
	callq	_ffs
	decq	%rax
	movq	%rax, 24(%rbx)
	jmp	LBB0_19
LBB0_6:
	movl	(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_18
## %bb.7:
	movl	8(%rbx), %eax
	movb	12(%rbx), %cl
	addb	$-9, %cl
	shll	%cl, %eax
	cmpl	$262143, %eax                   ## imm = 0x3FFFF
	ja	LBB0_9
## %bb.8:
	movl	$1024, 4(%rbx)                  ## imm = 0x400
	movl	$1024, %ecx                     ## imm = 0x400
	cmpl	%esi, %ecx
	jge	LBB0_16
	jmp	LBB0_15
LBB0_18:
	movl	$0, 4(%rbx)
	jmp	LBB0_19
LBB0_9:
	cmpl	$1048575, %eax                  ## imm = 0xFFFFF
	ja	LBB0_11
## %bb.10:
	movl	$2048, 4(%rbx)                  ## imm = 0x800
	movl	$2048, %ecx                     ## imm = 0x800
	cmpl	%esi, %ecx
	jge	LBB0_16
	jmp	LBB0_15
LBB0_11:
	cmpl	$2097151, %eax                  ## imm = 0x1FFFFF
	ja	LBB0_13
## %bb.12:
	movl	$4096, 4(%rbx)                  ## imm = 0x1000
	movl	$4096, %ecx                     ## imm = 0x1000
	cmpl	%esi, %ecx
	jl	LBB0_15
LBB0_16:
	movl	%ecx, %eax
	xorl	%edx, %edx
	idivl	%esi
	testl	%edx, %edx
	je	LBB0_19
## %bb.17:
	addl	%esi, %ecx
	subl	%edx, %ecx
	movl	%ecx, 4(%rbx)
	jmp	LBB0_19
LBB0_13:
	movl	$8192, 4(%rbx)                  ## imm = 0x2000
	movl	$8192, %ecx                     ## imm = 0x2000
	cmpl	%esi, %ecx
	jge	LBB0_16
LBB0_15:
	movl	%esi, 4(%rbx)
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mmc_init_erase                 ; -- Begin function mmc_init_erase
	.p2align	2
_mmc_init_erase:                        ; @mmc_init_erase
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0]
	bl	_is_power_of_2
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19]
	bl	_ffs
	sub	x8, x0, #1
	b	LBB0_3
LBB0_2:
	mov	x8, #0
LBB0_3:
	str	x8, [x19, #24]
	mov	x0, x19
	bl	_mmc_card_sd
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w0, [x19, #16]
	cbz	w0, LBB0_6
; %bb.5:
	str	w0, [x19, #4]
	bl	_ffs
	sub	x8, x0, #1
	str	x8, [x19, #24]
	b	LBB0_19
LBB0_6:
	ldr	w8, [x19]
	cbz	w8, LBB0_9
; %bb.7:
	ldp	w9, w10, [x19, #8]
	sub	w10, w10, #9
	lsl	w9, w9, w10
	lsr	w10, w9, #18
	cbnz	w10, LBB0_10
; %bb.8:
	mov	w9, #1024
	b	LBB0_15
LBB0_9:
	str	wzr, [x19, #4]
	b	LBB0_19
LBB0_10:
	lsr	w10, w9, #20
	cbnz	w10, LBB0_12
; %bb.11:
	mov	w9, #2048
	b	LBB0_15
LBB0_12:
	lsr	w9, w9, #21
	cbnz	w9, LBB0_14
; %bb.13:
	mov	w9, #4096
	b	LBB0_15
LBB0_14:
	mov	w9, #8192
LBB0_15:
	str	w9, [x19, #4]
	cmp	w9, w8
	b.lt	LBB0_18
; %bb.16:
	sdiv	w10, w9, w8
	msub	w10, w10, w8, w9
	cbz	w10, LBB0_19
; %bb.17:
	add	w8, w9, w8
	sub	w8, w8, w10
LBB0_18:
	str	w8, [x19, #4]
LBB0_19:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
