	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_mov_cenc_avc_write_nal_units ## -- Begin function ff_mov_cenc_avc_write_nal_units
	.p2align	4, 0x90
_ff_mov_cenc_avc_write_nal_units:       ## @ff_mov_cenc_avc_write_nal_units
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movq	%r8, %rbx
	movq	%rcx, %r12
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_mov_cenc_start_packet
	testl	%eax, %eax
	jne	LBB0_21
## %bb.1:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	jle	LBB0_23
## %bb.2:
	leal	1(%rax), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leal	-1(%rax), %ecx
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %ecx
	andl	$3, %ecx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %r14d
	andl	$-4, %r14d
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
	movl	%r15d, %r13d
	subl	%eax, %r15d
	jle	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_avio_write
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testl	%edi, %edi
	jle	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %r8
	xorl	%r12d, %r12d
	cmpl	$3, -60(%rbp)                   ## 4-byte Folded Reload
	jae	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
                                        ## implicit-def: $rdx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_13
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	addq	$-16, %rax
	addq	$4, %rcx
	cmpl	%ecx, %r14d
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	-4(%rbx), %rdx
	subq	%rax, %rdx
	movl	-16(%rbx,%rcx,4), %esi
	movl	-12(%rbx,%rcx,4), %r12d
	shll	$16, %esi
	shll	$8, %r12d
	orl	%esi, %r12d
	orl	-8(%rbx,%rcx,4), %r12d
	shll	$8, %r12d
	orl	-4(%rbx,%rcx,4), %r12d
	subq	%rax, %rbx
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	shll	$8, %r12d
	orl	(%rbx), %r12d
	addq	$4, %rbx
	decl	%eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	-4(%rbx), %rdx
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	subl	%edi, %r13d
	testl	%r12d, %r12d
	jle	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r12d, %r13d
	jl	LBB0_18
## %bb.22:                              ##   in Loop: Header=BB0_3 Depth=1
	addq	$8, %rdx
	movl	%r13d, -64(%rbp)                ## 4-byte Spill
	leal	-1(%r12), %r15d
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movq	%r8, %rsi
	movl	%r15d, %ecx
	callq	_mov_cenc_write_encrypted
	movl	%r12d, %eax
	leaq	(%rbx,%rax,4), %rbx
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	-64(%rbp), %r15d                ## 4-byte Reload
	callq	_auxiliary_info_add_subsample
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	subl	%r12d, %r15d
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	jg	LBB0_3
LBB0_23:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mov_cenc_end_packet            ## TAILCALL
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	jmp	LBB0_20
LBB0_8:
	xorl	%r12d, %r12d
	jmp	LBB0_19
LBB0_18:
	movl	%r13d, %r15d
LBB0_19:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %ecx
	movl	%r15d, %r8d
LBB0_20:
	callq	_av_log
	movl	$-1, %eax
LBB0_21:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CENC-AVC: remaining size %d smaller than nal length+type %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"CENC-AVC: nal size %d remaining %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_mov_cenc_avc_write_nal_units ; -- Begin function ff_mov_cenc_avc_write_nal_units
	.p2align	2
_ff_mov_cenc_avc_write_nal_units:       ; @ff_mov_cenc_avc_write_nal_units
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x26, x5
	mov	x23, x4
	mov	x20, x3
	mov	x22, x2
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	bl	_mov_cenc_start_packet
	cbnz	w0, LBB0_14
; %bb.1:
	cmp	w26, #1
	b.lt	LBB0_9
; %bb.2:
	add	w24, w22, #1
	sub	w8, w22, #1
	add	x28, x8, #1
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	subs	w25, w26, w22
	b.le	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	mov	x1, x23
	mov	x2, x24
	bl	_avio_write
	cmp	w22, #1
	b.lt	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w26, #0
	mov	x8, x22
	mov	x9, x23
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w10, [x9], #4
	orr	w26, w10, w26, lsl #8
	subs	w8, w8, #1
	b.ne	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	subs	w27, w26, #1
	ccmp	w25, w26, #8, ge
	b.lt	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, x28, lsl #2
	add	x2, x23, #4
	mov	x0, x21
	mov	x1, x20
	mov	x3, x27
	bl	_mov_cenc_write_encrypted
	add	x23, x23, x26, lsl #2
	sub	w26, w25, w26
	mov	x0, x21
	mov	x1, x24
	mov	x2, x27
	bl	_auxiliary_info_add_subsample
	cmp	w26, #0
	b.gt	LBB0_3
LBB0_9:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mov_cenc_end_packet
LBB0_10:
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
	mov	x0, x19
	mov	x3, x26
	mov	x4, x24
	b	LBB0_13
LBB0_11:
	mov	w26, #0
LBB0_12:
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x3, x26
	mov	x4, x25
LBB0_13:
	bl	_av_log
	mov	w0, #-1
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CENC-AVC: remaining size %d smaller than nal length+type %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"CENC-AVC: nal size %d remaining %d\n"

.subsections_via_symbols
