	.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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movq	_audio_fd@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	movq	(%r14), %rax
LBB0_2:
	movl	$131083, -20(%rbp)              ## imm = 0x2000B
	movq	_SNDCTL_DSP_SETFRAGMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-20(%rbp), %rbx
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	_myioctl
	movq	(%r14), %rdi
	movq	_SNDCTL_DSP_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_myioctl
	movl	$11025, -20(%rbp)               ## imm = 0x2B11
	movq	(%r14), %rdi
	movq	_SNDCTL_DSP_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_myioctl
	movl	$1, -20(%rbp)
	movq	(%r14), %rdi
	movq	_SNDCTL_DSP_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_myioctl
	movq	(%r14), %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, -20(%rbp)
	je	LBB0_4
## %bb.3:
	movq	(%r14), %rdi
	movq	_SNDCTL_DSP_SETFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_myioctl
	jmp	LBB0_5
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_fprintf
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_audio_fd,8,3                   ## @audio_fd
	.comm	_stderr,4,2                     ## @stderr
L_.str.1:                               ## @.str.1
	.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	_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.2:                               ## @.str.2
	.asciz	"Could not play signed 16 data\n"

.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, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
Lloh5:
	adrp	x19, _audio_fd@GOTPAGE
Lloh6:
	ldr	x19, [x19, _audio_fd@GOTPAGEOFF]
	str	x0, [x19]
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _stderr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	ldr	x0, [x19]
LBB0_2:
	mov	w8, #11
	movk	w8, #2, lsl #16
	str	w8, [sp, #12]
Lloh12:
	adrp	x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	ldr	x0, [x19]
Lloh15:
	adrp	x8, _SNDCTL_DSP_RESET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SNDCTL_DSP_RESET@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_myioctl
	mov	w8, #11025
	str	w8, [sp, #12]
	ldr	x0, [x19]
Lloh18:
	adrp	x8, _SNDCTL_DSP_SPEED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SNDCTL_DSP_SPEED@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	x0, [x19]
Lloh21:
	adrp	x8, _SNDCTL_DSP_STEREO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SNDCTL_DSP_STEREO@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	ldr	x0, [x19]
Lloh24:
	adrp	x8, _SNDCTL_DSP_GETFMTS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SNDCTL_DSP_GETFMTS@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
Lloh27:
	adrp	x8, _AFMT_S16_LE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AFMT_S16_LE@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	ands	w8, w9, w8
	str	w8, [sp, #12]
	b.eq	LBB0_4
; %bb.3:
	ldr	x0, [x19]
Lloh30:
	adrp	x8, _SNDCTL_DSP_SETFMT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SNDCTL_DSP_SETFMT@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_myioctl
	b	LBB0_5
LBB0_4:
Lloh33:
	adrp	x8, _stderr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_audio_fd,8,3                   ; @audio_fd
	.comm	_stderr,4,2                     ; @stderr
l_.str.1:                               ; @.str.1
	.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	_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.2:                               ; @.str.2
	.asciz	"Could not play signed 16 data\n"

.subsections_via_symbols
