	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wv_get_value
_wv_get_value:                          ## @wv_get_value
	.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
	movq	%rcx, %r13
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	32(%rdi), %rbx
	movslq	%edx, %rcx
	movl	$0, (%r13)
	movq	(%rbx), %rax
	cmpl	$1, (%rax)
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	ja	LBB0_4
## %bb.1:
	movq	16(%rbx), %rax
	cmpl	$1, (%rax)
	ja	LBB0_4
## %bb.2:
	cmpl	$0, (%rdi)
	jne	LBB0_4
## %bb.3:
	cmpl	$0, 4(%rdi)
	je	LBB0_37
LBB0_4:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	cmpl	$0, (%rdi)
	movl	$0, %r13d
	jne	LBB0_14
## %bb.5:
	movq	%r12, %rdi
	callq	_get_unary_0_33
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	js	LBB0_47
## %bb.6:
	cmpl	$16, %r13d
	jne	LBB0_13
## %bb.7:
	movq	%r12, %rdi
	callq	_get_unary_0_33
	movl	%eax, %r13d
	cmpl	$1, %eax
	jg	LBB0_10
## %bb.8:
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	js	LBB0_47
## %bb.9:
	addl	$16, %r13d
	jmp	LBB0_13
LBB0_10:
	cmpl	$31, %r13d
	ja	LBB0_47
## %bb.11:
	movq	%r12, %rdi
	callq	_get_bits_left
	decl	%r13d
	cmpl	%r13d, %eax
	jl	LBB0_47
## %bb.12:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_get_bits_long
	btsl	%r13d, %eax
	addl	$16, %eax
	movl	%eax, %r13d
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	4(%rdi), %ecx
	movl	%r13d, %eax
	andl	$1, %eax
	movl	%eax, 4(%rdi)
	sarl	%r13d
	cmpl	$1, %ecx
	sbbl	$-1, %r13d
	xorl	$1, %eax
LBB0_14:
	movl	%eax, (%rdi)
	testl	%r15d, %r15d
	jne	LBB0_17
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 24(%rax)
	je	LBB0_17
## %bb.16:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_update_error_limit
	testq	%rax, %rax
	js	LBB0_47
LBB0_17:
	cmpl	$2, %r13d
	je	LBB0_21
## %bb.18:
	cmpl	$1, %r13d
	je	LBB0_22
## %bb.19:
	testl	%r13d, %r13d
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_24
## %bb.20:
	xorl	%r13d, %r13d
	xorl	%edi, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_DEC_MED
	jmp	LBB0_25
LBB0_21:
	xorl	%edi, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	movl	$1, %edi
	callq	_GET_MED
	movl	%eax, %r13d
	addl	%ebx, %r13d
	movl	$2, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_INC_MED
	movl	$1, %edi
	callq	_INC_MED
	movl	$2, %edi
	jmp	LBB0_23
LBB0_22:
	xorl	%edi, %edi
	callq	_GET_MED
	movl	%eax, %r13d
	movl	$1, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_INC_MED
	movl	$1, %edi
LBB0_23:
	callq	_DEC_MED
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_25
LBB0_24:
	xorl	%edi, %edi
	callq	_GET_MED
	movl	%eax, %r14d
	movl	$1, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	addl	%r14d, %ebx
	movl	$2, %edi
	callq	_GET_MED
	addl	$-2, %r13d
	imull	%eax, %r13d
	addl	%ebx, %r13d
	movl	$2, %edi
	callq	_GET_MED
	movl	%eax, %ebx
	xorl	%edi, %edi
	callq	_INC_MED
	movl	$1, %edi
	callq	_INC_MED
	movl	$2, %edi
	callq	_INC_MED
LBB0_25:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	leal	-1(%rbx), %r14d
	shlq	$4, %rcx
	movl	8(%r15,%rcx), %eax
	testl	%eax, %eax
	je	LBB0_30
