	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function klv_decode_ber_length
_klv_decode_ber_length:                 ## @klv_decode_ber_length
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_avio_r8
	movl	%eax, %r15d
	movl	%eax, %ebx
	testb	$-128, %r15b
	je	LBB0_4
## %bb.1:
	andl	$127, %r15d
	cmpl	$8, %r15d
	ja	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	je	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	shll	$8, %ebx
	movq	%r14, %rdi
	callq	_avio_r8
	orl	%eax, %ebx
	decl	%r15d
	jne	LBB0_3
LBB0_4:
	movq	_INT64_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_6
LBB0_5:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_INT64_MAX,4,2                  ## @INT64_MAX
	.no_dead_strip	_klv_decode_ber_length
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function klv_decode_ber_length
_klv_decode_ber_length:                 ; @klv_decode_ber_length
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_avio_r8
	mov	x20, x0
	tbnz	w0, #7, LBB0_2
LBB0_1:
Lloh0:
	adrp	x8, _INT64_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT64_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _AVERROR_INVALIDDATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w20, w8
	csel	w0, w9, w20, gt
	b	LBB0_4
LBB0_2:
	and	w21, w20, #0x7f
	cmp	w21, #8
	b.ls	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	cbz	w21, LBB0_14
; %bb.6:
	mov	x0, x19
	bl	_avio_r8
	mov	x20, x0
	cmp	w21, #1
	b.eq	LBB0_1
; %bb.7:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #2
	b.eq	LBB0_1
; %bb.8:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #3
	b.eq	LBB0_1
; %bb.9:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #4
	b.eq	LBB0_1
; %bb.10:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #5
	b.eq	LBB0_1
; %bb.11:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #6
	b.eq	LBB0_1
; %bb.12:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	cmp	w21, #7
	b.eq	LBB0_1
; %bb.13:
	mov	x0, x19
	bl	_avio_r8
	orr	w20, w0, w20, lsl #8
	b	LBB0_1
LBB0_14:
	mov	w20, #0
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_INT64_MAX,4,2                  ; @INT64_MAX
	.no_dead_strip	_klv_decode_ber_length
.subsections_via_symbols
