	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_ChangeSwitchTexture          ## -- Begin function P_ChangeSwitchTexture
	.p2align	4, 0x90
_P_ChangeSwitchTexture:                 ## @P_ChangeSwitchTexture
	.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, %r14d
	movq	%rdi, %r15
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	cmpl	$11, (%r15)
	sete	%al
	testb	%al, %al
	je	LBB0_4
LBB0_5:
	movq	_sfx_swtchx@GOTPCREL(%rip), %rdx
	jmp	LBB0_6
LBB0_2:
	movl	$0, (%r15)
	xorl	%eax, %eax
	testb	%al, %al
	jne	LBB0_5
LBB0_4:
	movq	_sfx_swtchn@GOTPCREL(%rip), %rdx
LBB0_6:
	movq	_numswitches@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_19
## %bb.7:
	movq	8(%r15), %rax
	movq	_sides@GOTPCREL(%rip), %r12
	movq	(%rax), %rax
	movq	(%r12), %rcx
	leaq	(%rax,%rax,2), %rsi
	movl	(%rcx,%rsi,4), %eax
	movl	4(%rcx,%rsi,4), %r9d
	movl	8(%rcx,%rsi,4), %r8d
	movl	(%rdx), %esi
	addl	%ebx, %ebx
	movq	_switchlist@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	cmpl	$2, %ebx
	movl	$1, %edx
	cmovgel	%ebx, %edx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdi,%rbx,4), %ecx
	cmpl	%eax, %ecx
	je	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r9d, %ecx
	je	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpl	%r8d, %ecx
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	incq	%rbx
	cmpq	%rbx, %rdx
	jne	LBB0_8
	jmp	LBB0_19
LBB0_9:
	movq	_buttonlist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_S_StartSound
	movq	%rbx, %rcx
	xorq	$1, %rcx
	movq	(%r13), %rax
	movl	(%rax,%rcx,4), %ecx
	movq	(%r12), %rdx
	movq	8(%r15), %rsi
	movq	(%rsi), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	movl	%ecx, (%rdx,%rsi,4)
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.10:
	movq	_top@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_12:
	movq	_buttonlist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_S_StartSound
	movq	%rbx, %rcx
	xorq	$1, %rcx
	movq	(%r13), %rax
	movl	(%rax,%rcx,4), %ecx
	movq	(%r12), %rdx
	movq	8(%r15), %rsi
	movq	(%rsi), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	movl	%ecx, 4(%rdx,%rsi,4)
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.13:
	movq	_middle@GOTPCREL(%rip), %rcx
	jmp	LBB0_17
LBB0_15:
	movq	_buttonlist@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_S_StartSound
	movq	%rbx, %rcx
	xorq	$1, %rcx
	movq	(%r13), %rax
	movl	(%rax,%rcx,4), %ecx
	movq	(%r12), %rdx
	movq	8(%r15), %rsi
	movq	(%rsi), %rsi
	leaq	(%rsi,%rsi,2), %rsi
	movl	%ecx, 8(%rdx,%rsi,4)
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.16:
	movq	_bottom@GOTPCREL(%rip), %rcx
LBB0_17:
	movl	(%rcx), %esi
	movl	(%rax,%rbx,4), %edx
	movq	_BUTTONTIME@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_P_StartButton                  ## TAILCALL
LBB0_19:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sides,8,3                      ## @sides
	.comm	_sfx_swtchn,4,2                 ## @sfx_swtchn
	.comm	_sfx_swtchx,4,2                 ## @sfx_swtchx
	.comm	_numswitches,4,2                ## @numswitches
	.comm	_switchlist,8,3                 ## @switchlist
	.comm	_buttonlist,8,3                 ## @buttonlist
	.comm	_top,4,2                        ## @top
	.comm	_BUTTONTIME,4,2                 ## @BUTTONTIME
	.comm	_middle,4,2                     ## @middle
	.comm	_bottom,4,2                     ## @bottom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_P_ChangeSwitchTexture          ; -- Begin function P_ChangeSwitchTexture
	.p2align	2
_P_ChangeSwitchTexture:                 ; @P_ChangeSwitchTexture
	.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	x20, x1
	mov	x19, x0
	cbz	w1, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #11
	cset	w8, eq
	b	LBB0_3
LBB0_2:
	mov	w8, #0
	str	wzr, [x19]
LBB0_3:
Lloh0:
	adrp	x9, _sfx_swtchx@GOTPAGE
Lloh1:
	ldr	x9, [x9, _sfx_swtchx@GOTPAGEOFF]
Lloh2:
	adrp	x10, _sfx_swtchn@GOTPAGE
