	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpl	$64, %edx
	jne	LBB0_3
## %bb.1:
	leaq	_sd_pkt_scan.frame_header(%rip), %rsi
	movq	%r15, %rdi
	movl	$6, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_2
LBB0_3:
	movq	(%r14), %rdx
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_6
## %bb.4:
	movq	16(%r14), %rax
	movslq	8(%r14), %rcx
	movq	_MODE_JPEG@GOTPCREL(%rip), %rsi
	movl	(%rsi), %edi
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	testl	%edi, (%rax,%rcx,4)
	je	LBB0_7
## %bb.5:
	movq	_JPEG_HDR_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_gspca_frame_add
LBB0_6:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_7:
	movq	%r14, %rdi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	jmp	LBB0_8
LBB0_2:
	movl	140(%r15), %eax
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$3, %ecx
	movl	76(%r15), %edx
	movl	80(%r15), %esi
	leal	(%rcx,%rsi,4), %ecx
	shll	$10, %edx
	orl	%ecx, %edx
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$3, %ecx
	movl	88(%r15), %esi
	leal	(%rcx,%rsi,4), %ecx
	movl	84(%r15), %esi
	shll	$10, %esi
	orl	%ecx, %esi
	addl	%edx, %esi
	shrl	$6, %eax
	andl	$3, %eax
	movl	96(%r15), %ecx
	leal	(%rax,%rcx,4), %eax
	movl	92(%r15), %ecx
	shll	$10, %ecx
	orl	%eax, %ecx
	addl	%esi, %ecx
	movl	144(%r15), %eax
	movl	%eax, %edx
	andl	$3, %edx
	movl	104(%r15), %esi
	leal	(%rdx,%rsi,4), %edx
	movl	100(%r15), %esi
	shll	$10, %esi
	orl	%edx, %esi
	addl	%ecx, %esi
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$3, %ecx
	movl	112(%r15), %edx
	leal	(%rcx,%rdx,4), %ecx
	movl	108(%r15), %edx
	shll	$10, %edx
	orl	%ecx, %edx
	addl	%esi, %edx
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$3, %ecx
	movl	120(%r15), %esi
	leal	(%rcx,%rsi,4), %ecx
	movl	116(%r15), %esi
	shll	$10, %esi
	orl	%ecx, %esi
	addl	%edx, %esi
	shrl	$6, %eax
	andl	$3, %eax
	movl	128(%r15), %ecx
	leal	(%rax,%rcx,4), %eax
	movl	124(%r15), %ecx
	shll	$10, %ecx
	orl	%eax, %ecx
	addl	%esi, %ecx
	movl	176(%r15), %eax
	shrl	$4, %eax
	andl	$3, %eax
	movl	136(%r15), %edx
	leal	(%rax,%rdx,4), %eax
	movl	132(%r15), %esi
	shll	$10, %esi
	orl	%eax, %esi
	addl	%ecx, %esi
	sarl	$9, %esi
	leaq	8(%r14), %rdi
	callq	_atomic_set
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_frame_add                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	4                               ## @sd_pkt_scan.frame_header
_sd_pkt_scan.frame_header:
	.long	255                             ## 0xff
	.long	255                             ## 0xff
	.long	0                               ## 0x0
	.long	196                             ## 0xc4
	.long	196                             ## 0xc4
	.long	150                             ## 0x96

	.comm	_LAST_PACKET,8,3                ## @LAST_PACKET
	.comm	_MODE_JPEG,4,2                  ## @MODE_JPEG
	.comm	_FIRST_PACKET,8,3               ## @FIRST_PACKET
	.comm	_JPEG_HDR_SZ,4,2                ## @JPEG_HDR_SZ
	.comm	_INTER_PACKET,8,3               ## @INTER_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	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	x21, x2
	mov	x20, x1
	mov	x19, x0
	cmp	w2, #64
	b.ne	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, _sd_pkt_scan.frame_header@PAGE
Lloh1:
	add	x1, x1, _sd_pkt_scan.frame_header@PAGEOFF
	mov	x0, x20
	mov	w2, #6
	bl	_memcmp
	cbz	x0, LBB0_7
LBB0_2:
	ldr	x2, [x19]
Lloh2:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x2, x8
	b.ne	LBB0_5
; %bb.3:
	ldp	x9, x8, [x19, #8]
	sbfiz	x9, x9, #2, #32
	ldr	w8, [x8, x9]
Lloh5:
	adrp	x9, _MODE_JPEG@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MODE_JPEG@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _FIRST_PACKET@GOTPAGE
Lloh9:
	ldr	x10, [x10, _FIRST_PACKET@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x10]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh11:
	adrp	x8, _JPEG_HDR_SZ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _JPEG_HDR_SZ@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_gspca_frame_add
LBB0_5:
Lloh14:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh16:
	ldr	x1, [x8]
LBB0_6:
	mov	x0, x19
	mov	x2, x20
	mov	x3, x21
	b	LBB0_8
LBB0_7:
	ldp	w9, w8, [x20, #76]
	lsl	w8, w8, #2
	ldp	w10, w11, [x20, #140]
	bfxil	w8, w10, #2, #2
	orr	w8, w8, w9, lsl #10
	lsr	w9, w10, #4
	ldp	w13, w12, [x20, #84]
	bfi	w9, w12, #2, #30
	orr	w9, w9, w13, lsl #10
	lsr	w10, w10, #6
	ldp	w13, w12, [x20, #92]
	bfi	w10, w12, #2, #30
	orr	w10, w10, w13, lsl #10
	add	w8, w9, w8
	add	w8, w8, w10
	lsr	w9, w11, #2
	lsr	w10, w11, #4
	lsr	w12, w11, #6
	ldp	w14, w13, [x20, #100]
	bfi	w11, w13, #2, #30
	orr	w11, w11, w14, lsl #10
	ldp	w14, w13, [x20, #108]
	bfi	w9, w13, #2, #30
	orr	w9, w9, w14, lsl #10
	add	w8, w8, w11
	add	w8, w8, w9
	ldp	w11, w9, [x20, #116]
	bfi	w10, w9, #2, #30
	orr	w9, w10, w11, lsl #10
	ldp	w11, w10, [x20, #124]
	bfi	w12, w10, #2, #30
	orr	w10, w12, w11, lsl #10
	add	w8, w8, w9
	add	w8, w8, w10
	ldr	w9, [x20, #176]
	ldp	w11, w10, [x20, #132]
	lsl	w10, w10, #2
	bfxil	w10, w9, #4, #2
	orr	w9, w10, w11, lsl #10
	add	w8, w8, w9
	add	x0, x19, #8
	asr	w1, w8, #9
	bl	_atomic_set
Lloh17:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh19:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
LBB0_8:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @sd_pkt_scan.frame_header
_sd_pkt_scan.frame_header:
	.long	255                             ; 0xff
	.long	255                             ; 0xff
	.long	0                               ; 0x0
	.long	196                             ; 0xc4
	.long	196                             ; 0xc4
	.long	150                             ; 0x96

	.comm	_LAST_PACKET,8,3                ; @LAST_PACKET
	.comm	_MODE_JPEG,4,2                  ; @MODE_JPEG
	.comm	_FIRST_PACKET,8,3               ; @FIRST_PACKET
	.comm	_JPEG_HDR_SZ,4,2                ; @JPEG_HDR_SZ
	.comm	_INTER_PACKET,8,3               ; @INTER_PACKET
	.no_dead_strip	_sd_pkt_scan
.subsections_via_symbols
