	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_ConstructAVIStream
_AVIFILE_ConstructAVIStream:            ## @AVIFILE_ConstructAVIStream
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_assert
	movq	_MAX_AVISTREAMS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	%r15, (%rax)
	seta	%dil
	callq	_assert
	movq	(%r12), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax,%r15,8)
	setne	%dil
	callq	_assert
	movq	(%r12), %rax
	movq	(%rax,%r15,8), %rbx
	movq	_avist_vt@GOTPCREL(%rip), %rax
	movq	%rax, 112(%rbx)
	movq	$0, 104(%rbx)
	movq	%r12, 96(%rbx)
	movq	%r15, (%rbx)
	movq	$-1, 8(%rbx)
	movl	$-1, 16(%rbx)
	testq	%r14, %r14
	je	LBB0_9
## %bb.1:
	leaq	32(%rbx), %rdi
	movq	%r14, %rsi
	movl	$48, %edx
	callq	_memcpy
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.2:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r14), %edx
	shll	$2, %edx
	movl	%eax, %edi
	callq	_HeapAlloc
	movq	%rax, 88(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	(%r14), %eax
	movl	%eax, 20(%rbx)
LBB0_4:
	cmpl	$0, 4(%r14)
	jle	LBB0_7
## %bb.5:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	4(%r14), %edx
	shll	$2, %edx
	movl	%eax, %edi
	callq	_HeapAlloc
	movq	%rax, 80(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	4(%r14), %eax
	movl	%eax, 24(%rbx)
LBB0_7:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 56(%rbx)
	movq	$0, 72(%rbx)
	movl	$1, 32(%rbx)
	cmpq	$0, 40(%rbx)
	jle	LBB0_9
## %bb.8:
	leaq	52(%rbx), %rdi
	callq	_SetRectEmpty
LBB0_9:
	movq	_AVIFILECAPS_CANREAD@GOTPCREL(%rip), %rax
	movq	_AVIFILECAPS_CANWRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 48(%rbx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_AVISTREAMS,8,3             ## @MAX_AVISTREAMS
	.comm	_avist_vt,4,2                   ## @avist_vt
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_AVIFILECAPS_CANREAD,4,2        ## @AVIFILECAPS_CANREAD
	.comm	_AVIFILECAPS_CANWRITE,4,2       ## @AVIFILECAPS_CANWRITE
	.no_dead_strip	_AVIFILE_ConstructAVIStream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_ConstructAVIStream
_AVIFILE_ConstructAVIStream:            ; @AVIFILE_ConstructAVIStream
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
Lloh0:
	adrp	x8, _MAX_AVISTREAMS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_AVISTREAMS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	cset	w0, hi
	bl	_assert
	ldr	x8, [x21]
	lsl	x22, x20, #3
	ldr	x8, [x8, x22]
	cmp	x8, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x21]
	ldr	x22, [x8, x22]
Lloh3:
	adrp	x8, _avist_vt@GOTPAGE
Lloh4:
	ldr	x8, [x8, _avist_vt@GOTPAGEOFF]
	stp	xzr, x8, [x22, #104]
	str	x21, [x22, #96]
	mov	x8, #-1
	stp	x20, x8, [x22]
	mov	w8, #-1
	str	w8, [x22, #16]
	cbz	x19, LBB0_9
; %bb.1:
	add	x0, x22, #32
	mov	x1, x19
	mov	w2, #48
	bl	_memcpy
	ldr	w8, [x19]
Lloh5:
	adrp	x20, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh6:
	ldr	x20, [x20, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	bl	_GetProcessHeap
	ldr	w1, [x20]
	ldr	w8, [x19]
	lsl	w2, w8, #2
	bl	_HeapAlloc
	str	x0, [x22, #88]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	str	w8, [x22, #20]
LBB0_4:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	bl	_GetProcessHeap
	ldr	w1, [x20]
	ldr	w8, [x19, #4]
	lsl	w2, w8, #2
	bl	_HeapAlloc
	str	x0, [x22, #80]
	cbz	x0, LBB0_7
; %bb.6:
	ldr	w8, [x19, #4]
	str	w8, [x22, #24]
LBB0_7:
	stp	xzr, xzr, [x22, #56]
	str	xzr, [x22, #72]
	mov	w8, #1
	str	w8, [x22, #32]
	ldr	x8, [x22, #40]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.8:
	add	x0, x22, #52
	bl	_SetRectEmpty
LBB0_9:
Lloh7:
	adrp	x8, _AVIFILECAPS_CANREAD@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AVIFILECAPS_CANREAD@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _AVIFILECAPS_CANWRITE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _AVIFILECAPS_CANWRITE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x22, #48]
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_AVISTREAMS,8,3             ; @MAX_AVISTREAMS
	.comm	_avist_vt,4,2                   ; @avist_vt
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_AVIFILECAPS_CANREAD,4,2        ; @AVIFILECAPS_CANREAD
	.comm	_AVIFILECAPS_CANWRITE,4,2       ; @AVIFILECAPS_CANWRITE
	.no_dead_strip	_AVIFILE_ConstructAVIStream
.subsections_via_symbols
