	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov518_pkt_scan
_ov518_pkt_scan:                        ## @ov518_pkt_scan
	.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	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movdqu	(%rsi), %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	por	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	orl	20(%rsi), %eax
	jne	LBB0_3
## %bb.1:
	movl	24(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_3
## %bb.2:
	shrl	%esi
	andl	$1, %esi
	movq	%r15, %rdi
	callq	_ov51x_handle_button
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	movl	$0, (%r15)
LBB0_3:
	movq	(%r15), %rcx
	movq	_DISCARD_PACKET@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rcx
	jne	LBB0_4
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	testb	$7, %r14b
	je	LBB0_7
## %bb.5:
	movslq	%r14d, %rax
	decl	%r14d
	movl	-4(%rbx,%rax,4), %edx
	cmpl	%ecx, %edx
	jne	LBB0_8
## %bb.6:
	incl	%ecx
	movl	%ecx, (%r15)
	jmp	LBB0_7
LBB0_8:
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.9:
	testl	%edx, %edx
	jne	LBB0_10
LBB0_7:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movl	%r14d, %ecx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_frame_add                ## TAILCALL
LBB0_10:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_gspca_err
	movq	(%r12), %rax
	movq	%rax, (%r15)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_LAST_PACKET,4,2                ## @LAST_PACKET
	.comm	_FIRST_PACKET,4,2               ## @FIRST_PACKET
	.comm	_DISCARD_PACKET,8,3             ## @DISCARD_PACKET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid packet nr: %d (expect: %d)\n"

	.comm	_INTER_PACKET,4,2               ## @INTER_PACKET
	.no_dead_strip	_ov518_pkt_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov518_pkt_scan
_ov518_pkt_scan:                        ; @ov518_pkt_scan
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	q0, [x1]
	ldr	w8, [x1, #20]
	ext.16b	v1, v0, v0, #8
	orr.8b	v0, v0, v1
	mov.s	w9, v0[1]
	fmov	w10, s0
	orr	w9, w10, w9
	orr	w8, w9, w8
	cbnz	w8, LBB0_3
; %bb.1:
	ldr	w8, [x21, #24]
	cbz	w8, LBB0_3
; %bb.2:
	ubfx	w1, w8, #1, #1
	mov	x0, x19
	bl	_ov51x_handle_button
Lloh0:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_gspca_frame_add
Lloh3:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_gspca_frame_add
	str	wzr, [x19]
LBB0_3:
	ldr	x3, [x19]
Lloh6:
	adrp	x22, _DISCARD_PACKET@GOTPAGE
Lloh7:
	ldr	x22, [x22, _DISCARD_PACKET@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x3, x8
	b.ne	LBB0_5
LBB0_4:
	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_5:
	tst	w20, #0x7
	b.eq	LBB0_10
; %bb.6:
	sub	w20, w20, #1
	ldr	w2, [x21, w20, sxtw #2]
	cmp	w2, w3
	b.ne	LBB0_8
; %bb.7:
	add	w8, w3, #1
	str	w8, [x19]
	b	LBB0_10
LBB0_8:
	cbz	w3, LBB0_11
; %bb.9:
	cbnz	w2, LBB0_11
LBB0_10:
Lloh8:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	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	_gspca_frame_add
LBB0_11:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_gspca_err
	ldr	x8, [x22]
	str	x8, [x19]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_LAST_PACKET,4,2                ; @LAST_PACKET
	.comm	_FIRST_PACKET,4,2               ; @FIRST_PACKET
	.comm	_DISCARD_PACKET,8,3             ; @DISCARD_PACKET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid packet nr: %d (expect: %d)\n"

	.comm	_INTER_PACKET,4,2               ; @INTER_PACKET
	.no_dead_strip	_ov518_pkt_scan
.subsections_via_symbols
