	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxf_decrypt_triplet
_mxf_decrypt_triplet:                   ## @mxf_decrypt_triplet
	.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	$168, %rsp
	.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, -200(%rbp)                ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rbx
	movq	24(%rdi), %r12
	movq	%rbx, %rdi
	callq	_avio_tell
	movl	%eax, %r14d
	addl	(%r15), %r14d
	cmpq	$0, (%r12)
	je	LBB0_1
LBB0_7:
	movq	%rbx, %rdi
	callq	_klv_decode_ber_length
	testl	%eax, %eax
	js	LBB0_23
## %bb.8:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_avio_skip
	movq	%rbx, %rdi
	callq	_klv_decode_ber_length
	movq	%rbx, %rdi
	callq	_avio_rb64
	movl	%eax, -180(%rbp)                ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_klv_decode_ber_length
	movq	8(%r15), %rsi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_avio_read
	movq	_mxf_essence_element_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_IS_KLV_KEY
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	16(%r15), %esi
	movq	%r12, %rdi
	callq	_find_body_sid_by_absolute_offset
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_mxf_get_stream_index
	testl	%eax, %eax
	js	LBB0_9
## %bb.11:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_klv_decode_ber_length
	movq	%rbx, %rdi
	callq	_avio_rb64
	cmpl	-180(%rbp), %eax                ## 4-byte Folded Reload
	jl	LBB0_9
