	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_do_calc_max_discard
_mmc_do_calc_max_discard:               ## @mmc_do_calc_max_discard
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_MMC_ERASE_TIMEOUT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
LBB0_2:
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_4
## %bb.3:
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shrl	%cl, %edi
	movl	4(%rbx), %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %eax
	jmp	LBB0_7
LBB0_4:
	movq	%rbx, %rdi
	callq	_mmc_card_sd
	movq	_UINT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	4(%rbx), %eax
	jmp	LBB0_7
LBB0_6:
	movl	4(%rbx), %ecx
	movl	8(%rbx), %esi
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %edi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
LBB0_7:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leal	-1(%rdi), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_10 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_9:                                 ##   in Loop: Header=BB0_10 Depth=1
	addl	%r13d, %r15d
	testl	%r13d, %r13d
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_21
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	testl	%edi, %edi
	je	LBB0_21
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%r15d, -68(%rbp)                ## 4-byte Folded Reload
	jb	LBB0_21
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	leal	1(%r15), %r14d
	movq	%rbx, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%r14d, %edx
	callq	_mmc_erase_timeout
	cmpl	-44(%rbp), %r14d                ## 4-byte Folded Reload
	seta	%cl
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	seta	%dl
	xorl	%r13d, %r13d
	testb	%dl, %cl
	jne	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%r12d, %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jb	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	$1, %r14d
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, %r13d
	movl	%eax, %r12d
	leal	(%r13,%r13), %r14d
	movl	%edi, %eax
	subl	%r14d, %eax
	setb	%cl
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	testb	%cl, %cl
	jne	LBB0_9
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	cmpl	%r15d, %eax
	jb	LBB0_9
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=2
	leal	(%r14,%r15), %ebx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_mmc_erase_timeout
	cmpl	-44(%rbp), %ebx                 ## 4-byte Folded Reload
	seta	%cl
	cmpl	-48(%rbp), %eax                 ## 4-byte Folded Reload
	seta	%dl
	testb	%dl, %cl
	jne	LBB0_8
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=2
	cmpl	%r12d, %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jae	LBB0_15
	jmp	LBB0_9
LBB0_21:
	testl	%r15d, %r15d
	je	LBB0_30
## %bb.22:
	cmpl	$1, %r15d
	jne	LBB0_24
## %bb.23:
	movl	$1, 12(%rbx)
	movl	$1, %r15d
	jmp	LBB0_25
LBB0_24:
	decl	%r15d
LBB0_25:
	movl	(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_27
## %bb.26:
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r15d
	jmp	LBB0_30
LBB0_27:
	movq	%rbx, %rdi
	callq	_mmc_card_sd
	testq	%rax, %rax
	je	LBB0_29
## %bb.28:
	incl	%r15d
	jmp	LBB0_30
LBB0_29:
	imull	8(%rbx), %r15d
LBB0_30:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_ERASE_TIMEOUT_MS,4,2       ## @MMC_ERASE_TIMEOUT_MS
	.comm	_UINT_MAX,4,2                   ## @UINT_MAX
	.no_dead_strip	_mmc_do_calc_max_discard
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_do_calc_max_discard
_mmc_do_calc_max_discard:               ; @mmc_do_calc_max_discard
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _MMC_ERASE_TIMEOUT_MS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_ERASE_TIMEOUT_MS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w23, w9, w8, eq
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _UINT_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _UINT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsr	w24, w9, w8
	ldr	w9, [x19, #4]
	lsr	w25, w9, w8
	b	LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_mmc_card_sd
Lloh6:
	adrp	x8, _UINT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UINT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w25, [x19, #4]
	b	LBB0_5
LBB0_4:
	ldp	w9, w8, [x19, #4]
	udiv	w24, w24, w8
	udiv	w25, w9, w8
LBB0_5:
	mov	w21, #0
	mov	w27, #0
	sub	w8, w24, #1
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w21, w26, w21
	cbz	w26, LBB0_17
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	cbz	w24, LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, w21
	b.lo	LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w21, #1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_mmc_erase_timeout
	mov	w26, #0
	cmp	w0, w23
	ccmp	w22, w25, #0, hi
	b.hi	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cmp	w0, w27
	b.lo	LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w28, #1
LBB0_12:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x26, x28
	mov	x27, x0
	lsl	w28, w28, #1
	subs	w8, w24, w28
	cbz	w28, LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	b.lo	LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=2
	cmp	w8, w21
	b.lo	LBB0_6
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w22, w28, w21
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_mmc_erase_timeout
	cmp	w0, w23
	ccmp	w22, w25, #0, hi
	b.hi	LBB0_6
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=2
	cmp	w0, w27
	b.hs	LBB0_12
	b	LBB0_6
LBB0_17:
	cbz	w21, LBB0_25
; %bb.18:
	subs	w20, w21, #1
	b.ne	LBB0_20
; %bb.19:
	mov	w20, #1
	str	w20, [x19, #12]
LBB0_20:
	ldr	w8, [x19]
	cbz	w8, LBB0_22
; %bb.21:
	lsl	w21, w20, w8
	b	LBB0_25
LBB0_22:
	mov	x0, x19
	bl	_mmc_card_sd
	cbz	x0, LBB0_24
; %bb.23:
	add	w21, w20, #1
	b	LBB0_25
LBB0_24:
	ldr	w8, [x19, #8]
	mul	w21, w8, w20
LBB0_25:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_ERASE_TIMEOUT_MS,4,2       ; @MMC_ERASE_TIMEOUT_MS
	.comm	_UINT_MAX,4,2                   ; @UINT_MAX
	.no_dead_strip	_mmc_do_calc_max_discard
.subsections_via_symbols
