	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_mmc_slot          ## -- Begin function menelaus_set_mmc_slot
	.p2align	4, 0x90
_menelaus_set_mmc_slot:                 ## @menelaus_set_mmc_slot
	.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, %r12d
	leal	-3(%r12), %eax
	cmpl	$-3, %eax
	jbe	LBB0_1
## %bb.2:
	movl	%edx, %r15d
	cmpl	$3, %edx
	jl	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_3:
	movl	%ecx, %r13d
	movl	%esi, %r14d
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_mutex_lock
	movq	_MENELAUS_MCT_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_19
## %bb.4:
	cmpl	$1, %r12d
	jne	LBB0_8
## %bb.5:
	movq	_MCT_CTRL2_S1CD_BUFEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MCT_CTRL2_S1CD_DBEN@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_8:
	movq	_MCT_CTRL2_S2CD_BUFEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MCT_CTRL2_S2CD_BEN@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.7:
	orl	%ebx, %esi
	orl	%eax, %esi
	jmp	LBB0_10
LBB0_9:
	orl	%esi, %eax
	notl	%eax
	andl	%eax, %ebx
	movl	%ebx, %esi
LBB0_10:
	movq	_MENELAUS_MCT_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_menelaus_write_reg
	testl	%eax, %eax
	js	LBB0_18
## %bb.11:
	movq	_MENELAUS_MCT_CTRL3@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_menelaus_read_reg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_19
## %bb.12:
	cmpl	$1, %r12d
	jne	LBB0_15
## %bb.13:
	movq	_MCT_CTRL3_SLOT1_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%r14d, %r14d
	je	LBB0_16
## %bb.14:
	orl	%ebx, %r12d
	jmp	LBB0_17
LBB0_15:
	movq	_MCT_CTRL3_SLOT2_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r12d, %eax
	orl	%ebx, %eax
	notl	%r12d
	andl	%ebx, %r12d
	testl	%r14d, %r14d
	cmovnel	%eax, %r12d
	movq	_MENELAUS_MCT_CTRL2@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_menelaus_read_reg
	movq	_MCT_CTRL2_VS2_SEL_D0@GOTPCREL(%rip), %rcx
	movq	_MCT_CTRL2_VS2_SEL_D1@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	notl	%esi
	andl	%eax, %esi
	orl	%r15d, %esi
	movl	(%rbx), %edi
	callq	_menelaus_write_reg
	testl	%eax, %eax
	jns	LBB0_17
	jmp	LBB0_18
LBB0_16:
	notl	%r12d
	andl	%ebx, %r12d
LBB0_17:
	movq	_MCT_CTRL3_S1_AUTO_EN@GOTPCREL(%rip), %rax
	movq	_MCT_CTRL3_S2_AUTO_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	notl	%esi
	andl	%r12d, %esi
	movl	(%r13), %edi
	callq	_menelaus_write_reg
LBB0_18:
	movl	%eax, %ebx
LBB0_19:
	movq	_the_menelaus@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_mutex_unlock
LBB0_20:
	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_CTRL2,4,2         ## @MENELAUS_MCT_CTRL2
	.comm	_MCT_CTRL2_S1CD_BUFEN,4,2       ## @MCT_CTRL2_S1CD_BUFEN
	.comm	_MCT_CTRL2_S1CD_DBEN,4,2        ## @MCT_CTRL2_S1CD_DBEN
	.comm	_MCT_CTRL2_S2CD_BUFEN,4,2       ## @MCT_CTRL2_S2CD_BUFEN
	.comm	_MCT_CTRL2_S2CD_BEN,4,2         ## @MCT_CTRL2_S2CD_BEN
	.comm	_MENELAUS_MCT_CTRL3,4,2         ## @MENELAUS_MCT_CTRL3
	.comm	_MCT_CTRL3_SLOT1_EN,4,2         ## @MCT_CTRL3_SLOT1_EN
	.comm	_MCT_CTRL3_SLOT2_EN,4,2         ## @MCT_CTRL3_SLOT2_EN
	.comm	_MCT_CTRL2_VS2_SEL_D0,4,2       ## @MCT_CTRL2_VS2_SEL_D0
	.comm	_MCT_CTRL2_VS2_SEL_D1,4,2       ## @MCT_CTRL2_VS2_SEL_D1
	.comm	_MCT_CTRL3_S1_AUTO_EN,4,2       ## @MCT_CTRL3_S1_AUTO_EN
	.comm	_MCT_CTRL3_S2_AUTO_EN,4,2       ## @MCT_CTRL3_S2_AUTO_EN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_menelaus_set_mmc_slot          ; -- Begin function menelaus_set_mmc_slot
	.p2align	2
_menelaus_set_mmc_slot:                 ; @menelaus_set_mmc_slot
	.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
	sub	w8, w0, #3
	cmn	w8, #3
	b.ls	LBB0_2
; %bb.1:
	mov	x19, x2
	cmp	w2, #3
	b.lt	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_15
LBB0_3:
	mov	x23, x3
	mov	x20, x1
	mov	x22, x0
Lloh3:
	adrp	x24, _the_menelaus@GOTPAGE
