	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_channel_residues
_decode_channel_residues:               ## @decode_channel_residues
	.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
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rdi, %r14
	leaq	48(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_get_bits1
	movq	(%r14), %rcx
	movslq	%r12d, %r13
	movl	%eax, (%rcx,%r13,4)
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movl	%r15d, %edi
	callq	_av_log2
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_get_bits
	movq	8(%r14), %rcx
	movl	%eax, (%rcx,%r13,4)
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movq	(%r14), %rax
	movl	$0, (%rax,%r13,4)
LBB0_3:
	movq	72(%r14), %rax
	movq	(%rax,%r13,8), %rdi
	movl	16(%r14), %eax
	movl	%eax, %esi
	shrl	$31, %esi
	addl	%eax, %esi
	sarl	%esi
	callq	_FFMAX
	movq	72(%r14), %rcx
	movq	%rax, (%rcx,%r13,8)
	jmp	LBB0_6
LBB0_4:
	movq	72(%r14), %rax
	cmpq	$0, (%rax,%r13,8)
	je	LBB0_6
## %bb.5:
	movl	$1, (%rcx,%r13,4)
LBB0_6:
	xorl	%r12d, %r12d
	cmpq	$0, 64(%r14)
	movl	$0, %eax
	je	LBB0_9
## %bb.7:
	movl	20(%r14), %esi
	movq	%rbx, %rdi
	callq	_get_bits
	movb	32(%r14), %cl
	incb	%cl
	shll	%cl, %eax
	movq	24(%r14), %rcx
	movl	%eax, (%rcx,%r13,4)
	cmpq	$0, 64(%r14)
	movl	$0, %eax
	je	LBB0_9
## %bb.8:
	movl	20(%r14), %esi
	cmpq	$1, 56(%r14)
	sbbl	$-1, %esi
	movq	%rbx, %rdi
	callq	_get_sbits_long
	movq	40(%r14), %rcx
	movq	(%rcx,%r13,8), %rcx
	movl	%eax, (%rcx)
	movl	$1, %eax
LBB0_9:
	cmpl	%r15d, %eax
	jge	LBB0_20
## %bb.10:
	movl	%r15d, %ecx
	movl	%eax, %r15d
	movl	%ecx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_get_bits1
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	incl	%r12d
	movq	%rbx, %rdi
	callq	_get_bits_left
	testq	%rax, %rax
	jg	LBB0_12
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpl	$32, %r12d
	jb	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rbx, %rdi
	movl	$5, %esi
	callq	_get_bits
                                        ## kill: def $eax killed $eax def $rax
	leal	1(%rax), %esi
	movq	%rbx, %rdi
	callq	_get_bits_long
	addl	%r12d, %eax
	movl	%eax, %r12d
LBB0_17:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	32(%r14), %eax
	movl	$1, %edi
	movl	%eax, %ecx
	shll	%cl, %edi
	movq	24(%r14), %rdx
	movl	(%rdx,%r13,4), %esi
	addl	%esi, %edi
	leal	1(%rax), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %edi
	cmpl	$2, %edi
	jb	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	callq	_av_ceil_log2
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_get_bits_long
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	addl	%eax, %r12d
	movq	24(%r14), %rdx
	movl	(%rdx,%r13,4), %esi
	movl	32(%r14), %eax
LBB0_19:                                ##   in Loop: Header=BB0_11 Depth=1
	leal	(%rsi,%r12), %edi
	movl	%eax, %ecx
	shrl	%cl, %esi
	subl	%esi, %edi
	movl	%edi, (%rdx,%r13,4)
	movl	%r12d, %eax
	sarl	%eax
	andl	$1, %r12d
	negl	%r12d
	xorl	%eax, %r12d
	movq	40(%r14), %rax
	movq	(%rax,%r13,8), %rax
	movl	%r12d, (%rax,%r15,4)
	incq	%r15
	xorl	%r12d, %r12d
	cmpq	-56(%rbp), %r15                 ## 8-byte Folded Reload
	jne	LBB0_11
	jmp	LBB0_20
LBB0_14:
	movl	$-1, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_decode_channel_residues
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_channel_residues
_decode_channel_residues:               ; @decode_channel_residues
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	add	x20, x0, #48
	mov	x0, x20
	bl	_get_bits1
	ldr	x8, [x19]
	sxtw	x23, w22
	str	w0, [x8, w22, sxtw #2]
	cbz	w0, LBB0_4
; %bb.1:
	mov	x0, x21
	bl	_av_log2
	mov	x1, x0
	mov	x0, x20
	bl	_get_bits
	ldr	x8, [x19, #8]
	str	w0, [x8, x23, lsl #2]
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x8, [x19]
	str	wzr, [x8, x23, lsl #2]
LBB0_3:
	ldr	x8, [x19, #72]
	lsl	x22, x23, #3
	ldr	x0, [x8, x22]
	ldr	w8, [x19, #16]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w1, w8, #1
	bl	_FFMAX
	ldr	x8, [x19, #72]
	str	x0, [x8, x22]
	b	LBB0_6
LBB0_4:
	ldr	x9, [x19, #72]
	ldr	x9, [x9, x23, lsl #3]
	cbz	x9, LBB0_6
; %bb.5:
	mov	w9, #1
	str	w9, [x8, x23, lsl #2]
LBB0_6:
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_9
; %bb.7:
	ldr	w1, [x19, #20]
	mov	x0, x20
	bl	_get_bits
	ldr	w8, [x19, #32]
	add	w8, w8, #1
	lsl	w8, w0, w8
	ldr	x9, [x19, #24]
	str	w8, [x9, x23, lsl #2]
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x8, [x19, #56]
	cmp	x8, #0
	ldr	w8, [x19, #20]
	cinc	w1, w8, ne
	mov	x0, x20
	bl	_get_sbits_long
	ldr	x8, [x19, #40]
	ldr	x8, [x8, x23, lsl #3]
	str	w0, [x8]
	mov	w8, #1
LBB0_9:
	cmp	w8, w21
	b.ge	LBB0_19
; %bb.10:
	mov	w22, w8
	mov	w24, #1
	mov	w25, w21
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	mov	w26, #0
LBB0_12:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	bl	_get_bits1
	cbz	w0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w26, w26, #1
	mov	x0, x20
	bl	_get_bits_left
	cmp	x0, #1
	b.ge	LBB0_12
	b	LBB0_20
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	cmp	w26, #32
	b.lo	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	mov	w1, #5
	bl	_get_bits
	add	w1, w0, #1
	mov	x0, x20
	bl	_get_bits_long
	add	w26, w0, w26
LBB0_16:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19, #24]
	ldr	w9, [x8, x23, lsl #2]
	ldr	w10, [x19, #32]
	lsl	w11, w24, w10
	add	w11, w11, w9
	add	w12, w10, #1
	lsr	w0, w11, w12
	cmp	w0, #2
	b.lo	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_11 Depth=1
	bl	_av_ceil_log2
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_get_bits_long
	lsl	w8, w26, w21
	add	w26, w8, w0
	ldr	x8, [x19, #24]
	ldr	w9, [x8, x23, lsl #2]
	ldr	w10, [x19, #32]
LBB0_18:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	w0, #0
	lsr	w10, w9, w10
	add	w9, w9, w26
	sub	w9, w9, w10
	str	w9, [x8, x23, lsl #2]
	and	w8, w26, #0x1
	neg	w8, w8
	eor	w8, w8, w26, asr #1
	ldr	x9, [x19, #40]
	ldr	x9, [x9, x23, lsl #3]
	str	w8, [x9, x22, lsl #2]
	add	x22, x22, #1
	cmp	x22, x25
	b.ne	LBB0_11
	b	LBB0_21
LBB0_19:
	mov	w0, #0
	b	LBB0_21
LBB0_20:
	mov	w0, #-1
LBB0_21:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_decode_channel_residues
.subsections_via_symbols
