	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_calc_sw_timeout
_sdhci_calc_sw_timeout:                 ## @sdhci_calc_sw_timeout
	.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, %r14
	movq	(%rsi), %r15
	movq	8(%rdi), %rax
	movb	8(%rax), %cl
	movl	$1, %r12d
	shll	%cl, %r12d
	movq	%r15, %rdx
	callq	_sdhci_target_timeout
	movl	%eax, %ebx
	movq	_NSEC_PER_USEC@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	testq	%r15, %r15
	je	LBB0_4
## %bb.1:
	movl	(%r15), %ecx
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %esi
LBB0_3:
	movq	_NSEC_PER_SEC@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movb	$8, %al
	movzbl	%al, %eax
	divb	%r12b
	movzbl	%al, %r12d
	imull	%ecx, %r12d
	movl	%r12d, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_do_div
	imull	4(%r15), %ebx
	leal	(%rbx,%r12,2), %ebx
LBB0_4:
	movl	%ebx, 4(%r14)
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.5:
	movq	_MMC_CMD_TRANSFER_TIME@GOTPCREL(%rip), %rax
	addl	(%rax), %ebx
	movl	%ebx, 4(%r14)
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NSEC_PER_USEC,4,2              ## @NSEC_PER_USEC
	.comm	_NSEC_PER_SEC,4,2               ## @NSEC_PER_SEC
	.comm	_MMC_CMD_TRANSFER_TIME,8,3      ## @MMC_CMD_TRANSFER_TIME
	.no_dead_strip	_sdhci_calc_sw_timeout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdhci_calc_sw_timeout
_sdhci_calc_sw_timeout:                 ; @sdhci_calc_sw_timeout
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x0
	ldr	x20, [x1]
	ldr	x8, [x0, #8]
	ldr	w21, [x8, #8]
	mov	x2, x20
	bl	_sdhci_target_timeout
Lloh0:
	adrp	x8, _NSEC_PER_USEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NSEC_PER_USEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mul	w22, w8, w0
	cbz	x20, LBB0_4
; %bb.1:
	mov	w8, #1
	lsl	w8, w8, w21
	ldr	w9, [x20]
	ldr	x10, [x19, #8]
	ldr	x1, [x10]
	cbnz	x1, LBB0_3
; %bb.2:
	ldr	w1, [x19]
LBB0_3:
Lloh3:
	adrp	x10, _NSEC_PER_SEC@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NSEC_PER_SEC@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	mul	w9, w10, w9
	and	w8, w8, #0xff
	mov	w10, #8
	udiv	w8, w10, w8
	mul	w21, w9, w8
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_do_div
	ldr	w8, [x20, #4]
	mul	w8, w8, w22
	add	w22, w8, w21, lsl #1
LBB0_4:
	str	w22, [x19, #4]
	cbz	w22, LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _MMC_CMD_TRANSFER_TIME@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MMC_CMD_TRANSFER_TIME@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	add	w8, w22, w8
	str	w8, [x19, #4]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NSEC_PER_USEC,4,2              ; @NSEC_PER_USEC
	.comm	_NSEC_PER_SEC,4,2               ; @NSEC_PER_SEC
	.comm	_MMC_CMD_TRANSFER_TIME,8,3      ; @MMC_CMD_TRANSFER_TIME
	.no_dead_strip	_sdhci_calc_sw_timeout
.subsections_via_symbols
