	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdhci_calc_timeout
_sdhci_calc_timeout:                    ## @sdhci_calc_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
	movl	$1, (%rdx)
	movl	$14, %ebx
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.1:
	movq	%rdi, %r14
	movq	_SDHCI_QUIRK_BROKEN_TIMEOUT_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rdi), %eax
	jne	LBB0_22
## %bb.2:
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	8(%rsi), %rdx
	testq	%rdx, %rdx
	jne	LBB0_4
## %bb.3:
	cmpl	$0, 4(%r12)
	je	LBB0_22
LBB0_4:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_sdhci_target_timeout
	movl	%eax, %ecx
	xorl	%ebx, %ebx
	movl	$8192000, %eax                  ## imm = 0x7D0000
	xorl	%edx, %edx
	idivl	4(%r14)
                                        ## kill: def $eax killed $eax def $rax
	cmpl	%ecx, %eax
	jae	LBB0_21
## %bb.5:
	leal	(%rax,%rax), %edx
	movl	$1, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.6:
	leal	(,%rax,4), %edx
	movl	$2, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.7:
	leal	(,%rax,8), %edx
	movl	$3, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.8:
	movl	%eax, %edx
	shll	$4, %edx
	movl	$4, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.9:
	movl	%eax, %edx
	shll	$5, %edx
	movl	$5, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.10:
	movl	%eax, %edx
	shll	$6, %edx
	movl	$6, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.11:
	movl	%eax, %edx
	shll	$7, %edx
	movl	$7, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.12:
	movl	%eax, %edx
	shll	$8, %edx
	movl	$8, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.13:
	movl	%eax, %edx
	shll	$9, %edx
	movl	$9, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.14:
	movl	%eax, %edx
	shll	$10, %edx
	movl	$10, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.15:
	movl	%eax, %edx
	shll	$11, %edx
	movl	$11, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.16:
	movl	%eax, %edx
	shll	$12, %edx
	movl	$12, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.17:
	movl	%eax, %edx
	shll	$13, %edx
	movl	$13, %ebx
	cmpl	%ecx, %edx
	jae	LBB0_21
## %bb.18:
	shll	$14, %eax
	movl	$14, %ebx
	cmpl	%ecx, %eax
	jae	LBB0_21
## %bb.19:
	movq	_SDHCI_QUIRK2_DISABLE_HW_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$14, %ebx
	testl	%eax, 8(%r14)
	jne	LBB0_22
## %bb.20:
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rdi
	movl	$15, %esi
	callq	_DBG
	jmp	LBB0_22
LBB0_21:
	movl	$0, (%r15)
LBB0_22:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,4,2 ## @SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
	.comm	_SDHCI_QUIRK2_DISABLE_HW_TIMEOUT,4,2 ## @SDHCI_QUIRK2_DISABLE_HW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Too large timeout 0x%x requested for CMD%d!\n"

	.no_dead_strip	_sdhci_calc_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_timeout
_sdhci_calc_timeout:                    ; @sdhci_calc_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	x21, x0
	mov	w8, #1
	str	w8, [x2]
	mov	w0, #14
	cbz	x1, LBB0_38
; %bb.1:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _SDHCI_QUIRK_BROKEN_TIMEOUT_VAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SDHCI_QUIRK_BROKEN_TIMEOUT_VAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cbnz	w8, LBB0_38
; %bb.2:
	mov	x19, x2
	mov	x20, x1
	ldr	x2, [x1, #8]
	cbnz	x2, LBB0_4
; %bb.3:
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_21
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	bl	_sdhci_target_timeout
	ldr	w8, [x21, #4]
	mov	w9, #8192000
	sdiv	w8, w9, w8
	cmp	w8, w0
	b.hs	LBB0_22
; %bb.5:
	cmp	w0, w8, lsl #1
	b.ls	LBB0_23
; %bb.6:
	cmp	w0, w8, lsl #2
	b.ls	LBB0_24
; %bb.7:
	cmp	w0, w8, lsl #3
	b.ls	LBB0_25
; %bb.8:
	cmp	w0, w8, lsl #4
	b.ls	LBB0_26
; %bb.9:
	cmp	w0, w8, lsl #5
	b.ls	LBB0_27
; %bb.10:
	cmp	w0, w8, lsl #6
	b.ls	LBB0_28
; %bb.11:
	cmp	w0, w8, lsl #7
	b.ls	LBB0_29
; %bb.12:
	cmp	w0, w8, lsl #8
	b.ls	LBB0_30
; %bb.13:
	cmp	w0, w8, lsl #9
	b.ls	LBB0_31
; %bb.14:
	cmp	w0, w8, lsl #10
	b.ls	LBB0_32
; %bb.15:
	cmp	w0, w8, lsl #11
	b.ls	LBB0_33
; %bb.16:
	cmp	w0, w8, lsl #12
	b.ls	LBB0_34
; %bb.17:
	cmp	w0, w8, lsl #13
	b.ls	LBB0_35
; %bb.18:
	cmp	w0, w8, lsl #14
	b.ls	LBB0_36
; %bb.19:
	ldr	w8, [x21, #8]
Lloh3:
	adrp	x9, _SDHCI_QUIRK2_DISABLE_HW_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SDHCI_QUIRK2_DISABLE_HW_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_21
; %bb.20:
	ldr	w2, [x20]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #15
	bl	_DBG
LBB0_21:
	mov	w0, #14
	b	LBB0_38
LBB0_22:
	mov	w0, #0
	b	LBB0_37
LBB0_23:
	mov	w0, #1
	b	LBB0_37
LBB0_24:
	mov	w0, #2
	b	LBB0_37
LBB0_25:
	mov	w0, #3
	b	LBB0_37
LBB0_26:
	mov	w0, #4
	b	LBB0_37
LBB0_27:
	mov	w0, #5
	b	LBB0_37
LBB0_28:
	mov	w0, #6
	b	LBB0_37
LBB0_29:
	mov	w0, #7
	b	LBB0_37
LBB0_30:
	mov	w0, #8
	b	LBB0_37
LBB0_31:
	mov	w0, #9
	b	LBB0_37
LBB0_32:
	mov	w0, #10
	b	LBB0_37
LBB0_33:
	mov	w0, #11
	b	LBB0_37
LBB0_34:
	mov	w0, #12
	b	LBB0_37
LBB0_35:
	mov	w0, #13
	b	LBB0_37
LBB0_36:
	mov	w0, #14
LBB0_37:
	str	wzr, [x19]
LBB0_38:
	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 AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,4,2 ; @SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
	.comm	_SDHCI_QUIRK2_DISABLE_HW_TIMEOUT,4,2 ; @SDHCI_QUIRK2_DISABLE_HW_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Too large timeout 0x%x requested for CMD%d!\n"

	.no_dead_strip	_sdhci_calc_timeout
.subsections_via_symbols
