	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_read_random_index_pack
_mxf_read_random_index_pack:            ## @mxf_read_random_index_pack
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_12
## %bb.1:
	movq	8(%rbx), %r12
	callq	_avio_size
	movl	%eax, %r14d
	subl	(%r12), %eax
	cltq
	imulq	$-1677082467, %rax, %rcx        ## imm = 0x9C09C09D
	shrq	$32, %rcx
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$6, %eax
	addl	%ecx, %eax
	leal	(%rax,%rax,2), %eax
	leal	28(,%rax,4), %edi
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_FFMIN
	movl	%eax, %r15d
	movq	(%rbx), %rdi
	leal	-4(%r14), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_avio_seek
	movq	(%rbx), %rdi
	callq	_avio_rb32
	cmpl	$45, %eax
	jl	LBB0_11
## %bb.2:
	cmpl	%r15d, %eax
	jg	LBB0_11
## %bb.3:
	movq	(%rbx), %rdi
	movl	%r14d, %esi
	subl	%eax, %esi
	movl	(%r13), %edx
	callq	_avio_seek
	movq	(%rbx), %rsi
	leaq	-56(%rbp), %rdi
	callq	_klv_read_packet
	testq	%rax, %rax
	js	LBB0_11
## %bb.4:
	movl	-48(%rbp), %edi
	movq	_mxf_random_index_pack_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IS_KLV_KEY
	testl	%eax, %eax
	je	LBB0_11
## %bb.5:
	cmpl	%r14d, -56(%rbp)
	jne	LBB0_8
## %bb.6:
	movl	-52(%rbp), %esi
	cmpl	$5, %esi
	jl	LBB0_8
## %bb.7:
	imull	$-1431655765, %esi, %eax        ## imm = 0xAAAAAAAB
	addl	$1431655764, %eax               ## imm = 0x55555554
	rorl	$2, %eax
	cmpl	$357913942, %eax                ## imm = 0x15555556
	jb	LBB0_9
LBB0_8:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
LBB0_11:
	movq	(%rbx), %rdi
	movl	(%r12), %esi
	movl	(%r13), %edx
	callq	_avio_seek
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	(%rbx), %rdi
	addl	$-12, %esi
	callq	_avio_skip
	movq	(%rbx), %rdi
	callq	_avio_rb64
	movl	%eax, 4(%r12)
	addl	(%r12), %eax
	cmpl	%r14d, %eax
	jl	LBB0_11
## %bb.10:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movl	$0, 4(%r12)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_mxf_random_index_pack_key,4,2  ## @mxf_random_index_pack_key
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid RIP KLV length\n"

L_.str.1:                               ## @.str.1
	.asciz	"bad FooterPartition in RIP - ignoring\n"

	.no_dead_strip	_mxf_read_random_index_pack
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_read_random_index_pack
_mxf_read_random_index_pack:            ; @mxf_read_random_index_pack
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x0, [x0]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.1:
	ldr	x22, [x19, #8]
	bl	_avio_size
	mov	x20, x0
	ldr	w8, [x22]
	mov	w9, #49309
	movk	w9, #39945, lsl #16
	sub	w8, w0, w8
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w8, w9, w8
	asr	w9, w8, #6
	add	w8, w9, w8, lsr #31
	mov	w9, #12
	orr	w10, wzr, #0x1c
	madd	w0, w8, w9, w10
Lloh3:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_FFMIN
	mov	x21, x0
	ldr	x0, [x19]
	sub	w1, w20, #4
Lloh6:
	adrp	x23, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x23, [x23, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_avio_seek
	ldr	x0, [x19]
	bl	_avio_rb32
	cmp	w0, #45
	b.lt	LBB0_9
; %bb.2:
	cmp	w0, w21
	b.gt	LBB0_9
; %bb.3:
	ldr	x8, [x19]
	sub	w1, w20, w0
	ldr	w2, [x23]
	mov	x0, x8
	bl	_avio_seek
	ldr	x1, [x19]
	mov	x0, sp
	bl	_klv_read_packet
	tbnz	x0, #63, LBB0_9
; %bb.4:
	ldr	w0, [sp, #8]
Lloh8:
	adrp	x8, _mxf_random_index_pack_key@GOTPAGE
Lloh9:
	ldr	x8, [x8, _mxf_random_index_pack_key@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_IS_KLV_KEY
	cbz	w0, LBB0_9
; %bb.5:
	ldr	w8, [sp]
	cmp	w8, w20
	b.ne	LBB0_8
; %bb.6:
	ldr	w8, [sp, #4]
	cmp	w8, #5
	b.lt	LBB0_8
; %bb.7:
	sub	w9, w8, #4
	mov	w10, #43691
	movk	w10, #43690, lsl #16
	mul	w9, w9, w10
	ror	w9, w9, #2
	mov	w10, #21846
	movk	w10, #5461, lsl #16
	cmp	w9, w10
	b.lo	LBB0_11
LBB0_8:
Lloh11:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_9:
	ldr	x0, [x19]
	ldr	w1, [x22]
	ldr	w2, [x23]
	bl	_avio_seek
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	x0, [x19]
	sub	w1, w8, #12
	bl	_avio_skip
	ldr	x0, [x19]
	bl	_avio_rb64
	str	w0, [x22, #4]
	ldr	w8, [x22]
	add	w8, w8, w0
	cmp	w8, w20
	b.lt	LBB0_9
; %bb.12:
Lloh16:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	str	wzr, [x22, #4]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_mxf_random_index_pack_key,4,2  ; @mxf_random_index_pack_key
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid RIP KLV length\n"

l_.str.1:                               ; @.str.1
	.asciz	"bad FooterPartition in RIP - ignoring\n"

	.no_dead_strip	_mxf_read_random_index_pack
.subsections_via_symbols
