	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_InitSound                    ## -- Begin function I_InitSound
	.p2align	4, 0x90
_I_InitSound:                           ## @I_InitSound
	.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
	movq	_stderr@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_open
	movq	_audio_fd@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	(%r15), %rax
LBB0_2:
	movl	$131083, -44(%rbp)              ## imm = 0x2000B
	movq	_SNDCTL_DSP_SETFRAGMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-44(%rbp), %rbx
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	_myioctl
	movq	(%r15), %rdi
	movq	_SNDCTL_DSP_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_myioctl
	movq	_SAMPLERATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	(%r15), %rdi
	movq	_SNDCTL_DSP_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_myioctl
	movl	$1, -44(%rbp)
	movq	(%r15), %rdi
	movq	_SNDCTL_DSP_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_myioctl
	movq	(%r15), %rdi
	movq	_SNDCTL_DSP_GETFMTS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_myioctl
	movq	_AFMT_S16_LE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, -44(%rbp)
	je	LBB0_4
## %bb.3:
	movq	(%r15), %rdi
	movq	_SNDCTL_DSP_SETFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_myioctl
	jmp	LBB0_5
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
LBB0_5:
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, -44(%rbp)
	movq	_NUMSFX@GOTPCREL(%rip), %rbx
	cmpl	$2, (%rbx)
	jl	LBB0_11
## %bb.6:
	movq	_S_sfx@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	$1, %eax
	movq	_lengths@GOTPCREL(%rip), %r13
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%rdx), %edx
	movl	%edx, 8(%rcx,%rax)
	movq	(%r13), %rax
	movslq	-44(%rbp), %rdx
	movq	%rdx, %rsi
	shlq	$4, %rsi
	movq	(%rcx,%rsi), %rsi
	subq	%rcx, %rsi
	sarq	$4, %rsi
	andq	$-4, %rsi
	movl	(%rax,%rsi), %esi
	movl	%esi, (%rax,%rdx,4)
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %eax
	incl	%eax
	movl	%eax, -44(%rbp)
	cmpl	(%rbx), %eax
	jge	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%eax, %rsi
	movq	%rsi, %rax
	shlq	$4, %rax
	movq	(%rcx,%rax), %rdx
	testq	%rdx, %rdx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	12(%rcx,%rax), %edi
	shlq	$2, %rsi
	addq	(%r13), %rsi
	callq	_getsfx
	movq	(%r12), %rcx
	movslq	-44(%rbp), %rdx
	shlq	$4, %rdx
	movl	%eax, 8(%rcx,%rdx)
	jmp	LBB0_10
LBB0_11:
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	_MIXBUFFERSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.12:
	movq	_mixbuffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	(,%rbx,8), %rsi
	callq	___bzero
	movl	%ebx, %r15d
LBB0_13:
	movl	%r15d, -44(%rbp)
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"I_InitSound: "

L_.str.1:                               ## @.str.1
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_audio_fd,8,3                   ## @audio_fd
L_.str.2:                               ## @.str.2
	.asciz	"Could not open /dev/dsp\n"

	.comm	_SNDCTL_DSP_SETFRAGMENT,4,2     ## @SNDCTL_DSP_SETFRAGMENT
	.comm	_SNDCTL_DSP_RESET,4,2           ## @SNDCTL_DSP_RESET
	.comm	_SAMPLERATE,4,2                 ## @SAMPLERATE
	.comm	_SNDCTL_DSP_SPEED,4,2           ## @SNDCTL_DSP_SPEED
	.comm	_SNDCTL_DSP_STEREO,4,2          ## @SNDCTL_DSP_STEREO
	.comm	_SNDCTL_DSP_GETFMTS,4,2         ## @SNDCTL_DSP_GETFMTS
	.comm	_AFMT_S16_LE,4,2                ## @AFMT_S16_LE
	.comm	_SNDCTL_DSP_SETFMT,4,2          ## @SNDCTL_DSP_SETFMT
L_.str.3:                               ## @.str.3
	.asciz	"Could not play signed 16 data\n"

