	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rice_decompress
_rice_decompress:                       ## @rice_decompress
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -68(%rbp)                 ## 4-byte Spill
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	testl	%edx, %edx
	jle	LBB0_15
## %bb.1:
	movq	%rdi, %rbx
	movl	(%rdi), %r12d
	leaq	8(%rdi), %r14
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	movl	-44(%rbp), %edx                 ## 4-byte Reload
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %r14                 ## 8-byte Reload
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	%r15d
	movl	%ebx, %r12d
	cmpl	%edx, %r15d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jge	LBB0_17
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_get_bits_left
	testq	%rax, %rax
	jle	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%r12d, %edi
	shrl	$9, %edi
	addl	$3, %edi
	callq	_av_log2
	movl	12(%rbx), %esi
	movl	%eax, %edi
	callq	_FFMIN
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	-72(%rbp), %edx                 ## 4-byte Reload
	callq	_decode_scalar
	addl	%eax, %r13d
	movl	%r13d, %eax
	shrl	%eax
	movl	%r13d, %ecx
	andl	$1, %ecx
	negl	%ecx
	xorl	%eax, %ecx
	movslq	%r15d, %rax
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%ecx, (%rdx,%rax,4)
	xorl	%eax, %eax
	movl	$65535, %ebx                    ## imm = 0xFFFF
	cmpl	$65535, %r13d                   ## imm = 0xFFFF
	ja	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	imull	%ecx, %r13d
	movl	%r12d, %edx
	imull	%ecx, %edx
	shrl	$9, %edx
	subl	%edx, %r13d
	movl	%r13d, %ebx
	addl	%r12d, %ebx
	cmpl	$127, %ebx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	ja	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	leal	1(%r15), %r12d
	cmpl	%edx, %r12d
	jge	LBB0_14
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %edi
	callq	_av_log2
	addl	$16, %ebx
	shrl	$6, %ebx
	subl	%eax, %ebx
	addl	$7, %ebx
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %esi
	movl	%ebx, %edi
	callq	_FFMIN
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	$16, %edx
	callq	_decode_scalar
	movq	%rax, %rbx
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r13d
	subl	%r15d, %r13d
	cmpl	%ebx, %r13d
	jg	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	movl	%r15d, %r9d
	callq	_av_log
	decl	%r13d
	movl	%r13d, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r12d, %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rdi
	leal	(,%rbx,4), %edx
	xorl	%esi, %esi
	callq	_memset
	addl	%ebx, %r15d
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	cmpl	$65536, %ebx                    ## imm = 0x10000
	setl	%r13b
	xorl	%ebx, %ebx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	jmp	LBB0_3
LBB0_15:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_16:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid zero block size of %d %d %d\n"

	.no_dead_strip	_rice_decompress
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rice_decompress
_rice_decompress:                       ; @rice_decompress
	.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
	cmp	w2, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	mov	w28, #0
	mov	w24, #0
	mov	x25, x0
	ldr	w27, [x25], #8
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w28, #0
	mov	w27, #65535
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w24, w24, #1
	cmp	w24, w21
	b.ge	LBB0_14
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_get_bits_left
	cmp	x0, #1
	b.lt	LBB0_15
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	lsr	w8, w27, #9
	add	w0, w8, #3
	bl	_av_log2
	ldr	w1, [x23, #12]
	bl	_FFMIN
	mov	x1, x0
	mov	x0, x25
	mov	x2, x20
	bl	_decode_scalar
	add	w8, w28, w0
	and	w9, w8, #0x1
	neg	w9, w9
	eor	w9, w9, w8, lsr #1
	str	w9, [x22, w24, sxtw #2]
	lsr	w9, w8, #16
	cbnz	w9, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mul	w8, w8, w19
	mul	w9, w27, w19
	sub	w8, w8, w9, lsr #9
	add	w27, w8, w27
	cmp	w27, #127
	b.hi	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x8, w24
	add	x26, x8, #1
	cmp	w26, w21
	b.ge	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_av_log2
	add	w8, w27, #16
	lsr	w8, w8, #6
	sub	w8, w8, w0
	add	w0, w8, #7
	ldr	w1, [x23, #12]
	bl	_FFMIN
	mov	x1, x0
	mov	x0, x25
	mov	w2, #16
	bl	_decode_scalar
	mov	x28, x0
	cmp	w28, #1
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w27, w21, w24
	cmp	w27, w28
	b.gt	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x23, #4]
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x28
	mov	x4, x21
	mov	x5, x24
	bl	_av_log
	sub	w28, w27, #1
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w2, w28, #2
	add	x0, x22, x26, lsl #2
	mov	w1, #0
	bl	_memset
	add	w24, w28, w24
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w27, #0
	cmp	w28, #16, lsl #12               ; =65536
	cset	w28, lt
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w28, #0
	b	LBB0_3
LBB0_14:
	mov	w0, #0
	b	LBB0_16
LBB0_15:
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
LBB0_16:
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid zero block size of %d %d %d\n"

	.no_dead_strip	_rice_decompress
.subsections_via_symbols
