	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function film_write_header
_film_write_header:                     ## @film_write_header
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	8(%rdi), %r13
	movq	16(%rdi), %r14
	movl	(%r13), %ebx
	shll	$4, %ebx
	addl	$64, %ebx
	movl	%ebx, %esi
	callq	_shift_data
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_seek
	movl	4(%r13), %eax
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	(%r12), %rcx
	movq	(%rcx,%rax,8), %r15
LBB0_4:
	movl	8(%r13), %eax
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	(%r12), %rcx
	movq	(%rcx,%rax,8), %rcx
	jmp	LBB0_7
LBB0_1:
	movl	%eax, %r15d
	jmp	LBB0_25
LBB0_5:
	xorl	%ecx, %ecx
LBB0_7:
	testq	%r15, %r15
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.11:
	movq	8(%r15), %rax
	movl	(%rax), %edi
	callq	_get_audio_codec_id
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, %eax
	jns	LBB0_9
## %bb.12:
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_13
LBB0_8:
                                        ## implicit-def: $eax
LBB0_9:
	movq	8(%rcx), %rcx
	movq	8(%rcx), %rdx
	movq	_AV_PIX_FMT_RGB24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_10
## %bb.14:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_avio_wb32
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	%r14, %rdi
	movl	$32, %esi
	callq	_avio_wb32
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	(%rax), %eax
	cmpl	$129, %eax
	je	LBB0_15
## %bb.16:
	cmpl	$128, %eax
	jne	LBB0_17
## %bb.18:
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_19
LBB0_10:
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_13
LBB0_15:
	leaq	L_.str.5(%rip), %rsi
