	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_packet
_mxf_write_packet:                      ## @mxf_write_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	24(%rdi), %r14
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rcx
	movq	(%rax,%rcx,8), %r12
	movq	16(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	cmpq	$0, 32(%r14)
	jne	LBB0_4
## %bb.1:
	cmpq	$0, 24(%r14)
	jne	LBB0_4
## %bb.2:
	movl	(%r14), %ecx
	movq	_EDIT_UNITS_PER_BODY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	LBB0_4
## %bb.3:
	leaq	16(%r14), %rdi
	addl	%ecx, %esi
	movl	$16, %edx
	callq	_av_reallocp_array
	testl	%eax, %eax
	js	LBB0_54
LBB0_4:
	movq	8(%r12), %rax
	movq	(%rax), %rax
	movq	_AV_CODEC_ID_MPEG2VIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	leaq	-56(%rbp), %rcx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_parse_mpeg2_frame
	testl	%eax, %eax
	jne	LBB0_18
## %bb.6:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_57
LBB0_7:
	movq	_AV_CODEC_ID_DNXHD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_parse_dnxhd_frame
	testl	%eax, %eax
	jne	LBB0_18
## %bb.9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_57
LBB0_10:
	movq	_AV_CODEC_ID_PRORES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.11:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_parse_prores_frame
	testl	%eax, %eax
	jne	LBB0_18
## %bb.12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_57
LBB0_13:
	movq	_AV_CODEC_ID_DVVIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.14:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_parse_dv_frame
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_57
LBB0_16:
	movq	_AV_CODEC_ID_H264@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.17:
	leaq	-56(%rbp), %rcx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_parse_h264_frame
	testl	%eax, %eax
	je	LBB0_56
LBB0_18:
	cmpq	$0, 32(%r14)
	je	LBB0_24
## %bb.19:
	movl	8(%r15), %r8d
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r9d
	cmpl	%r9d, %r8d
	je	LBB0_22
## %bb.20:
	movq	8(%r12), %rax
	movq	8(%rax), %rax
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
## %bb.21:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %ecx
	leaq	L_.str.6(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_58
LBB0_22:
	cmpl	$0, 4(%r14)
	jne	LBB0_24
## %bb.23:
	movq	%r13, %rdi
	callq	_mxf_compute_edit_unit_byte_count
LBB0_24:
	movq	(%r13), %rax
	cmpq	_ff_mxf_opatom_muxer@GOTPCREL(%rip), %rax
	je	LBB0_29
## %bb.25:
	cmpl	$0, 4(%r14)
	jne	LBB0_32
## %bb.26:
	cmpq	$0, 24(%r14)
	movq	_header_open_partition_key@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	je	LBB0_30
## %bb.27:
	movl	$1, %esi
	movl	$2, %edx
	movl	$1, %r8d
	callq	_mxf_write_partition
	testl	%eax, %eax
	js	LBB0_53
## %bb.28:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	%r13, %rdi
	callq	_mxf_write_index_table_segment
	jmp	LBB0_31
LBB0_29:
	leaq	-56(%rbp), %rdx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_mxf_write_opatom_packet
	movl	%eax, %ebx
	jmp	LBB0_59
LBB0_30:
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_mxf_write_partition
	testl	%eax, %eax
	js	LBB0_53
LBB0_31:
	movl	$1, 4(%r14)
LBB0_32:
	movl	(%r12), %eax
	movq	24(%r14), %rcx
	testl	%eax, %eax
	je	LBB0_37
## %bb.33:
	testq	%rcx, %rcx
	jne	LBB0_47
## %bb.34:
	cmpl	$1, %eax
	jne	LBB0_47
## %bb.35:
	movslq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_52
## %bb.36:
	movl	8(%r14), %ecx
	movq	16(%r14), %rdx
	shlq	$4, %rax
	subl	-16(%rax,%rdx), %ecx
	movl	%ecx, -8(%rax,%rdx)
	jmp	LBB0_47
LBB0_37:
	testq	%rcx, %rcx
	jne	LBB0_43
## %bb.38:
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_40
## %bb.39:
	movq	_EDIT_UNITS_PER_BODY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_43
LBB0_40:
	testb	$51, -56(%rbp)
	jne	LBB0_43
## %bb.41:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	_body_partition_key@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$2, %edx
	xorl	%r8d, %r8d
	callq	_mxf_write_partition
	testl	%eax, %eax
	js	LBB0_53
## %bb.42:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	%r13, %rdi
	callq	_mxf_write_index_table_segment
LBB0_43:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	%r13, %rdi
	callq	_mxf_write_system_item
	cmpq	$0, 24(%r14)
	je	LBB0_45
## %bb.44:
	movl	(%r14), %eax
	jmp	LBB0_46
LBB0_53:
	movl	%eax, %ebx
	jmp	LBB0_59
LBB0_45:
	movl	8(%r14), %ecx
	movq	16(%r14), %rdx
	movslq	(%r14), %rax
	movq	%rax, %rsi
	shlq	$4, %rsi
	movl	%ecx, (%rdx,%rsi)
	movl	-56(%rbp), %edi
	movl	%edi, 4(%rdx,%rsi)
	movl	-52(%rbp), %edi
	movl	%edi, 12(%rdx,%rsi)
	movq	_KAG_SIZE@GOTPCREL(%rip), %rdx
	addl	(%rdx), %ecx
	movl	%ecx, 8(%r14)
LBB0_46:
	incl	%eax
	movl	%eax, (%r14)
LBB0_47:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$16, %edx
	callq	_avio_write
	movq	(%r13), %rax
	cmpq	_ff_mxf_d10_muxer@GOTPCREL(%rip), %rax
	jne	LBB0_50
## %bb.48:
	movq	8(%r12), %rax
	movq	8(%rax), %rax
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_50
## %bb.49:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_mxf_write_d10_audio_packet
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_51
LBB0_50:
	movl	8(%r15), %esi
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_klv_encode_ber4_length
	movl	8(%r15), %edx
	movl	12(%r15), %esi
	movq	%r12, %rdi
	callq	_avio_write
	movl	8(%r15), %ebx
	leal	20(%rbx), %edi
	callq	_klv_fill_size
                                        ## kill: def $eax killed $eax def $rax
	addl	%ebx, %eax
	addl	$20, %eax
	addl	%eax, 8(%r14)
LBB0_51:
	movq	%r12, %rdi
	callq	_avio_flush
	xorl	%ebx, %ebx
	jmp	LBB0_59
LBB0_52:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.7(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_59
LBB0_54:
	movl	%eax, %ebx
	movl	$0, (%r14)
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_59
LBB0_56:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdx
LBB0_57:
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_58:
	movl	$-1, %ebx
LBB0_59:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EDIT_UNITS_PER_BODY,4,2        ## @EDIT_UNITS_PER_BODY
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate index entries\n"

	.comm	_AV_CODEC_ID_MPEG2VIDEO,8,3     ## @AV_CODEC_ID_MPEG2VIDEO
L_.str.1:                               ## @.str.1
	.asciz	"could not get mpeg2 profile and level\n"

	.comm	_AV_CODEC_ID_DNXHD,8,3          ## @AV_CODEC_ID_DNXHD
L_.str.2:                               ## @.str.2
	.asciz	"could not get dnxhd profile\n"

	.comm	_AV_CODEC_ID_PRORES,8,3         ## @AV_CODEC_ID_PRORES
L_.str.3:                               ## @.str.3
	.asciz	"could not get prores profile\n"

	.comm	_AV_CODEC_ID_DVVIDEO,8,3        ## @AV_CODEC_ID_DVVIDEO
L_.str.4:                               ## @.str.4
	.asciz	"could not get dv profile\n"

	.comm	_AV_CODEC_ID_H264,8,3           ## @AV_CODEC_ID_H264
L_.str.5:                               ## @.str.5
	.asciz	"could not get h264 profile\n"

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
L_.str.6:                               ## @.str.6
	.asciz	"track %d: frame size does not match index unit size, %d != %d\n"

	.comm	_ff_mxf_opatom_muxer,4,2        ## @ff_mxf_opatom_muxer
	.comm	_header_open_partition_key,4,2  ## @header_open_partition_key
	.comm	_body_partition_key,4,2         ## @body_partition_key
	.comm	_KAG_SIZE,4,2                   ## @KAG_SIZE
L_.str.7:                               ## @.str.7
	.asciz	"No packets in first stream\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_ff_mxf_d10_muxer,4,2           ## @ff_mxf_d10_muxer
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.no_dead_strip	_mxf_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_write_packet
_mxf_write_packet:                      ; @mxf_write_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
	ldp	x20, x24, [x0, #16]
	ldr	x8, [x0, #8]
	ldr	x9, [x1]
	ldr	x22, [x8, x9, lsl #3]
	ldr	x25, [x22, #16]
	str	wzr, [sp, #40]
	str	xzr, [sp, #32]
	ldr	x8, [x24, #32]
	cbnz	x8, LBB0_4
; %bb.1:
	ldr	x8, [x24, #24]
	cbnz	x8, LBB0_4
; %bb.2:
	ldr	w8, [x24]
Lloh0:
	adrp	x9, _EDIT_UNITS_PER_BODY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _EDIT_UNITS_PER_BODY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w10, w8, w9
	msub	w10, w10, w9, w8
	cbnz	w10, LBB0_4
; %bb.3:
	add	x0, x24, #16
	add	w1, w9, w8
	mov	w2, #16
	bl	_av_reallocp_array
	tbnz	w0, #31, LBB0_56
LBB0_4:
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _AV_CODEC_ID_MPEG2VIDEO@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_CODEC_ID_MPEG2VIDEO@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	add	x3, sp, #32
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_parse_mpeg2_frame
	cbnz	w0, LBB0_18
; %bb.6:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str.1@PAGE
Lloh10:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_7:
Lloh11:
	adrp	x9, _AV_CODEC_ID_DNXHD@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AV_CODEC_ID_DNXHD@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_parse_dnxhd_frame
	cbnz	w0, LBB0_18
; %bb.9:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str.2@PAGE
Lloh18:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_22
LBB0_10:
Lloh19:
	adrp	x9, _AV_CODEC_ID_PRORES@GOTPAGE
Lloh20:
	ldr	x9, [x9, _AV_CODEC_ID_PRORES@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_parse_prores_frame
	cbnz	w0, LBB0_18
; %bb.12:
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.3@PAGE
Lloh26:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_22
LBB0_13:
Lloh27:
	adrp	x9, _AV_CODEC_ID_DVVIDEO@GOTPAGE
Lloh28:
	ldr	x9, [x9, _AV_CODEC_ID_DVVIDEO@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.14:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_parse_dv_frame
	cbnz	w0, LBB0_18
; %bb.15:
Lloh30:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x2, l_.str.4@PAGE
Lloh34:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_22
LBB0_16:
Lloh35:
	adrp	x9, _AV_CODEC_ID_H264@GOTPAGE
Lloh36:
	ldr	x9, [x9, _AV_CODEC_ID_H264@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.17:
	add	x3, sp, #32
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_parse_h264_frame
	cbz	w0, LBB0_57
LBB0_18:
	ldr	x8, [x24, #32]
	cbz	x8, LBB0_25
; %bb.19:
	ldr	w8, [x21, #8]
	ldr	w9, [x25]
	cmp	w8, w9
	b.eq	LBB0_23
; %bb.20:
	ldr	x10, [x22, #8]
	ldr	x10, [x10, #8]
Lloh38:
	adrp	x11, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh39:
	ldr	x11, [x11, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh40:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_23
; %bb.21:
Lloh41:
	adrp	x10, _AV_LOG_ERROR@GOTPAGE
Lloh42:
	ldr	x10, [x10, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x10]
	ldr	w10, [x22]
	stp	x8, x9, [sp, #8]
	str	x10, [sp]
Lloh44:
	adrp	x2, l_.str.6@PAGE
Lloh45:
	add	x2, x2, l_.str.6@PAGEOFF
LBB0_22:
	mov	x0, x19
	bl	_av_log
	mov	w23, #-1
	b	LBB0_54
LBB0_23:
	ldr	w8, [x24, #4]
	cbnz	w8, LBB0_25
; %bb.24:
	mov	x0, x19
	bl	_mxf_compute_edit_unit_byte_count
LBB0_25:
	ldr	x8, [x19]
Lloh46:
	adrp	x9, _ff_mxf_opatom_muxer@GOTPAGE
Lloh47:
	ldr	x9, [x9, _ff_mxf_opatom_muxer@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_30
; %bb.26:
	ldr	w8, [x24, #4]
	cbnz	w8, LBB0_33
; %bb.27:
	ldr	x8, [x24, #24]
Lloh48:
	adrp	x9, _header_open_partition_key@GOTPAGE
Lloh49:
	ldr	x9, [x9, _header_open_partition_key@GOTPAGEOFF]
Lloh50:
	ldr	w3, [x9]
	mov	x0, x19
	cbz	x8, LBB0_31
; %bb.28:
	mov	w1, #1
	mov	w2, #2
	mov	w4, #1
	bl	_mxf_write_partition
	tbnz	w0, #31, LBB0_46
; %bb.29:
	mov	x0, x19
	bl	_mxf_write_klv_fill
	mov	x0, x19
	bl	_mxf_write_index_table_segment
	b	LBB0_32
LBB0_30:
	add	x2, sp, #32
	mov	x0, x19
	mov	x1, x21
	bl	_mxf_write_opatom_packet
	mov	x23, x0
	b	LBB0_54
LBB0_31:
	mov	w1, #0
	mov	w2, #0
	mov	w4, #1
	bl	_mxf_write_partition
	tbnz	w0, #31, LBB0_46
LBB0_32:
	mov	w8, #1
	str	w8, [x24, #4]
LBB0_33:
	ldr	w8, [x22]
	ldr	x9, [x24, #24]
	cbz	w8, LBB0_38
; %bb.34:
	cbnz	x9, LBB0_49
; %bb.35:
	cmp	w8, #1
	b.ne	LBB0_49
; %bb.36:
	ldr	w8, [x24]
	cbz	w8, LBB0_55
; %bb.37:
	ldr	w9, [x24, #8]
	ldr	x10, [x24, #16]
	sub	w8, w8, #1
	add	x8, x10, w8, sxtw #4
	ldr	w10, [x8]
	sub	w9, w9, w10
	str	w9, [x8, #8]
	b	LBB0_49
LBB0_38:
	cbnz	x9, LBB0_44
; %bb.39:
	ldr	w8, [x24]
	cbz	w8, LBB0_41
; %bb.40:
Lloh51:
	adrp	x9, _EDIT_UNITS_PER_BODY@GOTPAGE
Lloh52:
	ldr	x9, [x9, _EDIT_UNITS_PER_BODY@GOTPAGEOFF]
Lloh53:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_44
LBB0_41:
	ldrb	w8, [sp, #32]
	tst	w8, #0x33333333
	b.ne	LBB0_44
; %bb.42:
	mov	x0, x19
	bl	_mxf_write_klv_fill
Lloh54:
	adrp	x8, _body_partition_key@GOTPAGE
Lloh55:
	ldr	x8, [x8, _body_partition_key@GOTPAGEOFF]
Lloh56:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #2
	mov	w4, #0
	bl	_mxf_write_partition
	tbnz	w0, #31, LBB0_46
; %bb.43:
	mov	x0, x19
	bl	_mxf_write_klv_fill
	mov	x0, x19
	bl	_mxf_write_index_table_segment
LBB0_44:
	mov	x0, x19
	bl	_mxf_write_klv_fill
	mov	x0, x19
	bl	_mxf_write_system_item
	ldr	x8, [x24, #24]
	cbz	x8, LBB0_47
; %bb.45:
	ldr	w8, [x24]
	b	LBB0_48
LBB0_46:
	mov	x23, x0
	b	LBB0_54
LBB0_47:
	ldr	w9, [x24, #8]
	ldr	x10, [x24, #16]
	ldrsw	x8, [x24]
	add	x10, x10, x8, lsl #4
	ldp	w11, w12, [sp, #32]
	stp	w9, w11, [x10]
	str	w12, [x10, #12]
Lloh57:
	adrp	x10, _KAG_SIZE@GOTPAGE
Lloh58:
	ldr	x10, [x10, _KAG_SIZE@GOTPAGEOFF]
Lloh59:
	ldr	w10, [x10]
	add	w9, w10, w9
	str	w9, [x24, #8]
LBB0_48:
	add	w8, w8, #1
	str	w8, [x24]
LBB0_49:
	mov	x0, x19
	bl	_mxf_write_klv_fill
	ldr	w1, [x25, #4]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_write
	ldr	x8, [x19]
Lloh60:
	adrp	x9, _ff_mxf_d10_muxer@GOTPAGE
Lloh61:
	ldr	x9, [x9, _ff_mxf_d10_muxer@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_52
; %bb.50:
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
Lloh62:
	adrp	x9, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh63:
	ldr	x9, [x9, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh64:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_52
; %bb.51:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_mxf_write_d10_audio_packet
	b	LBB0_53
LBB0_52:
	ldr	w1, [x21, #8]
	mov	x0, x20
	bl	_klv_encode_ber4_length
	ldp	w2, w1, [x21, #8]
	mov	x0, x20
	bl	_avio_write
	ldr	w8, [x21, #8]
	add	w19, w8, #20
	mov	x0, x19
	bl	_klv_fill_size
	ldr	w8, [x24, #8]
	add	w9, w19, w0
	add	w8, w9, w8
	str	w8, [x24, #8]
LBB0_53:
	mov	x0, x20
	bl	_avio_flush
	mov	w23, #0
LBB0_54:
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_55:
Lloh65:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh66:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh67:
	ldr	w1, [x8]
Lloh68:
	adrp	x2, l_.str.7@PAGE
Lloh69:
	add	x2, x2, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh70:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh71:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
Lloh72:
	ldr	w23, [x8]
	b	LBB0_54
LBB0_56:
	mov	x23, x0
	str	wzr, [x24]
Lloh73:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh74:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh75:
	ldr	w1, [x8]
Lloh76:
	adrp	x2, l_.str@PAGE
Lloh77:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_54
LBB0_57:
Lloh78:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh79:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh80:
	ldr	w1, [x8]
Lloh81:
	adrp	x2, l_.str.5@PAGE
Lloh82:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh70, Lloh71, Lloh72
	.loh AdrpAdd	Lloh68, Lloh69
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.cfi_endproc
                                        ; -- End function
	.comm	_EDIT_UNITS_PER_BODY,4,2        ; @EDIT_UNITS_PER_BODY
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate index entries\n"

	.comm	_AV_CODEC_ID_MPEG2VIDEO,8,3     ; @AV_CODEC_ID_MPEG2VIDEO
l_.str.1:                               ; @.str.1
	.asciz	"could not get mpeg2 profile and level\n"

	.comm	_AV_CODEC_ID_DNXHD,8,3          ; @AV_CODEC_ID_DNXHD
l_.str.2:                               ; @.str.2
	.asciz	"could not get dnxhd profile\n"

	.comm	_AV_CODEC_ID_PRORES,8,3         ; @AV_CODEC_ID_PRORES
l_.str.3:                               ; @.str.3
	.asciz	"could not get prores profile\n"

	.comm	_AV_CODEC_ID_DVVIDEO,8,3        ; @AV_CODEC_ID_DVVIDEO
l_.str.4:                               ; @.str.4
	.asciz	"could not get dv profile\n"

	.comm	_AV_CODEC_ID_H264,8,3           ; @AV_CODEC_ID_H264
l_.str.5:                               ; @.str.5
	.asciz	"could not get h264 profile\n"

	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
l_.str.6:                               ; @.str.6
	.asciz	"track %d: frame size does not match index unit size, %d != %d\n"

	.comm	_ff_mxf_opatom_muxer,4,2        ; @ff_mxf_opatom_muxer
	.comm	_header_open_partition_key,4,2  ; @header_open_partition_key
	.comm	_body_partition_key,4,2         ; @body_partition_key
	.comm	_KAG_SIZE,4,2                   ; @KAG_SIZE
l_.str.7:                               ; @.str.7
	.asciz	"No packets in first stream\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_ff_mxf_d10_muxer,4,2           ; @ff_mxf_d10_muxer
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.no_dead_strip	_mxf_write_packet
.subsections_via_symbols
