	.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	%rsi, %r12
	movq	%rdi, %r15
	movq	%rdx, -48(%rbp)
	cmpl	$0, 24(%rdi)
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_3
## %bb.1:
	movq	8(%r15), %rax
	movl	(%rax), %r14d
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_be32
LBB0_2:
	movq	8(%r15), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	cmpl	%eax, %r14d
	je	LBB0_14
## %bb.11:
	cmpl	%eax, %ebx
	jne	LBB0_13
LBB0_12:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_3:
	movl	4(%r15), %eax
	imull	(%r15), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	8(%r15), %rax
	movl	(%rax), %r13d
	xorl	%ebx, %ebx
	testl	%r13d, %r13d
	jle	LBB0_7
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	movslq	(%rax), %rdi
	movslq	%ebx, %rax
	imulq	%rax, %rdi
	addq	(%rcx), %rdi
	movq	16(%r15), %rcx
	movq	(%rcx), %rdx
	movq	8(%rcx), %rcx
	movslq	(%rdx), %rsi
	imulq	%rax, %rsi
	addq	(%rcx), %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	movq	8(%r15), %rax
	movl	(%rax), %r13d
	cmpl	%r13d, %ebx
	jl	LBB0_4
	jmp	LBB0_7
LBB0_5:
	movq	8(%r15), %rax
	movl	(%rax), %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %r14d
	cmpl	%ebx, %r13d
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	leal	-1(%r14), %r13d
	movslq	(%rax), %rdi
	movslq	%r13d, %rax
	imulq	%rax, %rdi
	addq	(%rcx), %rdi
	movq	16(%r15), %rcx
	movq	(%rcx), %rdx
	movq	8(%rcx), %rcx
	movslq	(%rdx), %rsi
	imulq	%rax, %rsi
	addq	(%rcx), %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_7
LBB0_9:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_be32
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.10:
	movq	8(%r15), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	je	LBB0_12
LBB0_13:
	leaq	-48(%rbp), %r13
	movq	%r13, %rdi
	movl	$8, %esi
	callq	_bytestream_put_be16
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_bytestream_put_be16
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_be16
	movl	%r14d, %esi
	subl	%ebx, %esi
	movq	%r13, %rdi
	callq	_bytestream_put_be16
LBB0_14:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_be16
	cmpl	%r14d, %ebx
	jge	LBB0_17
## %bb.15:
	leaq	-48(%rbp), %r13
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	movq	%r13, %rcx
	callq	_qtrle_encode_line
	incl	%ebx
	cmpl	%ebx, %r14d
	jne	LBB0_16
LBB0_17:
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bytestream_put_byte
	movq	-48(%rbp), %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	subq	%rbx, %rsi
	shrq	$2, %rsi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_AV_WB32
	movq	-48(%rbp), %rax
	subq	%rbx, %rax
	shrq	$2, %rax
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	str	x2, [sp, #8]
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_5
; %bb.1:
	ldr	x8, [x21, #8]
	ldr	w24, [x8]
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_be32
LBB0_2:
	mov	w22, #0
	mov	w23, #0
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
	cmp	w24, w8
	b.eq	LBB0_16
; %bb.3:
	cmp	w22, w8
	b.ne	LBB0_15
LBB0_4:
	mov	x23, x8
	b	LBB0_16
LBB0_5:
	ldp	w8, w9, [x21]
	mul	w23, w9, w8
	ldr	x8, [x21, #8]
	ldr	w25, [x8]
	cmp	w25, #1
	b.lt	LBB0_9
; %bb.6:
	mov	w22, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x20]
	ldr	x8, [x8]
	ldrsw	x9, [x9]
	sxtw	x10, w22
	madd	x0, x9, x10, x8
	ldr	x8, [x21, #16]
	ldp	x8, x9, [x8]
	ldr	x9, [x9]
	ldrsw	x8, [x8]
	madd	x1, x8, x10, x9
	mov	x2, x23
	bl	_memcmp
	cbnz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	w22, w22, #1
	ldr	x8, [x21, #8]
	ldr	w25, [x8]
	cmp	w22, w25
	b.lt	LBB0_7
	b	LBB0_11
LBB0_9:
	mov	w22, #0
	b	LBB0_11
LBB0_10:
	ldr	x8, [x21, #8]
	ldr	w25, [x8]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x24, x25
	cmp	w25, w22
	b.le	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldp	x9, x8, [x20]
	ldr	x8, [x8]
	sub	w25, w24, #1
	ldrsw	x9, [x9]
	sxtw	x10, w25
	madd	x0, x9, x10, x8
	ldr	x8, [x21, #16]
	ldp	x8, x9, [x8]
	ldr	x9, [x9]
	ldrsw	x8, [x8]
	madd	x1, x8, x10, x9
	mov	x2, x23
	bl	_memcmp
	cbz	x0, LBB0_11
LBB0_13:
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_be32
	cbz	w22, LBB0_2
; %bb.14:
	ldr	x8, [x21, #8]
	ldr	w8, [x8]
	cmp	w22, w8
	b.eq	LBB0_4
LBB0_15:
	add	x0, sp, #8
	mov	w1, #8
	bl	_bytestream_put_be16
	add	x0, sp, #8
	mov	x1, x22
	bl	_bytestream_put_be16
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_be16
	sub	w1, w24, w22
	add	x0, sp, #8
	bl	_bytestream_put_be16
	mov	x23, x22
LBB0_16:
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_be16
	cmp	w23, w24
	b.ge	LBB0_18
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	bl	_qtrle_encode_line
	add	w23, w23, #1
	cmp	w24, w23
	b.ne	LBB0_17
LBB0_18:
	add	x0, sp, #8
	mov	w1, #0
	bl	_bytestream_put_byte
	ldr	x8, [sp, #8]
	sub	x8, x8, x19
	lsr	x1, x8, #2
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_AV_WB32
	ldr	x8, [sp, #8]
	sub	x8, x8, x19
	lsr	x0, x8, #2
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_encode_frame
.subsections_via_symbols
