	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CassetteRead
_CassetteRead:                          ## @CassetteRead
	.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	_cassette_readable@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	je	LBB0_9
## %bb.1:
	movslq	%edi, %rax
	movq	_event_time_left@GOTPCREL(%rip), %r13
	subq	%rax, (%r13)
	jns	LBB0_9
## %bb.2:
	movq	_passing_gap@GOTPCREL(%rip), %rbx
	movq	_pending_serin@GOTPCREL(%rip), %r12
	movq	_pending_serin_byte@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rbx)
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, (%r12)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r15), %eax
	movq	_serin_byte@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	movq	_POKEY_SKCTL@GOTPCREL(%rip), %rcx
	testb	$3, (%rcx)
	setne	%al
	movl	%eax, (%r12)
	movq	_cassette_file@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_IMG_TAPE_Read
	testl	%eax, %eax
	je	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %eax
	addq	%rax, (%r13)
	js	LBB0_4
	jmp	LBB0_9
LBB0_8:
	movq	_eof_of_tape@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	xorl	%eax, %eax
	callq	_UpdateFlags
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cassette_readable,8,3          ## @cassette_readable
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_event_time_left,8,3            ## @event_time_left
	.comm	_passing_gap,4,2                ## @passing_gap
	.comm	_pending_serin,4,2              ## @pending_serin
	.comm	_pending_serin_byte,4,2         ## @pending_serin_byte
	.comm	_serin_byte,4,2                 ## @serin_byte
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_POKEY_SKCTL,4,2                ## @POKEY_SKCTL
	.comm	_cassette_file,4,2              ## @cassette_file
	.comm	_eof_of_tape,4,2                ## @eof_of_tape
	.no_dead_strip	_CassetteRead
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CassetteRead
_CassetteRead:                          ; @CassetteRead
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _cassette_readable@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cassette_readable@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _FALSE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x9]
	cbz	x8, LBB0_8
; %bb.1:
Lloh6:
	adrp	x22, _event_time_left@GOTPAGE
Lloh7:
	ldr	x22, [x22, _event_time_left@GOTPAGEOFF]
	ldr	x8, [x22]
	subs	x8, x8, w0, sxtw
	str	x8, [x22]
	b.pl	LBB0_8
; %bb.2:
Lloh8:
	adrp	x20, _passing_gap@GOTPAGE
Lloh9:
	ldr	x20, [x20, _passing_gap@GOTPAGEOFF]
Lloh10:
	adrp	x23, _pending_serin@GOTPAGE
Lloh11:
	ldr	x23, [x23, _pending_serin@GOTPAGEOFF]
Lloh12:
	adrp	x24, _POKEY_SKCTL@GOTPAGE
Lloh13:
	ldr	x24, [x24, _POKEY_SKCTL@GOTPAGEOFF]
Lloh14:
	adrp	x25, _cassette_file@GOTPAGE
Lloh15:
	ldr	x25, [x25, _cassette_file@GOTPAGEOFF]
Lloh16:
	adrp	x21, _pending_serin_byte@GOTPAGE
Lloh17:
	ldr	x21, [x21, _pending_serin_byte@GOTPAGEOFF]
Lloh18:
	adrp	x26, _serin_byte@GOTPAGE
Lloh19:
	ldr	x26, [x26, _serin_byte@GOTPAGEOFF]
Lloh20:
	adrp	x27, _TRUE@GOTPAGE
Lloh21:
	ldr	x27, [x27, _TRUE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	ldr	w9, [x23]
	cmp	w8, #0
	ccmp	w9, #0, #4, eq
	b.eq	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x21]
	str	w8, [x26]
	ldr	w19, [x27]
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	tst	w8, #0x3
	cset	w8, ne
	str	w8, [x23]
	ldr	w0, [x25]
	add	x1, sp, #12
	mov	x2, x20
	mov	x3, x21
	bl	_IMG_TAPE_Read
	cbz	w0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [sp, #12]
	ldr	x9, [x22]
	adds	x8, x9, x8
	str	x8, [x22]
	b.mi	LBB0_3
	b	LBB0_8
LBB0_7:
Lloh22:
	adrp	x8, _eof_of_tape@GOTPAGE
Lloh23:
	ldr	x8, [x8, _eof_of_tape@GOTPAGEOFF]
	mov	w9, #1
Lloh24:
	str	w9, [x8]
	bl	_UpdateFlags
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_cassette_readable,8,3          ; @cassette_readable
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_event_time_left,8,3            ; @event_time_left
	.comm	_passing_gap,4,2                ; @passing_gap
	.comm	_pending_serin,4,2              ; @pending_serin
	.comm	_pending_serin_byte,4,2         ; @pending_serin_byte
	.comm	_serin_byte,4,2                 ; @serin_byte
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_POKEY_SKCTL,4,2                ; @POKEY_SKCTL
	.comm	_cassette_file,4,2              ; @cassette_file
	.comm	_eof_of_tape,4,2                ; @eof_of_tape
	.no_dead_strip	_CassetteRead
.subsections_via_symbols