L_.str.4:                               ## @.str.4
	.asciz	" configured audio device\n"

	.comm	_NUMSFX,4,2                     ## @NUMSFX
	.comm	_S_sfx,8,3                      ## @S_sfx
	.comm	_lengths,8,3                    ## @lengths
L_.str.5:                               ## @.str.5
	.asciz	" pre-cached all sound data\n"

	.comm	_MIXBUFFERSIZE,4,2              ## @MIXBUFFERSIZE
	.comm	_mixbuffer,8,3                  ## @mixbuffer
L_.str.6:                               ## @.str.6
	.asciz	"I_InitSound: sound module ready\n"

	.comm	_SOUND_INTERVAL,4,2             ## @SOUND_INTERVAL
	.comm	_X_OK,4,2                       ## @X_OK
	.comm	_sndserver,4,2                  ## @sndserver
	.comm	_sndserver_filename,8,3         ## @sndserver_filename
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_InitSound                    ; -- Begin function I_InitSound
	.p2align	2
_I_InitSound:                           ; @I_InitSound
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
Lloh0:
	adrp	x19, _stderr@GOTPAGE
Lloh1:
	ldr	x19, [x19, _stderr@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
Lloh4:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_open
Lloh9:
	adrp	x20, _audio_fd@GOTPAGE
Lloh10:
	ldr	x20, [x20, _audio_fd@GOTPAGEOFF]
	str	x0, [x20]
	tbz	x0, #63, LBB0_2
; %bb.1:
	ldr	w0, [x19]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	ldr	x0, [x20]
LBB0_2:
	mov	w8, #11
	movk	w8, #2, lsl #16
	str	w8, [sp, #12]
Lloh13:
	adrp	x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	ldr	x0, [x20]
Lloh16:
	adrp	x8, _SNDCTL_DSP_RESET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SNDCTL_DSP_RESET@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_myioctl
Lloh19:
	adrp	x8, _SAMPLERATE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SAMPLERATE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	ldr	x0, [x20]
Lloh22:
	adrp	x8, _SNDCTL_DSP_SPEED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SNDCTL_DSP_SPEED@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	x0, [x20]
Lloh25:
	adrp	x8, _SNDCTL_DSP_STEREO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SNDCTL_DSP_STEREO@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	ldr	x0, [x20]
Lloh28:
	adrp	x8, _SNDCTL_DSP_GETFMTS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SNDCTL_DSP_GETFMTS@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
Lloh31:
	adrp	x8, _AFMT_S16_LE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AFMT_S16_LE@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	ands	w8, w9, w8
	str	w8, [sp, #12]
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x20]
Lloh34:
	adrp	x8, _SNDCTL_DSP_SETFMT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SNDCTL_DSP_SETFMT@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	b	LBB0_5
LBB0_4:
	ldr	w0, [x19]
Lloh37:
	adrp	x1, l_.str.3@PAGE
Lloh38:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
LBB0_5:
	ldr	w0, [x19]
Lloh39:
	adrp	x1, l_.str.4@PAGE
Lloh40:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh41:
	adrp	x1, l_.str@PAGE
Lloh42:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w8, #1
	str	w8, [sp, #12]
Lloh43:
	adrp	x20, _NUMSFX@GOTPAGE
Lloh44:
	ldr	x20, [x20, _NUMSFX@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.le	LBB0_11
; %bb.6:
Lloh45:
	adrp	x21, _S_sfx@GOTPAGE
Lloh46:
	ldr	x21, [x21, _S_sfx@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w9, #1
Lloh47:
	adrp	x22, _lengths@GOTPAGE
Lloh48:
	ldr	x22, [x22, _lengths@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x9, #8]
	add	x10, x8, x10, lsl #4
	str	w9, [x10, #8]
	ldr	x9, [x22]
	ldrsw	x10, [sp, #12]
	lsl	x11, x10, #4
	ldr	x11, [x8, x11]
	sub	x11, x11, x8
	asr	x11, x11, #4
	and	x11, x11, #0xfffffffffffffffc
	ldr	w11, [x9, x11]
	str	w11, [x9, x10, lsl #2]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [sp, #12]
	add	w9, w9, #1
	str	w9, [sp, #12]
	ldr	w10, [x20]
	cmp	w9, w10
	b.ge	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sxtw	x10, w9
	sbfiz	x9, x9, #4, #32
	ldr	x9, [x8, x9]
	cbnz	x9, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x8, x10, lsl #4
	ldr	w0, [x8, #12]
	ldr	x8, [x22]
	add	x1, x8, x10, lsl #2
	bl	_getsfx
	ldr	x8, [x21]
	ldrsw	x9, [sp, #12]
	add	x9, x8, x9, lsl #4
	str	w0, [x9, #8]
	b	LBB0_8
LBB0_11:
	ldr	w0, [x19]
Lloh49:
	adrp	x1, l_.str.5@PAGE
Lloh50:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
Lloh51:
	adrp	x8, _MIXBUFFERSIZE@GOTPAGE
Lloh52:
	ldr	x8, [x8, _MIXBUFFERSIZE@GOTPAGEOFF]
Lloh53:
	ldr	w20, [x8]
	cmp	w20, #1
	b.lt	LBB0_13
; %bb.12:
Lloh54:
	adrp	x8, _mixbuffer@GOTPAGE
Lloh55:
	ldr	x8, [x8, _mixbuffer@GOTPAGEOFF]
Lloh56:
	ldr	x0, [x8]
	lsl	x1, x20, #3
	bl	_bzero
	b	LBB0_14
LBB0_13:
	mov	w20, #0
LBB0_14:
	str	w20, [sp, #12]
	ldr	w0, [x19]
Lloh57:
	adrp	x1, l_.str.6@PAGE
Lloh58:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fprintf
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh57, Lloh58
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"I_InitSound: "

l_.str.1:                               ; @.str.1
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_audio_fd,8,3                   ; @audio_fd
l_.str.2:                               ; @.str.2
	.asciz	"Could not open /dev/dsp\n"

	.comm	_SNDCTL_DSP_SETFRAGMENT,4,2     ; @SNDCTL_DSP_SETFRAGMENT
	.comm	_SNDCTL_DSP_RESET,4,2           ; @SNDCTL_DSP_RESET
	.comm	_SAMPLERATE,4,2                 ; @SAMPLERATE
	.comm	_SNDCTL_DSP_SPEED,4,2           ; @SNDCTL_DSP_SPEED
	.comm	_SNDCTL_DSP_STEREO,4,2          ; @SNDCTL_DSP_STEREO
	.comm	_SNDCTL_DSP_GETFMTS,4,2         ; @SNDCTL_DSP_GETFMTS
	.comm	_AFMT_S16_LE,4,2                ; @AFMT_S16_LE
	.comm	_SNDCTL_DSP_SETFMT,4,2          ; @SNDCTL_DSP_SETFMT
l_.str.3:                               ; @.str.3
	.asciz	"Could not play signed 16 data\n"

l_.str.4:                               ; @.str.4
	.asciz	" configured audio device\n"

	.comm	_NUMSFX,4,2                     ; @NUMSFX
	.comm	_S_sfx,8,3                      ; @S_sfx
	.comm	_lengths,8,3                    ; @lengths
l_.str.5:                               ; @.str.5
	.asciz	" pre-cached all sound data\n"

	.comm	_MIXBUFFERSIZE,4,2              ; @MIXBUFFERSIZE
	.comm	_mixbuffer,8,3                  ; @mixbuffer
l_.str.6:                               ; @.str.6
	.asciz	"I_InitSound: sound module ready\n"

	.comm	_SOUND_INTERVAL,4,2             ; @SOUND_INTERVAL
	.comm	_X_OK,4,2                       ; @X_OK
	.comm	_sndserver,4,2                  ; @sndserver
	.comm	_sndserver_filename,8,3         ; @sndserver_filename
.subsections_via_symbols
