	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aspeed_sdhci_calculate_slot
_aspeed_sdhci_calculate_slot:           ## @aspeed_sdhci_calculate_slot
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_resource_type
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	(%rbx), %rcx
	movq	(%r14), %rax
	movq	(%rax), %rax
	subq	(%rax), %rcx
	jl	LBB0_2
## %bb.4:
	testb	%cl, %cl
	je	LBB0_5
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	leal	255(%rcx), %eax
	testl	%ecx, %ecx
	cmovnsl	%ecx, %eax
	sarl	$8, %eax
	decl	%eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_IORESOURCE_MEM,8,3             ## @IORESOURCE_MEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_aspeed_sdhci_calculate_slot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aspeed_sdhci_calculate_slot
_aspeed_sdhci_calculate_slot:           ; @aspeed_sdhci_calculate_slot
	.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
	cbz	x1, LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_resource_type
Lloh0:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x20]
	ldr	x9, [x19]
	ldr	x9, [x9]
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_4
; %bb.3:
	sub	w8, w8, w9
	tst	w8, #0xff
	b.eq	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	add	w9, w8, #255
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #8
	sub	w0, w8, #1
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_IORESOURCE_MEM,8,3             ; @IORESOURCE_MEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_aspeed_sdhci_calculate_slot
.subsections_via_symbols
