	.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	%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
	movl	(%rdi), %r12d
	cmpl	$64, %edx
	jl	LBB0_6
## %bb.1:
	leaq	_sd_pkt_scan.frame_header(%rip), %rsi
	movq	%rbx, %rdi
	movl	$6, %edx
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movl	140(%rbx), %eax
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$3, %ecx
	movl	76(%rbx), %edx
	movl	80(%rbx), %esi
	leal	(%rcx,%rsi,4), %ecx
	shll	$10, %edx
	orl	%ecx, %edx
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$3, %ecx
	movl	88(%rbx), %esi
	leal	(%rcx,%rsi,4), %ecx
	movl	84(%rbx), %esi
	shll	$10, %esi
	orl	%ecx, %esi
	addl	%edx, %esi
	shrl	$6, %eax
	andl	$3, %eax
	movl	96(%rbx), %ecx
	leal	(%rax,%rcx,4), %eax
	movl	92(%rbx), %ecx
	shll	$10, %ecx
	orl	%eax, %ecx
	addl	%esi, %ecx
	movl	144(%rbx), %eax
	movl	%eax, %edx
	andl	$3, %edx
	movl	104(%rbx), %esi
	leal	(%rdx,%rsi,4), %edx
	movl	100(%rbx), %esi
	shll	$10, %esi
	orl	%edx, %esi
	addl	%ecx, %esi
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$3, %ecx
	movl	112(%rbx), %edx
	leal	(%rcx,%rdx,4), %ecx
	movl	108(%rbx), %edx
	shll	$10, %edx
	orl	%ecx, %edx
	addl	%esi, %edx
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$3, %ecx
	movl	120(%rbx), %esi
	leal	(%rcx,%rsi,4), %ecx
	movl	116(%rbx), %esi
	shll	$10, %esi
	orl	%ecx, %esi
	addl	%edx, %esi
	shrl	$6, %eax
	andl	$3, %eax
	movl	128(%rbx), %ecx
	leal	(%rax,%rcx,4), %eax
	movl	124(%rbx), %ecx
	shll	$10, %ecx
	orl	%eax, %ecx
	addl	%esi, %ecx
	movl	176(%rbx), %eax
	shrl	$4, %eax
	andl	$3, %eax
	movl	136(%rbx), %edx
	leal	(%rax,%rdx,4), %eax
	movl	132(%rbx), %esi
	shll	$10, %esi
	orl	%eax, %esi
	addl	%ecx, %esi
	sarl	$9, %esi
	leaq	24(%r15), %rdi
	callq	_atomic_set
	testb	$3, %r12b
	jne	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_transfer_check
LBB0_4:
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	addl	$-64, %r14d
	je	LBB0_13
## %bb.5:
	addq	$256, %rbx                      ## imm = 0x100
LBB0_6:
	movq	(%r15), %rax
	movq	_LAST_PACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testb	$3, %r12b
	jne	LBB0_12
## %bb.8:
	movq	8(%r15), %rdx
	movq	_JPEG_HDR_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_gspca_frame_add
	jmp	LBB0_11
LBB0_9:
	testb	$3, %r12b
	jne	LBB0_11
## %bb.10:
	incl	20(%r15)
	addl	%r14d, 16(%r15)
LBB0_11:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_12:
	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_13:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.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	_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	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, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w8, [x0]
	and	w22, w8, #0x3
Lloh0:
	adrp	x23, _LAST_PACKET@GOTPAGE
Lloh1:
	ldr	x23, [x23, _LAST_PACKET@GOTPAGEOFF]
	cmp	w2, #64
	b.lt	LBB0_6
; %bb.1:
Lloh2:
	adrp	x1, _sd_pkt_scan.frame_header@PAGE
Lloh3:
	add	x1, x1, _sd_pkt_scan.frame_header@PAGEOFF
	mov	x0, x20
	mov	w2, #6
	bl	_memcmp
	cbnz	x0, LBB0_6
; %bb.2:
	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, x21, #24
	asr	w1, w8, #9
	bl	_atomic_set
	cbnz	w22, LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x1, x20
	bl	_transfer_check
LBB0_4:
	ldr	x1, [x23]
	mov	x0, x21
	mov	x2, #0
	mov	w3, #0
	bl	_gspca_frame_add
	subs	w19, w19, #64
	b.eq	LBB0_13
; %bb.5:
	add	x20, x20, #256
LBB0_6:
	ldr	x8, [x21]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
Lloh4:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x8]
	cbnz	w22, LBB0_12
; %bb.8:
	ldr	x2, [x21, #8]
Lloh7:
	adrp	x8, _JPEG_HDR_SZ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _JPEG_HDR_SZ@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_gspca_frame_add
	b	LBB0_11
LBB0_9:
	cbnz	w22, LBB0_11
; %bb.10:
	ldr	d0, [x21, #16]
	movi.2s	v1, #1
	mov.s	v1[0], w19
	add.2s	v0, v0, v1
	str	d0, [x21, #16]
LBB0_11:
Lloh10:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh12:
	ldr	x1, [x8]
LBB0_12:
	mov	x0, x21
	mov	x2, x20
	mov	x3, 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_frame_add
LBB0_13:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.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	_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
