	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kv_calculate_nbps_level_settings
_kv_calculate_nbps_level_settings:      ## @kv_calculate_nbps_level_settings
	.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
	movq	%rdi, %r14
	callq	_kv_get_pi
	movq	(%rax), %rbx
	movq	8(%rax), %rsi
	cmpq	%rsi, %rbx
	jbe	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	jmp	LBB0_21
LBB0_2:
	movq	16(%r14), %r8
	movq	(%r14), %rdx
	movq	_CHIP_KABINI@GOTPCREL(%rip), %rdi
	movq	16(%rax), %rcx
	cmpq	(%rdi), %rdx
	je	LBB0_10
## %bb.3:
	movq	_CHIP_MULLINS@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	je	LBB0_10
## %bb.4:
	leaq	(%rbx,%rbx,2), %rdi
	leaq	(%rcx,%rdi,4), %rcx
	addq	$8, %rcx
	movq	%rbx, %rdx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	$1, -8(%rcx)
	movl	$0, (%rcx)
	incq	%rdx
	addq	$12, %rcx
	cmpq	%rsi, %rdx
	jbe	LBB0_5
## %bb.6:
	xorl	%ecx, %ecx
	cmpq	$0, 40(%rax)
	je	LBB0_21
## %bb.7:
	cmpq	$0, 24(%rax)
	je	LBB0_21
## %bb.8:
	movq	16(%rax), %rax
	movl	$40, 8(%rax,%rdi,4)
	movl	$0, (%rax,%rdi,4)
	cmpq	%rsi, %rbx
	je	LBB0_21
## %bb.9:
	movl	$1, 4(%rax,%rdi,4)
	jmp	LBB0_21
LBB0_10:
	leaq	(%rbx,%rbx,2), %rdi
	leaq	(%rcx,%rdi,4), %rcx
	addq	$8, %rcx
	movq	%rbx, %rdx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	$1, -8(%rcx)
	movl	$0, (%rcx)
	incq	%rdx
	addq	$12, %rcx
	cmpq	%rsi, %rdx
	jbe	LBB0_11
## %bb.12:
	xorl	%ecx, %ecx
	cmpq	$0, 40(%rax)
	je	LBB0_21
## %bb.13:
	movq	32(%rax), %rdx
	cmpq	24(%rdx), %r8
	jae	LBB0_16
## %bb.14:
	cmpl	$2, 8(%r14)
	jg	LBB0_16
## %bb.15:
	cmpq	$0, 48(%rax)
	je	LBB0_18
LBB0_16:
	shlq	$2, %rdi
	addq	16(%rax), %rdi
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rdi)
	incq	%rbx
	addq	$12, %rdi
	cmpq	%rsi, %rbx
	jbe	LBB0_17
LBB0_21:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_18:
	cmpq	$0, 24(%rax)
	movq	16(%rax), %rax
	je	LBB0_20
## %bb.19:
	movl	$1, 4(%rax)
LBB0_20:
	movl	$0, 12(%rax)
	movl	$0, 24(%rax)
	movl	$0, 36(%rax)
	movl	$0, 48(%rax)
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CHIP_KABINI,8,3                ## @CHIP_KABINI
	.comm	_CHIP_MULLINS,8,3               ## @CHIP_MULLINS
	.no_dead_strip	_kv_calculate_nbps_level_settings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function kv_calculate_nbps_level_settings
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	0                               ; 0x0
lCPI0_1:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	0                               ; 0x0
lCPI0_2:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
lCPI0_3:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_kv_calculate_nbps_level_settings:      ; @kv_calculate_nbps_level_settings
	.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
	mov	x19, x0
	bl	_kv_get_pi
	ldp	x10, x9, [x0]
	cmp	x10, x9
	b.ls	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_33
LBB0_2:
	ldr	x12, [x19]
Lloh3:
	adrp	x8, _CHIP_KABINI@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHIP_KABINI@GOTPAGEOFF]
Lloh5:
	ldr	x13, [x8]
Lloh6:
	adrp	x8, _CHIP_MULLINS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHIP_MULLINS@GOTPAGEOFF]
