	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_regulator_sleep   ## -- Begin function menelaus_set_regulator_sleep
	.p2align	4, 0x90
_menelaus_set_regulator_sleep:          ## @menelaus_set_regulator_sleep
	.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, %r14d
	movq	_the_menelaus@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	movq	8(%rdi), %r12
	callq	_mutex_lock
	movq	_MENELAUS_SLEEP_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_menelaus_write_reg
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_dev_dbg
	movq	_MENELAUS_GPIO_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:
	movq	_GPIO_CTRL_SLPCTLEN@GOTPCREL(%rip), %rax
	movq	_GPIO3_DIR_INPUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	%esi, %eax
	orl	%ebx, %eax
	notl	%esi
	andl	%ebx, %esi
	testl	%r14d, %r14d
	cmovnel	%eax, %esi
	movl	(%r15), %edi
	callq	_menelaus_write_reg
LBB0_3:
	movl	%eax, %ebx
LBB0_4:
	movq	(%r13), %rdi
	callq	_mutex_unlock
	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	_MENELAUS_SLEEP_CTRL2,4,2       ## @MENELAUS_SLEEP_CTRL2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"regulator sleep configuration: %02x\n"

	.comm	_MENELAUS_GPIO_CTRL,4,2         ## @MENELAUS_GPIO_CTRL
	.comm	_GPIO_CTRL_SLPCTLEN,4,2         ## @GPIO_CTRL_SLPCTLEN
	.comm	_GPIO3_DIR_INPUT,4,2            ## @GPIO3_DIR_INPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_regulator_sleep   ; -- Begin function menelaus_set_regulator_sleep
	.p2align	2
_menelaus_set_regulator_sleep:          ; @menelaus_set_regulator_sleep
	.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	x19, x0
Lloh0:
	adrp	x23, _the_menelaus@GOTPAGE
Lloh1:
	ldr	x23, [x23, _the_menelaus@GOTPAGEOFF]
	ldr	x0, [x23]
	ldr	x22, [x0, #8]
	bl	_mutex_lock
Lloh2:
	adrp	x8, _MENELAUS_SLEEP_CTRL2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MENELAUS_SLEEP_CTRL2@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_menelaus_write_reg
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_dbg
Lloh7:
	adrp	x21, _MENELAUS_GPIO_CTRL@GOTPAGE
Lloh8:
	ldr	x21, [x21, _MENELAUS_GPIO_CTRL@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_menelaus_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_4
; %bb.2:
Lloh9:
	adrp	x8, _GPIO_CTRL_SLPCTLEN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GPIO_CTRL_SLPCTLEN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _GPIO3_DIR_INPUT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GPIO3_DIR_INPUT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
	orr	w9, w8, w20
	bic	w8, w20, w8
	cmp	w19, #0
	csel	w1, w8, w9, eq
	ldr	w0, [x21]
	bl	_menelaus_write_reg
LBB0_3:
	mov	x20, x0
LBB0_4:
	ldr	x0, [x23]
	bl	_mutex_unlock
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.comm	_MENELAUS_SLEEP_CTRL2,4,2       ; @MENELAUS_SLEEP_CTRL2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"regulator sleep configuration: %02x\n"

	.comm	_MENELAUS_GPIO_CTRL,4,2         ; @MENELAUS_GPIO_CTRL
	.comm	_GPIO_CTRL_SLPCTLEN,4,2         ; @GPIO_CTRL_SLPCTLEN
	.comm	_GPIO3_DIR_INPUT,4,2            ; @GPIO3_DIR_INPUT
.subsections_via_symbols
