	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_add_metadata_stream
_mxf_add_metadata_stream:               ## @mxf_add_metadata_stream
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rsi), %rax
	cmpl	$0, (%rax)
	jle	LBB0_9
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r12
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rsi
	addq	%r14, %rsi
	movq	%r12, %rdi
	callq	_mxf_resolve_sourceclip
	testq	%rax, %rax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	(%r15), %rax
	movslq	(%rax), %rcx
	addq	$4, %r14
	cmpq	%rcx, %rbx
	jl	LBB0_3
	jmp	LBB0_9
LBB0_4:
	movq	%rax, %r13
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	%rax, %r14
	movq	_AVMEDIA_TYPE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	movl	%eax, 4(%rcx)
	movq	_AV_CODEC_ID_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movl	16(%r15), %eax
	movl	%eax, 4(%r14)
	leaq	-44(%rbp), %rdi
	movl	4(%r13), %esi
	movl	$16, %edx
	callq	_memcpy
	movl	(%r13), %esi
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_memcpy
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_mxf_add_umid_metadata
	movq	8(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.6:
	cmpq	$0, (%rdx)
	je	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_av_dict_set
LBB0_8:
	movq	_ff_mxf_data_definition_uls@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	$4, %rsi
	callq	_mxf_get_codec_ul
	movl	(%rax), %edi
	callq	_av_get_media_type_string
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_av_dict_set
LBB0_9:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r12), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate metadata stream\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_DATA,4,2          ## @AVMEDIA_TYPE_DATA
	.comm	_AV_CODEC_ID_NONE,4,2           ## @AV_CODEC_ID_NONE
L_.str.1:                               ## @.str.1
	.asciz	"file_package_umid"

L_.str.2:                               ## @.str.2
	.asciz	"track_name"

	.comm	_ff_mxf_data_definition_uls,4,2 ## @ff_mxf_data_definition_uls
L_.str.3:                               ## @.str.3
	.asciz	"data_type"

	.no_dead_strip	_mxf_add_metadata_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_add_metadata_stream
_mxf_add_metadata_stream:               ; @mxf_add_metadata_stream
	.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	x8, [x1]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x19, x1
	mov	x21, x0
	mov	x20, #0
	mov	x23, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	add	x1, x8, x20
	mov	x0, x21
	bl	_mxf_resolve_sourceclip
	cbnz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x23, x23, #1
	ldr	x8, [x19]
	ldrsw	x9, [x8]
	add	x20, x20, #4
	cmp	x23, x9
	b.lt	LBB0_2
	b	LBB0_9
LBB0_4:
	mov	x22, x0
	ldr	w0, [x21]
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_10
; %bb.5:
	mov	x20, x0
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _AV_CODEC_ID_NONE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	ldr	w8, [x19, #16]
	str	w8, [x0, #4]
	add	x8, sp, #8
	orr	x0, x8, #0x4
	ldr	w1, [x22, #4]
	mov	w2, #16
	bl	_memcpy
	ldr	w1, [x22]
	add	x0, sp, #8
	mov	w2, #16
	bl	_memcpy
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	x0, x20
	bl	_mxf_add_umid_metadata
	ldr	x2, [x19, #8]
	cbz	x2, LBB0_8
; %bb.6:
	ldr	x8, [x2]
	cbz	x8, LBB0_8
; %bb.7:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	mov	w3, #0
	bl	_av_dict_set
LBB0_8:
Lloh10:
	adrp	x8, _ff_mxf_data_definition_uls@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ff_mxf_data_definition_uls@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	x8, [x19]
	add	x1, x8, #4
	bl	_mxf_get_codec_ul
	ldr	w0, [x0]
	bl	_av_get_media_type_string
	mov	x2, x0
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	w3, #0
	bl	_av_dict_set
LBB0_9:
	mov	w0, #0
	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_10:
	ldr	w0, [x21]
Lloh15:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x2, l_.str@PAGE
Lloh19:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	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
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate metadata stream\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_DATA,4,2          ; @AVMEDIA_TYPE_DATA
	.comm	_AV_CODEC_ID_NONE,4,2           ; @AV_CODEC_ID_NONE
l_.str.1:                               ; @.str.1
	.asciz	"file_package_umid"

l_.str.2:                               ; @.str.2
	.asciz	"track_name"

	.comm	_ff_mxf_data_definition_uls,4,2 ; @ff_mxf_data_definition_uls
l_.str.3:                               ; @.str.3
	.asciz	"data_type"

	.no_dead_strip	_mxf_add_metadata_stream
.subsections_via_symbols
