	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mov_cenc_end_packet
_mov_cenc_end_packet:                   ## @mov_cenc_end_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	52(%rdi), %edi
	callq	_av_aes_ctr_increment_iv
	cmpl	$0, 48(%rbx)
	movl	(%rbx), %eax
	je	LBB0_1
## %bb.2:
	cmpl	4(%rbx), %eax
	jl	LBB0_5
## %bb.3:
	cltq
	leaq	(%rax,%rax), %r14
	incq	%r14
	leaq	40(%rbx), %rdi
	movq	%r14, %rsi
	callq	_av_reallocp
	testq	%rax, %rax
	je	LBB0_4
## %bb.7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_1:
	incl	%eax
	movl	%eax, (%rbx)
	jmp	LBB0_6
LBB0_4:
	movl	%r14d, 4(%rbx)
	movl	(%rbx), %eax
LBB0_5:
	movq	_AES_CTR_IV_SIZE@GOTPCREL(%rip), %rcx
	movq	32(%rbx), %rdx
	addq	(%rcx), %rdx
	movq	40(%rbx), %rcx
	subq	16(%rbx), %rdx
	cltq
	movq	%rdx, (%rcx,%rax,8)
	incl	%eax
	movl	%eax, (%rbx)
	movq	16(%rbx), %rdi
	addq	24(%rbx), %rdi
	movl	8(%rbx), %esi
	callq	_AV_WB16
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AES_CTR_IV_SIZE,8,3            ## @AES_CTR_IV_SIZE
	.no_dead_strip	_mov_cenc_end_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mov_cenc_end_packet
_mov_cenc_end_packet:                   ; @mov_cenc_end_packet
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w0, [x0, #52]
	bl	_av_aes_ctr_increment_iv
	ldr	w9, [x19, #48]
	ldr	w8, [x19]
	cbz	w9, LBB0_4
; %bb.1:
	ldr	w9, [x19, #4]
	cmp	w8, w9
	b.lt	LBB0_6
; %bb.2:
	sxtw	x8, w8
	mov	w20, #1
	bfi	x20, x8, #1, #63
	add	x0, x19, #40
	mov	x1, x20
	bl	_av_reallocp
	cbz	x0, LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_4:
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_7
LBB0_5:
	str	w20, [x19, #4]
	ldr	w8, [x19]
LBB0_6:
Lloh3:
	adrp	x9, _AES_CTR_IV_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AES_CTR_IV_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x10, [x19, #16]
	ldp	x11, x12, [x19, #32]
	add	x9, x11, x9
	sub	x9, x9, x10
	str	x9, [x12, w8, sxtw #3]
	add	w8, w8, #1
	str	w8, [x19]
	ldp	x9, x8, [x19, #16]
	add	x0, x9, x8
	ldr	w1, [x19, #8]
	bl	_AV_WB16
LBB0_7:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AES_CTR_IV_SIZE,8,3            ; @AES_CTR_IV_SIZE
	.no_dead_strip	_mov_cenc_end_packet
.subsections_via_symbols
