	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_volt_parse_bios
_nvkm_volt_parse_bios:                  ## @nvkm_volt_parse_bios
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	leaq	-132(%rbp), %r8
	leaq	-112(%rbp), %r9
	callq	_nvbios_volt_parse
	testq	%rax, %rax
	setne	%cl
	cmpl	$0, -112(%rbp)
	setne	%dl
	andb	%cl, %dl
	movq	-104(%rbp), %rcx
	movq	-64(%rbp), %rsi
	cmpb	$1, %dl
	jne	LBB0_12
## %bb.1:
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.2:
	cmpq	$0, -96(%rbp)
	je	LBB0_12
## %bb.3:
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_nvkm_debug
	movslq	-88(%rbp), %r8
	movl	%r8d, (%r15)
	movl	-84(%rbp), %ebx
	movl	%ebx, 4(%r15)
	movl	-112(%rbp), %ecx
	testl	%ecx, %ecx
	js	LBB0_11
## %bb.5:
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %r9
	xorl	%edi, %edi
	cmpq	%r8, %rdx
	jl	LBB0_9
	.p2align	4, 0x90
LBB0_7:
	movslq	%ebx, %rbx
	cmpq	%rbx, %rdx
	jg	LBB0_9
## %bb.8:
	movq	8(%r15), %rsi
	movq	24(%r15), %rax
	movq	%rsi, %rbx
	shlq	$4, %rbx
	movq	%rdx, (%rax,%rbx)
	movl	%edi, 8(%rax,%rbx)
	incq	%rsi
	movq	%rsi, 8(%r15)
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%edi, %ecx
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	incl	%edi
	movl	-84(%rbp), %ebx
	addq	%r9, %rdx
	cmpq	%r8, %rdx
	jge	LBB0_7
	jmp	LBB0_9
LBB0_12:
	testb	%dl, %dl
	je	LBB0_20
## %bb.13:
	testq	%rsi, %rsi
	jne	LBB0_20
## %bb.14:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_nvkm_debug
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	movq	%rax, (%r15)
	cmpl	$0, -44(%rbp)
	jle	LBB0_19
## %bb.15:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r13
	leaq	-128(%rbp), %r12
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	incl	%ebx
	cmpl	-44(%rbp), %ebx
	jge	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	leaq	-52(%rbp), %rdx
	movq	%r13, %rcx
	movq	%r12, %r8
	callq	_nvbios_volt_entry_parse
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-128(%rbp), %rsi
	movq	8(%r15), %rax
	movq	24(%r15), %rcx
	movq	%rax, %rdx
	shlq	$4, %rdx
	movq	%rsi, (%rcx,%rdx)
	movl	-120(%rbp), %edi
	movl	%edi, 8(%rcx,%rdx)
	incq	%rax
	movq	%rax, 8(%r15)
	movl	(%r15), %edi
	callq	_min
	movl	%eax, (%r15)
	movl	4(%r15), %edi
	movq	-128(%rbp), %rsi
	callq	_max
	movl	%eax, 4(%r15)
	jmp	LBB0_18
LBB0_11:
	movl	%ecx, 16(%r15)
	jmp	LBB0_23
LBB0_20:
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	movq	-80(%rbp), %rax
	movq	_NVBIOS_VOLT_PWM@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_23
## %bb.22:
	movl	%ecx, (%r15)
	addl	-72(%rbp), %ecx
	movl	%ecx, 4(%r15)
	jmp	LBB0_23
LBB0_19:
	movl	-112(%rbp), %eax
	movl	%eax, 16(%r15)
LBB0_23:
	addq	$104, %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	"found ranged based VIDs\n"

L_.str.1:                               ## @.str.1
	.asciz	"found entry based VIDs\n"

	.comm	_NVBIOS_VOLT_PWM,8,3            ## @NVBIOS_VOLT_PWM
	.no_dead_strip	_nvkm_volt_parse_bios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_volt_parse_bios
_nvkm_volt_parse_bios:                  ; @nvkm_volt_parse_bios
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x1
	mov	x20, x0
	add	x1, sp, #20
	add	x2, sp, #16
	add	x3, sp, #12
	add	x4, sp, #8
	add	x5, sp, #24
	bl	_nvbios_volt_parse
	cmp	x0, #0
	ldr	w8, [sp, #24]
	ccmp	w8, #0, #4, ne
	cset	w9, ne
	ldp	x8, x11, [sp, #32]
	ldr	x10, [sp, #72]
	cmp	w9, #1
	ccmp	x8, #0, #4, eq
	ccmp	x11, #0, #4, ne
	ccmp	x10, #0, #4, ne
	b.ne	LBB0_5
; %bb.1:
	cmp	w9, #0
	ccmp	x10, #0, #0, ne
	b.eq	LBB0_12
; %bb.2:
	cbz	x0, LBB0_18
; %bb.3:
	ldr	x9, [sp, #56]
Lloh0:
	adrp	x10, _NVBIOS_VOLT_PWM@GOTPAGE
Lloh1:
	ldr	x10, [x10, _NVBIOS_VOLT_PWM@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_18
; %bb.4:
	ldr	w9, [sp, #64]
	add	w9, w9, w8
	stp	w8, w9, [x19]
	b	LBB0_18
LBB0_5:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
	ldp	w8, w13, [sp, #48]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	ldr	w9, [sp, #24]
	stp	w8, w13, [x19]
	tbnz	w9, #31, LBB0_11
; %bb.6:
	mov	w10, #0
	ldp	x11, x12, [sp, #32]
	cmp	x11, x8
	b.lt	LBB0_9
LBB0_7:
	sxtw	x13, w13
	cmp	x11, x13
	b.gt	LBB0_9
; %bb.8:
	ldr	x13, [x19, #24]
	ldr	x14, [x19, #8]
	add	x13, x13, x14, lsl #4
	str	x11, [x13]
	str	w10, [x13, #8]
	add	x13, x14, #1
	str	x13, [x19, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w9, w10
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w10, w10, #1
	ldr	w13, [sp, #52]
	add	x11, x11, x12
	cmp	x11, x8
	b.ge	LBB0_7
	b	LBB0_9
LBB0_11:
	str	w9, [x19, #16]
	b	LBB0_18
LBB0_12:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
	movi	d0, #0x000000ffffffff
	str	d0, [x19]
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.13:
	mov	w21, #0
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	w21, w21, #1
	ldr	w8, [sp, #12]
	cmp	w21, w8
	b.ge	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #20
	add	x3, sp, #16
	sub	x4, x29, #48
	mov	x0, x20
	mov	x1, x21
	bl	_nvbios_volt_entry_parse
	cbz	x0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldur	x1, [x29, #-48]
	ldr	x8, [x19, #24]
	ldr	x9, [x19, #8]
	add	x8, x8, x9, lsl #4
	str	x1, [x8]
	ldur	w10, [x29, #-40]
	str	w10, [x8, #8]
	add	x8, x9, #1
	str	x8, [x19, #8]
	ldr	w0, [x19]
	bl	_min
	str	w0, [x19]
	ldr	w0, [x19, #4]
	ldur	x1, [x29, #-48]
	bl	_max
	str	w0, [x19, #4]
	b	LBB0_14
LBB0_17:
	ldr	w8, [sp, #24]
	str	w8, [x19, #16]
LBB0_18:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"found ranged based VIDs\n"

l_.str.1:                               ; @.str.1
	.asciz	"found entry based VIDs\n"

	.comm	_NVBIOS_VOLT_PWM,8,3            ; @NVBIOS_VOLT_PWM
	.no_dead_strip	_nvkm_volt_parse_bios
.subsections_via_symbols
