	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvme_configure_apst
_nvme_configure_apst:                   ## @nvme_configure_apst
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%ebx, %ebx
	cmpl	$0, 36(%rdi)
	je	LBB0_25
## %bb.1:
	movq	%rdi, %r12
	cmpl	$32, (%rdi)
	jl	LBB0_3
## %bb.2:
	movl	20(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_25
LBB0_3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_25
## %bb.4:
	cmpl	$0, 32(%r12)
	je	LBB0_6
## %bb.5:
	cmpq	$0, 8(%r12)
	je	LBB0_6
## %bb.7:
	xorl	%edi, %edi
	callq	_cpu_to_le64
	movl	(%r12), %r15d
	testl	%r15d, %r15d
	js	LBB0_19
## %bb.8:
	movl	%eax, %edx
	leaq	(,%r15,4), %rax
	leaq	(%rax,%rax,2), %r14
	leal	(,%r15,8), %r13d
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rax, %rbx
	movq	24(%r12), %rax
	movl	4(%rax,%r14), %edi
	callq	_le32_to_cpu
	leaq	(%rax,%rbx), %rcx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	addq	%rax, %rbx
	addq	$19, %rbx
	movq	%rbx, %rdi
	movl	$20, %esi
	callq	_do_div
	cmpq	$16777215, %rbx                 ## imm = 0xFFFFFF
	movl	$16777215, %eax                 ## imm = 0xFFFFFF
	cmovgeq	%rax, %rbx
	shll	$8, %ebx
	orl	%r13d, %ebx
	movl	%ebx, %edi
	callq	_cpu_to_le64
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	cmpl	$-1, %ecx
	cmovel	%r15d, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rax, %rcx
	cmovgq	%rcx, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
LBB0_17:                                ##   in Loop: Header=BB0_9 Depth=1
	leaq	-1(%r15), %rax
	addq	$-12, %r14
	addl	$-8, %r13d
	testq	%r15, %r15
	movq	%rax, %r15
	jle	LBB0_18
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	testl	%edx, %edx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	%edx, (%rax,%r15,4)
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r12), %eax
	cmpq	%rax, %r15
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_NVME_QUIRK_NO_DEEPEST_PS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r12)
	jne	LBB0_17
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	24(%r12), %rax
	movq	_NVME_PS_FLAGS_NON_OP_STATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax,%r14)
	je	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%edx, -72(%rbp)                 ## 4-byte Spill
	movl	8(%rax,%r14), %edi
	callq	_le32_to_cpu
	cmpq	8(%r12), %rax
	jle	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	jmp	LBB0_17
