	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_frame
_encode_frame:                          ## @encode_frame
	.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	%rcx, %r15
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	16(%rdi), %rbx
	movl	(%rdi), %eax
	imull	4(%rdi), %eax
	leal	(%rax,%rax,2), %esi
	movq	%rbx, %rdi
	callq	_deflateBound
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movq	8(%r12), %rax
	movq	_AV_PIX_FMT_BGR24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_deflateReset
	movq	_Z_OK@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_7
## %bb.3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %eax
	movl	%eax, 20(%rbx)
	movl	4(%rcx), %eax
	movl	%eax, 16(%rbx)
	movl	4(%r12), %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testl	%r15d, %r15d
	jle	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	decl	%r15d
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	movslq	(%rax), %rax
	movslq	%r15d, %rdx
	imulq	%rax, %rdx
	addq	(%rcx), %rdx
	movq	%rdx, 8(%rbx)
	movl	(%r12), %eax
	leal	(%rax,%rax,2), %eax
	movl	%eax, (%rbx)
	movq	_Z_NO_FLUSH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_deflate
	cmpl	(%r14), %eax
	je	LBB0_4
	jmp	LBB0_10
LBB0_6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_12
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_11
LBB0_8:
	movq	_Z_FINISH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_deflate
	movq	_Z_STREAM_END@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
## %bb.9:
	movl	4(%rbx), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.2(%rip), %rdx
LBB0_11:
	movq	%r12, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_12:
	movl	$-1, %eax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PIX_FMT_BGR24,8,3           ## @AV_PIX_FMT_BGR24
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Format not supported!\n"

	.comm	_Z_OK,4,2                       ## @Z_OK
L_.str.1:                               ## @.str.1
	.asciz	"Deflate reset error: %d\n"

	.comm	_Z_NO_FLUSH,4,2                 ## @Z_NO_FLUSH
L_.str.2:                               ## @.str.2
	.asciz	"Deflate error: %d\n"

	.comm	_Z_FINISH,4,2                   ## @Z_FINISH
	.comm	_Z_STREAM_END,4,2               ## @Z_STREAM_END
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_frame
_encode_frame:                          ; @encode_frame
	.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	x20, x3
	mov	x23, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
	ldp	w8, w9, [x0]
	mul	w8, w8, w9
	add	w1, w8, w8, lsl #1
	mov	x0, x22
	bl	_deflateBound
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_12
; %bb.1:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _AV_PIX_FMT_BGR24@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_PIX_FMT_BGR24@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x22
	bl	_deflateReset
                                        ; kill: def $w0 killed $w0 def $x0
Lloh3:
	adrp	x24, _Z_OK@GOTPAGE
Lloh4:
	ldr	x24, [x24, _Z_OK@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.3:
	ldur	d0, [x21, #4]
	str	d0, [x22, #16]
	ldr	w25, [x19, #4]
Lloh5:
	adrp	x26, _Z_NO_FLUSH@GOTPAGE
Lloh6:
	ldr	x26, [x26, _Z_NO_FLUSH@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	subs	w25, w25, #1
	b.lt	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	x9, x8, [x23]
	ldr	x8, [x8]
	ldrsw	x9, [x9]
	sxtw	x10, w25
	madd	x8, x9, x10, x8
	str	x8, [x22, #8]
	ldr	w8, [x19]
	add	w8, w8, w8, lsl #1
	str	w8, [x22]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_deflate
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x24]
	cmp	w0, w8
	b.eq	LBB0_4
	b	LBB0_10
LBB0_6:
Lloh7:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str@PAGE
Lloh11:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_11
LBB0_7:
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh15:
	adrp	x2, l_.str.1@PAGE
Lloh16:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh17:
	adrp	x8, _Z_FINISH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _Z_FINISH@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_deflate
                                        ; kill: def $w0 killed $w0 def $x0
Lloh20:
	adrp	x8, _Z_STREAM_END@GOTPAGE
Lloh21:
	ldr	x8, [x8, _Z_STREAM_END@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.9:
	mov	w0, #0
	ldr	w8, [x22, #4]
Lloh23:
	adrp	x9, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	ldr	w10, [x21]
	orr	w9, w10, w9
	stp	w9, w8, [x21]
	mov	w8, #1
	str	w8, [x20]
	b	LBB0_12
LBB0_10:
Lloh26:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
LBB0_11:
	mov	x0, x19
	bl	_av_log
	mov	w0, #-1
LBB0_12:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PIX_FMT_BGR24,8,3           ; @AV_PIX_FMT_BGR24
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Format not supported!\n"

	.comm	_Z_OK,4,2                       ; @Z_OK
l_.str.1:                               ; @.str.1
	.asciz	"Deflate reset error: %d\n"

	.comm	_Z_NO_FLUSH,4,2                 ; @Z_NO_FLUSH
l_.str.2:                               ; @.str.2
	.asciz	"Deflate error: %d\n"

	.comm	_Z_FINISH,4,2                   ; @Z_FINISH
	.comm	_Z_STREAM_END,4,2               ; @Z_STREAM_END
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_encode_frame
.subsections_via_symbols
