	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReadChunkIntoExtra             ## -- Begin function ReadChunkIntoExtra
	.p2align	4, 0x90
_ReadChunkIntoExtra:                    ## @ReadChunkIntoExtra
	.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	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_assert
	xorl	%edi, %edi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	setne	%dil
	callq	_assert
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_assert
	movl	(%r15), %r14d
	movl	%r14d, %ebx
	andl	$1, %ebx
	movq	8(%r12), %r13
	xorl	%eax, %eax
	callq	_GetProcessHeap
	leal	(%r14,%rbx), %edx
	addl	$8, %edx
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movslq	%edx, %r14
	testq	%r13, %r13
	je	LBB0_2
## %bb.1:
	movq	8(%r12), %rdx
	movq	(%r12), %rcx
	addq	%r14, %rcx
	movl	%eax, %edi
	callq	_HeapReAlloc
	jmp	LBB0_3
LBB0_2:
	movl	%eax, %edi
	callq	_HeapAlloc
LBB0_3:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, 8(%r12)
	movq	(%r12), %r13
	addq	%r13, %r14
	movq	%r14, (%r12)
	movq	16(%r15), %rax
	movq	%rax, (%r13,%rbx)
	movq	(%r15), %rax
	movq	%rax, 8(%r13,%rbx)
	cmpq	$0, (%r15)
	jle	LBB0_8
## %bb.6:
	movl	8(%r15), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_mmioSeek
	movq	_AVIERR_FILEREAD@GOTPCREL(%rip), %r14
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.7:
	addq	%rbx, %r13
	addl	$16, %r13d
	movq	(%r15), %rdx
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_mmioRead
	cmpq	(%r15), %rax
	jne	LBB0_9
LBB0_8:
	movq	_AVIERR_OK@GOTPCREL(%rip), %r14
	jmp	LBB0_9
LBB0_4:
	movq	_AVIERR_MEMORY@GOTPCREL(%rip), %r14
LBB0_9:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_AVIERR_MEMORY,4,2              ## @AVIERR_MEMORY
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AVIERR_FILEREAD,4,2            ## @AVIERR_FILEREAD
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReadChunkIntoExtra             ; -- Begin function ReadChunkIntoExtra
	.p2align	2
_ReadChunkIntoExtra:                    ; @ReadChunkIntoExtra
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	cmp	x20, #0
	cset	w0, ne
	bl	_assert
	cmp	x19, #0
	cset	w0, ne
	bl	_assert
	ldr	w8, [x19]
	and	w9, w8, #0x1
	add	w8, w8, w9
	add	w22, w8, #8
	ldr	x23, [x21, #8]
	bl	_GetProcessHeap
Lloh0:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	cbz	x23, LBB0_6
; %bb.1:
	ldp	x8, x2, [x21]
	add	x3, x8, w22, sxtw
	bl	_HeapReAlloc
	cbz	x0, LBB0_7
LBB0_2:
	ldr	x8, [x21]
	add	x23, x8, x0
	add	x8, x8, w22, sxtw
	stp	x8, x0, [x21]
	ldr	x8, [x19, #16]
	str	x8, [x23]
	ldr	x8, [x19]
	str	x8, [x23, #8]
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	w1, [x19, #8]
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mmioSeek
	cmn	w0, #1
	b.eq	LBB0_8
; %bb.4:
	add	w1, w23, #16
	ldr	x2, [x19]
	mov	x0, x20
	bl	_mmioRead
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_8
LBB0_5:
Lloh6:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	mov	x2, x22
	bl	_HeapAlloc
	cbnz	x0, LBB0_2
LBB0_7:
Lloh8:
	adrp	x8, _AVIERR_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AVIERR_MEMORY@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x8, _AVIERR_FILEREAD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVIERR_FILEREAD@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_AVIERR_MEMORY,4,2              ; @AVIERR_MEMORY
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AVIERR_FILEREAD,4,2            ; @AVIERR_FILEREAD
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
.subsections_via_symbols