LBB0_19:
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rax
	movl	16(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_wb32
	movq	8(%rbx), %rax
	movl	20(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_wb32
	movq	%r14, %rdi
	movl	$24, %esi
	callq	_avio_w8
	testq	%r15, %r15
	je	LBB0_21
## %bb.20:
	movq	8(%r15), %rax
	movl	24(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_w8
	movq	8(%r15), %rax
	movl	28(%rax), %esi
	movq	%r14, %rdi
	callq	_avio_w8
	movq	%r14, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_w8
	movq	8(%r15), %rax
	movl	32(%rax), %ebx
	jmp	LBB0_22
LBB0_17:
	leaq	L_.str.7(%rip), %rdx
LBB0_13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_21:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
LBB0_22:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_avio_wb16
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_avio_wb16
	leaq	L_.str.8(%rip), %rsi
	movq	%r14, %rdi
	callq	_ffio_wfourcc
	movl	(%r13), %esi
	shll	$4, %esi
	addl	$16, %esi
	movq	%r14, %rdi
	callq	_avio_wb32
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_av_inv_q
	movl	%eax, %edi
	callq	_av_q2d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_avio_wb32
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_avio_wb32
	movq	%r14, %rdi
	callq	_avio_flush
	movq	16(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_25
## %bb.23:
	leaq	-64(%rbp), %r14
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_film_write_packet_to_header
	movq	%rbx, -64(%rbp)
	movq	(%rbx), %rbx
	movq	%r14, %rdi
	callq	_av_freep
	testq	%rbx, %rbx
	jne	LBB0_24
LBB0_25:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Incompatible audio stream format.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AV_PIX_FMT_RGB24,8,3           ## @AV_PIX_FMT_RGB24
L_.str.1:                               ## @.str.1
	.asciz	"Pixel format must be rgb24.\n"

L_.str.2:                               ## @.str.2
	.asciz	"FILM"

L_.str.3:                               ## @.str.3
	.asciz	"1.09"

L_.str.4:                               ## @.str.4
	.asciz	"FDSC"

L_.str.5:                               ## @.str.5
	.asciz	"cvid"

L_.str.6:                               ## @.str.6
	.asciz	"raw "

L_.str.7:                               ## @.str.7
	.asciz	"Incompatible video stream format.\n"

L_.str.8:                               ## @.str.8
	.asciz	"STAB"

	.no_dead_strip	_film_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function film_write_header
_film_write_header:                     ; @film_write_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	ldp	x23, x20, [x0, #8]
	ldr	w8, [x23]
	lsl	w8, w8, #4
	add	w22, w8, #64
	mov	x1, x22
	bl	_shift_data
	tbnz	w0, #31, LBB0_23
; %bb.1:
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_avio_seek
	ldr	w8, [x23, #4]
	tbnz	w8, #31, LBB0_6
; %bb.2:
	ldr	x9, [x19]
	ldr	x25, [x9, x8, lsl #3]
	ldr	w8, [x23, #8]
	tbnz	w8, #31, LBB0_7
LBB0_3:
	ldr	x9, [x19]
	ldr	x24, [x9, x8, lsl #3]
	cbz	x25, LBB0_8
LBB0_4:
	ldr	x8, [x25, #8]
	ldr	w0, [x8]
	bl	_get_audio_codec_id
	mov	x21, x0
	tbz	w0, #31, LBB0_9
; %bb.5:
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_18
LBB0_6:
	mov	x25, #0
	ldr	w8, [x23, #8]
	tbz	w8, #31, LBB0_3
LBB0_7:
	mov	x24, #0
	cbnz	x25, LBB0_4
LBB0_8:
                                        ; implicit-def: $w21
LBB0_9:
	ldr	x8, [x24, #8]
	ldr	x8, [x8, #8]
Lloh5:
	adrp	x9, _AV_PIX_FMT_RGB24@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AV_PIX_FMT_RGB24@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.10:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_ffio_wfourcc
	mov	x0, x20
	mov	x1, x22
	bl	_avio_wb32
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_ffio_wfourcc
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_ffio_wfourcc
	mov	x0, x20
	mov	w1, #32
	bl	_avio_wb32
	ldr	x8, [x24, #8]
	ldr	w8, [x8]
	cmp	w8, #129
	b.eq	LBB0_14
; %bb.11:
	cmp	w8, #128
	b.ne	LBB0_17
; %bb.12:
Lloh14:
	adrp	x1, l_.str.6@PAGE
Lloh15:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh16:
	adrp	x2, l_.str.1@PAGE
Lloh17:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_14:
Lloh18:
	adrp	x1, l_.str.5@PAGE
Lloh19:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_15:
	mov	x0, x20
	bl	_ffio_wfourcc
	ldr	x8, [x24, #8]
	ldr	w1, [x8, #16]
	mov	x0, x20
	bl	_avio_wb32
	ldr	x8, [x24, #8]
	ldr	w1, [x8, #20]
	mov	x0, x20
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #24
	bl	_avio_w8
	cbz	x25, LBB0_19
; %bb.16:
	ldr	x8, [x25, #8]
	ldr	w1, [x8, #24]
	mov	x0, x20
	bl	_avio_w8
	ldr	x8, [x25, #8]
	ldr	w1, [x8, #28]
	mov	x0, x20
	bl	_avio_w8
	mov	x0, x20
	mov	x1, x21
	bl	_avio_w8
	ldr	x8, [x25, #8]
	ldr	w1, [x8, #32]
	b	LBB0_20
LBB0_17:
Lloh20:
	adrp	x2, l_.str.7@PAGE
Lloh21:
	add	x2, x2, l_.str.7@PAGEOFF
LBB0_18:
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_av_log
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_AVERROR
LBB0_19:
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	w1, #0
LBB0_20:
	mov	x0, x20
	bl	_avio_wb16
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb16
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x20
	bl	_ffio_wfourcc
	ldr	w8, [x23]
	lsl	w8, w8, #4
	add	w1, w8, #16
	mov	x0, x20
	bl	_avio_wb32
	ldr	w0, [x24]
	bl	_av_inv_q
	bl	_av_q2d
	mov	x1, x0
	mov	x0, x20
	bl	_avio_wb32
	ldr	w1, [x23]
	mov	x0, x20
	bl	_avio_wb32
	mov	x0, x20
	bl	_avio_flush
	ldr	x20, [x23, #16]
	cbz	x20, LBB0_22
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_film_write_packet_to_header
	str	x20, [sp, #8]
	ldr	x20, [x20]
	add	x0, sp, #8
	bl	_av_freep
	cbnz	x20, LBB0_21
LBB0_22:
	mov	w0, #0
LBB0_23:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Incompatible audio stream format.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AV_PIX_FMT_RGB24,8,3           ; @AV_PIX_FMT_RGB24
l_.str.1:                               ; @.str.1
	.asciz	"Pixel format must be rgb24.\n"

l_.str.2:                               ; @.str.2
	.asciz	"FILM"

l_.str.3:                               ; @.str.3
	.asciz	"1.09"

l_.str.4:                               ; @.str.4
	.asciz	"FDSC"

l_.str.5:                               ; @.str.5
	.asciz	"cvid"

l_.str.6:                               ; @.str.6
	.asciz	"raw "

l_.str.7:                               ; @.str.7
	.asciz	"Incompatible video stream format.\n"

l_.str.8:                               ; @.str.8
	.asciz	"STAB"

	.no_dead_strip	_film_write_header
.subsections_via_symbols
