	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpeg4_is_resync
_mpeg4_is_resync:                       ## @mpeg4_is_resync
	.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
	leaq	20(%rdi), %r15
	movq	%r15, %rdi
	callq	_get_bits_count
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	$16, %esi
	callq	_show_bits
	movq	_FF_BUG_NO_PADDING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%r14)
	je	LBB0_2
## %bb.1:
	cmpl	$0, (%r14)
	je	LBB0_21
LBB0_2:
	cmpl	$255, %eax
	jg	LBB0_8
## %bb.3:
	movq	_AV_PICTURE_TYPE_B@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%r14), %esi
	cmpl	(%r12), %esi
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movb	$8, %cl
	subb	%sil, %cl
	movl	%eax, %edx
	sarl	%cl, %edx
	cmpl	$1, %edx
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, 24(%r14)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	$8, %esi
	movq	%r15, %rdi
	callq	_skip_bits
	movl	12(%r14), %eax
	addl	%eax, %ebx
	addl	$8, %ebx
	movq	%r15, %rdi
	movl	$16, %esi
	callq	_show_bits
	cmpl	$256, %eax                      ## imm = 0x100
	jl	LBB0_4
LBB0_8:
	leal	8(%rbx), %ecx
	cmpl	(%r15), %ecx
	jge	LBB0_9
## %bb.11:
	movq	_ff_mpeg4_resync_prefix@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	andl	$7, %ebx
	cmpl	(%rcx,%rbx,4), %eax
	jne	LBB0_21
## %bb.12:
	leaq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	16(%r14), %edi
	decl	%edi
	callq	_av_log2
	movl	%eax, %ebx
	incl	%ebx
	movl	20(%r14), %r13d
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_skip_bits
	movq	%r15, %rdi
	callq	_align_get_bits
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_get_bits1
	testq	%rax, %rax
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	incl	%r12d
	cmpl	$32, %r12d
	jne	LBB0_13
## %bb.15:
	movl	$32, %r12d
LBB0_16:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_get_bits
	testl	%eax, %eax
	je	LBB0_19
## %bb.17:
	movl	%eax, %ebx
	cmpl	16(%r14), %eax
	jg	LBB0_19
## %bb.18:
	movq	%r15, %rdi
	callq	_get_bits_count
	addl	$6, %eax
	cmpl	(%r15), %eax
	jle	LBB0_20
LBB0_19:
	movl	$-1, %ebx
LBB0_20:
	movl	%r13d, 20(%r14)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ff_mpeg4_get_video_packet_prefix_length
	cmpl	%eax, %r12d
	jl	LBB0_21
	jmp	LBB0_22
LBB0_9:
	notb	%bl
	andb	$7, %bl
	movl	$127, %edx
	movl	%ebx, %ecx
	shrl	%cl, %edx
	sarl	$8, %eax
	orl	%eax, %edx
	cmpl	$127, %edx
	jne	LBB0_21
## %bb.10:
	movl	16(%r14), %ebx
	jmp	LBB0_22
LBB0_21:
	xorl	%ebx, %ebx
LBB0_22:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FF_BUG_NO_PADDING,4,2          ## @FF_BUG_NO_PADDING
	.comm	_AV_PICTURE_TYPE_B,4,2          ## @AV_PICTURE_TYPE_B
	.comm	_ff_mpeg4_resync_prefix,8,3     ## @ff_mpeg4_resync_prefix
	.no_dead_strip	_mpeg4_is_resync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpeg4_is_resync
_mpeg4_is_resync:                       ; @mpeg4_is_resync
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	add	x20, x0, #20
	mov	x0, x20
	bl	_get_bits_count
	mov	x22, x0
	mov	x0, x20
	mov	w1, #16
	bl	_show_bits
	mov	x21, x19
	ldr	w8, [x21, #8]!
Lloh0:
	adrp	x9, _FF_BUG_NO_PADDING@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FF_BUG_NO_PADDING@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	ldr	w8, [x19]
	cbz	w8, LBB0_20
LBB0_2:
	cmp	w0, #255
	b.gt	LBB0_8
; %bb.3:
Lloh3:
	adrp	x23, _AV_PICTURE_TYPE_B@GOTPAGE
Lloh4:
	ldr	x23, [x23, _AV_PICTURE_TYPE_B@GOTPAGEOFF]
	mov	w24, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #12]
	ldr	w9, [x23]
	cmp	w8, w9
	b.eq	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w9, w24, w8
	asr	w9, w0, w9
	cmp	w9, #1
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x19, #24]
	cbnz	x9, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w1, w8, #8
	mov	x0, x20
	bl	_skip_bits
	ldr	w8, [x19, #12]
	add	w8, w22, w8
	add	w22, w8, #8
	mov	x0, x20
	mov	w1, #16
	bl	_show_bits
	cmp	w0, #256
	b.lt	LBB0_4
LBB0_8:
	add	w8, w22, #8
	ldr	w9, [x20]
	cmp	w8, w9
	b.ge	LBB0_18
; %bb.9:
Lloh5:
	adrp	x8, _ff_mpeg4_resync_prefix@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ff_mpeg4_resync_prefix@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	and	w9, w22, #0x7
	ldr	w8, [x8, w9, uxtw #2]
	cmp	w0, w8
	b.ne	LBB0_20
; %bb.10:
	ldr	w8, [x19, #16]
	sub	w0, w8, #1
	bl	_av_log2
	add	w22, w0, #1
	ldr	w23, [x19, #20]
	mov	x0, x20
	mov	w1, #1
	bl	_skip_bits
	mov	x0, x20
	bl	_align_get_bits
	mov	w24, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_get_bits1
	cbnz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	w24, w24, #1
	cmp	w24, #32
	b.ne	LBB0_11
LBB0_13:
	mov	x0, x20
	mov	x1, x22
	bl	_get_bits
	cbz	w0, LBB0_16
; %bb.14:
	mov	x22, x0
	ldr	w8, [x19, #16]
	cmp	w0, w8
	b.gt	LBB0_16
; %bb.15:
	mov	x0, x20
	bl	_get_bits_count
	add	w8, w0, #6
	ldr	w9, [x20]
	cmp	w8, w9
	b.le	LBB0_17
LBB0_16:
	mov	w22, #-1
LBB0_17:
	str	w23, [x19, #20]
	mov	x0, x21
	bl	_ff_mpeg4_get_video_packet_prefix_length
	cmp	w24, w0
	b.lt	LBB0_20
	b	LBB0_21
LBB0_18:
	mvn	w8, w22
	and	w8, w8, #0x7
	mov	w9, #127
	lsr	w8, w9, w8
	orr	w8, w8, w0, asr #8
	cmp	w8, #127
	b.ne	LBB0_20
; %bb.19:
	ldr	w22, [x19, #16]
	b	LBB0_21
LBB0_20:
	mov	w22, #0
LBB0_21:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_FF_BUG_NO_PADDING,4,2          ; @FF_BUG_NO_PADDING
	.comm	_AV_PICTURE_TYPE_B,4,2          ; @AV_PICTURE_TYPE_B
	.comm	_ff_mpeg4_resync_prefix,8,3     ; @ff_mpeg4_resync_prefix
	.no_dead_strip	_mpeg4_is_resync
.subsections_via_symbols
