	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function menelaus_set_voltage
_menelaus_set_voltage:                  ## @menelaus_set_voltage
	.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	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movl	%esi, %r13d
	movq	%rdi, %r15
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	8(%rdi), %r14
	callq	_mutex_lock
	movl	12(%r15), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movb	(%r15), %cl
	movb	4(%r15), %al
	movl	$-1, %edx
	shll	%cl, %edx
	notl	%edx
	movl	%eax, %ecx
	shll	%cl, %edx
	notl	%edx
	shll	%cl, %r12d
	andl	%edx, %ebx
	orl	%ebx, %r12d
	movl	16(%r15), %edx
	movl	12(%r15), %r8d
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r13d, %ecx
	movl	%r12d, %r9d
	callq	_dev_dbg
	movl	12(%r15), %edi
	movl	%r12d, %esi
	callq	_menelaus_write_reg
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:
	movl	8(%r15), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_menelaus_write_reg
	movl	%eax, %ebx
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.5:
	movl	$1, %edi
	callq	_msleep
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_2:
	movl	%eax, %ebx
LBB0_3:
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_mutex_unlock
LBB0_6:
	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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting voltage '%s'to %d mV (reg 0x%02x, val 0x%02x)\n"

	.no_dead_strip	_menelaus_set_voltage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function menelaus_set_voltage
_menelaus_set_voltage:                  ; @menelaus_set_voltage
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x24, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _the_menelaus@GOTPAGE
Lloh1:
	ldr	x25, [x25, _the_menelaus@GOTPAGEOFF]
	ldr	x0, [x25]
	ldr	x23, [x0, #8]
	bl	_mutex_lock
	ldr	w0, [x20, #12]
	bl	_menelaus_read_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	w8, #-1
	ldp	w9, w10, [x20]
	lsl	w8, w8, w9
	mvn	w8, w8
	lsl	w8, w8, w10
	bic	w8, w21, w8
	lsl	w9, w24, w10
	orr	w21, w8, w9
	ldp	w4, w2, [x20, #12]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	mov	x3, x22
	mov	x5, x21
	bl	_dev_dbg
	ldr	w0, [x20, #12]
	mov	x1, x21
	bl	_menelaus_write_reg
	tbnz	w0, #31, LBB0_4
; %bb.2:
	ldr	w0, [x20, #8]
	mov	x1, x19
	bl	_menelaus_write_reg
	mov	x21, x0
	ldr	x0, [x25]
	bl	_mutex_unlock
	cbnz	w21, LBB0_6
; %bb.3:
	mov	w0, #1
	bl	_msleep
	b	LBB0_6
LBB0_4:
	mov	x21, x0
LBB0_5:
	ldr	x0, [x25]
	bl	_mutex_unlock
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting voltage '%s'to %d mV (reg 0x%02x, val 0x%02x)\n"

	.no_dead_strip	_menelaus_set_voltage
.subsections_via_symbols
