	.file	"extr_core.c_mmc_calc_max_discard.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%s: calculated max. discard sectors %u for timeout %u ms\n"
	.text
	.p2align 4
	.globl	mmc_calc_max_discard
	.type	mmc_calc_max_discard, @function
mmc_calc_max_discard:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r14, QWORD PTR 16[rdi]
	call	mmc_card_mmc@PLT
	test	rax, rax
	je	.L2
	test	BYTE PTR 8[rbp], 1
	je	.L17
.L2:
	mov	esi, DWORD PTR MMC_ERASE_ARG[rip]
	mov	rdi, rbp
	call	mmc_do_calc_max_discard@PLT
	mov	rdi, rbp
	mov	r12d, eax
	call	mmc_can_trim@PLT
	test	rax, rax
	jne	.L18
	cmp	DWORD PTR 4[rbp], r12d
	mov	eax, 0
	cmova	r12d, eax
.L5:
	mov	r13, QWORD PTR [r14]
	mov	rdi, r14
	test	r13, r13
	cmove	r13, QWORD PTR MMC_ERASE_TIMEOUT_MS[rip]
	call	mmc_hostname@PLT
	mov	edx, r12d
	lea	rdi, .LC0[rip]
	mov	rcx, r13
	mov	esi, eax
	call	pr_debug@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore_state
	mov	r12d, DWORD PTR 0[rbp]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	esi, DWORD PTR MMC_TRIM_ARG[rip]
	mov	rdi, rbp
	call	mmc_do_calc_max_discard@PLT
	cmp	r12d, eax
	ja	.L8
	test	r12d, r12d
	jne	.L5
.L8:
	mov	r12d, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	mmc_calc_max_discard, .-mmc_calc_max_discard
	.comm	MMC_TRIM_ARG,4,4
	.comm	MMC_ERASE_TIMEOUT_MS,8,8
	.comm	MMC_ERASE_ARG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_core.c_mmc_calc_max_discard.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: calculated max. discard sectors %u for timeout "
	.ascii	"%u ms\012\000"
	.text
	.align	2
	.global	mmc_calc_max_discard
	.syntax unified
	.arm
	.fpu softvfp
	.type	mmc_calc_max_discard, %function
mmc_calc_max_discard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r6, [r0, #12]
	bl	mmc_card_mmc
	cmp	r0, #0
	beq	.L2
	ldr	r3, [r4, #8]
	tst	r3, #1
	ldreq	r5, [r4]
	beq	.L1
.L2:
	ldr	r3, .L15
	mov	r0, r4
	ldr	r1, [r3]
	bl	mmc_do_calc_max_discard
	mov	r5, r0
	mov	r0, r4
	bl	mmc_can_trim
	cmp	r0, #0
	bne	.L14
	ldr	r3, [r4, #4]
	cmp	r3, r5
	movhi	r5, #0
.L5:
	mov	r0, r6
	bl	mmc_hostname
	ldr	r3, [r6]
	mov	r1, r0
	cmp	r3, #0
	ldreq	r3, .L15+4
	mov	r2, r5
	ldreq	r3, [r3]
	ldr	r0, .L15+8
	bl	pr_debug
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L14:
	ldr	r3, .L15+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	mmc_do_calc_max_discard
	clz	r3, r5
	lsr	r3, r3, #5
	cmp	r5, r0
	orrhi	r3, r3, #1
	cmp	r3, #0
	movne	r5, r0
	b	.L5
.L16:
	.align	2
.L15:
	.word	MMC_ERASE_ARG
	.word	MMC_ERASE_TIMEOUT_MS
	.word	.LC0
	.word	MMC_TRIM_ARG
	.size	mmc_calc_max_discard, .-mmc_calc_max_discard
	.comm	MMC_TRIM_ARG,4,4
	.comm	MMC_ERASE_TIMEOUT_MS,4,4
	.comm	MMC_ERASE_ARG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
