	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_slot_sel          ## -- Begin function menelaus_set_slot_sel
	.p2align	4, 0x90
_menelaus_set_slot_sel:                 ## @menelaus_set_slot_sel
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_the_menelaus@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_mutex_lock
	movq	_MENELAUS_GPIO_CTRL@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	_GPIO2_DIR_INPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%ebx, %eax
	movq	_GPIO_CTRL_SLOTSELEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %ecx
	orl	%eax, %ecx
	notl	%esi
	andl	%eax, %esi
	testl	%r14d, %r14d
	cmovnel	%ecx, %esi
	movl	(%r12), %edi
	callq	_menelaus_write_reg
	movl	%eax, %ebx
LBB0_2:
	movq	(%r15), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_the_menelaus,8,3               ## @the_menelaus
	.comm	_MENELAUS_GPIO_CTRL,4,2         ## @MENELAUS_GPIO_CTRL
	.comm	_GPIO2_DIR_INPUT,4,2            ## @GPIO2_DIR_INPUT
	.comm	_GPIO_CTRL_SLOTSELEN,4,2        ## @GPIO_CTRL_SLOTSELEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_slot_sel          ; -- Begin function menelaus_set_slot_sel
	.p2align	2
_menelaus_set_slot_sel:                 ; @menelaus_set_slot_sel
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
Lloh0:
	adrp	x21, _the_menelaus@GOTPAGE
Lloh1:
	ldr	x21, [x21, _the_menelaus@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_mutex_lock
Lloh2:
	adrp	x22, _MENELAUS_GPIO_CTRL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MENELAUS_GPIO_CTRL@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_menelaus_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _GPIO2_DIR_INPUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GPIO2_DIR_INPUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	orr	w8, w8, w20
Lloh7:
	adrp	x9, _GPIO_CTRL_SLOTSELEN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _GPIO_CTRL_SLOTSELEN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w10, w9, w8
	bic	w8, w8, w9
	cmp	w19, #0
	csel	w1, w8, w10, eq
	ldr	w0, [x22]
	bl	_menelaus_write_reg
	mov	x20, x0
LBB0_2:
	ldr	x0, [x21]
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.comm	_MENELAUS_GPIO_CTRL,4,2         ; @MENELAUS_GPIO_CTRL
	.comm	_GPIO2_DIR_INPUT,4,2            ; @GPIO2_DIR_INPUT
	.comm	_GPIO_CTRL_SLOTSELEN,4,2        ; @GPIO_CTRL_SLOTSELEN
.subsections_via_symbols
