	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lag_read_prob_header
_lag_read_prob_header:                  ## @lag_read_prob_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rcx
	movq	%rdi, %r12
	movq	(%rdi), %rsi
	movl	$0, (%rsi)
	movq	_UINT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 1028(%rsi)
	addq	$4, %rsi
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rdi
	callq	_lag_decode_prob
	testq	%rax, %rax
	js	LBB0_4
## %bb.1:
	xorl	%r15d, %r15d
	movl	$1, %r13d
	movl	$1, %r14d
	movl	$0, -60(%rbp)                   ## 4-byte Folded Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_13 Depth 2
	movl	%r15d, %eax
	movq	(%r12), %rcx
	movl	(%rcx,%r14,4), %ebx
	addq	%rbx, %rax
	movq	_UINT_MAX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.40:                              ##   in Loop: Header=BB0_2 Depth=1
	incl	-60(%rbp)                       ## 4-byte Folded Spill
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	callq	_lag_decode_prob
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %eax
	movl	$256, %ecx                      ## imm = 0x100
	subl	%r13d, %ecx
	cmpl	%ecx, %eax
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jbe	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%ecx, -44(%rbp)
	movl	%ecx, %eax
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rax
	leaq	(%rax,%r14,4), %rcx
	addq	$4, %rcx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$0, (%rcx,%rax,4)
	incq	%rax
	cmpl	-44(%rbp), %eax
	jb	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	addl	%eax, %r14d
	movl	%r14d, %r13d
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	%r15d, %ebx
	cmpl	$255, %r13d
	jg	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movslq	%r13d, %r14
	incl	%r13d
	leaq	4(,%r14,4), %rsi
	incq	%r14
	addq	(%r12), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_lag_decode_prob
	movl	%ebx, %r15d
	testq	%rax, %rax
	jns	LBB0_2
LBB0_4:
	movl	12(%r12), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_5
LBB0_3:
	movl	12(%r12), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_5
LBB0_17:
	testl	%ebx, %ebx
	je	LBB0_18
## %bb.19:
	cmpl	$1, -60(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_22
## %bb.20:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	$32, %esi
	callq	_show_bits_long
	testl	$16777215, %eax                 ## imm = 0xFFFFFF
	jne	LBB0_21
LBB0_22:
	movl	%ebx, %edi
	callq	_av_log2
	movl	%eax, %r14d
	leal	-1(%rbx), %eax
	testl	%eax, %ebx
	jne	LBB0_24
## %bb.23:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rdx
LBB0_37:
	movl	%r14d, 8(%rdi)
	movl	(%rdx), %ecx
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_38:                                ## =>This Inner Loop Header: Depth=1
	addl	4(%rdx,%rsi,4), %ecx
	movl	%ecx, 4(%rdx,%rsi,4)
	addl	8(%rdx,%rsi,4), %ecx
	movl	%ecx, 8(%rdx,%rsi,4)
	addl	12(%rdx,%rsi,4), %ecx
	movl	%ecx, 12(%rdx,%rsi,4)
	addl	16(%rdx,%rsi,4), %ecx
	movl	%ecx, 16(%rdx,%rsi,4)
	addq	$4, %rsi
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_38
	jmp	LBB0_39
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	12(%rax), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_5
LBB0_18:
	movl	12(%r12), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_5:
	callq	_av_log
	movl	$-1, %eax
LBB0_39:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movl	%ebx, %edi
	callq	_softfloat_reciprocal
	movq	%rax, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%rdx,%rbx,4), %edi
	movq	%r15, %rsi
	callq	_softfloat_mul
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	movl	%eax, 4(%rdx,%rbx,4)
	addl	%eax, %r12d
	incq	%rbx
	cmpq	$128, %rbx
	jne	LBB0_25
## %bb.26:
	testl	%r12d, %r12d
	je	LBB0_41
## %bb.27:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movl	516(%rdx,%rbx,4), %edi
	movq	%r15, %rsi
	callq	_softfloat_mul
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rdx
	movl	%eax, 516(%rdx,%rbx,4)
	addl	%eax, %r12d
	incq	%rbx
	cmpq	$128, %rbx
	jne	LBB0_28
## %bb.29:
	incl	%r14d
	cmpl	$32, %r14d
	jae	LBB0_21
## %bb.30:
	movl	$1, %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	subl	%r12d, %eax
	jae	LBB0_32
## %bb.31:
	movl	12(%rdi), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_5
