	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_ChangeMusic                  ## -- Begin function S_ChangeMusic
	.p2align	4, 0x90
_S_ChangeMusic:                         ## @S_ChangeMusic
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %esi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_mus_None@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_NUMMUSIC@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_2
## %bb.3:
	movq	_S_music@GOTPCREL(%rip), %rax
	movslq	%esi, %rbx
	shlq	$5, %rbx
	addq	(%rax), %rbx
	movq	_mus_playing@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jne	LBB0_4
	jmp	LBB0_7
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_I_Error
                                        ## implicit-def: $rbx
LBB0_4:
	xorl	%eax, %eax
	callq	_S_StopMusic
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_6
## %bb.5:
	movq	(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	leaq	-41(%rbp), %r14
	movq	%r14, %rdi
	callq	_sprintf
	movq	%r14, %rdi
	callq	_W_GetNumForName
	movq	%rax, %rdi
	movq	%rax, 24(%rbx)
LBB0_6:
	movq	_PU_MUSIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_W_CacheLumpNum
	movq	%rax, 16(%rbx)
	movq	%rax, %rdi
	callq	_I_RegisterSong
	movl	%eax, 8(%rbx)
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_I_PlaySong
	movq	_mus_playing@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_mus_None,4,2                   ## @mus_None
	.comm	_NUMMUSIC,4,2                   ## @NUMMUSIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad music number %d"

	.comm	_S_music,8,3                    ## @S_music
	.comm	_mus_playing,8,3                ## @mus_playing
L_.str.1:                               ## @.str.1
	.asciz	"d_%s"

	.comm	_PU_MUSIC,4,2                   ## @PU_MUSIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_S_ChangeMusic                  ; -- Begin function S_ChangeMusic
	.p2align	2
_S_ChangeMusic:                         ; @S_ChangeMusic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x1, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _mus_None@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mus_None@GOTPAGEOFF]
Lloh5:
	adrp	x9, _NUMMUSIC@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NUMMUSIC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w0
	ccmp	w9, w0, #4, lt
Lloh9:
	adrp	x20, _mus_playing@GOTPAGE
Lloh10:
	ldr	x20, [x20, _mus_playing@GOTPAGEOFF]
	b.gt	LBB0_2
; %bb.1:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_I_Error
                                        ; implicit-def: $x21
	b	LBB0_3
LBB0_2:
Lloh13:
	adrp	x8, _S_music@GOTPAGE
Lloh14:
	ldr	x8, [x8, _S_music@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	sxtw	x9, w1
	add	x21, x8, x9, lsl #5
	ldr	x8, [x20]
	cmp	x8, x21
	b.eq	LBB0_6
LBB0_3:
	bl	_S_StopMusic
	ldr	x0, [x21, #24]
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	x2, [x21]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #15
	bl	_sprintf
	add	x0, sp, #15
	bl	_W_GetNumForName
	str	x0, [x21, #24]
LBB0_5:
Lloh18:
	adrp	x8, _PU_MUSIC@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PU_MUSIC@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_W_CacheLumpNum
	str	x0, [x21, #16]
	bl	_I_RegisterSong
	str	w0, [x21, #8]
	mov	x1, x19
	bl	_I_PlaySong
	str	x21, [x20]
LBB0_6:
	ldr	x8, [sp, #24]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	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
	add	sp, sp, #80
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_mus_None,4,2                   ; @mus_None
	.comm	_NUMMUSIC,4,2                   ; @NUMMUSIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad music number %d"

	.comm	_S_music,8,3                    ; @S_music
	.comm	_mus_playing,8,3                ; @mus_playing
l_.str.1:                               ; @.str.1
	.asciz	"d_%s"

	.comm	_PU_MUSIC,4,2                   ; @PU_MUSIC
.subsections_via_symbols
