	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_write_opatom_packet
_mxf_write_opatom_packet:               ## @mxf_write_opatom_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	(%rdi), %r14
	movq	8(%rdi), %r13
	cmpl	$0, (%r13)
	je	LBB0_1
## %bb.4:
	cmpl	$0, 32(%r13)
	je	LBB0_6
LBB0_5:
	movq	8(%r13), %rax
	jmp	LBB0_7
LBB0_1:
	movq	%rdi, %rbx
	movq	_header_open_partition_key@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %r8d
	callq	_mxf_write_partition
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	callq	_mxf_write_klv_fill
	movq	%rbx, %rdi
	callq	_mxf_write_opatom_body_partition
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movl	$1, (%r13)
	cmpl	$0, 32(%r13)
	jne	LBB0_5
LBB0_6:
	movl	16(%r13), %ecx
	movq	24(%r13), %rdx
	movq	8(%r13), %rax
	leaq	(%rax,%rax,2), %rsi
	movl	%ecx, 8(%rdx,%rsi,4)
	movl	4(%r15), %ecx
	movl	%ecx, 4(%rdx,%rsi,4)
	movl	(%r15), %ecx
	movl	%ecx, (%rdx,%rsi,4)
LBB0_7:
	incq	%rax
	movq	%rax, 8(%r13)
	movl	(%r12), %edx
	movl	4(%r12), %esi
	movq	%r14, %rdi
	callq	_avio_write
	movl	(%r12), %eax
	addl	%eax, 16(%r13)
	movq	%r14, %rdi
	callq	_avio_flush
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_header_open_partition_key,4,2  ## @header_open_partition_key
	.no_dead_strip	_mxf_write_opatom_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_opatom_packet
_mxf_write_opatom_packet:               ; @mxf_write_opatom_packet
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x20, x1
	ldp	x19, x23, [x0]
	ldr	w8, [x23]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	w8, [x23, #32]
	cbz	w8, LBB0_6
LBB0_2:
	ldr	x8, [x23, #8]
	b	LBB0_7
LBB0_3:
	mov	x22, x0
Lloh0:
	adrp	x8, _header_open_partition_key@GOTPAGE
Lloh1:
	ldr	x8, [x8, _header_open_partition_key@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w1, #0
	mov	w2, #0
	mov	w4, #1
	bl	_mxf_write_partition
	tbnz	w0, #31, LBB0_8
; %bb.4:
	mov	x0, x22
	bl	_mxf_write_klv_fill
	mov	x0, x22
	bl	_mxf_write_opatom_body_partition
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	w8, #1
	str	w8, [x23]
	ldr	w8, [x23, #32]
	cbnz	w8, LBB0_2
LBB0_6:
	ldr	w9, [x23, #16]
	ldr	x10, [x23, #24]
	ldr	x8, [x23, #8]
	mov	w11, #12
	madd	x10, x8, x11, x10
	str	w9, [x10, #8]
	ldr	d0, [x21]
	str	d0, [x10]
LBB0_7:
	add	x8, x8, #1
	str	x8, [x23, #8]
	ldp	w2, w1, [x20]
	mov	x0, x19
	bl	_avio_write
	ldr	w8, [x20]
	ldr	w9, [x23, #16]
	add	w8, w9, w8
	str	w8, [x23, #16]
	mov	x0, x19
	bl	_avio_flush
	mov	w0, #0
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_header_open_partition_key,4,2  ; @header_open_partition_key
	.no_dead_strip	_mxf_write_opatom_packet
.subsections_via_symbols
