	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function h264_remove_emulation_prevention_bytes
_h264_remove_emulation_prevention_bytes: ## @h264_remove_emulation_prevention_bytes
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	(%rdi), %eax
	andl	$31, %eax
	movq	_NAL_UNIT_PREFIX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	sete	%cl
	movq	_NAL_UNIT_EXTENSION@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	sete	%al
	orb	%cl, %al
	movzbl	%al, %eax
	leal	(%rax,%rax,2), %eax
	incl	%eax
	movl	%eax, %r12d
	orl	$2, %r12d
	cmpl	%esi, %r12d
	jge	LBB0_10
## %bb.1:
	movq	%rdi, %r14
	movl	%eax, %eax
	movl	(%rdi,%rax,4), %edx
	movl	4(%rdi,%rax,4), %eax
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r12d
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %edx
	movl	%ecx, %eax
	cmpl	%r15d, %r12d
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r12d, %rsi
	movl	(%r14,%rsi,4), %ecx
	testl	%edx, %edx
	jne	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$3, %ecx
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%r15d
	movl	%r15d, %edx
	subl	%r12d, %edx
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r14,%rsi,4), %rbx
	leaq	(%r14,%rsi,4), %rsi
	addq	$4, %rsi
	movq	%rbx, %rdi
	callq	_memmove
	movl	(%rbx), %ecx
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_6:
	movl	%r12d, %r15d
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAL_UNIT_PREFIX,4,2            ## @NAL_UNIT_PREFIX
	.comm	_NAL_UNIT_EXTENSION,4,2         ## @NAL_UNIT_EXTENSION
	.no_dead_strip	_h264_remove_emulation_prevention_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function h264_remove_emulation_prevention_bytes
_h264_remove_emulation_prevention_bytes: ; @h264_remove_emulation_prevention_bytes
	.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, x1
	ldr	w8, [x0]
	and	w8, w8, #0x1f
Lloh0:
	adrp	x9, _NAL_UNIT_PREFIX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAL_UNIT_PREFIX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _NAL_UNIT_EXTENSION@GOTPAGE
Lloh4:
	ldr	x10, [x10, _NAL_UNIT_EXTENSION@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w8, w10
	ccmp	w8, w9, #4, ne
	mov	w8, #4
	csinc	w8, w8, wzr, eq
	orr	w21, w8, #0x2
	cmp	w21, w1
	b.ge	LBB0_10
; %bb.1:
	mov	x20, x0
	add	w9, w8, #1
	ldr	w10, [x0, w8, uxtw #2]
	ldr	w8, [x0, w9, uxtw #2]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x10, x8
	mov	x8, x9
	cmp	w21, w19
	b.ge	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, x20, w21, sxtw #2
	ldr	w9, [x0]
	cbnz	w10, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w8, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, #3
	b.ne	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w19, w19, #1
	subs	w2, w19, w21
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	sxtw	x8, w21
	add	x22, x20, x8, lsl #2
	add	x1, x22, #4
	bl	_memmove
	mov	w8, #0
	ldr	w9, [x22]
	b	LBB0_3
LBB0_9:
	mov	x19, x21
LBB0_10:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NAL_UNIT_PREFIX,4,2            ; @NAL_UNIT_PREFIX
	.comm	_NAL_UNIT_EXTENSION,4,2         ; @NAL_UNIT_EXTENSION
	.no_dead_strip	_h264_remove_emulation_prevention_bytes
.subsections_via_symbols
