	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_primer_pack
_mxf_write_primer_pack:                 ## @mxf_write_primer_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, %r12
	movq	16(%rdi), %r15
	movq	24(%rdi), %rbx
	movq	_mxf_local_tag_batch@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_FF_ARRAY_ELEMS
	movl	%eax, %r13d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ebx
	movq	_mxf_user_comments_local_tag@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_FF_ARRAY_ELEMS
                                        ## kill: def $eax killed $eax def $rax
	imull	%ebx, %eax
	addl	%r13d, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_1
## %bb.2:
	xorl	%r13d, %r13d
	movq	_AV_CODEC_ID_H264@GOTPCREL(%rip), %rbx
	xorl	%eax, %eax
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movslq	%esi, %rcx
	cmpq	%rcx, %r13
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rcx
	movq	(%rcx,%r13,8), %rcx
	movq	(%rcx), %rdx
	movq	(%rdx), %rdx
	cmpq	(%rbx), %rdx
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rcx), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_mxf_avc_subdescriptor_local_tags@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_FF_ARRAY_ELEMS
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	(%r12), %esi
	jmp	LBB0_6
LBB0_1:
	xorl	%eax, %eax
LBB0_7:
	movl	%eax, %r12d
	movq	_primer_pack_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leal	(%rbx,%rbx,8), %eax
	leal	(%rax,%rax), %esi
	addl	$8, %esi
	movq	%r15, %rdi
	callq	_klv_encode_ber_length
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_avio_wb32
	movq	%r15, %rdi
	movl	$18, %esi
	callq	_avio_wb32
	movq	(%r14), %rdi
	callq	_FF_ARRAY_ELEMS
	testl	%eax, %eax
	jle	LBB0_10
## %bb.8:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	4(%rax,%rbx,8), %esi
	movq	%r15, %rdi
	callq	_avio_wb16
	movq	(%r14), %rax
	movl	(%rax,%rbx,8), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	incq	%rbx
	movq	(%r14), %rdi
	callq	_FF_ARRAY_ELEMS
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	movq	_mxf_user_comments_local_tag@GOTPCREL(%rip), %r14
	je	LBB0_14
## %bb.11:
	movq	(%r14), %rdi
	callq	_FF_ARRAY_ELEMS
	testl	%eax, %eax
	jle	LBB0_14
## %bb.12:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movl	4(%rax,%rbx,8), %esi
	movq	%r15, %rdi
	callq	_avio_wb16
	movq	(%r14), %rax
	movl	(%rax,%rbx,8), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	incq	%rbx
	movq	(%r14), %rdi
	callq	_FF_ARRAY_ELEMS
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_13
LBB0_14:
	testl	%r12d, %r12d
	jle	LBB0_15
## %bb.16:
	movl	%r12d, %edx
	movq	_mxf_avc_subdescriptor_local_tags@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mxf_write_local_tags           ## TAILCALL
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mxf_local_tag_batch,8,3        ## @mxf_local_tag_batch
	.comm	_mxf_user_comments_local_tag,8,3 ## @mxf_user_comments_local_tag
	.comm	_AV_CODEC_ID_H264,8,3           ## @AV_CODEC_ID_H264
	.comm	_mxf_avc_subdescriptor_local_tags,8,3 ## @mxf_avc_subdescriptor_local_tags
	.comm	_primer_pack_key,4,2            ## @primer_pack_key
	.no_dead_strip	_mxf_write_primer_pack
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_write_primer_pack
_mxf_write_primer_pack:                 ; @mxf_write_primer_pack
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x0
	ldp	x19, x25, [x0, #16]
Lloh0:
	adrp	x26, _mxf_local_tag_batch@GOTPAGE
Lloh1:
	ldr	x26, [x26, _mxf_local_tag_batch@GOTPAGEOFF]
	ldr	x0, [x26]
	bl	_FF_ARRAY_ELEMS
	mov	x20, x0
	ldr	w21, [x25]
Lloh2:
	adrp	x23, _mxf_user_comments_local_tag@GOTPAGE
Lloh3:
	ldr	x23, [x23, _mxf_user_comments_local_tag@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_FF_ARRAY_ELEMS
	madd	w21, w0, w21, w20
	ldr	w8, [x22]
Lloh4:
	adrp	x24, _mxf_avc_subdescriptor_local_tags@GOTPAGE
Lloh5:
	ldr	x24, [x24, _mxf_avc_subdescriptor_local_tags@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x27, #0
	mov	w20, #0
Lloh6:
	adrp	x28, _AV_CODEC_ID_H264@GOTPAGE
Lloh7:
	ldr	x28, [x28, _AV_CODEC_ID_H264@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x27, x27, #1
	cmp	x27, w8, sxtw
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x22, #8]
	ldr	x9, [x9, x27, lsl #3]
	ldr	x10, [x9]
	ldr	x10, [x10]
	ldr	x11, [x28]
	cmp	x10, x11
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x9, #8]
	ldr	w9, [x9]
	cbnz	w9, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x24]
	bl	_FF_ARRAY_ELEMS
	mov	x20, x0
	add	w21, w0, w21
	ldr	w8, [x22]
	b	LBB0_2
LBB0_6:
	mov	w20, #0
LBB0_7:
Lloh8:
	adrp	x8, _primer_pack_key@GOTPAGE
Lloh9:
	ldr	x8, [x8, _primer_pack_key@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #16
	bl	_avio_write
	mov	w8, #18
	orr	w9, wzr, #0x8
	madd	w1, w21, w8, w9
	mov	x0, x19
	bl	_klv_encode_ber_length
	mov	x0, x19
	mov	x1, x21
	bl	_avio_wb32
	mov	x0, x19
	mov	w1, #18
	bl	_avio_wb32
	ldr	x0, [x26]
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x21, #0
	mov	x22, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x8, x8, x21
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_avio_wb16
	ldr	x8, [x26]
	ldr	w1, [x8, x21]
	mov	x0, x19
	mov	w2, #16
	bl	_avio_write
	add	x22, x22, #1
	ldr	x0, [x26]
	bl	_FF_ARRAY_ELEMS
	add	x21, x21, #8
	cmp	x22, w0, sxtw
	b.lt	LBB0_9
LBB0_10:
	ldr	w8, [x25]
	cbz	w8, LBB0_14
; %bb.11:
	ldr	x0, [x23]
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x21, #0
	mov	x22, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	add	x8, x8, x21
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_avio_wb16
	ldr	x8, [x23]
	ldr	w1, [x8, x21]
	mov	x0, x19
	mov	w2, #16
	bl	_avio_write
	add	x22, x22, #1
	ldr	x0, [x23]
	bl	_FF_ARRAY_ELEMS
	add	x21, x21, #8
	cmp	x22, w0, sxtw
	b.lt	LBB0_13
LBB0_14:
	cmp	w20, #1
	b.lt	LBB0_16
; %bb.15:
	ldr	x1, [x24]
	mov	x0, x19
	mov	x2, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mxf_write_local_tags
LBB0_16:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_mxf_local_tag_batch,8,3        ; @mxf_local_tag_batch
	.comm	_mxf_user_comments_local_tag,8,3 ; @mxf_user_comments_local_tag
	.comm	_AV_CODEC_ID_H264,8,3           ; @AV_CODEC_ID_H264
	.comm	_mxf_avc_subdescriptor_local_tags,8,3 ; @mxf_avc_subdescriptor_local_tags
	.comm	_primer_pack_key,4,2            ; @primer_pack_key
	.no_dead_strip	_mxf_write_primer_pack
.subsections_via_symbols
