	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function encode_header
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_encode_header:                         ## @encode_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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MID_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-176(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$128, %edx
	callq	_memset
	leaq	112(%r15), %r12
	movl	(%r15), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_put_rac
	cmpl	$0, (%r15)
	jne	LBB0_2
## %bb.1:
	cmpl	$0, 4(%r15)
	je	LBB0_6
LBB0_2:
	movq	%r15, %rdi
	callq	_ff_snow_reset_contexts
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%r15)
	movl	$0, 24(%r15)
	movq	120(%r15), %rax
	movups	%xmm0, (%rax)
	movq	40(%rax), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	120(%r15), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, 48(%rax)
	movq	88(%rax), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.3:
	movq	104(%r15), %rsi
	movl	28(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	4(%r15), %edx
	movq	%r12, %rdi
	callq	_put_rac
	movq	104(%r15), %rsi
	movl	32(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	36(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	40(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	44(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	cmpl	$3, 48(%r15)
	jl	LBB0_5
## %bb.4:
	movq	104(%r15), %rsi
	movl	52(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	56(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
LBB0_5:
	movq	104(%r15), %rsi
	movl	60(%r15), %edx
	movq	%r12, %rdi
	callq	_put_rac
	movq	104(%r15), %rsi
	movl	64(%r15), %edx
	decl	%edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	%r15, %rdi
	callq	_encode_qlogs
	cmpl	$0, (%r15)
	jne	LBB0_20
LBB0_6:
	movl	48(%r15), %edi
	movl	$2, %esi
	callq	_FFMIN
	testl	%eax, %eax
	jle	LBB0_7
## %bb.8:
	movq	%r12, -184(%rbp)                ## 8-byte Spill
	xorl	%r12d, %r12d
	movl	$40, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	120(%r15), %rax
	movq	-40(%rax,%r13), %rcx
	movq	-32(%rax,%r13), %rdx
	xorl	%esi, %esi
	cmpq	-24(%rax,%r13), %rcx
	setne	%sil
	orl	%ebx, %esi
	xorl	%r14d, %r14d
	cmpq	-16(%rax,%r13), %rdx
	setne	%r14b
	orl	%esi, %r14d
	movq	(%rax,%r13), %rdi
	movq	-8(%rax,%r13), %rsi
	movl	$8, %edx
	callq	_memcmp
	xorl	%ebx, %ebx
	testl	%eax, %eax
	setne	%bl
	orl	%r14d, %ebx
	incq	%r12
	movl	48(%r15), %edi
	movl	$2, %esi
	callq	_FFMIN
	cltq
	addq	$48, %r13
	cmpq	%rax, %r12
	jl	LBB0_9
## %bb.10:
	movq	104(%r15), %rsi
	movq	-184(%rbp), %r12                ## 8-byte Reload
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_put_rac
	testl	%ebx, %ebx
	je	LBB0_17
## %bb.11:
	movl	48(%r15), %edi
	movl	$2, %esi
	callq	_FFMIN
	testl	%eax, %eax
	jle	LBB0_17
## %bb.12:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-184(%rbp), %rbx                ## 8-byte Reload
	incq	%rbx
	movl	48(%r15), %edi
	movl	$2, %esi
	callq	_FFMIN
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_17
LBB0_13:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	104(%r15), %rsi
	movq	120(%r15), %r13
	movq	%rbx, -184(%rbp)                ## 8-byte Spill
	leaq	(%rbx,%rbx,2), %rbx
	shlq	$4, %rbx
	movl	24(%r13,%rbx), %edx
	movq	%r12, %rdi
	callq	_put_rac
	movq	104(%r15), %rsi
	movq	16(%r13,%rbx), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	shrq	%rdx
	decl	%edx
	movq	%r12, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	16(%r13,%rbx), %rcx
	movq	%rcx, %rax
	shrq	$63, %rax
	addq	%rcx, %rax
	sarq	%rax
	testl	%eax, %eax
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	addq	%rbx, %r13
	addq	$32, %r13
	movslq	%eax, %r14
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_13 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	104(%r15), %rbx
	movq	(%r13), %rax
	movl	(%rax,%r14,4), %edi
	callq	_FFABS
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_put_symbol
	decq	%r14
	testl	%r14d, %r14d
	jne	LBB0_15
	jmp	LBB0_16
LBB0_7:
	movq	104(%r15), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_put_rac
LBB0_17:
	movslq	40(%r15), %rax
	movq	104(%r15), %rsi
	cmpq	%rax, 72(%r15)
	jne	LBB0_18
## %bb.19:
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_put_rac
	jmp	LBB0_20
LBB0_18:
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_put_rac
	movq	104(%r15), %rsi
	movl	40(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_put_symbol
	movq	%r15, %rdi
	callq	_encode_qlogs
LBB0_20:
	movq	104(%r15), %rsi
	movl	80(%r15), %edx
	subl	8(%r15), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	84(%r15), %edx
	subl	12(%r15), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	88(%r15), %edx
	subl	20(%r15), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	92(%r15), %edx
	subl	16(%r15), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_put_symbol
	movq	104(%r15), %rsi
	movl	96(%r15), %edx
	subl	24(%r15), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	callq	_put_symbol
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MID_STATE,4,2                  ## @MID_STATE
	.no_dead_strip	_encode_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_header
_encode_header:                         ; @encode_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #224
	.cfi_def_cfa_offset 224
	stp	x26, x25, [sp, #144]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #160]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #176]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #192]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #208]            ; 16-byte Folded Spill
	add	x29, sp, #208
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _MID_STATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MID_STATE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #128
	bl	_memset
	add	x20, x19, #112
	ldr	w2, [x19]
	add	x1, sp, #8
	mov	x0, x20
	bl	_put_rac
	ldr	w8, [x19]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_6
LBB0_2:
	mov	x0, x19
	bl	_ff_snow_reset_contexts
	str	wzr, [x19, #24]
	stp	xzr, xzr, [x19, #8]
	ldr	x8, [x19, #120]
	stp	xzr, xzr, [x8]
	ldr	x0, [x8, #40]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x19, #120]
	stp	xzr, xzr, [x8, #48]
	ldr	x0, [x8, #88]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #28]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_put_rac
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #32]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #36]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #40]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #44]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	w8, [x19, #48]
	cmp	w8, #3
	b.lt	LBB0_5
; %bb.4:
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #52]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #56]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
LBB0_5:
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #60]
	mov	x0, x20
	bl	_put_rac
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #64]
	sub	w2, w8, #1
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	mov	x0, x19
	bl	_encode_qlogs
	ldr	w8, [x19]
	cbnz	w8, LBB0_20
LBB0_6:
	ldr	w0, [x19, #48]
	mov	w1, #2
	bl	_FFMIN
	cmp	w0, #0
	b.le	LBB0_16
; %bb.7:
	mov	x22, #0
	mov	x23, #0
	mov	w21, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #120]
	add	x8, x8, x22
	ldp	x9, x10, [x8]
	ldp	x11, x12, [x8, #16]
	cmp	x9, x11
	cset	w9, ne
	orr	w9, w21, w9
	cmp	x10, x12
	cset	w10, ne
	orr	w21, w9, w10
	ldp	x1, x0, [x8, #32]
	mov	w2, #8
	bl	_memcmp
	cmp	w0, #0
	cset	w8, ne
	orr	w21, w21, w8
	add	x23, x23, #1
	ldr	w0, [x19, #48]
	mov	w1, #2
	bl	_FFMIN
	add	x22, x22, #48
	cmp	x23, w0, sxtw
	b.lt	LBB0_8
; %bb.9:
	ldr	x1, [x19, #104]
	mov	x0, x20
	mov	x2, x21
	bl	_put_rac
	cbz	w21, LBB0_17
; %bb.10:
	ldr	w0, [x19, #48]
	mov	w1, #2
	bl	_FFMIN
	cmp	w0, #1
	b.lt	LBB0_17
; %bb.11:
	mov	x22, #0
	mov	w23, #48
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x22, x22, #1
	ldr	w0, [x19, #48]
	mov	w1, #2
	bl	_FFMIN
	cmp	x22, w0, sxtw
	b.ge	LBB0_17
LBB0_13:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	ldr	x21, [x19, #120]
	ldr	x1, [x19, #104]
	madd	x24, x22, x23, x21
	ldr	w2, [x24, #24]
	mov	x0, x20
	bl	_put_rac
	ldr	x1, [x19, #104]
	ldr	x8, [x24, #16]
	cmp	x8, #0
	cinc	x8, x8, lt
	lsr	x8, x8, #1
	sub	w2, w8, #1
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	ldr	x8, [x24, #16]
	cmp	x8, #0
	cinc	x8, x8, lt
	asr	x24, x8, #1
	cbz	w24, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	madd	x8, x22, x23, x21
	add	x25, x8, #32
	sxtw	x8, w24
	lsl	x26, x8, #2
LBB0_15:                                ;   Parent Loop BB0_13 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x21, [x19, #104]
	ldr	x8, [x25]
	ldr	w0, [x8, x26]
	bl	_FFABS
	mov	x2, x0
	mov	x0, x20
	mov	x1, x21
	mov	w3, #0
	bl	_put_symbol
	sub	x26, x26, #4
	subs	w24, w24, #1
	b.ne	LBB0_15
	b	LBB0_12
LBB0_16:
	ldr	x1, [x19, #104]
	mov	x0, x20
	mov	w2, #0
	bl	_put_rac
LBB0_17:
	ldr	x8, [x19, #72]
	ldrsw	x9, [x19, #40]
	ldr	x1, [x19, #104]
	mov	x0, x20
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.18:
	mov	w2, #0
	bl	_put_rac
	b	LBB0_20
LBB0_19:
	mov	w2, #1
	bl	_put_rac
	ldr	x1, [x19, #104]
	ldr	w2, [x19, #40]
	mov	x0, x20
	mov	w3, #0
	bl	_put_symbol
	mov	x0, x19
	bl	_encode_qlogs
LBB0_20:
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #80]
	ldr	w9, [x19, #8]
	sub	w2, w8, w9
	mov	x0, x20
	mov	w3, #1
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #84]
	ldr	w9, [x19, #12]
	sub	w2, w8, w9
	mov	x0, x20
	mov	w3, #1
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #88]
	ldr	w9, [x19, #20]
	sub	w2, w8, w9
	mov	x0, x20
	mov	w3, #1
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #92]
	ldr	w9, [x19, #16]
	sub	w2, w8, w9
	mov	x0, x20
	mov	w3, #1
	bl	_put_symbol
	ldr	x1, [x19, #104]
	ldr	w8, [x19, #96]
	ldr	w9, [x19, #24]
	sub	w2, w8, w9
	mov	x0, x20
	mov	w3, #1
	bl	_put_symbol
	ldur	x8, [x29, #-72]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	ldp	x29, x30, [sp, #208]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #192]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #176]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #160]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #224
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MID_STATE,4,2                  ; @MID_STATE
	.no_dead_strip	_encode_header
.subsections_via_symbols
