	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function film_write_packet
_film_write_packet:                     ## @film_write_packet
	.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	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %r13
	movq	16(%rdi), %r14
	movl	$32, %edi
	callq	_av_mallocz
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %rbx
	movq	(%r15), %rax
	xorl	%ecx, %ecx
	cmpq	(%r13), %rax
	sete	%cl
	movl	%ecx, (%rbx)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	8(%r15), %ecx
	movl	%ecx, 4(%rbx)
	movl	28(%r15), %ecx
	movl	%ecx, 28(%rbx)
	movl	24(%r15), %ecx
	movl	%ecx, 24(%rbx)
	movl	12(%r15), %edx
	movl	%edx, 8(%rbx)
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.3:
	movl	8(%rsi), %ecx
	addl	12(%rsi), %ecx
	movq	%rbx, 16(%rsi)
	jmp	LBB0_4
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	xorl	%ecx, %ecx
LBB0_4:
	movl	%ecx, 12(%rbx)
	movq	$0, 16(%rbx)
	cmpq	$0, 24(%r13)
	jne	LBB0_6
## %bb.5:
	movq	%rbx, 24(%r13)
LBB0_6:
	incl	16(%r13)
	movq	%rbx, 8(%r13)
	movq	(%r12), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movq	_AV_CODEC_ID_CINEPAK@GOTPCREL(%rip), %rcx
	movq	16(%r15), %rsi
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.7:
	addq	$4, %rsi
	movq	%rsi, %rdi
	callq	_AV_RB24
	movl	12(%r15), %ecx
	cmpl	%ecx, %eax
	je	LBB0_10
## %bb.8:
	movl	%eax, %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	je	LBB0_10
## %bb.9:
	movq	16(%r15), %rsi
	movq	%r14, %rdi
	movl	%ecx, %edx
	jmp	LBB0_12
LBB0_10:
	movq	$0, -48(%rbp)
	movq	16(%r15), %rdi
	addq	$4, %rdi
	addl	$-6, %ecx
	movl	%ecx, %esi
	callq	_AV_WB24
	addl	$2, 8(%rbx)
	movq	16(%r15), %rsi
	movq	%r14, %rdi
	movl	$10, %edx
	callq	_avio_write
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	movl	$2, %edx
	callq	_avio_write
	movq	16(%r15), %rsi
	addq	$40, %rsi
	movl	12(%r15), %edx
	addl	$-10, %edx
LBB0_11:
	movq	%r14, %rdi
LBB0_12:
	callq	_avio_write
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.comm	_AV_CODEC_ID_CINEPAK,4,2        ## @AV_CODEC_ID_CINEPAK
	.no_dead_strip	_film_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function film_write_packet
_film_write_packet:                     ; @film_write_packet
	.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	x20, x1
	mov	x22, x0
	ldp	x23, x19, [x0, #8]
	mov	w0, #32
	bl	_av_mallocz
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x8, [x20]
	ldp	x10, x9, [x23]
	cmp	x8, x10
	cset	w10, eq
	str	w10, [x0]
	ldr	w10, [x20, #8]
Lloh0:
	adrp	x11, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh1:
	ldr	x11, [x11, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x11]
	and	w10, w11, w10
	str	w10, [x0, #4]
	ldr	d0, [x20, #24]
	str	d0, [x0, #24]
	ldr	w2, [x20, #12]
	str	w2, [x0, #8]
	cbz	x9, LBB0_4
; %bb.2:
	ldp	w11, w10, [x9, #8]
	add	w10, w11, w10
	str	x21, [x9, #16]
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	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
	b	_AVERROR
LBB0_4:
	mov	w10, #0
LBB0_5:
	str	w10, [x21, #12]
	str	xzr, [x21, #16]
	ldr	x9, [x23, #24]
	cbnz	x9, LBB0_7
; %bb.6:
	str	x21, [x23, #24]
LBB0_7:
	ldr	w9, [x23, #16]
	add	w9, w9, #1
	str	w9, [x23, #16]
	str	x21, [x23, #8]
	ldr	x9, [x22]
	ldr	x8, [x9, x8, lsl #3]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _AV_CODEC_ID_CINEPAK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AV_CODEC_ID_CINEPAK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	ldr	x1, [x20, #16]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.8:
	add	x0, x1, #4
	bl	_AV_RB24
	ldr	w2, [x20, #12]
	cmp	w0, w2
	b.eq	LBB0_11
; %bb.9:
	sdiv	w8, w2, w0
	msub	w8, w8, w0, w2
	cbz	w8, LBB0_11
; %bb.10:
	ldr	x1, [x20, #16]
	b	LBB0_12
LBB0_11:
	str	xzr, [sp, #8]
	ldr	x8, [x20, #16]
	add	x0, x8, #4
	sub	w1, w2, #6
	bl	_AV_WB24
	ldr	w8, [x21, #8]
	add	w8, w8, #2
	str	w8, [x21, #8]
	ldr	x1, [x20, #16]
	mov	x0, x19
	mov	w2, #10
	bl	_avio_write
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #2
	bl	_avio_write
	ldr	x8, [x20, #16]
	add	x1, x8, #40
	ldr	w8, [x20, #12]
	sub	w2, w8, #10
LBB0_12:
	mov	x0, x19
	bl	_avio_write
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.comm	_AV_CODEC_ID_CINEPAK,4,2        ; @AV_CODEC_ID_CINEPAK
	.no_dead_strip	_film_write_packet
.subsections_via_symbols