LBB0_6:
	movl	20(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_22
LBB0_18:
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	$-1, %edx
	je	LBB0_19
## %bb.20:
	movl	20(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	$8, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_21
LBB0_19:
	movl	20(%r12), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_21:
	movl	$1, %ebx
LBB0_22:
	movq	_NVME_FEAT_AUTO_PST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	$8, %r8d
	xorl	%r9d, %r9d
	callq	_nvme_set_features
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_24
## %bb.23:
	movl	20(%r12), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_24:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
LBB0_25:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NPSS is invalid; not using APST\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"APST disabled\n"

	.comm	_NVME_QUIRK_NO_DEEPEST_PS,4,2   ## @NVME_QUIRK_NO_DEEPEST_PS
	.comm	_NVME_PS_FLAGS_NON_OP_STATE,4,2 ## @NVME_PS_FLAGS_NON_OP_STATE
L_.str.2:                               ## @.str.2
	.asciz	"APST enabled but no non-operational states are available\n"

L_.str.3:                               ## @.str.3
	.asciz	"APST enabled: max PS = %d, max round-trip latency = %lluus, table = %*phN\n"

	.comm	_NVME_FEAT_AUTO_PST,4,2         ## @NVME_FEAT_AUTO_PST
L_.str.4:                               ## @.str.4
	.asciz	"failed to set APST feature (%d)\n"

	.no_dead_strip	_nvme_configure_apst
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvme_configure_apst
_nvme_configure_apst:                   ; @nvme_configure_apst
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x0, #36]
	cbz	w8, LBB0_8
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #32
	b.lt	LBB0_3
; %bb.2:
	ldr	w0, [x19, #20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	b	LBB0_8
LBB0_3:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.4:
	mov	x20, x0
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_18
; %bb.5:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_18
; %bb.6:
	mov	w0, #0
	bl	_cpu_to_le64
	ldr	w25, [x19]
	tbnz	w25, #31, LBB0_21
; %bb.7:
	mov	x21, x0
	mov	x23, #0
	add	x8, x25, x25, lsl #1
	lsl	x26, x8, #2
	lsl	w27, w25, #3
	mov	w24, #-1
Lloh5:
	adrp	x28, _NVME_PS_FLAGS_NON_OP_STATE@GOTPAGE
Lloh6:
	ldr	x28, [x28, _NVME_PS_FLAGS_NON_OP_STATE@GOTPAGEOFF]
	b	LBB0_12
LBB0_8:
	mov	w21, #0
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x19, #16]
Lloh7:
	adrp	x9, _NVME_QUIRK_NO_DEEPEST_PS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NVME_QUIRK_NO_DEEPEST_PS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	sub	x8, x25, #1
	sub	x26, x26, #12
	sub	w27, w27, #8
	cmp	x25, #0
	mov	x25, x8
	b.le	LBB0_19
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	w21, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x20]
	str	w21, [x8, x25, lsl #2]
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x19]
	cmp	x25, x8
	b.eq	LBB0_10
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x19, #24]
	ldr	w9, [x8, x26]
	ldr	w10, [x28]
	tst	w10, w9
	b.eq	LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	add	x8, x8, x26
	ldr	w0, [x8, #8]
	bl	_le32_to_cpu
	ldr	x8, [x19, #8]
	cmp	x0, x8
	b.gt	LBB0_11
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x22, x0
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	add	x22, x0, x22
	add	x21, x22, #19
	mov	x0, x21
	mov	w1, #20
	bl	_do_div
	mov	w8, #16777215
	cmp	x21, x8
	csel	x8, x21, x8, lt
	orr	w0, w27, w8, lsl #8
	bl	_cpu_to_le64
	mov	x21, x0
	cmn	w24, #1
	csel	w24, w25, w24, eq
	cmp	x22, x23
	csel	x23, x22, x23, gt
	b	LBB0_11
LBB0_18:
	ldr	w0, [x19, #20]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w2, #0
	b	LBB0_23
LBB0_19:
	cmn	w24, #1
	b.eq	LBB0_21
; %bb.20:
	ldr	w0, [x19, #20]
	mov	w8, #8
	stp	x8, x20, [sp, #16]
	stp	x24, x23, [sp]
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_22
LBB0_21:
	ldr	w0, [x19, #20]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_22:
	bl	_dev_dbg
	mov	w2, #1
LBB0_23:
Lloh16:
	adrp	x8, _NVME_FEAT_AUTO_PST@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NVME_FEAT_AUTO_PST@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x3, x20
	mov	w4, #8
	mov	x5, #0
	bl	_nvme_set_features
	mov	x21, x0
	cbz	w0, LBB0_25
; %bb.24:
	ldr	w0, [x19, #20]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x21
	bl	_dev_err
LBB0_25:
	mov	x0, x20
	bl	_kfree
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NPSS is invalid; not using APST\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"APST disabled\n"

	.comm	_NVME_QUIRK_NO_DEEPEST_PS,4,2   ; @NVME_QUIRK_NO_DEEPEST_PS
	.comm	_NVME_PS_FLAGS_NON_OP_STATE,4,2 ; @NVME_PS_FLAGS_NON_OP_STATE
l_.str.2:                               ; @.str.2
	.asciz	"APST enabled but no non-operational states are available\n"

l_.str.3:                               ; @.str.3
	.asciz	"APST enabled: max PS = %d, max round-trip latency = %lluus, table = %*phN\n"

	.comm	_NVME_FEAT_AUTO_PST,4,2         ; @NVME_FEAT_AUTO_PST
l_.str.4:                               ; @.str.4
	.asciz	"failed to set APST feature (%d)\n"

	.no_dead_strip	_nvme_configure_apst
.subsections_via_symbols