Lloh8:
	ldr	x14, [x8]
	ldr	x8, [x0, #16]
	add	x11, x10, #1
	add	x15, x9, #1
	cmp	x11, x15
	csinc	x11, x11, x9, hi
	sub	x11, x11, x10
	cmp	x12, x13
	ccmp	x12, x14, #4, ne
	b.ne	LBB0_20
; %bb.3:
	ldr	x12, [x19, #16]
	mov	x13, x10
	cmp	x11, #16
	b.lo	LBB0_7
; %bb.4:
	and	x14, x11, #0xfffffffffffffff0
	add	x13, x10, x14
	mov	w15, #12
	madd	x15, x10, x15, x8
	add	x15, x15, #96
Lloh9:
	adrp	x16, lCPI0_0@PAGE
Lloh10:
	ldr	q0, [x16, lCPI0_0@PAGEOFF]
Lloh11:
	adrp	x16, lCPI0_1@PAGE
Lloh12:
	ldr	q1, [x16, lCPI0_1@PAGEOFF]
Lloh13:
	adrp	x16, lCPI0_2@PAGE
Lloh14:
	ldr	q2, [x16, lCPI0_2@PAGEOFF]
	mov	x16, x14
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	stp	q2, q1, [x15, #-96]
	stp	q1, q0, [x15, #-32]
	stp	q0, q2, [x15, #-64]
	stp	q2, q1, [x15]
	stp	q1, q0, [x15, #64]
	stp	q0, q2, [x15, #32]
	add	x15, x15, #192
	subs	x16, x16, #16
	b.ne	LBB0_5
; %bb.6:
	cmp	x11, x14
	b.eq	LBB0_9
LBB0_7:
	mov	w11, #12
	madd	x8, x13, x11, x8
	add	x8, x8, #8
Lloh15:
	adrp	x11, lCPI0_3@PAGE
Lloh16:
	ldr	d0, [x11, lCPI0_3@PAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	stur	d0, [x8, #-8]
	str	wzr, [x8], #12
	add	x13, x13, #1
	cmp	x13, x9
	b.ls	LBB0_8
LBB0_9:
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_33
; %bb.10:
	ldr	x8, [x0, #32]
	ldr	x8, [x8, #24]
	cmp	x12, x8
	b.hs	LBB0_13
; %bb.11:
	ldr	w8, [x19, #8]
	cmp	w8, #2
	b.gt	LBB0_13
; %bb.12:
	ldr	x8, [x0, #48]
	cbz	x8, LBB0_30
LBB0_13:
	ldr	x8, [x0, #16]
	add	x11, x10, #1
	add	x12, x9, #1
	cmp	x11, x12
	csinc	x11, x11, x9, hi
	sub	x11, x11, x10
	cmp	x11, #4
	b.lo	LBB0_17
; %bb.14:
	and	x12, x11, #0xfffffffffffffffc
	add	x13, x10, x12
	mov	w14, #12
	madd	x10, x10, x14, x8
	add	x10, x10, #24
	mov	x14, x12
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	stur	wzr, [x10, #-24]
	stur	wzr, [x10, #-12]
	str	wzr, [x10]
	str	wzr, [x10, #12]
	add	x10, x10, #48
	subs	x14, x14, #4
	b.ne	LBB0_15
; %bb.16:
	mov	x10, x13
	cmp	x11, x12
	b.eq	LBB0_19
LBB0_17:
	mov	w11, #12
	madd	x8, x10, x11, x8
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	str	wzr, [x8], #12
	add	x10, x10, #1
	cmp	x10, x9
	b.ls	LBB0_18
LBB0_19:
	mov	w8, #0
	b	LBB0_33
LBB0_20:
	mov	x12, x10
	cmp	x11, #16
	b.lo	LBB0_24
; %bb.21:
	and	x13, x11, #0xfffffffffffffff0
	add	x12, x10, x13
	mov	w14, #12
	madd	x14, x10, x14, x8
	add	x14, x14, #96
Lloh17:
	adrp	x15, lCPI0_0@PAGE
Lloh18:
	ldr	q0, [x15, lCPI0_0@PAGEOFF]
Lloh19:
	adrp	x15, lCPI0_1@PAGE
Lloh20:
	ldr	q1, [x15, lCPI0_1@PAGEOFF]
Lloh21:
	adrp	x15, lCPI0_2@PAGE
Lloh22:
	ldr	q2, [x15, lCPI0_2@PAGEOFF]
	mov	x15, x13
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	stp	q2, q1, [x14, #-96]
	stp	q1, q0, [x14, #-32]
	stp	q0, q2, [x14, #-64]
	stp	q2, q1, [x14]
	stp	q1, q0, [x14, #64]
	stp	q0, q2, [x14, #32]
	add	x14, x14, #192
	subs	x15, x15, #16
	b.ne	LBB0_22
; %bb.23:
	cmp	x11, x13
	b.eq	LBB0_26
LBB0_24:
	mov	w11, #12
	madd	x8, x12, x11, x8
	add	x8, x8, #8
Lloh23:
	adrp	x11, lCPI0_3@PAGE
Lloh24:
	ldr	d0, [x11, lCPI0_3@PAGEOFF]
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	stur	d0, [x8, #-8]
	str	wzr, [x8], #12
	add	x12, x12, #1
	cmp	x12, x9
	b.ls	LBB0_25
LBB0_26:
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_33
; %bb.27:
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_33
; %bb.28:
	mov	w8, #0
	ldr	x11, [x0, #16]
	mov	w12, #12
	madd	x12, x10, x12, x11
	mov	w13, #40
	str	w13, [x12, #8]
	str	wzr, [x12]
	cmp	x10, x9
	b.eq	LBB0_33
; %bb.29:
	mov	w8, #0
	mov	w9, #12
	madd	x9, x10, x9, x11
	mov	w10, #1
	str	w10, [x9, #4]
	b	LBB0_33
LBB0_30:
	ldp	x9, x8, [x0, #16]
	cbz	x8, LBB0_32
; %bb.31:
	mov	w8, #1
	str	w8, [x9, #4]
LBB0_32:
	mov	w8, #0
	str	wzr, [x9, #12]
	str	wzr, [x9, #24]
	str	wzr, [x9, #36]
	str	wzr, [x9, #48]
LBB0_33:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdr	Lloh13, Lloh14
	.loh AdrpAdrp	Lloh11, Lloh13
	.loh AdrpLdr	Lloh11, Lloh12
	.loh AdrpAdrp	Lloh9, Lloh11
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdr	Lloh15, Lloh16
	.loh AdrpLdr	Lloh21, Lloh22
	.loh AdrpAdrp	Lloh19, Lloh21
	.loh AdrpLdr	Lloh19, Lloh20
	.loh AdrpAdrp	Lloh17, Lloh19
	.loh AdrpLdr	Lloh17, Lloh18
	.loh AdrpLdr	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CHIP_KABINI,8,3                ; @CHIP_KABINI
	.comm	_CHIP_MULLINS,8,3               ; @CHIP_MULLINS
	.no_dead_strip	_kv_calculate_nbps_level_settings
.subsections_via_symbols
