	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_mmc_opendrain     ## -- Begin function menelaus_set_mmc_opendrain
	.p2align	4, 0x90
_menelaus_set_mmc_opendrain:            ## @menelaus_set_mmc_opendrain
	.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	%edi, %r15d
	leal	-3(%r15), %eax
	cmpl	$-3, %eax
	ja	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movl	%esi, %r14d
	movq	_the_menelaus@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_mutex_lock
	movq	_MENELAUS_MCT_CTRL1@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_10
## %bb.3:
	cmpl	$1, %r15d
	jne	LBB0_7
## %bb.4:
	movq	_MCT_CTRL1_S1_CMD_OD@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_7:
	movq	_MCT_CTRL1_S2_CMD_OD@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.6:
	orl	%ebx, %esi
	jmp	LBB0_9
LBB0_8:
	notl	%esi
	andl	%ebx, %esi
LBB0_9:
	movl	(%r13), %edi
	callq	_menelaus_write_reg
	movl	%eax, %ebx
LBB0_10:
	movq	(%r12), %rdi
	callq	_mutex_unlock
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_the_menelaus,8,3               ## @the_menelaus
	.comm	_MENELAUS_MCT_CTRL1,4,2         ## @MENELAUS_MCT_CTRL1
	.comm	_MCT_CTRL1_S1_CMD_OD,4,2        ## @MCT_CTRL1_S1_CMD_OD
	.comm	_MCT_CTRL1_S2_CMD_OD,4,2        ## @MCT_CTRL1_S2_CMD_OD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_mmc_opendrain     ; -- Begin function menelaus_set_mmc_opendrain
	.p2align	2
_menelaus_set_mmc_opendrain:            ; @menelaus_set_mmc_opendrain
	.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
	sub	w8, w0, #3
	cmn	w8, #3
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_2:
	mov	x19, x1
	mov	x21, x0
Lloh3:
	adrp	x22, _the_menelaus@GOTPAGE
Lloh4:
	ldr	x22, [x22, _the_menelaus@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_mutex_lock
Lloh5:
	adrp	x23, _MENELAUS_MCT_CTRL1@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MENELAUS_MCT_CTRL1@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_menelaus_read_reg
	mov	x20, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:
	cmp	w21, #1
	b.ne	LBB0_6
; %bb.4:
Lloh7:
	adrp	x8, _MCT_CTRL1_S1_CMD_OD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MCT_CTRL1_S1_CMD_OD@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	ldr	x0, [x22]
	bl	_mutex_unlock
	mov	x0, x20
	b	LBB0_8
LBB0_6:
Lloh9:
	adrp	x8, _MCT_CTRL1_S2_CMD_OD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCT_CTRL1_S2_CMD_OD@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	bic	w9, w20, w8
	orr	w8, w8, w20
	cmp	w19, #0
	csel	w1, w9, w8, eq
	ldr	w0, [x23]
	bl	_menelaus_write_reg
	mov	x19, x0
	ldr	x0, [x22]
	bl	_mutex_unlock
	mov	x0, x19
LBB0_8:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.comm	_MENELAUS_MCT_CTRL1,4,2         ; @MENELAUS_MCT_CTRL1
	.comm	_MCT_CTRL1_S1_CMD_OD,4,2        ; @MCT_CTRL1_S1_CMD_OD
	.comm	_MCT_CTRL1_S2_CMD_OD,4,2        ; @MCT_CTRL1_S2_CMD_OD
.subsections_via_symbols
