	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_handle_missing_index_segment
_mxf_handle_missing_index_segment:      ## @mxf_handle_missing_index_segment
	.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	24(%rsi), %r13
	xorl	%ebx, %ebx
	testq	%r13, %r13
	je	LBB0_29
## %bb.1:
	movq	(%r13), %rax
	movq	_ClipWrapped@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.2:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.3:
	movq	24(%r14), %rcx
	movq	_IndexTableSegment@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	xorl	%esi, %esi
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rdi
	cmpq	%rdx, (%rdi)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	8(%r13), %rdx
	jne	LBB0_6
	jmp	LBB0_28
LBB0_7:
	movl	4(%r14), %r9d
	testl	%r9d, %r9d
	jle	LBB0_29
## %bb.8:
	movq	16(%r14), %r8
	movq	8(%r13), %rdx
	cmpl	$1, %r9d
	jne	LBB0_10
## %bb.9:
	xorl	%edi, %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	jmp	LBB0_12
LBB0_10:
	movl	%r9d, %r10d
	andl	$-2, %r10d
	leaq	16(%r8), %rbx
	xorl	%edi, %edi
	xorl	%eax, %eax
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	xorl	%ecx, %ecx
	cmpq	%rdx, -16(%rbx)
	leaq	-16(%rbx), %r12
	sete	%cl
	cmovneq	%rax, %r12
	addl	%esi, %ecx
	xorl	%esi, %esi
	cmpq	%rdx, (%rbx)
	sete	%sil
	cmoveq	%rbx, %r12
	addl	%ecx, %esi
	addq	$2, %rdi
	addq	$32, %rbx
	movq	%r12, %rax
	cmpq	%rdi, %r10
	jne	LBB0_11
LBB0_12:
	testb	$1, %r9b
	je	LBB0_14
## %bb.13:
	shlq	$4, %rdi
	leaq	(%r8,%rdi), %rax
	xorl	%ecx, %ecx
	cmpq	%rdx, (%r8,%rdi)
	sete	%cl
	cmoveq	%rax, %r12
	addl	%ecx, %esi
LBB0_14:
	cmpl	$1, %esi
	jne	LBB0_28
## %bb.15:
	movq	16(%r15), %rax
	movq	(%rax), %rcx
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_18
## %bb.16:
	movl	12(%rax), %edi
	callq	_is_pcm
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	16(%r15), %rax
	movl	12(%rax), %edi
	callq	_av_get_bits_per_sample
	movq	16(%r15), %rcx
	imull	8(%rcx), %eax
	sarl	$3, %eax
	jmp	LBB0_21