## %bb.26:
	shrl	%ebx
	addl	%r13d, %ebx
	andl	$2147483647, %ebx               ## imm = 0x7FFFFFFF
	cmpl	%eax, %r14d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_34
## %bb.27:
	addq	%rcx, %r15
	addq	$8, %r15
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	jle	LBB0_47
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	movq	%r12, %rdi
	callq	_get_bits1
	addl	%r13d, %r14d
	subl	%ebx, %r14d
	movl	%r13d, %ecx
	notl	%ecx
	addl	%ebx, %ecx
	testl	%eax, %eax
                                        ## kill: def $ebx killed $ebx killed $rbx def $rbx
	cmovel	%r13d, %ebx
	cmovnel	%r14d, %ecx
	movl	%ebx, %r13d
	leal	(%rcx,%rbx,2), %ebx
	incl	%ebx
	shrl	%ebx
	movl	%ecx, %r14d
	cmpl	(%r15), %ecx
	jg	LBB0_28
	jmp	LBB0_34
LBB0_30:
	cmpl	$33554432, %r14d                ## imm = 0x2000000
	jb	LBB0_32
## %bb.31:
	movl	12(%rdx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	%r14d, %ecx
	callq	_av_log
	jmp	LBB0_47
LBB0_32:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_get_tail
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	jle	LBB0_47
## %bb.33:
	addl	%r13d, %ebx
LBB0_34:
	movq	%r12, %rdi
	callq	_get_bits1
	movl	%eax, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 16(%rax)
	je	LBB0_36
## %bb.35:
	movl	%ebx, %edi
	callq	_wp_log2
	movq	%rax, %r15
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	12(%r12,%r13), %edi
	callq	_LEVEL_DECAY
	subl	%eax, %r15d
	addl	%r15d, 12(%r12,%r13)
LBB0_36:
	xorl	%eax, %eax
	negl	%r14d
	sbbl	%eax, %eax
	xorl	%eax, %ebx
	jmp	LBB0_51
LBB0_37:
	movl	8(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_40
## %bb.38:
	decl	%eax
	movl	%eax, 8(%rdi)
	je	LBB0_4
## %bb.39:
	shlq	$4, %rcx
	movl	12(%rbx,%rcx), %edi
	movq	%rcx, %r14
	callq	_LEVEL_DECAY
	subl	%eax, 12(%rbx,%r14)
	jmp	LBB0_50
LBB0_40:
	movq	%rcx, %rbx
	movq	%r12, %rdi
	callq	_get_unary_0_33
	movl	%eax, %r14d
	cmpl	$2, %eax
	jl	LBB0_44
## %bb.41:
	cmpl	$31, %r14d
	ja	LBB0_47
## %bb.42:
	movq	%r12, %rdi
	callq	_get_bits_left
	decl	%r14d
	cmpl	%r14d, %eax
	jl	LBB0_47
## %bb.43:
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_get_bits_long
	btsl	%r14d, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, 8(%rdi)
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%rbx, %rcx
	jmp	LBB0_46
LBB0_44:
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	js	LBB0_47
## %bb.45:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, 8(%rdi)
	testl	%r14d, %r14d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%rbx, %rcx
	je	LBB0_4
LBB0_46:
	movq	32(%rdi), %rax
	movq	%rdi, %r12
	movq	(%rax), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	movl	$8, %edx
	movq	%rcx, %r15
	callq	_memset
	movq	32(%r12), %rax
	movq	16(%rax), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	shlq	$4, %r15
	movl	12(%r14,%r15), %edi
	callq	_LEVEL_DECAY
	subl	%eax, 12(%r14,%r15)
	jmp	LBB0_51
LBB0_47:
	movq	%r12, %rdi
	callq	_get_bits_left
	testl	%eax, %eax
	jg	LBB0_49
## %bb.48:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	12(%rcx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%eax, %ecx
	callq	_av_log
LBB0_49:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_50:
	xorl	%ebx, %ebx
LBB0_51:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"k %d is too large\n"

L_.str.1:                               ## @.str.1
	.asciz	"Too few bits (%d) left\n"

	.no_dead_strip	_wv_get_value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wv_get_value
_wv_get_value:                          ; @wv_get_value
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x25, [x0, #32]
	sxtw	x26, w22
	str	wzr, [x3]
	ldr	x8, [x25]
	ldr	w8, [x8]
	cmp	w8, #1
	b.hi	LBB0_4
; %bb.1:
	ldr	x8, [x25, #16]
	ldr	w8, [x8]
	cmp	w8, #1
	b.hi	LBB0_4
; %bb.2:
	ldr	w8, [x19]
	cbnz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_35
LBB0_4:
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.5:
	mov	w8, #0
	mov	w23, #0
	str	w8, [x19]
	cbz	w22, LBB0_15
	b	LBB0_17
LBB0_6:
	mov	x0, x21
	bl	_get_unary_0_33
	mov	x23, x0
	mov	x0, x21
	bl	_get_bits_left
	tbnz	w0, #31, LBB0_45
; %bb.7:
	cmp	w23, #16
	b.ne	LBB0_14
; %bb.8:
	mov	x0, x21
	bl	_get_unary_0_33
	mov	x24, x0
	subs	w23, w0, #1
	b.gt	LBB0_11
; %bb.9:
	mov	x0, x21
	bl	_get_bits_left
	tbnz	w0, #31, LBB0_45
; %bb.10:
	add	w23, w24, #16
	b	LBB0_14
LBB0_11:
	cmp	w24, #31
	b.hi	LBB0_45
; %bb.12:
	mov	x0, x21
	bl	_get_bits_left
	cmp	w0, w23
	b.lt	LBB0_45
; %bb.13:
	mov	x0, x21
	mov	x1, x23
	bl	_get_bits_long
	mov	w8, #1
	lsl	w8, w8, w23
	orr	w8, w0, w8
	add	w23, w8, #16
LBB0_14:
	ldr	w8, [x19, #4]
	cmp	w8, #0
	and	w8, w23, #0x1
	str	w8, [x19, #4]
	asr	w9, w23, #1
	cinc	w23, w9, ne
	eor	w8, w8, #0x1
	str	w8, [x19]
	cbnz	w22, LBB0_17
LBB0_15:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_update_error_limit
	tbnz	x0, #63, LBB0_45
LBB0_17:
	subs	w24, w23, #2
	b.eq	LBB0_21
; %bb.18:
	cmp	w23, #1
	b.eq	LBB0_22
; %bb.19:
	mov	w0, #0
	cbnz	w23, LBB0_23
; %bb.20:
	bl	_GET_MED
	mov	x23, x0
	mov	w0, #0
	bl	_DEC_MED
	mov	w22, #0
	b	LBB0_24
LBB0_21:
	mov	w0, #0
	bl	_GET_MED
	mov	x22, x0
	mov	w0, #1
	bl	_GET_MED
	add	w22, w0, w22
	mov	w0, #2
	bl	_GET_MED
	mov	x23, x0
	mov	w0, #0
	bl	_INC_MED
	mov	w0, #1
	bl	_INC_MED
	mov	w0, #2
	bl	_DEC_MED
	b	LBB0_24
LBB0_22:
	mov	w0, #0
	bl	_GET_MED
	mov	x22, x0
	mov	w0, #1
	bl	_GET_MED
	mov	x23, x0
	mov	w0, #0
	bl	_INC_MED
	mov	w0, #1
	bl	_DEC_MED
	b	LBB0_24
LBB0_23:
	bl	_GET_MED
	mov	x22, x0
	mov	w0, #1
	bl	_GET_MED
	add	w22, w0, w22
	mov	w0, #2
	bl	_GET_MED
	madd	w22, w0, w24, w22
	mov	w0, #2
	bl	_GET_MED
	mov	x23, x0
	mov	w0, #0
	bl	_INC_MED
	mov	w0, #1
	bl	_INC_MED
	mov	w0, #2
	bl	_INC_MED
LBB0_24:
	sub	w24, w23, #1
	add	x27, x25, x26, lsl #4
	ldr	w8, [x27, #8]!
	cbz	w8, LBB0_28
; %bb.25:
	add	w9, w22, w23, lsr #1
	and	w23, w9, #0x7fffffff
	cmp	w24, w8
	b.le	LBB0_32
LBB0_26:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_get_bits_left
	cmp	w0, #1
	b.lt	LBB0_45
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=1
	mov	x0, x21
	bl	_get_bits1
	add	w8, w24, w22
	sub	w8, w8, w23
	mvn	w9, w22
	add	w9, w23, w9
	cmp	w0, #0
	csel	w22, w22, w23, eq
	csel	w24, w9, w8, eq
	add	w8, w24, w22, lsl #1
	add	w8, w8, #1
	lsr	w23, w8, #1
	ldr	w8, [x27]
	cmp	w24, w8
	b.gt	LBB0_26
	b	LBB0_32
LBB0_28:
	lsr	w8, w24, #25
	cbz	w8, LBB0_30
; %bb.29:
	ldr	w0, [x19, #12]
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, x24
	bl	_av_log
	b	LBB0_45
LBB0_30:
	mov	x0, x21
	mov	x1, x24
	bl	_get_tail
	mov	x23, x0
	mov	x0, x21
	bl	_get_bits_left
	cmp	w0, #1
	b.lt	LBB0_45
; %bb.31:
	add	w23, w23, w22
LBB0_32:
	mov	x0, x21
	bl	_get_bits1
	mov	x20, x0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_34
; %bb.33:
	mov	x0, x23
	bl	_wp_log2
	mov	x19, x0
	add	x21, x25, x26, lsl #4
	ldr	w0, [x21, #12]
	bl	_LEVEL_DECAY
	ldr	w8, [x21, #12]
	sub	w9, w19, w0
	add	w8, w8, w9
	str	w8, [x21, #12]
LBB0_34:
	cmp	w20, #0
	cinv	w0, w23, ne
	b	LBB0_48
LBB0_35:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_37
; %bb.36:
	subs	w8, w8, #1
	str	w8, [x19, #8]
	b.ne	LBB0_44
	b	LBB0_4
LBB0_37:
	mov	x0, x21
	bl	_get_unary_0_33
	mov	x23, x0
	cmp	w0, #2
	b.lt	LBB0_41
; %bb.38:
	cmp	w23, #31
	b.hi	LBB0_45
; %bb.39:
	mov	x0, x21
	bl	_get_bits_left
	sub	w22, w23, #1
	cmp	w0, w22
	b.lt	LBB0_45
; %bb.40:
	mov	x0, x21
	mov	x1, x22
	bl	_get_bits_long
	mov	w8, #1
	lsl	w8, w8, w22
	orr	w8, w0, w8
	str	w8, [x19, #8]
	b	LBB0_43
LBB0_41:
	mov	x0, x21
	bl	_get_bits_left
	tbnz	w0, #31, LBB0_45
; %bb.42:
	str	w23, [x19, #8]
	cbz	w23, LBB0_4
LBB0_43:
	ldr	x8, [x19, #32]
	ldr	x0, [x8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [x19, #32]
	ldr	x0, [x8, #16]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
LBB0_44:
	add	x19, x25, x26, lsl #4
	ldr	w0, [x19, #12]
	bl	_LEVEL_DECAY
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x19, #12]
	sub	w8, w9, w8
	str	w8, [x19, #12]
	b	LBB0_48
LBB0_45:
	mov	x0, x21
	bl	_get_bits_left
	cmp	w0, #0
	b.gt	LBB0_47
; %bb.46:
	mov	x3, x0
	ldr	w0, [x19, #12]
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
LBB0_47:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x20]
LBB0_48:
	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 AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"k %d is too large\n"

l_.str.1:                               ; @.str.1
	.asciz	"Too few bits (%d) left\n"

	.no_dead_strip	_wv_get_value
.subsections_via_symbols
