	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sata_down_spd_limit            ## -- Begin function sata_down_spd_limit
	.p2align	4, 0x90
_sata_down_spd_limit:                   ## @sata_down_spd_limit
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_sata_scr_valid
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_SCR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_sata_scr_read
	testl	%eax, %eax
	je	LBB0_4
LBB0_6:
	movl	(%r15), %r12d
	jmp	LBB0_7
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	movl	-36(%rbp), %edi
	callq	_ata_sstatus_online
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	-36(%rbp), %r12d
	shrl	$4, %r12d
	andl	$15, %r12d
LBB0_7:
	movl	4(%r15), %ebx
	cmpl	$1, %ebx
	jle	LBB0_8
## %bb.9:
	movl	%ebx, %edi
	callq	_fls
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %ecx
	movl	$-2, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	roll	%cl, %edx
	leal	-1(%r12), %ecx
	movl	$-1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	cmpl	$2, %r12d
	notl	%esi
	movl	$1, %eax
	cmovgel	%esi, %eax
	andl	%ebx, %eax
	andl	%edx, %eax
	je	LBB0_8
## %bb.10:
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.12:
	movl	$-1, %edi
	movl	%r14d, %ecx
	shll	%cl, %edi
	notl	%edi
	andl	%eax, %edi
	jne	LBB0_14
## %bb.13:
	bsfl	%eax, %ecx
	movl	$1, %edi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edi
	jmp	LBB0_14
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	%eax, %edi
LBB0_14:
	movl	%edi, 4(%r15)
	movq	_KERN_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_fls
	movl	%eax, %edi
	callq	_sata_spd_string
	leaq	L_.str(%rip), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	callq	_ata_link_printk
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_SCR_STATUS,4,2                 ## @SCR_STATUS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KERN_WARNING,4,2               ## @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"limiting SATA link speed to %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sata_down_spd_limit            ; -- Begin function sata_down_spd_limit
	.p2align	2
_sata_down_spd_limit:                   ; @sata_down_spd_limit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x19, x0
	bl	_sata_scr_valid
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _SCR_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SCR_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_sata_scr_read
	cbz	w0, LBB0_4
LBB0_2:
	ldr	w22, [x19]
	b	LBB0_6
LBB0_3:
Lloh3:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_10
LBB0_4:
	ldr	w0, [sp, #12]
	bl	_ata_sstatus_online
	cbz	x0, LBB0_2
; %bb.5:
	ldr	w8, [sp, #12]
	ubfx	w22, w8, #4, #4
LBB0_6:
	ldr	w21, [x19, #4]
	cmp	w21, #1
	b.le	LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_fls
	sub	w9, w0, #1
	mov	w8, #1
	lsl	w9, w8, w9
	subs	w11, w22, #1
	mov	w10, #-1
	lsl	w11, w10, w11
	csinv	w11, w8, w11, le
	and	w11, w11, w21
	bics	w9, w11, w9
	b.eq	LBB0_9
; %bb.8:
	lsl	w10, w10, w20
	bics	w10, w9, w10
	rbit	w11, w9
	clz	w11, w11
	lsl	w8, w8, w11
	csel	w8, w10, w8, ne
	cmp	w20, #0
	csel	w0, w9, w8, eq
	str	w0, [x19, #4]
Lloh5:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	bl	_fls
	bl	_sata_spd_string
	mov	x3, x0
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_ata_link_printk
	mov	w0, #0
	b	LBB0_11
LBB0_9:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_SCR_STATUS,4,2                 ; @SCR_STATUS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KERN_WARNING,4,2               ; @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"limiting SATA link speed to %s\n"

.subsections_via_symbols