Lloh3:
	ldr	x10, [x10, _sfx_swtchn@GOTPAGEOFF]
	cmp	w8, #0
	csel	x11, x9, x10, ne
Lloh4:
	adrp	x8, _numswitches@GOTPAGE
Lloh5:
	ldr	x8, [x8, _numswitches@GOTPAGEOFF]
Lloh6:
	ldr	w12, [x8]
	cmp	w12, #1
	b.lt	LBB0_16
; %bb.4:
	mov	x21, #0
Lloh7:
	adrp	x22, _sides@GOTPAGE
Lloh8:
	ldr	x22, [x22, _sides@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x9, [x19, #8]
	ldr	x9, [x9]
	mov	w10, #12
	madd	x10, x9, x10, x8
	ldp	w8, w9, [x10]
	ldr	w10, [x10, #8]
	ldr	w1, [x11]
	lsl	w12, w12, #1
Lloh9:
	adrp	x23, _switchlist@GOTPAGE
Lloh10:
	ldr	x23, [x23, _switchlist@GOTPAGEOFF]
	ldr	x11, [x23]
	cmp	w12, #1
	csinc	w12, w12, wzr, gt
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x11, x21, lsl #2]
	cmp	w13, w8
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w13, w9
	b.eq	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w13, w10
	b.eq	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x21, x21, #1
	cmp	x12, x21
	b.ne	LBB0_5
	b	LBB0_16
LBB0_9:
Lloh11:
	adrp	x8, _buttonlist@GOTPAGE
Lloh12:
	ldr	x8, [x8, _buttonlist@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_S_StartSound
	ldr	x8, [x23]
	eor	x9, x21, #0x1
	ldr	w9, [x8, x9, lsl #2]
	ldr	x10, [x22]
	ldr	x11, [x19, #8]
	ldr	x11, [x11]
	mov	w12, #12
	mul	x11, x11, x12
	str	w9, [x10, x11]
	cbz	w20, LBB0_16
; %bb.10:
Lloh14:
	adrp	x9, _top@GOTPAGE
Lloh15:
	ldr	x9, [x9, _top@GOTPAGEOFF]
	b	LBB0_15
LBB0_11:
Lloh16:
	adrp	x8, _buttonlist@GOTPAGE
Lloh17:
	ldr	x8, [x8, _buttonlist@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_S_StartSound
	ldr	x8, [x23]
	eor	x9, x21, #0x1
	ldr	w9, [x8, x9, lsl #2]
	ldr	x10, [x22]
	ldr	x11, [x19, #8]
	ldr	x11, [x11]
	mov	w12, #12
	madd	x10, x11, x12, x10
	str	w9, [x10, #4]
	cbz	w20, LBB0_16
; %bb.12:
Lloh19:
	adrp	x9, _middle@GOTPAGE
Lloh20:
	ldr	x9, [x9, _middle@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:
Lloh21:
	adrp	x8, _buttonlist@GOTPAGE
Lloh22:
	ldr	x8, [x8, _buttonlist@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_S_StartSound
	ldr	x8, [x23]
	eor	x9, x21, #0x1
	ldr	w9, [x8, x9, lsl #2]
	ldr	x10, [x22]
	ldr	x11, [x19, #8]
	ldr	x11, [x11]
	mov	w12, #12
	madd	x10, x11, x12, x10
	str	w9, [x10, #8]
	cbz	w20, LBB0_16
; %bb.14:
Lloh24:
	adrp	x9, _bottom@GOTPAGE
Lloh25:
	ldr	x9, [x9, _bottom@GOTPAGEOFF]
LBB0_15:
	ldr	w2, [x8, x21, lsl #2]
Lloh26:
	adrp	x8, _BUTTONTIME@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BUTTONTIME@GOTPAGEOFF]
	ldr	w1, [x9]
Lloh28:
	ldr	w3, [x8]
	mov	x0, x19
	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
	b	_P_StartButton
LBB0_16:
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_sides,8,3                      ; @sides
	.comm	_sfx_swtchn,4,2                 ; @sfx_swtchn
	.comm	_sfx_swtchx,4,2                 ; @sfx_swtchx
	.comm	_numswitches,4,2                ; @numswitches
	.comm	_switchlist,8,3                 ; @switchlist
	.comm	_buttonlist,8,3                 ; @buttonlist
	.comm	_top,4,2                        ; @top
	.comm	_BUTTONTIME,4,2                 ; @BUTTONTIME
	.comm	_middle,4,2                     ; @middle
	.comm	_bottom,4,2                     ; @bottom
.subsections_via_symbols
