	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_read_tenc
_mov_read_tenc:                         ## @mov_read_tenc
	.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	(%rdi), %rdi
	movl	(%rdi), %eax
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jle	LBB0_26
## %bb.1:
	movq	8(%rdi), %rcx
	decl	%eax
	movq	(%rcx,%rax,8), %rax
	movq	(%rax), %r12
	cmpq	$0, (%r12)
	je	LBB0_3
## %bb.2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_3:
	movl	%edx, %ebx
	movq	%rsi, %r15
	cmpq	$0, 16(%r12)
	jne	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	movl	$16, %esi
	movl	$16, %edx
	callq	_av_encryption_info_alloc
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_27
LBB0_5:
	cmpl	$19, %ebx
	jle	LBB0_24
## %bb.6:
	movq	%r15, %rdi
	callq	_avio_r8
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_avio_rb24
	movq	%r15, %rdi
	callq	_avio_r8
	movq	%r15, %rdi
	callq	_avio_r8
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:
	movl	%eax, %ecx
	shrl	$4, %ecx
	movq	16(%r12), %rdx
	movl	%ecx, (%rdx)
	andl	$15, %eax
	movl	%eax, 4(%rdx)
LBB0_8:
	movq	%r15, %rdi
	callq	_avio_r8
	movq	%rax, %rbx
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.9:
	cmpq	$0, 24(%r12)
	jne	LBB0_11
## %bb.10:
	movl	$4, %edi
	callq	_av_mallocz
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_27
LBB0_11:
	movq	%r15, %rdi
	callq	_avio_r8
	movl	%eax, 8(%r12)
	cmpl	$16, %eax
	ja	LBB0_13
## %bb.12:
	movl	$65793, %ecx                    ## imm = 0x10101
	btl	%eax, %ecx
	jae	LBB0_13
## %bb.14:
	movq	16(%r12), %rax
	movl	12(%rax), %esi
	movq	%r15, %rdi
	movl	$16, %edx
	callq	_avio_read
	cmpl	$16, %eax
	jne	LBB0_15
## %bb.16:
	testl	%ebx, %ebx
	je	LBB0_26
## %bb.17:
	cmpl	$0, 8(%r12)
	jne	LBB0_26
## %bb.18:
	movq	%r15, %rdi
	callq	_avio_r8
	movq	%rax, %rbx
	cmpl	$8, %ebx
	je	LBB0_21
## %bb.19:
	cmpl	$16, %ebx
	jne	LBB0_20
LBB0_21:
	movq	16(%r12), %rax
	movl	8(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_avio_read
	cmpl	%ebx, %eax
	je	LBB0_26
## %bb.22:
	movq	(%r14), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_23
LBB0_27:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_15:
	movq	(%r14), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_23
LBB0_13:
	movq	(%r14), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_23:
	callq	_av_log
LBB0_24:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %r13d
LBB0_26:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	(%r14), %rdi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tenc atom are only supported in first sample descriptor\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"invalid per-sample IV size value\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to read the default key ID\n"

L_.str.3:                               ## @.str.3
	.asciz	"invalid default_constant_IV_size in tenc atom\n"

L_.str.4:                               ## @.str.4
	.asciz	"failed to read the default IV\n"

	.no_dead_strip	_mov_read_tenc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mov_read_tenc
_mov_read_tenc:                         ; @mov_read_tenc
	.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
	ldr	x0, [x0]
	ldr	w8, [x0]
	subs	w8, w8, #1
	b.lt	LBB0_16
; %bb.1:
	ldr	x9, [x0, #8]
	ldr	x8, [x9, w8, uxtw #3]
	ldr	x22, [x8]
	ldr	x8, [x22]
	cbz	x8, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh5:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
	b	LBB0_22
LBB0_3:
	mov	x21, x2
	mov	x20, x1
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_5
; %bb.4:
	mov	w0, #0
	mov	w1, #16
	mov	w2, #16
	bl	_av_encryption_info_alloc
	str	x0, [x22, #16]
	cbz	x0, LBB0_17
LBB0_5:
	cmp	w21, #19
	b.le	LBB0_21
; %bb.6:
	mov	x0, x20
	bl	_avio_r8
	mov	x21, x0
	mov	x0, x20
	bl	_avio_rb24
	mov	x0, x20
	bl	_avio_r8
	mov	x0, x20
	bl	_avio_r8
	cbz	w21, LBB0_8
; %bb.7:
	ubfx	x8, x0, #4, #28
	ldr	x9, [x22, #16]
	and	w10, w0, #0xf
	stp	w8, w10, [x9]
LBB0_8:
	mov	x0, x20
	bl	_avio_r8
	mov	x21, x0
	cbz	w21, LBB0_11
; %bb.9:
	ldr	x8, [x22, #24]
	cbnz	x8, LBB0_11
; %bb.10:
	mov	w0, #4
	bl	_av_mallocz
	str	x0, [x22, #24]
	cbz	x0, LBB0_17
LBB0_11:
	mov	x0, x20
	bl	_avio_r8
	str	w0, [x22, #8]
	cmp	w0, #16
	b.hi	LBB0_19
; %bb.12:
	mov	w8, #1
	lsl	w8, w8, w0
	mov	w9, #257
	movk	w9, #1, lsl #16
	tst	w8, w9
	b.eq	LBB0_19
; %bb.13:
	ldr	x8, [x22, #16]
	ldr	w1, [x8, #12]
	mov	x0, x20
	mov	w2, #16
	bl	_avio_read
	cmp	w0, #16
	b.ne	LBB0_18
; %bb.14:
	cbz	w21, LBB0_16
; %bb.15:
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_24
LBB0_16:
	mov	w0, #0
	b	LBB0_23
LBB0_17:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	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	_AVERROR
LBB0_18:
	ldr	x0, [x19]
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.2@PAGE
Lloh14:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_20
LBB0_19:
	ldr	x0, [x19]
Lloh15:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_20:
	bl	_av_log
LBB0_21:
Lloh20:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
LBB0_22:
	ldr	w0, [x8]
LBB0_23:
	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
	ret
LBB0_24:
	mov	x0, x20
	bl	_avio_r8
	mov	x21, x0
	cmp	w21, #8
	b.eq	LBB0_26
; %bb.25:
	cmp	w21, #16
	b.ne	LBB0_28
LBB0_26:
	ldr	x8, [x22, #16]
	ldr	w1, [x8, #8]
	mov	x0, x20
	mov	x2, x21
	bl	_avio_read
	cmp	w0, w21
	b.eq	LBB0_16
; %bb.27:
	ldr	x0, [x19]
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.4@PAGE
Lloh26:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_20
LBB0_28:
	ldr	x0, [x19]
Lloh27:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x2, l_.str.3@PAGE
Lloh31:
	add	x2, x2, l_.str.3@PAGEOFF
	b	LBB0_20
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tenc atom are only supported in first sample descriptor\n"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"invalid per-sample IV size value\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to read the default key ID\n"

l_.str.3:                               ; @.str.3
	.asciz	"invalid default_constant_IV_size in tenc atom\n"

l_.str.4:                               ; @.str.4
	.asciz	"failed to read the default IV\n"

	.no_dead_strip	_mov_read_tenc
.subsections_via_symbols
