	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CASSETTE_ToggleRecord          ## -- Begin function CASSETTE_ToggleRecord
	.p2align	4, 0x90
_CASSETTE_ToggleRecord:                 ## @CASSETTE_ToggleRecord
	.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
	movq	_CASSETTE_status@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_CASSETTE_STATUS_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_2:
	movq	_CASSETTE_record@GOTPCREL(%rip), %r14
	xorl	%eax, %eax
	cmpl	$0, (%r14)
	sete	%al
	movl	%eax, (%r14)
	je	LBB0_3
## %bb.4:
	movq	_cassette_writable@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	_cassette_file@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IMG_TAPE_Flush
	jmp	LBB0_6
LBB0_3:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_eof_of_tape@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_6:
	movq	_event_time_left@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_pending_serin@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_passing_gap@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_UpdateFlags
	cmpl	$0, (%r14)
	je	LBB0_7
## %bb.8:
	movq	(%rbx), %rax
	movq	_CASSETTE_STATUS_READ_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%al
	movq	_CASSETTE_write_protect@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	sete	%cl
	andb	%al, %cl
	movzbl	%cl, %eax
	jmp	LBB0_9
LBB0_7:
	movl	$1, %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CASSETTE_status,8,3            ## @CASSETTE_status
	.comm	_CASSETTE_STATUS_NONE,8,3       ## @CASSETTE_STATUS_NONE
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_CASSETTE_record,4,2            ## @CASSETTE_record
	.comm	_eof_of_tape,4,2                ## @eof_of_tape
	.comm	_cassette_writable,8,3          ## @cassette_writable
	.comm	_cassette_file,4,2              ## @cassette_file
	.comm	_event_time_left,8,3            ## @event_time_left
	.comm	_pending_serin,4,2              ## @pending_serin
	.comm	_passing_gap,4,2                ## @passing_gap
	.comm	_CASSETTE_STATUS_READ_WRITE,8,3 ## @CASSETTE_STATUS_READ_WRITE
	.comm	_CASSETTE_write_protect,4,2     ## @CASSETTE_write_protect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CASSETTE_ToggleRecord          ; -- Begin function CASSETTE_ToggleRecord
	.p2align	2
_CASSETTE_ToggleRecord:                 ; @CASSETTE_ToggleRecord
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x19, _CASSETTE_status@GOTPAGE
Lloh1:
	ldr	x19, [x19, _CASSETTE_status@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _CASSETTE_STATUS_NONE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CASSETTE_STATUS_NONE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _FALSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_2:
Lloh8:
	adrp	x20, _CASSETTE_record@GOTPAGE
Lloh9:
	ldr	x20, [x20, _CASSETTE_record@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #0
	cset	w9, eq
	str	w9, [x20]
Lloh10:
	adrp	x21, _FALSE@GOTPAGE
Lloh11:
	ldr	x21, [x21, _FALSE@GOTPAGEOFF]
	cbz	w8, LBB0_5
; %bb.3:
Lloh12:
	adrp	x8, _cassette_writable@GOTPAGE
Lloh13:
	ldr	x8, [x8, _cassette_writable@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.4:
Lloh15:
	adrp	x8, _cassette_file@GOTPAGE
Lloh16:
	ldr	x8, [x8, _cassette_file@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	bl	_IMG_TAPE_Flush
	b	LBB0_6
LBB0_5:
	ldr	w8, [x21]
Lloh18:
	adrp	x9, _eof_of_tape@GOTPAGE
Lloh19:
	ldr	x9, [x9, _eof_of_tape@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
LBB0_6:
Lloh21:
	adrp	x8, _event_time_left@GOTPAGE
Lloh22:
	ldr	x8, [x8, _event_time_left@GOTPAGEOFF]
Lloh23:
	str	xzr, [x8]
	ldr	w8, [x21]
Lloh24:
	adrp	x9, _pending_serin@GOTPAGE
Lloh25:
	ldr	x9, [x9, _pending_serin@GOTPAGEOFF]
Lloh26:
	str	w8, [x9]
Lloh27:
	adrp	x9, _passing_gap@GOTPAGE
Lloh28:
	ldr	x9, [x9, _passing_gap@GOTPAGEOFF]
Lloh29:
	str	w8, [x9]
	bl	_UpdateFlags
	ldr	w8, [x20]
	cbz	w8, LBB0_8
; %bb.7:
	ldr	x8, [x19]
Lloh30:
	adrp	x9, _CASSETTE_STATUS_READ_WRITE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CASSETTE_STATUS_READ_WRITE@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh33:
	adrp	x8, _CASSETTE_write_protect@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CASSETTE_write_protect@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ccmp	w8, #0, #0, eq
	cset	w0, eq
	b	LBB0_9
LBB0_8:
	mov	w0, #1
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_CASSETTE_status,8,3            ; @CASSETTE_status
	.comm	_CASSETTE_STATUS_NONE,8,3       ; @CASSETTE_STATUS_NONE
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_CASSETTE_record,4,2            ; @CASSETTE_record
	.comm	_eof_of_tape,4,2                ; @eof_of_tape
	.comm	_cassette_writable,8,3          ; @cassette_writable
	.comm	_cassette_file,4,2              ; @cassette_file
	.comm	_event_time_left,8,3            ; @event_time_left
	.comm	_pending_serin,4,2              ; @pending_serin
	.comm	_passing_gap,4,2                ; @passing_gap
	.comm	_CASSETTE_STATUS_READ_WRITE,8,3 ; @CASSETTE_STATUS_READ_WRITE
	.comm	_CASSETTE_write_protect,4,2     ; @CASSETTE_write_protect
.subsections_via_symbols