Lloh4:
	ldr	x24, [x24, _the_menelaus@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_mutex_lock
Lloh5:
	adrp	x25, _MENELAUS_MCT_CTRL2@GOTPAGE
Lloh6:
	ldr	x25, [x25, _MENELAUS_MCT_CTRL2@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_menelaus_read_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
; %bb.4:
	cmp	w22, #1
	b.ne	LBB0_6
; %bb.5:
Lloh7:
	adrp	x8, _MCT_CTRL2_S1CD_BUFEN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MCT_CTRL2_S1CD_BUFEN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _MCT_CTRL2_S1CD_DBEN@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MCT_CTRL2_S1CD_DBEN@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x8, _MCT_CTRL2_S2CD_BUFEN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MCT_CTRL2_S2CD_BUFEN@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _MCT_CTRL2_S2CD_BEN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MCT_CTRL2_S2CD_BEN@GOTPAGEOFF]
LBB0_7:
	ldr	w9, [x9]
	orr	w10, w9, w8
	bic	w10, w21, w10
	orr	w8, w8, w21
	orr	w8, w8, w9
	cmp	w23, #0
	csel	w1, w10, w8, eq
	ldr	w0, [x25]
	bl	_menelaus_write_reg
	tbnz	w0, #31, LBB0_13
; %bb.8:
Lloh17:
	adrp	x23, _MENELAUS_MCT_CTRL3@GOTPAGE
Lloh18:
	ldr	x23, [x23, _MENELAUS_MCT_CTRL3@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_menelaus_read_reg
	mov	x21, x0
	tbnz	w0, #31, LBB0_14
; %bb.9:
	cmp	w22, #1
	b.ne	LBB0_11
; %bb.10:
Lloh19:
	adrp	x8, _MCT_CTRL3_SLOT1_EN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MCT_CTRL3_SLOT1_EN@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	bic	w9, w21, w8
	orr	w8, w8, w21
	cmp	w20, #0
	csel	w20, w9, w8, eq
	b	LBB0_12
LBB0_11:
Lloh22:
	adrp	x8, _MCT_CTRL3_SLOT2_EN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MCT_CTRL3_SLOT2_EN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	orr	w9, w8, w21
	bic	w8, w21, w8
	cmp	w20, #0
	csel	w20, w8, w9, eq
	ldr	w0, [x25]
	bl	_menelaus_read_reg
Lloh25:
	adrp	x8, _MCT_CTRL2_VS2_SEL_D0@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MCT_CTRL2_VS2_SEL_D0@GOTPAGEOFF]
Lloh27:
	adrp	x9, _MCT_CTRL2_VS2_SEL_D1@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MCT_CTRL2_VS2_SEL_D1@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
	orr	w1, w8, w19
	ldr	w0, [x25]
	bl	_menelaus_write_reg
	tbnz	w0, #31, LBB0_13
LBB0_12:
Lloh31:
	adrp	x8, _MCT_CTRL3_S1_AUTO_EN@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MCT_CTRL3_S1_AUTO_EN@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _MCT_CTRL3_S2_AUTO_EN@GOTPAGE
Lloh35:
	ldr	x9, [x9, _MCT_CTRL3_S2_AUTO_EN@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w1, w20, w8
	ldr	w0, [x23]
	bl	_menelaus_write_reg
LBB0_13:
	mov	x21, x0
LBB0_14:
	ldr	x0, [x24]
	bl	_mutex_unlock
LBB0_15:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh29
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_the_menelaus,8,3               ; @the_menelaus
	.comm	_MENELAUS_MCT_CTRL2,4,2         ; @MENELAUS_MCT_CTRL2
	.comm	_MCT_CTRL2_S1CD_BUFEN,4,2       ; @MCT_CTRL2_S1CD_BUFEN
	.comm	_MCT_CTRL2_S1CD_DBEN,4,2        ; @MCT_CTRL2_S1CD_DBEN
	.comm	_MCT_CTRL2_S2CD_BUFEN,4,2       ; @MCT_CTRL2_S2CD_BUFEN
	.comm	_MCT_CTRL2_S2CD_BEN,4,2         ; @MCT_CTRL2_S2CD_BEN
	.comm	_MENELAUS_MCT_CTRL3,4,2         ; @MENELAUS_MCT_CTRL3
	.comm	_MCT_CTRL3_SLOT1_EN,4,2         ; @MCT_CTRL3_SLOT1_EN
	.comm	_MCT_CTRL3_SLOT2_EN,4,2         ; @MCT_CTRL3_SLOT2_EN
	.comm	_MCT_CTRL2_VS2_SEL_D0,4,2       ; @MCT_CTRL2_VS2_SEL_D0
	.comm	_MCT_CTRL2_VS2_SEL_D1,4,2       ; @MCT_CTRL2_VS2_SEL_D1
	.comm	_MCT_CTRL3_S1_AUTO_EN,4,2       ; @MCT_CTRL3_S1_AUTO_EN
	.comm	_MCT_CTRL3_S2_AUTO_EN,4,2       ; @MCT_CTRL3_S2_AUTO_EN
.subsections_via_symbols
