	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SoundRecording
_SoundRecording:                        ## @SoundRecording
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_SndSave_IsSoundFileOpen
	testl	%eax, %eax
	je	LBB0_1
## %bb.8:
	xorl	%eax, %eax
	callq	_SndSave_CloseSoundFile
	movq	_UI_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-32(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.4(%rip), %rdi
	movl	$1, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %r14
	leaq	-64(%rbp), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$32, %esi
	movq	%r14, %rdx
	movl	%ebx, %ecx
	callq	_snprintf
	movq	%r15, %rdi
	callq	_Util_fileexists
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	cmpl	$1000, %ebx                     ## imm = 0x3E8
	jne	LBB0_2
## %bb.5:
	movq	_UI_driver@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	L_.str.3(%rip), %rdi
	movl	$1, %esi
	callq	*(%rax)
	jmp	LBB0_6
LBB0_3:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_SndSave_OpenSoundFile
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rdi
	cmoveq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_FilenameMessage
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_10
## %bb.7:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"atari%03d.wav"

L_.str.1:                               ## @.str.1
	.asciz	"Recording sound to file \"%s\""

L_.str.2:                               ## @.str.2
	.asciz	"Can't write to file \"%s\""

	.comm	_UI_driver,8,3                  ## @UI_driver
L_.str.3:                               ## @.str.3
	.asciz	"All atariXXX.wav files exist!"

L_.str.4:                               ## @.str.4
	.asciz	"Recording stopped"

	.no_dead_strip	_SoundRecording
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SoundRecording
_SoundRecording:                        ; @SoundRecording
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	bl	_SndSave_IsSoundFileOpen
	cbz	w0, LBB0_3
; %bb.1:
	bl	_SndSave_CloseSoundFile
Lloh3:
	adrp	x8, _UI_driver@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UI_driver@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x2, [x8]
	ldur	x8, [x29, #-24]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.2:
Lloh9:
	adrp	x0, l_.str.4@PAGE
Lloh10:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	w1, #1
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	br	x2
LBB0_3:
	mov	w19, #0
Lloh11:
	adrp	x20, l_.str@PAGE
Lloh12:
	add	x20, x20, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	w1, #32
	mov	x2, x20
	mov	x3, x19
	bl	_snprintf
	add	x0, sp, #8
	bl	_Util_fileexists
	cbz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w19, w19, #1
	cmp	w19, #1000
	b.ne	LBB0_4
; %bb.6:
Lloh13:
	adrp	x8, _UI_driver@GOTPAGE
Lloh14:
	ldr	x8, [x8, _UI_driver@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	w1, #1
	blr	x8
	b	LBB0_8
LBB0_7:
	add	x0, sp, #8
	bl	_SndSave_OpenSoundFile
Lloh18:
	adrp	x8, l_.str.1@PAGE
Lloh19:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh20:
	adrp	x9, l_.str.2@PAGE
Lloh21:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x0, #0
	csel	x0, x9, x8, eq
	add	x1, sp, #8
	bl	_FilenameMessage
LBB0_8:
	ldur	x8, [x29, #-24]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"atari%03d.wav"

l_.str.1:                               ; @.str.1
	.asciz	"Recording sound to file \"%s\""

l_.str.2:                               ; @.str.2
	.asciz	"Can't write to file \"%s\""

	.comm	_UI_driver,8,3                  ; @UI_driver
l_.str.3:                               ; @.str.3
	.asciz	"All atariXXX.wav files exist!"

l_.str.4:                               ; @.str.4
	.asciz	"Recording stopped"

	.no_dead_strip	_SoundRecording
.subsections_via_symbols