LBB0_18:
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_28
## %bb.19:
	movl	8(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_28
## %bb.20:
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	divl	%ecx
	testl	%edx, %edx
	jne	LBB0_29
LBB0_21:
	testl	%eax, %eax
	jle	LBB0_28
## %bb.22:
	movl	8(%r14), %edi
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	8(%r15), %ecx
	leaq	L_.str(%rip), %rdx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %r8d
	callq	_av_log
	movl	$48, %edi
	callq	_av_mallocz
	movq	%rax, -56(%rbp)
	testq	%rax, %rax
	je	LBB0_30
## %bb.23:
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%rax, %r14
	callq	_mxf_add_metadata_set
	testl	%eax, %eax
	je	LBB0_25
## %bb.24:
	movl	%eax, %ebx
	leaq	-56(%rbp), %rdi
	movl	$1, %esi
	callq	_mxf_free_metadataset
	jmp	LBB0_29
LBB0_30:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_25:
	movq	%r14, %rcx
	cmpq	$0, 16(%r13)
	jne	LBB0_27
## %bb.26:
	movq	8(%r13), %rax
	movq	%rax, 16(%r13)
LBB0_27:
	movq	_IndexTableSegment@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rcx, %rbx
	movq	%rax, 40(%rcx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%rcx)
	movq	$0, 32(%rcx)
	movl	(%r15), %eax
	movl	%eax, 12(%rcx)
	movl	4(%r15), %edi
	callq	_av_inv_q
	movl	%eax, 24(%rbx)
	movq	16(%r13), %rax
	movq	%rax, 16(%rbx)
	movq	(%r12), %rax
	movq	%rax, (%rbx)
LBB0_28:
	xorl	%ebx, %ebx
LBB0_29:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ClipWrapped,8,3                ## @ClipWrapped
	.comm	_IndexTableSegment,8,3          ## @IndexTableSegment
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"guessing index for stream %d using edit unit byte count %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mxf_handle_missing_index_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_handle_missing_index_segment
_mxf_handle_missing_index_segment:      ; @mxf_handle_missing_index_segment
	.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
	ldr	x23, [x1, #24]
	cbz	x23, LBB0_21
; %bb.1:
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _ClipWrapped@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ClipWrapped@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.2:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	ldr	x9, [x20, #24]
Lloh3:
	adrp	x10, _IndexTableSegment@GOTPAGE
Lloh4:
	ldr	x10, [x10, _IndexTableSegment@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x9, x9, #8
	subs	x8, x8, #1
	b.eq	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	ldr	x11, [x11]
	cmp	x11, x10
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x11, [x23, #8]
	cmp	x10, x11
	b.ne	LBB0_4
	b	LBB0_21
LBB0_7:
	ldr	w8, [x20, #4]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.8:
	mov	x24, #0
	mov	w9, #0
	ldr	x11, [x20, #16]
	ldr	x10, [x23, #8]
	mov	x12, x11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x12], #16
	cmp	x13, x10
	csel	x24, x11, x24, eq
	cinc	w9, w9, eq
	mov	x11, x12
	subs	x8, x8, #1
	b.ne	LBB0_9
; %bb.10:
	cmp	w9, #1
	b.ne	LBB0_21
; %bb.11:
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
Lloh6:
	adrp	x10, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_14
; %bb.12:
	ldr	w0, [x8, #12]
	bl	_is_pcm
	cbz	x0, LBB0_14
; %bb.13:
	ldr	x8, [x19, #16]
	ldr	w0, [x8, #12]
	bl	_av_get_bits_per_sample
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	mul	w8, w8, w0
	asr	w21, w8, #3
	b	LBB0_17
LBB0_14:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.15:
	ldr	w9, [x24, #8]
	cmp	w9, #1
	b.lt	LBB0_21
; %bb.16:
	udiv	w21, w9, w8
	msub	w8, w21, w8, w9
	cbnz	w8, LBB0_21
LBB0_17:
	cmp	w21, #1
	b.lt	LBB0_21
; %bb.18:
	ldr	w0, [x20, #8]
Lloh9:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w3, [x19, #8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x4, x21
	bl	_av_log
	mov	w0, #48
	bl	_av_mallocz
	str	x0, [sp, #8]
	cbz	x0, LBB0_23
; %bb.19:
	mov	x22, x0
	mov	x0, x20
	mov	x1, x22
	bl	_mxf_add_metadata_set
	cbz	w0, LBB0_24
; %bb.20:
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #1
	bl	_mxf_free_metadataset
	b	LBB0_22
LBB0_21:
	mov	w20, #0
LBB0_22:
	mov	x0, x20
	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_23:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	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
	b	_AVERROR
LBB0_24:
	ldr	x8, [x23, #16]
	cbnz	x8, LBB0_26
; %bb.25:
	ldr	x8, [x23, #8]
	str	x8, [x23, #16]
LBB0_26:
Lloh17:
	adrp	x8, _IndexTableSegment@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IndexTableSegment@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	stp	xzr, x8, [x22, #32]
	ldp	w8, w0, [x19]
	stp	w21, w8, [x22, #8]
	bl	_av_inv_q
	mov	w20, #0
	str	w0, [x22, #24]
	ldr	x8, [x23, #16]
	str	x8, [x22, #16]
	ldr	x8, [x24]
	str	x8, [x22]
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ClipWrapped,8,3                ; @ClipWrapped
	.comm	_IndexTableSegment,8,3          ; @IndexTableSegment
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"guessing index for stream %d using edit unit byte count %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mxf_handle_missing_index_segment
.subsections_via_symbols