LBB0_41:
	movl	12(%rcx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	callq	_av_log
LBB0_21:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_39
LBB0_32:
	je	LBB0_37
## %bb.33:
	movl	$1, %ecx
	jmp	LBB0_34
LBB0_36:                                ##   in Loop: Header=BB0_34 Depth=1
	andl	$127, %ecx
	incl	%ecx
	testl	%eax, %eax
	je	LBB0_37
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	movl	%ecx, %ecx
	movl	(%rdx,%rcx,4), %esi
	testl	%esi, %esi
	je	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=1
	incl	%esi
	movl	%esi, (%rdx,%rcx,4)
	decl	%eax
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.comm	_UINT_MAX,8,3                   ## @UINT_MAX
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid probability encountered.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Integer overflow encountered in cumulative probability calculation.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Invalid probability run encountered.\n"

L_.str.3:                               ## @.str.3
	.asciz	"All probabilities are 0!\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.4:                               ## @.str.4
	.asciz	"Scaled probabilities invalid\n"

L_.str.5:                               ## @.str.5
	.asciz	"Scaled probabilities are larger than target!\n"

	.no_dead_strip	_lag_read_prob_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lag_read_prob_header
_lag_read_prob_header:                  ; @lag_read_prob_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x1
	mov	x19, x0
	ldr	x8, [x0]
	str	wzr, [x8]
Lloh0:
	adrp	x22, _UINT_MAX@GOTPAGE
Lloh1:
	ldr	x22, [x22, _UINT_MAX@GOTPAGEOFF]
	ldr	x9, [x22]
	str	w9, [x8, #1028]
	add	x1, x8, #4
	mov	x0, x21
	bl	_lag_decode_prob
	tbnz	x0, #63, LBB0_14
; %bb.1:
	mov	w20, #0
	mov	w23, #0
	mov	w25, #1
	mov	w24, #256
	mov	x26, x25
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x8, [x19]
	ldr	w27, [x8, x25, lsl #2]
	add	x8, x27, w20, uxtw
	ldr	x9, [x22]
	cmp	x8, x9
	b.gt	LBB0_15
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	w27, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w23, #1
	b	LBB0_12
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x1, sp, #12
	mov	x0, x21
	bl	_lag_decode_prob
	cbnz	x0, LBB0_24
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [sp, #12]
	sub	w9, w24, w26
	cmp	w8, w9
	b.ls	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	str	w9, [sp, #12]
	mov	x8, x9
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	cbz	w8, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x8, #0
	ldr	x9, [x19]
	add	x9, x9, x25, lsl #2
	add	x9, x9, #4
LBB0_10:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	str	wzr, [x9, x8, lsl #2]
	ldr	w10, [sp, #12]
	add	x8, x8, #1
	cmp	w8, w10
	b.lo	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w26, w25, w8
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w20, w27, w20
	cmp	w26, #255
	b.gt	LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_2 Depth=1
	add	w26, w26, #1
	ldr	x8, [x19]
	sxtw	x25, w26
	add	x1, x8, w26, sxtw #2
	mov	x0, x21
	bl	_lag_decode_prob
	tbz	x0, #63, LBB0_2
LBB0_14:
	ldr	w0, [x19, #12]
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_26
LBB0_15:
	ldr	w0, [x19, #12]
Lloh7:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x2, l_.str.1@PAGE
Lloh11:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_26
LBB0_16:
	cbz	w20, LBB0_25
; %bb.17:
	cmp	w23, #1
	b.ne	LBB0_19
; %bb.18:
	mov	x0, x21
	mov	w1, #32
	bl	_show_bits_long
	tst	w0, #0xffffff
	b.ne	LBB0_37
LBB0_19:
	mov	x0, x20
	bl	_av_log2
	mov	x21, x0
	sub	w8, w20, #1
	tst	w20, w8
	b.ne	LBB0_28
; %bb.20:
	ldr	x8, [x19]
LBB0_21:
	mov	x9, #0
	str	w21, [x19, #8]
	ldr	w10, [x8], #4
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8, x9]
	add	w10, w11, w10
	str	w10, [x8, x9]
	add	x9, x9, #4
	cmp	x9, #1024
	b.ne	LBB0_22
; %bb.23:
	mov	w0, #0
	b	LBB0_27
LBB0_24:
	ldr	w0, [x19, #12]
Lloh12:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_26
LBB0_25:
	ldr	w0, [x19, #12]
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.3@PAGE
Lloh21:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_26:
	bl	_av_log
	mov	w0, #-1
LBB0_27:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_28:
	mov	x0, x20
	bl	_softfloat_reciprocal
	mov	x20, x0
	mov	w22, #0
	ldr	x8, [x19]
	mov	w23, #4
LBB0_29:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x8, x23]
	mov	x1, x20
	bl	_softfloat_mul
	ldr	x8, [x19]
	str	w0, [x8, x23]
	add	w22, w22, w0
	add	x23, x23, #4
	cmp	x23, #516
	b.ne	LBB0_29
; %bb.30:
	cbz	w22, LBB0_36
; %bb.31:
	mov	w23, #516
LBB0_32:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x8, x23]
	mov	x1, x20
	bl	_softfloat_mul
	ldr	x8, [x19]
	str	w0, [x8, x23]
	add	w22, w22, w0
	add	x23, x23, #4
	cmp	x23, #1028
	b.ne	LBB0_32
; %bb.33:
	add	w21, w21, #1
	cmp	w21, #32
	b.hs	LBB0_37
; %bb.34:
	mov	w9, #1
	lsl	w9, w9, w21
	subs	w9, w9, w22
	b.hs	LBB0_38
; %bb.35:
	ldr	w0, [x19, #12]
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.5@PAGE
Lloh26:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_26
LBB0_36:
	ldr	w0, [x19, #12]
Lloh27:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x2, l_.str.4@PAGE
Lloh31:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_av_log
LBB0_37:
Lloh32:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh33:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	b	LBB0_27
LBB0_38:
	b.eq	LBB0_21
; %bb.39:
	mov	w10, #1
	b	LBB0_41
LBB0_40:                                ;   in Loop: Header=BB0_41 Depth=1
	and	w10, w10, #0x7f
	add	w10, w10, #1
	cbz	w9, LBB0_21
LBB0_41:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8, w10, uxtw #2]
	mov	w10, w10
	cbz	w11, LBB0_40
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=1
	add	w11, w11, #1
	str	w11, [x8, x10, lsl #2]
	sub	w9, w9, #1
	b	LBB0_40
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_UINT_MAX,8,3                   ; @UINT_MAX
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid probability encountered.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Integer overflow encountered in cumulative probability calculation.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Invalid probability run encountered.\n"

l_.str.3:                               ; @.str.3
	.asciz	"All probabilities are 0!\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.4:                               ; @.str.4
	.asciz	"Scaled probabilities invalid\n"

l_.str.5:                               ; @.str.5
	.asciz	"Scaled probabilities are larger than target!\n"

	.no_dead_strip	_lag_read_prob_header
.subsections_via_symbols
