	.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
	movl	(%rsi), %eax
	cmpl	$255, %eax
	je	LBB0_4
## %bb.1:
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	leal	-1(%r15), %r12d
	leaq	4(%rsi), %r13
	testl	%eax, %eax
	jne	LBB0_10
## %bb.2:
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	cmpl	$2, %r15d
	jg	LBB0_5
## %bb.3:
	movq	_D_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PDEBUG
	movq	_DISCARD_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	testb	$16, 8(%rbx)
	jne	LBB0_6
## %bb.9:
	movl	(%r14), %eax
	movq	_Rev012A@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	xorl	%esi, %esi
	cmpl	(%rcx), %eax
	sete	%dl
	setne	%sil
	leal	(%r15,%rsi,4), %ecx
	addl	$-21, %ecx
	shlq	$4, %rdx
	addq	%rbx, %rdx
	addq	$68, %rdx
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	jmp	LBB0_8
LBB0_6:
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r13, %rdx
	movl	%r12d, %ecx
LBB0_8:
	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	_LAST_PACKET,4,2                ## @LAST_PACKET
	.comm	_D_ERR,4,2                      ## @D_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Short SOF packet, ignoring"

	.comm	_DISCARD_PACKET,4,2             ## @DISCARD_PACKET
	.comm	_FIRST_PACKET,4,2               ## @FIRST_PACKET
	.comm	_Rev012A,4,2                    ## @Rev012A
	.comm	_INTER_PACKET,4,2               ## @INTER_PACKET
	.comm	_KEY_CAMERA,4,2                 ## @KEY_CAMERA
	.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	x22, x1
	ldr	w8, [x22], #4
	cmp	w8, #255
	b.eq	LBB0_4
; %bb.1:
	mov	x21, x2
	mov	x19, x0
	sub	w23, w2, #1
	cbnz	w8, LBB0_5
; %bb.2:
	mov	x20, x1
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
	cmp	w21, #2
	b.gt	LBB0_6
; %bb.3:
Lloh3:
	adrp	x8, _D_ERR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _D_ERR@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
Lloh8:
	adrp	x8, _DISCARD_PACKET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DISCARD_PACKET@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_4:
	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_5:
Lloh11:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	ldrb	w8, [x20, #8]
	tbnz	w8, #4, LBB0_8
; %bb.7:
Lloh13:
	adrp	x8, _Rev012A@GOTPAGE
Lloh14:
	ldr	x8, [x8, _Rev012A@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh15:
	ldr	w8, [x8]
	mov	w10, #-17
	mov	w11, #-21
	cmp	w9, w8
	csel	w8, w11, w10, eq
	add	w3, w8, w21
	mov	w8, #68
	mov	w9, #84
	csel	x8, x9, x8, eq
Lloh16:
	adrp	x9, _FIRST_PACKET@GOTPAGE
Lloh17:
	ldr	x9, [x9, _FIRST_PACKET@GOTPAGEOFF]
	add	x2, x20, x8
Lloh18:
	ldr	w1, [x9]
	mov	x0, x19
	b	LBB0_10
LBB0_8:
Lloh19:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
LBB0_9:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
LBB0_10:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_LAST_PACKET,4,2                ; @LAST_PACKET
	.comm	_D_ERR,4,2                      ; @D_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Short SOF packet, ignoring"

	.comm	_DISCARD_PACKET,4,2             ; @DISCARD_PACKET
	.comm	_FIRST_PACKET,4,2               ; @FIRST_PACKET
	.comm	_Rev012A,4,2                    ; @Rev012A
	.comm	_INTER_PACKET,4,2               ; @INTER_PACKET
	.comm	_KEY_CAMERA,4,2                 ; @KEY_CAMERA
	.no_dead_strip	_sd_pkt_scan
.subsections_via_symbols
