	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_vcore_hw          ## -- Begin function menelaus_set_vcore_hw
	.p2align	4, 0x90
_menelaus_set_vcore_hw:                 ## @menelaus_set_vcore_hw
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %r12d
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_vcore_values@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_menelaus_get_vtg_value
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %r14d
	movl	(%r13), %ebx
	movl	%ebx, %edi
	callq	_ARRAY_SIZE
	movl	%r15d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_menelaus_get_vtg_value
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_dev_dbg
	movq	_the_menelaus@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	$4, %rdi
	callq	_mutex_lock
	movq	_MENELAUS_VCORE_CTRL3@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	callq	_menelaus_write_reg
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	_MENELAUS_VCORE_CTRL4@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_menelaus_write_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	movq	(%r15), %rax
	cmpl	$0, (%rax)
	jne	LBB0_8
## %bb.7:
	movq	_MENELAUS_VCORE_CTRL1@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_menelaus_read_reg
	movq	_VCORE_CTRL1_HW_NSW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_VCORE_CTRL1_BYP_COMP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %edi
	movl	%eax, %esi
	callq	_menelaus_write_reg
	movl	%eax, %ebx
	movq	(%r15), %rax
	movl	$1, (%rax)
LBB0_8:
	movl	$1, %edi
	callq	_msleep
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movl	%eax, %ebx
LBB0_9:
	movq	(%r15), %rdi
	addq	$4, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_the_menelaus,8,3               ## @the_menelaus
	.comm	_vcore_values,4,2               ## @vcore_values
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting VCORE FLOOR to %d mV and ROOF to %d mV\n"

	.comm	_MENELAUS_VCORE_CTRL3,4,2       ## @MENELAUS_VCORE_CTRL3
	.comm	_MENELAUS_VCORE_CTRL4,4,2       ## @MENELAUS_VCORE_CTRL4
	.comm	_MENELAUS_VCORE_CTRL1,4,2       ## @MENELAUS_VCORE_CTRL1
	.comm	_VCORE_CTRL1_HW_NSW,4,2         ## @VCORE_CTRL1_HW_NSW
	.comm	_VCORE_CTRL1_BYP_COMP,4,2       ## @VCORE_CTRL1_BYP_COMP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_vcore_hw          ; -- Begin function menelaus_set_vcore_hw
	.p2align	2
_menelaus_set_vcore_hw:                 ; @menelaus_set_vcore_hw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _the_menelaus@GOTPAGE
Lloh1:
	ldr	x24, [x24, _the_menelaus@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x22, [x8, #8]
Lloh2:
	adrp	x23, _vcore_values@GOTPAGE
Lloh3:
	ldr	x23, [x23, _vcore_values@GOTPAGEOFF]
	ldr	w19, [x23]
	mov	x0, x19
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x20
	mov	x1, x19
	bl	_menelaus_get_vtg_value
	tbnz	w0, #31, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w23, [x23]
	mov	x0, x23
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_menelaus_get_vtg_value
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x23, x0
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	bl	_dev_dbg
	ldr	x8, [x24]
	add	x0, x8, #4
	bl	_mutex_lock
Lloh6:
	adrp	x8, _MENELAUS_VCORE_CTRL3@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MENELAUS_VCORE_CTRL3@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_menelaus_write_reg
	tbnz	w0, #31, LBB0_8
; %bb.3:
Lloh9:
	adrp	x8, _MENELAUS_VCORE_CTRL4@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MENELAUS_VCORE_CTRL4@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_menelaus_write_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_9
; %bb.4:
	ldr	x8, [x24]
	ldr	w8, [x8]
	cbnz	w8, LBB0_6
; %bb.5:
Lloh12:
	adrp	x19, _MENELAUS_VCORE_CTRL1@GOTPAGE
Lloh13:
	ldr	x19, [x19, _MENELAUS_VCORE_CTRL1@GOTPAGEOFF]
	ldr	w0, [x19]
	bl	_menelaus_read_reg
Lloh14:
	adrp	x8, _VCORE_CTRL1_HW_NSW@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VCORE_CTRL1_HW_NSW@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _VCORE_CTRL1_BYP_COMP@GOTPAGE
Lloh18:
	ldr	x9, [x9, _VCORE_CTRL1_BYP_COMP@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w8, w0
	orr	w1, w8, w9
	ldr	w0, [x19]
	bl	_menelaus_write_reg
	mov	x20, x0
	ldr	x8, [x24]
	mov	w9, #1
	str	w9, [x8]
LBB0_6:
	mov	w0, #1
	bl	_msleep
	b	LBB0_9
LBB0_7:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_8:
	mov	x20, x0
LBB0_9:
	ldr	x8, [x24]
	add	x0, x8, #4
	bl	_mutex_unlock
LBB0_10:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.comm	_vcore_values,4,2               ; @vcore_values
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting VCORE FLOOR to %d mV and ROOF to %d mV\n"

	.comm	_MENELAUS_VCORE_CTRL3,4,2       ; @MENELAUS_VCORE_CTRL3
	.comm	_MENELAUS_VCORE_CTRL4,4,2       ; @MENELAUS_VCORE_CTRL4
	.comm	_MENELAUS_VCORE_CTRL1,4,2       ; @MENELAUS_VCORE_CTRL1
	.comm	_VCORE_CTRL1_HW_NSW,4,2         ; @VCORE_CTRL1_HW_NSW
	.comm	_VCORE_CTRL1_BYP_COMP,4,2       ; @VCORE_CTRL1_BYP_COMP
.subsections_via_symbols
