	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AVIFILE_AddFrame
_AVIFILE_AddFrame:                      ## @AVIFILE_AddFrame
	.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
	movl	%r8d, %r13d
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	setne	%dil
	callq	_assert
	movl	%r12d, %edi
	callq	_TWOCCFromFOURCC
                                        ## kill: def $eax killed $eax def $rax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_4
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	48(%rbx), %rax
	movq	_AVIFILEINFO_TRUSTCKTYPE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_12
## %bb.3:
	movq	_AVIIF_KEYFRAME@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	jmp	LBB0_12
LBB0_4:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %edi
	callq	_TWOCCFromFOURCC
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_WARN
	jmp	LBB0_12
LBB0_5:
	movl	36(%rbx), %eax
	movq	_streamtypeVIDEO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_25
## %bb.6:
	movl	%r15d, %r12d
	movq	56(%rbx), %rax
	movl	(%rbx), %r15d
	testq	%rax, %rax
	je	LBB0_26
## %bb.7:
	movl	16(%rbx), %ecx
	cmpl	%ecx, %r15d
	jg	LBB0_29
## %bb.8:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	56(%rbx), %rdx
	leal	64(,%r15,4), %ecx
	movl	%eax, %edi
	callq	_HeapReAlloc
	testq	%rax, %rax
	je	LBB0_32
## %bb.9:
	addl	$16, %r15d
	movq	%rax, 56(%rbx)
	jmp	LBB0_28
LBB0_10:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	48(%rbx), %rax
	movq	_AVIFILEINFO_TRUSTCKTYPE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_12
## %bb.11:
	movq	_AVIIF_KEYFRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, %r13d
LBB0_12:
	movl	4(%rbx), %ecx
	movl	20(%rbx), %eax
	xorl	%r15d, %r15d
	cmpl	$-1, %ecx
	jne	LBB0_14
## %bb.13:
	movq	_AVIIF_KEYFRAME@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r15d
LBB0_14:
	cmpl	%r14d, %eax
	jge	LBB0_16
## %bb.15:
	movl	%r14d, 20(%rbx)
