	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_partition
_mxf_write_partition:                   ## @mxf_write_partition
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rcx, %r15
	movl	%edx, %r14d
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r13
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	cmpq	$0, 32(%r13)
	movl	%r14d, -80(%rbp)                ## 4-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.3:
	movl	$80, %ebx
	testl	%r14d, %r14d
	movq	%r15, %r14
	jne	LBB0_6
## %bb.4:
	xorl	%edi, %edi
	jmp	LBB0_7
LBB0_1:
	movl	(%r13), %eax
	xorl	%edi, %edi
	testl	%eax, %eax
	je	LBB0_2
## %bb.5:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	leal	(%rcx,%rcx,2), %ecx
	leal	(%rax,%rax,4), %eax
	leal	(%rax,%rax,2), %eax
	leal	(%rax,%rcx,2), %ebx
	addl	$115, %ebx
	movq	%r15, %r14
	je	LBB0_7
LBB0_6:
	leal	20(%rbx), %edi
	callq	_klv_fill_size
                                        ## kill: def $eax killed $eax def $rax
	leal	(%rbx,%rax), %edi
	addl	$20, %edi
	jmp	LBB0_7
LBB0_2:
	movq	%r15, %r14
LBB0_7:
	movq	_body_partition_key@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	testq	%r14, %r14
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movl	%edi, -76(%rbp)                 ## 4-byte Spill
	je	LBB0_13
## %bb.8:
	movq	%r14, %rdi
	movl	$16, %edx
	callq	_memcmp
	testl	%eax, %eax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_12
## %bb.9:
	leaq	8(%rbx), %rdi
	movl	16(%rbx), %esi
	incl	%esi
	movl	$4, %edx
	callq	_av_reallocp_array
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	8(%rbx), %rax
	movslq	16(%rbx), %rcx
	leal	1(%rcx), %edx
	movl	%edx, 16(%rbx)
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax,%rcx,4)
	movq	-88(%rbp), %r14                 ## 8-byte Reload
LBB0_12:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	$16, %edx
	callq	_avio_write
	jmp	LBB0_14
LBB0_13:
	movq	%r12, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:
	movl	28(%rbx), %edi
	callq	_DESCRIPTOR_COUNT
	shll	$4, %eax
	leal	88(%rax), %esi
	movq	%r12, %rdi
	callq	_klv_encode_ber4_length
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_avio_wb16
	movq	%r12, %rdi
	movl	$3, %esi
	callq	_avio_wb16
	movq	_KAG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_avio_wb32
	movq	%r12, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_wb64
	movl	$0, %esi
	testq	%r14, %r14
	je	LBB0_22
## %bb.15:
	movq	(%r15), %rsi
	movq	%r14, %rdi
	movl	$16, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_18
## %bb.16:
	movl	16(%rbx), %eax
	cmpl	$2, %eax
	jl	LBB0_18
## %bb.17:
	addl	$-2, %eax
	shlq	$2, %rax
	addq	8(%rbx), %rax
	jmp	LBB0_21
LBB0_18:
	movq	_footer_partition_key@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	movl	$16, %edx
	callq	_memcmp
	movl	$0, %esi
	testl	%eax, %eax
	jne	LBB0_22
## %bb.19:
	movslq	16(%rbx), %rax
	movl	$0, %esi
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	8(%rbx), %rcx
	leaq	(%rcx,%rax,4), %rax
	addq	$-4, %rax
LBB0_21:
	movl	(%rax), %esi
