	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SndSave_WriteToSoundFile       ## -- Begin function SndSave_WriteToSoundFile
	.p2align	4, 0x90
_SndSave_WriteToSoundFile:              ## @SndSave_WriteToSoundFile
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%eax, %eax
	testl	%esi, %esi
	je	LBB0_5
## %bb.1:
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.2:
	movq	_sndoutput@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r8
	testq	%r8, %r8
	je	LBB0_5
## %bb.3:
	movl	%esi, %ebx
	movq	_POKEYSND_snd_flags@GOTPCREL(%rip), %rax
	movq	_POKEYSND_BIT16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	setne	%cl
	shll	%cl, %ebx
	movl	$1, %esi
	movl	%ebx, %edx
	movq	%r8, %rcx
	callq	_fwrite
	movl	%eax, %r14d
	movq	_byteswritten@GOTPCREL(%rip), %rax
	addl	%r14d, (%rax)
	movl	%ebx, %eax
	cmpl	%ebx, %r14d
	je	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_SndSave_CloseSoundFile
	movl	%r14d, %eax
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sndoutput,8,3                  ## @sndoutput
	.comm	_POKEYSND_snd_flags,4,2         ## @POKEYSND_snd_flags
	.comm	_POKEYSND_BIT16,4,2             ## @POKEYSND_BIT16
	.comm	_byteswritten,4,2               ## @byteswritten
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SndSave_WriteToSoundFile       ; -- Begin function SndSave_WriteToSoundFile
	.p2align	2
_SndSave_WriteToSoundFile:              ; @SndSave_WriteToSoundFile
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	w19, #0
	cbz	w1, LBB0_5
; %bb.1:
	cbz	x0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _sndoutput@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sndoutput@GOTPAGEOFF]
Lloh2:
	ldr	x3, [x8]
	cbz	x3, LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _POKEYSND_snd_flags@GOTPAGE
Lloh4:
	ldr	x8, [x8, _POKEYSND_snd_flags@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _POKEYSND_BIT16@GOTPAGE
Lloh7:
	ldr	x9, [x9, _POKEYSND_BIT16@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
	lsl	w19, w1, w8
	mov	w1, #1
	mov	x2, x19
	bl	_fwrite
Lloh9:
	adrp	x8, _byteswritten@GOTPAGE
Lloh10:
	ldr	x8, [x8, _byteswritten@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w0
	str	w9, [x8]
	cmp	w0, w19
	b.eq	LBB0_5
; %bb.4:
	mov	x20, x0
	bl	_SndSave_CloseSoundFile
	mov	x19, x20
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_sndoutput,8,3                  ; @sndoutput
	.comm	_POKEYSND_snd_flags,4,2         ; @POKEYSND_snd_flags
	.comm	_POKEYSND_BIT16,4,2             ; @POKEYSND_BIT16
	.comm	_byteswritten,4,2               ; @byteswritten
.subsections_via_symbols
