	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IMG_TAPE_Read                  ## -- Begin function IMG_TAPE_Read
	.p2align	4, 0x90
_IMG_TAPE_Read:                         ## @IMG_TAPE_Read
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_CassetteFlush
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_2:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jl	LBB0_7
## %bb.3:
	leaq	-36(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ReadNextRecord
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	$0, 8(%rbx)
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.12:
	imull	$1789, %eax, %ecx               ## imm = 0x6FD
	imull	$790, %eax, %eax                ## imm = 0x316
	cltq
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rdx
	shrq	$63, %rdx
	sarq	$38, %rax
	addl	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, (%r14)
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r15)
	jmp	LBB0_11
LBB0_4:
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	movq	48(%rbx), %rcx
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rbx)
	movl	(%rcx,%rax,4), %eax
	movl	%eax, (%r12)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	cmpq	$0, 40(%rbx)
	je	LBB0_8
## %bb.9:
	movq	24(%rbx), %rax
	movq	32(%rbx), %rcx
	movl	(%rax,%rcx,4), %ecx
	jmp	LBB0_10
LBB0_8:
	movl	$600, %ecx                      ## imm = 0x258
LBB0_10:
	movl	$17897900, %eax                 ## imm = 0x11119AC
	xorl	%edx, %edx
	idivl	%ecx
	movl	%eax, (%r14)
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_TRUE,4,2                       ## @TRUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_IMG_TAPE_Read                  ; -- Begin function IMG_TAPE_Read
	.p2align	2
_IMG_TAPE_Read:                         ; @IMG_TAPE_Read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x23, _FALSE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _FALSE@GOTPAGEOFF]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_CassetteFlush
	ldr	w8, [x23]
	str	w8, [x21]
LBB0_2:
	ldp	x8, x9, [x21, #8]
	cmp	x8, x9
	b.lt	LBB0_8
; %bb.3:
	add	x1, sp, #12
	mov	x0, x21
	bl	_ReadNextRecord
	cbz	w0, LBB0_6
; %bb.4:
	str	xzr, [x21, #8]
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	mov	w9, #1789
	mov	w10, #790
	mul	w10, w8, w10
	mov	w11, #19923
	movk	w11, #4194, lsl #16
	smull	x10, w10, w11
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
	madd	w8, w8, w9, w10
	str	w8, [x19]
Lloh2:
	adrp	x8, _TRUE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	ldr	w9, [x8]
	str	w9, [x20]
	b	LBB0_12
LBB0_6:
Lloh4:
	adrp	x8, _FALSE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	b	LBB0_12
LBB0_7:
	mov	x8, #0
LBB0_8:
	add	x9, x8, #1
	str	x9, [x21, #8]
	ldp	x10, x9, [x21, #40]
	ldr	w8, [x9, x8, lsl #2]
	str	w8, [x22]
	ldr	w8, [x23]
	str	w8, [x20]
	cbz	x10, LBB0_10
; %bb.9:
	ldp	x8, x9, [x21, #24]
	ldr	w8, [x8, x9, lsl #2]
	b	LBB0_11
LBB0_10:
	mov	w8, #600
LBB0_11:
	mov	w9, #6572
	movk	w9, #273, lsl #16
	sdiv	w8, w9, w8
	str	w8, [x19]
Lloh6:
	adrp	x8, _TRUE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_TRUE,4,2                       ; @TRUE
.subsections_via_symbols