LBB0_22:
	movq	%r12, %rdi
	callq	_avio_wb64
	movl	20(%rbx), %esi
	movq	%r12, %rdi
	callq	_avio_wb64
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avio_wb64
	movq	%r12, %rdi
	movl	-76(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %esi
	callq	_avio_wb64
	testl	%r15d, %r15d
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	cmovel	%r15d, %esi
	movq	%r12, %rdi
	callq	_avio_wb32
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_23
## %bb.24:
	cmpl	$0, (%rbx)
	je	LBB0_23
## %bb.25:
	cmpl	$0, 16(%rbx)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	$0, %esi
	je	LBB0_28
## %bb.26:
	movq	16(%r13), %rax
	cmpq	_ff_mxf_opatom_muxer@GOTPCREL(%rip), %rax
	je	LBB0_28
## %bb.27:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	24(%rax), %esi
	jmp	LBB0_28
LBB0_23:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	xorl	%esi, %esi
LBB0_28:
	movq	%r12, %rdi
	callq	_avio_wb64
	movq	%r12, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_wb32
	movq	16(%r13), %rax
	cmpq	_ff_mxf_opatom_muxer@GOTPCREL(%rip), %rax
	jne	LBB0_29
## %bb.30:
	movq	_opatom_ul@GOTPCREL(%rip), %rax
	jmp	LBB0_31
LBB0_29:
	movq	_op1a_ul@GOTPCREL(%rip), %rax
LBB0_31:
	movq	(%rax), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	callq	_avio_write
	movq	%r13, %rdi
	callq	_mxf_write_essence_container_refs
	testl	%ebx, %ebx
	je	LBB0_33
## %bb.32:
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	8(%r13), %rdi
	callq	_avio_tell
	movl	%eax, %r14d
	movq	%r13, %rdi
	callq	_mxf_write_primer_pack
	movq	%r13, %rdi
	callq	_mxf_write_klv_fill
	movq	%r13, %rdi
	callq	_mxf_write_header_metadata_sets
	movq	8(%r13), %rdi
	callq	_avio_tell
	movl	%eax, %r15d
	movl	%eax, %ebx
	subl	%r14d, %ebx
	movl	%eax, %edi
	callq	_klv_fill_size
	addl	%eax, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%r12, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_avio_seek
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_wb64
	movl	(%r14), %edx
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_avio_seek
LBB0_33:
	xorl	%r14d, %r14d
	cmpq	$0, -88(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_35
## %bb.34:
	movq	%r12, %rdi
	callq	_avio_flush
LBB0_35:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%eax, %r14d
	movl	$0, 16(%rbx)
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_body_partition_key,8,3         ## @body_partition_key
	.comm	_KAG_SIZE,4,2                   ## @KAG_SIZE
	.comm	_footer_partition_key,8,3       ## @footer_partition_key
	.comm	_ff_mxf_opatom_muxer,4,2        ## @ff_mxf_opatom_muxer
	.comm	_opatom_ul,8,3                  ## @opatom_ul
	.comm	_op1a_ul,8,3                    ## @op1a_ul
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_mxf_write_partition
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_write_partition
_mxf_write_partition:                   ; @mxf_write_partition
	.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, x4
	mov	x19, x3
	mov	x24, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x27, [x0, #24]
	ldr	x20, [x0, #8]
	mov	x0, x20
	bl	_avio_tell
	mov	x26, x0
	ldr	x8, [x27, #32]
	cbz	x8, LBB0_3
; %bb.1:
	cbz	w24, LBB0_6
; %bb.2:
	mov	w8, #80
	b	LBB0_5
LBB0_3:
	ldr	w8, [x27]
	cbz	w8, LBB0_6
; %bb.4:
	ldr	w9, [x21]
	mov	w10, #6
	lsl	w11, w8, #4
	sub	w8, w11, w8
	madd	w8, w9, w10, w8
	adds	w8, w8, #115
	b.eq	LBB0_6
LBB0_5:
	add	w25, w8, #20
	mov	x0, x25
	bl	_klv_fill_size
	add	w25, w25, w0
	b	LBB0_7
LBB0_6:
	mov	w25, #0
LBB0_7:
Lloh0:
	adrp	x28, _body_partition_key@GOTPAGE
Lloh1:
	ldr	x28, [x28, _body_partition_key@GOTPAGEOFF]
	ldr	x1, [x28]
	cbz	x19, LBB0_12
; %bb.8:
	mov	x0, x19
	mov	w2, #16
	bl	_memcmp
	cbnz	w0, LBB0_11
; %bb.9:
	add	x0, x27, #8
	ldr	w8, [x27, #16]
	add	w1, w8, #1
	mov	w2, #4
	bl	_av_reallocp_array
	tbnz	w0, #31, LBB0_34
; %bb.10:
	ldr	x8, [x27, #8]
	ldrsw	x9, [x27, #16]
	add	w10, w9, #1
	str	w10, [x27, #16]
	str	w26, [x8, x9, lsl #2]
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	b	LBB0_13
LBB0_12:
	mov	x0, x20
LBB0_13:
	mov	w2, #16
	bl	_avio_write
	ldr	w0, [x27, #28]
	bl	_DESCRIPTOR_COUNT
	lsl	w8, w0, #4
	add	w1, w8, #88
	mov	x0, x20
	bl	_klv_encode_ber4_length
	mov	x0, x20
	mov	w1, #1
	bl	_avio_wb16
	mov	x0, x20
	mov	w1, #3
	bl	_avio_wb16
Lloh2:
	adrp	x8, _KAG_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KAG_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_avio_wb32
	mov	x0, x20
	mov	x1, x26
	bl	_avio_wb64
	cbz	x19, LBB0_18
; %bb.14:
	ldr	x1, [x28]
	mov	x0, x19
	mov	w2, #16
	bl	_memcmp
	cbnz	w0, LBB0_17
; %bb.15:
	ldr	w8, [x27, #16]
	subs	w8, w8, #2
	b.lt	LBB0_17
; %bb.16:
	ldr	x9, [x27, #8]
	add	x8, x9, w8, uxtw #2
	b	LBB0_21
LBB0_17:
Lloh5:
	adrp	x8, _footer_partition_key@GOTPAGE
Lloh6:
	ldr	x8, [x8, _footer_partition_key@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x8]
	mov	x0, x19
	mov	w2, #16
	bl	_memcmp
	cbz	w0, LBB0_19
LBB0_18:
	mov	w1, #0
	b	LBB0_22
LBB0_19:
	ldr	w8, [x27, #16]
	cbz	w8, LBB0_18
; %bb.20:
	ldr	x9, [x27, #8]
	sub	w8, w8, #1
	add	x8, x9, w8, sxtw #2
LBB0_21:
	ldr	w1, [x8]
LBB0_22:
	mov	x0, x20
	bl	_avio_wb64
	ldr	w1, [x27, #20]
	mov	x0, x20
	bl	_avio_wb64
	mov	x0, x20
	bl	_avio_tell
	mov	x26, x0
	mov	x0, x20
	mov	w1, #0
	bl	_avio_wb64
	mov	x0, x20
	mov	x1, x25
	bl	_avio_wb64
	cmp	w25, #0
	csel	w1, wzr, w24, eq
	mov	x0, x20
	bl	_avio_wb32
Lloh8:
	adrp	x24, _ff_mxf_opatom_muxer@GOTPAGE
Lloh9:
	ldr	x24, [x24, _ff_mxf_opatom_muxer@GOTPAGEOFF]
	cbz	w23, LBB0_27
; %bb.23:
	ldr	w8, [x27]
	cbz	w8, LBB0_27
; %bb.24:
	ldr	w8, [x27, #16]
	cbz	w8, LBB0_27
; %bb.25:
	ldr	x8, [x21, #16]
	cmp	x8, x24
	b.eq	LBB0_27
; %bb.26:
	ldr	w1, [x27, #24]
	b	LBB0_28
LBB0_27:
	mov	w1, #0
LBB0_28:
	mov	x0, x20
	bl	_avio_wb64
	mov	x0, x20
	mov	x1, x23
	bl	_avio_wb32
Lloh10:
	adrp	x8, _opatom_ul@GOTPAGE
Lloh11:
	ldr	x8, [x8, _opatom_ul@GOTPAGEOFF]
	ldr	x9, [x21, #16]
Lloh12:
	adrp	x10, _op1a_ul@GOTPAGE
Lloh13:
	ldr	x10, [x10, _op1a_ul@GOTPAGEOFF]
	cmp	x9, x24
	csel	x8, x8, x10, eq
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_write
	mov	x0, x21
	bl	_mxf_write_essence_container_refs
	cbz	w22, LBB0_30
; %bb.29:
	mov	x0, x21
	bl	_mxf_write_klv_fill
	ldr	x0, [x21, #8]
	bl	_avio_tell
	mov	x22, x0
	mov	x0, x21
	bl	_mxf_write_primer_pack
	mov	x0, x21
	bl	_mxf_write_klv_fill
	mov	x0, x21
	bl	_mxf_write_header_metadata_sets
	ldr	x0, [x21, #8]
	bl	_avio_tell
	mov	x21, x0
	sub	w22, w0, w22
	bl	_klv_fill_size
	add	w22, w22, w0
Lloh14:
	adrp	x23, _SEEK_SET@GOTPAGE
Lloh15:
	ldr	x23, [x23, _SEEK_SET@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x26
	bl	_avio_seek
	mov	x0, x20
	mov	x1, x22
	bl	_avio_wb64
	ldr	w2, [x23]
	mov	x0, x20
	mov	x1, x21
	bl	_avio_seek
LBB0_30:
	cbz	x19, LBB0_32
; %bb.31:
	mov	x0, x20
	bl	_avio_flush
LBB0_32:
	mov	w0, #0
LBB0_33:
	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
LBB0_34:
	str	wzr, [x27, #16]
	b	LBB0_33
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_body_partition_key,8,3         ; @body_partition_key
	.comm	_KAG_SIZE,4,2                   ; @KAG_SIZE
	.comm	_footer_partition_key,8,3       ; @footer_partition_key
	.comm	_ff_mxf_opatom_muxer,4,2        ; @ff_mxf_opatom_muxer
	.comm	_opatom_ul,8,3                  ; @opatom_ul
	.comm	_op1a_ul,8,3                    ; @op1a_ul
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_mxf_write_partition
.subsections_via_symbols
