	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_pkt_scan
_sd_pkt_scan:                           ## @sd_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	%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, %r13
	cmpl	$3, %edx
	jg	LBB0_1
## %bb.14:
	movq	_D_PACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r13, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_dbg                      ## TAILCALL
LBB0_1:
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	8(%rsi), %edi
	callq	_le16_to_cpu
	xorl	%ecx, %ecx
	testl	$256, %eax                      ## imm = 0x100
	sete	%cl
	cmpl	%ecx, (%r13)
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_3:
	movq	8(%r13), %rax
	incq	%rax
LBB0_4:
	movq	%rax, 8(%r13)
	movq	_STK1135_HDR_FRAME_START@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_9
## %bb.5:
	movl	4(%r13), %ebx
	movq	_STK1135_HDR_SEQ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_6
LBB0_9:
	movq	_STK1135_HDR_SEQ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	4(%r15), %ebx
	andl	%ecx, %ebx
	cmpl	4(%r13), %ebx
	jne	LBB0_10
LBB0_6:
	leal	1(%rbx), %edx
	xorl	%esi, %esi
	cmpl	%ecx, %ebx
	cmovll	%edx, %esi
	movl	%esi, 4(%r13)
	cmpl	$12, %r14d
	je	LBB0_11
## %bb.7:
	testl	%eax, (%r15)
	je	LBB0_8
## %bb.12:
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	$8, %eax
	jmp	LBB0_13
LBB0_10:
	movq	_D_PACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	callq	_gspca_dbg
	movl	%ebx, 4(%r13)
	movq	_DISCARD_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$12, %eax
LBB0_13:
	movl	%eax, %ecx
	leaq	(%r15,%rcx,4), %rdx
	subl	%eax, %r14d
	movq	%r13, %rdi
	movl	%r12d, %esi
	movl	%r14d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_frame_add                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_INTER_PACKET,4,2               ## @INTER_PACKET
	.comm	_D_PACK,4,2                     ## @D_PACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"received short packet (less than 4 bytes)\n"

	.comm	_STK1135_HDR_FRAME_START,4,2    ## @STK1135_HDR_FRAME_START
	.comm	_STK1135_HDR_SEQ_MASK,4,2       ## @STK1135_HDR_SEQ_MASK
L_.str.1:                               ## @.str.1
	.asciz	"received out-of-sequence packet\n"

	.comm	_DISCARD_PACKET,4,2             ## @DISCARD_PACKET
	.comm	_LAST_PACKET,4,2                ## @LAST_PACKET
	.comm	_FIRST_PACKET,4,2               ## @FIRST_PACKET
	.no_dead_strip	_sd_pkt_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_pkt_scan
_sd_pkt_scan:                           ; @sd_pkt_scan
	.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
	cmp	w2, #3
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _D_PACK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D_PACK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	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
	b	_gspca_dbg
LBB0_2:
	mov	x20, x2
	mov	x21, x1
Lloh5:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
	ldr	w0, [x1, #8]
	bl	_le16_to_cpu
	mov	w8, #1
	bic	w8, w8, w0, lsr #8
	ldr	w9, [x19]
	cmp	w9, w8
	b.ne	LBB0_4
; %bb.3:
	mov	x8, #0
	b	LBB0_5
LBB0_4:
	ldr	x8, [x19, #8]
	add	x8, x8, #1
LBB0_5:
	str	x8, [x19, #8]
	ldr	w9, [x21]
Lloh8:
	adrp	x8, _STK1135_HDR_FRAME_START@GOTPAGE
Lloh9:
	ldr	x8, [x8, _STK1135_HDR_FRAME_START@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_7
; %bb.6:
	ldr	w23, [x19, #4]
Lloh11:
	adrp	x9, _STK1135_HDR_SEQ_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _STK1135_HDR_SEQ_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	b	LBB0_8
LBB0_7:
	ldr	w10, [x21, #4]
Lloh14:
	adrp	x9, _STK1135_HDR_SEQ_MASK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _STK1135_HDR_SEQ_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w23, w9, w10
	ldr	w10, [x19, #4]
	cmp	w23, w10
	b.ne	LBB0_11
LBB0_8:
	cmp	w23, w9
	csinc	w9, wzr, w23, ge
	str	w9, [x19, #4]
	cmp	w20, #12
	b.eq	LBB0_12
; %bb.9:
	ldr	w9, [x21]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.10:
Lloh17:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #0
	bl	_gspca_frame_add
Lloh20:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
Lloh22:
	ldr	w22, [x8]
	mov	w8, #8
	b	LBB0_14
LBB0_11:
Lloh23:
	adrp	x8, _D_PACK@GOTPAGE
Lloh24:
	ldr	x8, [x8, _D_PACK@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x2, l_.str.1@PAGE
Lloh27:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_gspca_dbg
Lloh28:
	adrp	x8, _DISCARD_PACKET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DISCARD_PACKET@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	stp	w8, w23, [x19]
LBB0_12:
	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
LBB0_13:
	mov	w8, #12
LBB0_14:
	add	x2, x21, w8, uxtw #2
	sub	w3, w20, w8
	mov	x0, x19
	mov	x1, 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
	b	_gspca_frame_add
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_INTER_PACKET,4,2               ; @INTER_PACKET
	.comm	_D_PACK,4,2                     ; @D_PACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"received short packet (less than 4 bytes)\n"

	.comm	_STK1135_HDR_FRAME_START,4,2    ; @STK1135_HDR_FRAME_START
	.comm	_STK1135_HDR_SEQ_MASK,4,2       ; @STK1135_HDR_SEQ_MASK
l_.str.1:                               ; @.str.1
	.asciz	"received out-of-sequence packet\n"

	.comm	_DISCARD_PACKET,4,2             ; @DISCARD_PACKET
	.comm	_LAST_PACKET,4,2                ; @LAST_PACKET
	.comm	_FIRST_PACKET,4,2               ; @FIRST_PACKET
	.no_dead_strip	_sd_pkt_scan
.subsections_via_symbols
