	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_read_primer_pack
_mxf_read_primer_pack:                  ## @mxf_read_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_avio_rb32
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_avio_rb32
	cmpl	$18, %eax
	jne	LBB0_1
## %bb.2:
	cmpl	$65537, %r14d                   ## imm = 0x10001
	jb	LBB0_4
## %bb.3:
	movl	16(%r15), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_avpriv_request_sample
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_4:
	cmpq	$0, 8(%r15)
	je	LBB0_5
## %bb.6:
	movl	16(%r15), %edi
	movq	_AV_LOG_VERBOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	movq	8(%r15), %rdi
	jmp	LBB0_7
LBB0_5:
	xorl	%edi, %edi
LBB0_7:
	callq	_av_free
	movl	$0, (%r15)
	movl	%r14d, %edi
	movl	$18, %esi
	callq	_av_calloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movl	%r14d, (%r15)
	addl	%r14d, %r14d
	leal	(%r14,%r14,8), %edx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_avio_read
	xorl	%eax, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Primer pack item length %d"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"item_num %d is too large\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_LOG_VERBOSE,4,2             ## @AV_LOG_VERBOSE
L_.str.2:                               ## @.str.2
	.asciz	"Multiple primer packs\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mxf_read_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_read_primer_pack
_mxf_read_primer_pack:                  ; @mxf_read_primer_pack
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x21, x0
	mov	x0, x1
	bl	_avio_rb32
	mov	x20, x0
	mov	x0, x19
	bl	_avio_rb32
	cmp	w0, #18
	b.ne	LBB0_3
; %bb.1:
	cmp	w20, #16, lsl #12               ; =65536
	b.ls	LBB0_4
; %bb.2:
	ldr	w0, [x21, #16]
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	x20, [sp]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_3:
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_avpriv_request_sample
Lloh10:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_4:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w0, [x21, #16]
Lloh13:
	adrp	x8, _AV_LOG_VERBOSE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_VERBOSE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str.2@PAGE
Lloh17:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_av_log
	ldr	x0, [x21, #8]
	b	LBB0_7
LBB0_6:
	mov	x0, #0
LBB0_7:
	bl	_av_free
	str	wzr, [x21]
	mov	x0, x20
	mov	w1, #18
	bl	_av_calloc
	str	x0, [x21, #8]
	cbz	x0, LBB0_10
; %bb.8:
	mov	x1, x0
	str	w20, [x21]
	add	w8, w20, w20, lsl #3
	lsl	w2, w8, #1
	mov	x0, x19
	bl	_avio_read
	mov	w0, #0
LBB0_9:
	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
	add	sp, sp, #64
	ret
LBB0_10:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	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
	add	sp, sp, #64
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Primer pack item length %d"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"item_num %d is too large\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_LOG_VERBOSE,4,2             ; @AV_LOG_VERBOSE
l_.str.2:                               ; @.str.2
	.asciz	"Multiple primer packs\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mxf_read_primer_pack
.subsections_via_symbols
