	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function klv_read_packet
_klv_read_packet:                       ## @klv_read_packet
	.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	%rsi, %r15
	movq	%rdi, %r14
	movq	_mxf_klv_key@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_mxf_read_sync
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_avio_tell
	addq	$-4, %rax
	movq	%rax, 24(%r14)
	movq	16(%r14), %rdi
	movl	(%rbx), %esi
	movl	$4, %edx
	callq	_memcpy
	movq	16(%r14), %rsi
	addq	$4, %rsi
	movq	%r15, %rdi
	movl	$12, %edx
	callq	_avio_read
	movq	%r15, %rdi
	callq	_klv_decode_ber_length
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_5
## %bb.3:
	movq	%rbx, 8(%r14)
	movq	%r15, %rdi
	callq	_avio_tell
	movq	_INT64_MAX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	subq	%rbx, %rcx
	cmpq	%rcx, %rax
	jle	LBB0_4
LBB0_1:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_5
LBB0_4:
	addq	%rbx, %rax
	movq	%rax, (%r14)
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mxf_klv_key,4,2                ## @mxf_klv_key
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_INT64_MAX,8,3                  ## @INT64_MAX
	.no_dead_strip	_klv_read_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function klv_read_packet
_klv_read_packet:                       ; @klv_read_packet
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _mxf_klv_key@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mxf_klv_key@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #4
	bl	_mxf_read_sync
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_avio_tell
	sub	x8, x0, #4
	str	x8, [x19, #24]
	ldr	x0, [x19, #16]
	ldr	w1, [x21]
	mov	w2, #4
	bl	_memcpy
	ldr	x8, [x19, #16]
	add	x1, x8, #4
	mov	x0, x20
	mov	w2, #12
	bl	_avio_read
	mov	x0, x20
	bl	_klv_decode_ber_length
	mov	x21, x0
	tbnz	x0, #63, LBB0_5
; %bb.2:
	str	x21, [x19, #8]
	mov	x0, x20
	bl	_avio_tell
Lloh2:
	adrp	x8, _INT64_MAX@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INT64_MAX@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	sub	x8, x8, x21
	cmp	x0, x8
	b.le	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
	b	LBB0_5
LBB0_4:
	add	x8, x0, x21
	mov	w21, #0
	str	x8, [x19]
LBB0_5:
	mov	x0, x21
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_mxf_klv_key,4,2                ; @mxf_klv_key
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_INT64_MAX,8,3                  ; @INT64_MAX
	.no_dead_strip	_klv_read_packet
.subsections_via_symbols
