	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encode_hq_slice
_encode_hq_slice:                       ## @encode_hq_slice
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	24(%rsi), %rbx
	leaq	16(%rsi), %r14
	movl	(%rsi), %eax
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	movl	4(%rsi), %eax
	movl	%eax, -72(%rbp)                 ## 4-byte Spill
	movl	8(%rsi), %r13d
	movl	12(%rsi), %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	_MAX_DWT_LEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$4, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -88(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_put_bits_ptr
	movl	(%rbx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_memset
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_skip_put_bytes
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	$8, %esi
	movl	%r13d, %edx
	callq	_put_bits
	cmpl	$0, 4(%rbx)
	jle	LBB0_5
## %bb.1:
	movslq	%r13d, %r15
	xorl	%r12d, %r12d
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	xorl	%r14d, %r14d
	testq	%r12, %r12
	setne	%r14b
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%rbx), %rax
	movq	(%rax,%r12,8), %rax
	movq	%r15, %rdi
	subq	(%rax,%r14,8), %rdi
	xorl	%esi, %esi
	callq	_FFMAX
	movl	%eax, (%r13,%r14,4)
	incq	%r14
	cmpq	$4, %r14
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movslq	4(%rbx), %rax
	addq	$16, %r13
	cmpq	%rax, %r12
	jl	LBB0_2
LBB0_5:
	xorl	%r15d, %r15d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	8(%rbx), %esi
	movl	%r13d, %edi
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	callq	_FFALIGN
	movl	8(%rbx), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %edx
	imull	%ecx, %edx
	subl	%r13d, %edx
	movq	(%r14), %rcx
	movl	%edx, %r13d
	movslq	%r12d, %rdx
	movl	%eax, (%rcx,%rdx,4)
	movq	%r14, %rdi
	callq	_flush_put_bits
	movq	%r14, %rdi
	callq	_put_bits_ptr
	movl	%eax, %edi
	movl	$255, %esi
	movl	%r13d, %edx
	callq	_memset
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_skip_put_bytes
	incq	%r15
	cmpq	$3, %r15
	je	LBB0_15
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##       Child Loop BB0_9 Depth 3
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_put_bits_count
	sarl	$3, %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movl	$8, %esi
	xorl	%edx, %edx
	callq	_put_bits
	cmpl	$0, 4(%rbx)
	jle	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_9 Depth 3
	xorl	%r14d, %r14d
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	setne	%r14b
	shlq	$2, %r14
	movq	%rbx, %r15
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	movq	-96(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_6 Depth=1
                                        ##     Parent Loop BB0_8 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movq	16(%r15), %rax
	movq	(%rax,%r13,8), %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rax,%rdx,8), %r8
	addq	%r14, %r8
	movl	(%rcx,%r14), %r9d
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	-76(%rbp), %edx                 ## 4-byte Reload
	movq	%rcx, %rbx
	movl	%r12d, %ecx
	callq	_encode_subband
	movq	%rbx, %rcx
	addq	$4, %r14
	cmpq	$16, %r14
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=2
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	incq	%rsi
	movslq	4(%r15), %rax
	addq	$16, %rcx
	movq	%rsi, %rdx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %rsi
	movq	%r15, %rbx
	jl	LBB0_8
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_avpriv_align_put_bits
	movq	%r14, %rdi
	callq	_put_bits_count
	sarl	$3, %eax
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %r13d
	notl	%r13d
	addl	%eax, %r13d
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	cmpq	$2, %r15
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r14, %rdi
	callq	_put_bits_count
	sarl	$3, %eax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	leal	(%rcx,%r13), %edi
	subl	%eax, %edi
	movl	8(%rbx), %esi
	jmp	LBB0_14
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_DWT_LEVELS,4,2             ## @MAX_DWT_LEVELS
	.no_dead_strip	_encode_hq_slice
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encode_hq_slice
_encode_hq_slice:                       ; @encode_hq_slice
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldr	x19, [x1, #24]
	add	x20, x1, #16
	ldp	w21, w22, [x1]
	ldp	w23, w8, [x1, #8]
	stur	w8, [x29, #-108]                ; 4-byte Folded Spill
Lloh3:
	adrp	x8, _MAX_DWT_LEVELS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_DWT_LEVELS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #4
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x8, x9, x8
	stur	x8, [x29, #-104]                ; 8-byte Folded Spill
	mov	sp, x8
	mov	x0, x20
	bl	_put_bits_ptr
	ldr	w2, [x19]
	mov	w1, #0
	bl	_memset
	ldr	w1, [x19]
	mov	x0, x20
	bl	_skip_put_bytes
	mov	x0, x20
	mov	w1, #8
	mov	x2, x23
	bl	_put_bits
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x25, #0
	sxtw	x23, w23
	ldur	x27, [x29, #-104]               ; 8-byte Folded Reload
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x19, #4]
	add	x27, x27, #16
	cmp	x25, x8
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x25, #0
	cset	w28, ne
	ldr	x8, [x19, #24]
	lsl	x26, x25, #3
	ldr	x8, [x8, x26]
	ldr	x8, [x8, w28, uxtw #3]
	mov	w9, #1
	cinc	x24, x9, ne
	sub	x0, x23, x8
	mov	w1, #0
	bl	_FFMAX
	str	w0, [x27, w28, uxtw #2]
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x26]
	ldr	x8, [x8, x24, lsl #3]
	sub	x0, x23, x8
	mov	w1, #0
	bl	_FFMAX
	str	w0, [x27, x24, lsl #2]
	add	x8, x24, #1
	cmp	x8, #4
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19, #24]
	ldr	x9, [x9, x25, lsl #3]
	ldr	x8, [x9, x8, lsl #3]
	sub	x0, x23, x8
	mov	w1, #0
	bl	_FFMAX
	add	x28, x27, x24, lsl #2
	str	w0, [x28, #4]
	add	x8, x24, #2
	cmp	x8, #4
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19, #24]
	ldr	x9, [x9, x25, lsl #3]
	ldr	x8, [x9, x8, lsl #3]
	sub	x0, x23, x8
	mov	w1, #0
	bl	_FFMAX
	str	w0, [x28, #8]
	b	LBB0_2
LBB0_6:
	mov	x26, #0
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x19, #8]
	mov	x0, x23
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	bl	_FFALIGN
	ldr	w9, [x19, #8]
	sdiv	w8, w0, w9
	mul	w9, w8, w9
	sub	w23, w9, w23
	ldr	x9, [x20]
	str	w8, [x9, w25, sxtw #2]
	mov	x0, x20
	bl	_flush_put_bits
	mov	x0, x20
	bl	_put_bits_ptr
	mov	w1, #255
	mov	x2, x23
	bl	_memset
	mov	x0, x20
	mov	x1, x23
	bl	_skip_put_bytes
	add	x26, x26, #1
	cmp	x26, #3
	b.eq	LBB0_17
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	mov	x0, x20
	bl	_put_bits_count
	stur	w0, [x29, #-92]                 ; 4-byte Folded Spill
	mov	x0, x20
	mov	w1, #8
	mov	w2, #0
	bl	_put_bits
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x28, #0
	ldur	x25, [x29, #-104]               ; 8-byte Folded Reload
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=2
	add	x28, x28, #1
	ldrsw	x8, [x19, #4]
	add	x25, x25, #16
	cmp	x28, x8
	b.ge	LBB0_15
LBB0_12:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x28, #0
	cset	w8, ne
	ldr	x9, [x19, #16]
	lsl	x23, x26, #3
	ldr	x9, [x9, x23]
	lsl	x27, x28, #3
	ldr	x9, [x9, x27]
	lsl	x8, x8, #2
	add	x4, x9, x8
	ldr	w5, [x25, x8]
	mov	w8, #1
	cinc	x24, x8, ne
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_encode_subband
	ldr	x8, [x19, #16]
	ldr	x8, [x8, x23]
	ldr	x8, [x8, x27]
	lsl	x9, x24, #2
	add	x4, x8, x9
	ldr	w5, [x25, x9]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_encode_subband
	add	x8, x24, #1
	cmp	x8, #4
	b.eq	LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	x9, [x19, #16]
	ldr	x9, [x9, x26, lsl #3]
	ldr	x9, [x9, x28, lsl #3]
	add	x4, x9, x8, lsl #2
	add	x23, x25, x24, lsl #2
	ldr	w5, [x23, #4]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_encode_subband
	add	x8, x24, #2
	cmp	x8, #4
	b.eq	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	x9, [x19, #16]
	ldr	x9, [x9, x26, lsl #3]
	ldr	x9, [x9, x28, lsl #3]
	add	x4, x9, x8, lsl #2
	ldr	w5, [x23, #8]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	x3, x22
	bl	_encode_subband
	b	LBB0_11
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	ldur	w8, [x29, #-92]                 ; 4-byte Folded Reload
	asr	w25, w8, #3
	mov	x0, x20
	bl	_avpriv_align_put_bits
	mov	x0, x20
	bl	_put_bits_count
	mvn	w8, w25
	add	w23, w8, w0, asr #3
	cmp	x26, #2
	b.ne	LBB0_7
; %bb.16:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	bl	_put_bits_count
	ldur	w8, [x29, #-108]                ; 4-byte Folded Reload
	add	w8, w23, w8
	sub	w0, w8, w0, asr #3
	ldr	w1, [x19, #8]
	b	LBB0_8
LBB0_17:
	ldur	x8, [x29, #-88]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	mov	w0, #0
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DWT_LEVELS,4,2             ; @MAX_DWT_LEVELS
	.no_dead_strip	_encode_hq_slice
.subsections_via_symbols