LBB0_16:
	movq	40(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	leal	1(%rcx), %edx
	movl	8(%rbx), %esi
	cmpl	%esi, %edx
	jl	LBB0_22
## %bb.18:
	addl	$512, %esi                      ## imm = 0x200
	movl	%esi, 8(%rbx)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	40(%rbx), %rdx
	movl	8(%rbx), %ecx
	shll	$2, %ecx
	movl	%eax, %edi
	callq	_HeapReAlloc
	jmp	LBB0_20
LBB0_19:
	addl	$512, 8(%rbx)                   ## imm = 0x200
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	8(%rbx), %edx
	shll	$2, %edx
	movl	%eax, %edi
	callq	_HeapAlloc
LBB0_20:
	movq	%rax, 40(%rbx)
	testq	%rax, %rax
	je	LBB0_32
## %bb.21:
	movl	4(%rbx), %ecx
	leal	1(%rcx), %edx
LBB0_22:
	orl	%r13d, %r15d
	movl	%edx, 4(%rbx)
	movslq	%edx, %rdx
	movq	%rdx, %rsi
	shlq	$4, %rsi
	movl	%r12d, (%rax,%rsi)
	movl	%r15d, 4(%rax,%rsi)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, 8(%rax,%rsi)
	movl	%r14d, 12(%rax,%rsi)
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
	cmpq	%rdx, 24(%rbx)
	ja	LBB0_30
## %bb.23:
	addl	$2, %ecx
	movslq	%ecx, %rcx
	movq	%rcx, 24(%rbx)
	jmp	LBB0_30
LBB0_25:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	movq	_AVIERR_BADFORMAT@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_26:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leal	64(,%r15,4), %edx
	movl	%eax, %edi
	callq	_HeapAlloc
	movq	%rax, 56(%rbx)
	testq	%rax, %rax
	je	LBB0_32
## %bb.27:
	addl	$16, %r15d
LBB0_28:
	movl	%r15d, (%rbx)
	movl	16(%rbx), %ecx
LBB0_29:
	movq	_AVISTREAMINFO_FORMATCHANGES@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%edx, 32(%rbx)
	movslq	%ecx, %rcx
	movq	%rcx, %rdx
	shlq	$4, %rdx
	incl	%ecx
	movl	%ecx, 16(%rbx)
	movl	4(%rbx), %ecx
	movl	%ecx, 16(%rdx,%rax)
	movl	$0, 20(%rdx,%rax)
	movl	%r12d, 24(%rdx,%rax)
	movl	%r14d, 28(%rdx,%rax)
	movq	_AVIERR_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_32:
	movq	_AVIERR_MEMORY@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_10
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_AVIFILEINFO_TRUSTCKTYPE,4,2    ## @AVIFILEINFO_TRUSTCKTYPE
	.comm	_AVIIF_KEYFRAME,4,2             ## @AVIIF_KEYFRAME
	.comm	_streamtypeVIDEO,4,2            ## @streamtypeVIDEO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	": found palette change in non-video stream!\n"

	.comm	_AVIERR_BADFORMAT,4,2           ## @AVIERR_BADFORMAT
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_AVIERR_MEMORY,4,2              ## @AVIERR_MEMORY
	.comm	_AVISTREAMINFO_FORMATCHANGES,4,2 ## @AVISTREAMINFO_FORMATCHANGES
	.comm	_AVIERR_OK,4,2                  ## @AVIERR_OK
L_.str.1:                               ## @.str.1
	.asciz	": unknown TWOCC 0x%04X found\n"

	.no_dead_strip	_AVIFILE_AddFrame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AVIFILE_AddFrame
_AVIFILE_AddFrame:                      ; @AVIFILE_AddFrame
	.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	x23, x4
	mov	x21, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	mov	x0, x22
	bl	_TWOCCFromFOURCC
	sub	w8, w0, #128
	cmp	w8, #3
	b.hi	LBB0_4
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	x8, [x19, #48]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _AVIFILEINFO_TRUSTCKTYPE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AVIFILEINFO_TRUSTCKTYPE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.3:
Lloh5:
	adrp	x8, _AVIIF_KEYFRAME@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVIIF_KEYFRAME@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w23, w8, w23
	b	LBB0_12
LBB0_4:
	mov	x0, x22
	bl	_TWOCCFromFOURCC
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	b	LBB0_12
LBB0_5:
	ldr	w8, [x19, #36]
Lloh10:
	adrp	x9, _streamtypeVIDEO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _streamtypeVIDEO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_22
; %bb.6:
	ldr	x0, [x19, #56]
	ldr	w9, [x19]
	cbz	x0, LBB0_23
; %bb.7:
	ldr	w8, [x19, #16]
	cmp	w9, w8
	b.gt	LBB0_25
; %bb.8:
	add	w22, w9, #16
	bl	_GetProcessHeap
Lloh13:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	x2, [x19, #56]
	lsl	w3, w22, #2
	bl	_HeapReAlloc
	cbz	x0, LBB0_26
; %bb.9:
	str	x0, [x19, #56]
	b	LBB0_24
LBB0_10:
	ldr	x8, [x19, #48]
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _AVIFILEINFO_TRUSTCKTYPE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _AVIFILEINFO_TRUSTCKTYPE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh19:
	adrp	x8, _AVIIF_KEYFRAME@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AVIIF_KEYFRAME@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	bic	w23, w23, w8
LBB0_12:
Lloh22:
	adrp	x9, _AVIIF_KEYFRAME@GOTPAGE
Lloh23:
	ldr	x9, [x9, _AVIIF_KEYFRAME@GOTPAGEOFF]
	ldr	w8, [x19, #4]
Lloh24:
	ldr	w9, [x9]
	cmn	w8, #1
	csel	w24, w9, wzr, eq
	ldr	w9, [x19, #20]
	cmp	w9, w20
	b.ge	LBB0_14
; %bb.13:
	str	w20, [x19, #20]
LBB0_14:
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_17
; %bb.15:
	add	w9, w8, #1
	ldr	w10, [x19, #8]
	cmp	w9, w10
	b.lt	LBB0_19
; %bb.16:
	add	w8, w10, #512
	str	w8, [x19, #8]
	bl	_GetProcessHeap
Lloh25:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	ldr	x2, [x19, #40]
	ldr	w8, [x19, #8]
	lsl	w3, w8, #2
	bl	_HeapReAlloc
	str	x0, [x19, #40]
	cbnz	x0, LBB0_18
	b	LBB0_26
LBB0_17:
	ldr	w8, [x19, #8]
	add	w8, w8, #512
	str	w8, [x19, #8]
	bl	_GetProcessHeap
Lloh28:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w8, [x19, #8]
	lsl	w2, w8, #2
	bl	_HeapAlloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_26
LBB0_18:
	ldr	w8, [x19, #4]
	add	w9, w8, #1
LBB0_19:
	orr	w10, w24, w23
	str	w9, [x19, #4]
	add	x11, x0, w9, sxtw #4
	stp	w22, w10, [x11]
	stp	w21, w20, [x11, #8]
	ldr	x10, [x19, #24]
	cmp	x10, w9, sxtw
	b.hi	LBB0_21
; %bb.20:
	add	w8, w8, #2
	sxtw	x8, w8
	str	x8, [x19, #24]
LBB0_21:
Lloh31:
	adrp	x8, _AVIERR_OK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AVIERR_OK@GOTPAGEOFF]
	b	LBB0_27
LBB0_22:
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
Lloh35:
	adrp	x8, _AVIERR_BADFORMAT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AVIERR_BADFORMAT@GOTPAGEOFF]
	b	LBB0_27
LBB0_23:
	add	w22, w9, #16
	bl	_GetProcessHeap
Lloh37:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh38:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	lsl	w2, w22, #2
	bl	_HeapAlloc
	str	x0, [x19, #56]
	cbz	x0, LBB0_26
LBB0_24:
	str	w22, [x19]
	ldr	w8, [x19, #16]
LBB0_25:
Lloh40:
	adrp	x9, _AVISTREAMINFO_FORMATCHANGES@GOTPAGE
Lloh41:
	ldr	x9, [x9, _AVISTREAMINFO_FORMATCHANGES@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	ldr	w10, [x19, #32]
	orr	w9, w10, w9
	str	w9, [x19, #32]
	sxtw	x8, w8
	add	x8, x8, #1
	str	w8, [x19, #16]
	ldr	w9, [x19, #4]
	add	x8, x0, x8, lsl #4
	stp	w9, wzr, [x8]
	stp	w21, w20, [x8, #8]
	b	LBB0_21
LBB0_26:
Lloh43:
	adrp	x8, _AVIERR_MEMORY@GOTPAGE
Lloh44:
	ldr	x8, [x8, _AVIERR_MEMORY@GOTPAGEOFF]
LBB0_27:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh43, Lloh44
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
                                        ; -- End function
	.comm	_AVIFILEINFO_TRUSTCKTYPE,4,2    ; @AVIFILEINFO_TRUSTCKTYPE
	.comm	_AVIIF_KEYFRAME,4,2             ; @AVIIF_KEYFRAME
	.comm	_streamtypeVIDEO,4,2            ; @streamtypeVIDEO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	": found palette change in non-video stream!\n"

	.comm	_AVIERR_BADFORMAT,4,2           ; @AVIERR_BADFORMAT
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_AVIERR_MEMORY,4,2              ; @AVIERR_MEMORY
	.comm	_AVISTREAMINFO_FORMATCHANGES,4,2 ; @AVISTREAMINFO_FORMATCHANGES
	.comm	_AVIERR_OK,4,2                  ; @AVIERR_OK
l_.str.1:                               ; @.str.1
	.asciz	": unknown TWOCC 0x%04X found\n"

	.no_dead_strip	_AVIFILE_AddFrame
.subsections_via_symbols
