	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_system_item
_mxf_write_system_item:                 ## @mxf_write_system_item
	.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	%rdi, %r14
	movq	16(%rdi), %r15
	movq	24(%rdi), %r13
	movl	4(%r13), %ebx
	addl	(%r13), %ebx
	movq	_system_metadata_pack_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	%r15, %rdi
	movl	$57, %esi
	callq	_klv_encode_ber4_length
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jle	LBB0_1
## %bb.2:
	movl	%ebx, %r12d
	movq	8(%r14), %rdi
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movq	(%rax), %r10
	movq	_AVMEDIA_TYPE_DATA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	cmpl	$1, %r8d
	jne	LBB0_4
## %bb.3:
	movl	$88, %esi
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_1:
	movl	$88, %esi
	jmp	LBB0_8
LBB0_4:
	movl	%r8d, %r9d
	andl	$-2, %r9d
	movl	$88, %esi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdi,%rdx,8), %rbx
	movq	8(%rbx), %rbx
	movq	(%rbx), %rbx
	movl	%esi, %eax
	orl	$4, %eax
	movl	%esi, %ecx
	orl	$2, %ecx
	cmpq	%r11, %rbx
	cmovnel	%esi, %ecx
	movq	8(%rdi,%rdx,8), %rsi
	cmpq	%r10, %rbx
	cmovel	%eax, %ecx
	movq	8(%rsi), %rax
	movq	(%rax), %rax
	movl	%ecx, %ebx
	orl	$4, %ebx
	movl	%ecx, %esi
	orl	$2, %esi
	cmpq	%r11, %rax
	cmovnel	%ecx, %esi
	cmpq	%r10, %rax
	cmovel	%ebx, %esi
	addq	$2, %rdx
	cmpq	%rdx, %r9
	jne	LBB0_5
LBB0_6:
	testb	$1, %r8b
	movl	%r12d, %ebx
	je	LBB0_8
## %bb.7:
	movq	(%rdi,%rdx,8), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movl	%esi, %ecx
	orl	$4, %ecx
	movl	%esi, %edx
	orl	$2, %edx
	cmpq	%r11, %rax
	cmovnel	%esi, %edx
	cmpq	%r10, %rax
	cmovel	%ecx, %edx
	movl	%edx, %esi
LBB0_8:
	movq	%r15, %rdi
	callq	_avio_w8
	movl	8(%r13), %esi
	movq	%r15, %rdi
	callq	_avio_w8
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wb16
	leaq	16(%r13), %r12
	movl	16(%r13), %eax
	addl	%ebx, %eax
	movzwl	%ax, %esi
	movq	%r15, %rdi
	callq	_avio_wb16
	cmpl	$1, 12(%r13)
	jle	LBB0_10
## %bb.9:
	movq	_multiple_desc_ul@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	(%rax), %rax
	movq	_mxf_essence_container_uls@GOTPCREL(%rip), %rcx
	movq	(%rax), %rax
	shlq	$2, %rax
	addq	(%rcx), %rax
LBB0_11:
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_w8
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wb64
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wb64
	movq	%r15, %rdi
	movl	$129, %esi
	callq	_avio_w8
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_av_timecode_get_smpte_from_framenum
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_avio_wb32
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wb32
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avio_wb64
	movq	_system_metadata_package_set_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	%r15, %rdi
	movl	$35, %esi
	callq	_klv_encode_ber4_length
	movq	%r15, %rdi
	movl	$131, %esi
	callq	_avio_w8
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_avio_wb16
	movq	%r14, %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mxf_write_umid                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_system_metadata_pack_key,4,2   ## @system_metadata_pack_key
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AVMEDIA_TYPE_DATA,8,3          ## @AVMEDIA_TYPE_DATA
	.comm	_multiple_desc_ul,4,2           ## @multiple_desc_ul
	.comm	_mxf_essence_container_uls,8,3  ## @mxf_essence_container_uls
	.comm	_system_metadata_package_set_key,4,2 ## @system_metadata_package_set_key
	.no_dead_strip	_mxf_write_system_item
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_write_system_item
_mxf_write_system_item:                 ; @mxf_write_system_item
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldp	x20, x21, [x0, #16]
	ldp	w8, w9, [x21]
	add	w22, w9, w8
Lloh0:
	adrp	x8, _system_metadata_pack_key@GOTPAGE
Lloh1:
	ldr	x8, [x8, _system_metadata_pack_key@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_write
	mov	x0, x20
	mov	w1, #57
	bl	_klv_encode_ber4_length
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
Lloh3:
	adrp	x10, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _AVMEDIA_TYPE_DATA@GOTPAGE
Lloh7:
	ldr	x11, [x11, _AVMEDIA_TYPE_DATA@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	mov	w1, #88
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9], #8
	ldr	x12, [x12, #8]
	ldr	x12, [x12]
	orr	w13, w1, #0x4
	orr	w14, w1, #0x2
	cmp	x12, x11
	csel	w14, w14, w1, eq
	cmp	x12, x10
	csel	w1, w13, w14, eq
	subs	x8, x8, #1
	b.ne	LBB0_2
	b	LBB0_4
LBB0_3:
	mov	w1, #88
LBB0_4:
	mov	x0, x20
	bl	_avio_w8
	ldr	w1, [x21, #8]
	mov	x0, x20
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb16
	ldr	w8, [x21, #16]!
	add	w8, w8, w22
	and	w1, w8, #0xffff
	mov	x0, x20
	bl	_avio_wb16
	ldur	w8, [x21, #-4]
	cmp	w8, #1
	b.le	LBB0_6
; %bb.5:
Lloh9:
	adrp	x8, _multiple_desc_ul@GOTPAGE
Lloh10:
	ldr	x8, [x8, _multiple_desc_ul@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _mxf_essence_container_uls@GOTPAGE
Lloh12:
	ldr	x9, [x9, _mxf_essence_container_uls@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ldr	x8, [x8]
	add	x8, x9, x8, lsl #2
LBB0_7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_write
	mov	x0, x20
	mov	w1, #0
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb64
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb64
	mov	x0, x20
	mov	w1, #129
	bl	_avio_w8
	mov	x0, x21
	mov	x1, x22
	bl	_av_timecode_get_smpte_from_framenum
	mov	x1, x0
	mov	x0, x20
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb32
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb64
Lloh14:
	adrp	x8, _system_metadata_package_set_key@GOTPAGE
Lloh15:
	ldr	x8, [x8, _system_metadata_package_set_key@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_write
	mov	x0, x20
	mov	w1, #35
	bl	_klv_encode_ber4_length
	mov	x0, x20
	mov	w1, #131
	bl	_avio_w8
	mov	x0, x20
	mov	w1, #32
	bl	_avio_wb16
	mov	x0, x19
	mov	w1, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mxf_write_umid
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_system_metadata_pack_key,4,2   ; @system_metadata_pack_key
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AVMEDIA_TYPE_DATA,8,3          ; @AVMEDIA_TYPE_DATA
	.comm	_multiple_desc_ul,4,2           ; @multiple_desc_ul
	.comm	_mxf_essence_container_uls,8,3  ; @mxf_essence_container_uls
	.comm	_system_metadata_package_set_key,4,2 ; @system_metadata_package_set_key
	.no_dead_strip	_mxf_write_system_item
.subsections_via_symbols