## %bb.12:
	movl	%eax, -184(%rbp)                ## 4-byte Spill
	movl	%r15d, -188(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_klv_decode_ber_length
	cmpl	$32, %eax
	jl	LBB0_9
## %bb.13:
	movl	%eax, %r15d
	addl	$-32, %r15d
	cmpl	-184(%rbp), %r15d               ## 4-byte Folded Reload
	jl	LBB0_9
## %bb.14:
	leaq	-112(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_avio_read
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$16, %edx
	callq	_avio_read
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.15:
	leaq	-176(%rbp), %rdx
	leaq	-112(%rbp), %r8
	movq	%rdx, %rsi
	movl	$1, %ecx
	movl	$1, %r9d
	callq	_av_aes_crypt
LBB0_16:
	leaq	_mxf_decrypt_triplet.checkv(%rip), %rsi
	leaq	-176(%rbp), %rdi
	movl	$16, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	callq	_av_log
LBB0_18:
	movq	%rbx, %rdi
	movq	-200(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rsi
	movl	%r15d, %edx
	callq	_av_get_packet
	testl	%eax, %eax
	js	LBB0_23
## %bb.19:
	subl	-180(%rbp), %eax                ## 4-byte Folded Reload
	jge	LBB0_20
LBB0_9:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_25
## %bb.24:
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpq	$0, 8(%r13)
	je	LBB0_7
## %bb.2:
	cmpl	$16, (%r13)
	jne	LBB0_7
## %bb.3:
	xorl	%eax, %eax
	callq	_av_aes_alloc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	movq	8(%r13), %rsi
	movq	%rax, %rdi
	movl	$128, %edx
	movl	$1, %ecx
	callq	_av_aes_init
	jmp	LBB0_7
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.5:
	addq	$168, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_20:
	movq	(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_22
## %bb.21:
	movslq	-180(%rbp), %rdx                ## 4-byte Folded Reload
	shlq	$2, %rdx
	addq	(%r13), %rdx
	sarl	$4, %eax
	leaq	-112(%rbp), %r8
	movq	%rdx, %rsi
	movl	%eax, %ecx
	movl	$1, %r9d
	callq	_av_aes_crypt
LBB0_22:
	movq	%r13, %rdi
	movl	-184(%rbp), %esi                ## 4-byte Reload
	callq	_av_shrink_packet
	movl	-188(%rbp), %eax                ## 4-byte Reload
	movl	%eax, 8(%r13)
	movq	%rbx, %rdi
	callq	_avio_tell
	subl	%eax, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_avio_skip
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @mxf_decrypt_triplet.checkv
_mxf_decrypt_triplet.checkv:
	.long	67                              ## 0x43
	.long	72                              ## 0x48
	.long	85                              ## 0x55
	.long	75                              ## 0x4b
	.long	67                              ## 0x43
	.long	72                              ## 0x48
	.long	85                              ## 0x55
	.long	75                              ## 0x4b
	.long	67                              ## 0x43
	.long	72                              ## 0x48
	.long	85                              ## 0x55
	.long	75                              ## 0x4b
	.long	67                              ## 0x43
	.long	72                              ## 0x48
	.long	85                              ## 0x55
	.long	75                              ## 0x4b

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_mxf_essence_element_key,4,2    ## @mxf_essence_element_key
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"probably incorrect decryption key\n"

	.no_dead_strip	_mxf_decrypt_triplet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxf_decrypt_triplet
_mxf_decrypt_triplet:                   ; @mxf_decrypt_triplet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x28, x27, [sp, #144]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #160]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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	x25, x2
	mov	x20, x1
	mov	x23, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	ldp	x19, x21, [x0, #16]
	mov	x0, x19
	bl	_avio_tell
	mov	x22, x0
	ldr	w28, [x25]
	ldr	x8, [x21]
	cbz	x8, LBB0_16
LBB0_1:
	mov	x0, x19
	bl	_klv_decode_ber_length
	mov	x1, x0
	tbnz	w0, #31, LBB0_14
; %bb.2:
	mov	x0, x19
	bl	_avio_skip
	mov	x0, x19
	bl	_klv_decode_ber_length
	mov	x0, x19
	bl	_avio_rb64
	mov	x24, x0
	mov	x0, x19
	bl	_klv_decode_ber_length
	ldr	x1, [x25, #8]
	mov	x0, x19
	mov	w2, #16
	bl	_avio_read
Lloh3:
	adrp	x8, _mxf_essence_element_key@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mxf_essence_element_key@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_IS_KLV_KEY
	cbz	w0, LBB0_13
; %bb.3:
	ldr	w1, [x25, #16]
	mov	x0, x21
	bl	_find_body_sid_by_absolute_offset
	mov	x2, x0
	mov	x0, x23
	mov	x1, x25
	bl	_mxf_get_stream_index
	tbnz	w0, #31, LBB0_13
; %bb.4:
	mov	x25, x0
	mov	x0, x19
	bl	_klv_decode_ber_length
	mov	x0, x19
	bl	_avio_rb64
	cmp	w0, w24
	b.lt	LBB0_13
; %bb.5:
	mov	x26, x0
	mov	x0, x19
	bl	_klv_decode_ber_length
	subs	w27, w0, #32
	b.lt	LBB0_13
; %bb.6:
	cmp	w27, w26
	b.lt	LBB0_13
; %bb.7:
	add	x1, sp, #72
	mov	x0, x19
	mov	w2, #16
	bl	_avio_read
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #16
	bl	_avio_read
	ldr	x0, [x21]
	cbz	x0, LBB0_9
; %bb.8:
	add	x1, sp, #8
	add	x2, sp, #8
	add	x4, sp, #72
	mov	w3, #1
	mov	w5, #1
	bl	_av_aes_crypt
LBB0_9:
Lloh6:
	adrp	x1, _mxf_decrypt_triplet.checkv@PAGE
Lloh7:
	add	x1, x1, _mxf_decrypt_triplet.checkv@PAGEOFF
	add	x0, sp, #8
	mov	w2, #16
	bl	_memcmp
	cbz	x0, LBB0_11
; %bb.10:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	bl	_av_log
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x27
	bl	_av_get_packet
	mov	x1, x0
	tbnz	w0, #31, LBB0_14
; %bb.12:
	subs	w8, w1, w24
	b.ge	LBB0_22
LBB0_13:
Lloh13:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
LBB0_14:
	ldur	x8, [x29, #-88]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.15:
	mov	x0, x1
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #160]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_16:
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_1
; %bb.17:
	ldr	w8, [x23]
	cmp	w8, #16
	b.ne	LBB0_1
; %bb.18:
	bl	_av_aes_alloc
	str	x0, [x21]
	cbz	x0, LBB0_20
; %bb.19:
	ldr	x1, [x23, #8]
	mov	w2, #128
	mov	w3, #1
	bl	_av_aes_init
	b	LBB0_1
LBB0_20:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldur	x8, [x29, #-88]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.21:
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #160]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #240
	b	_AVERROR
LBB0_22:
	add	w22, w28, w22
	ldr	x0, [x21]
	cbz	x0, LBB0_24
; %bb.23:
	ldr	x9, [x20]
	add	x1, x9, w24, sxtw #2
	asr	w3, w8, #4
	add	x4, sp, #72
	mov	x2, x1
	mov	w5, #1
	bl	_av_aes_crypt
LBB0_24:
	mov	x0, x20
	mov	x1, x26
	bl	_av_shrink_packet
	str	w25, [x20, #8]
	mov	x0, x19
	bl	_avio_tell
	sub	w1, w22, w0
	mov	x0, x19
	bl	_avio_skip
	mov	w1, #0
	b	LBB0_14
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @mxf_decrypt_triplet.checkv
_mxf_decrypt_triplet.checkv:
	.long	67                              ; 0x43
	.long	72                              ; 0x48
	.long	85                              ; 0x55
	.long	75                              ; 0x4b
	.long	67                              ; 0x43
	.long	72                              ; 0x48
	.long	85                              ; 0x55
	.long	75                              ; 0x4b
	.long	67                              ; 0x43
	.long	72                              ; 0x48
	.long	85                              ; 0x55
	.long	75                              ; 0x4b
	.long	67                              ; 0x43
	.long	72                              ; 0x48
	.long	85                              ; 0x55
	.long	75                              ; 0x4b

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_mxf_essence_element_key,4,2    ; @mxf_essence_element_key
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"probably incorrect decryption key\n"

	.no_dead_strip	_mxf_decrypt_triplet
.subsections_via_symbols
