	.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, %r15
	incl	(%rdi)
	movl	%edx, %r14d
	addl	%edx, 4(%rdi)
	movq	%rsi, %r12
	movslq	8(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.1:
	movl	$0, 8(%r15)
	movl	(%r12), %eax
	testl	%ebx, %ebx
	js	LBB0_2
## %bb.4:
	cmpl	$255, %eax
	je	LBB0_5
	jmp	LBB0_12
LBB0_2:
	cmpl	$255, %eax
	jne	LBB0_12
## %bb.3:
	cmpl	$0, 4(%r12)
	je	LBB0_7
LBB0_5:
	cmpl	$255, 4(%r12)
	jne	LBB0_12
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_12:
	subl	%ebx, %r14d
	jle	LBB0_37
## %bb.13:
	leaq	(%r12,%rbx,4), %r12
LBB0_14:
	leal	-1(%r14), %eax
	cmpl	$2, %r14d
	jl	LBB0_19
## %bb.15:
	leal	-2(%r14), %ebx
	movl	%eax, %ecx
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_16 Depth=1
	addl	$-2, %ecx
	movl	%ecx, %ebx
LBB0_18:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	%ebx, %ecx
	leal	-1(%rcx), %ebx
	testl	%ecx, %ecx
	jle	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edx
	cmpl	$255, (%r12,%rdx,4)
	jne	LBB0_17
## %bb.25:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%ecx, %edx
	cmpl	$255, (%r12,%rdx,4)
	jne	LBB0_18
## %bb.26:                              ##   in Loop: Header=BB0_16 Depth=1
	leal	1(%rcx), %edx
	cmpl	%r14d, %edx
	jge	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	%edx, %edx
	cmpl	$0, (%r12,%rdx,4)
	jne	LBB0_18
LBB0_28:
	cmpl	$4, %ecx
	jb	LBB0_7
## %bb.29:
	leal	-3(%rcx), %eax
	movl	$-3, %r13d
	cmpl	$255, (%r12,%rax,4)
	jne	LBB0_31
## %bb.30:
	addl	$-2, %ecx
	cmpl	$217, (%r12,%rcx,4)
	je	LBB0_9
	jmp	LBB0_31
LBB0_19:
	cltq
	cmpl	$255, (%r12,%rax,4)
	jne	LBB0_21
## %bb.20:
	movl	$-1, 8(%r15)
LBB0_21:
	movq	(%r15), %rax
	movq	_LAST_PACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.22:
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	16(%r15), %rdx
	movq	_JPEG_HDR_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_gspca_frame_add
LBB0_23:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
LBB0_24:
	movl	%r14d, %ecx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_frame_add                ## TAILCALL
LBB0_7:
	leal	6(%rbx), %eax
	cmpl	%r14d, %eax
	jge	LBB0_9
## %bb.8:
	cltq
	movl	$-5, %r13d
	testb	$8, (%r12,%rax,4)
	jne	LBB0_31
LBB0_9:
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	callq	_gspca_frame_add
	imull	$100, 4(%r15), %eax
	movq	8(%r15), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %ecx
	imull	(%r15), %ecx
	cltd
	idivl	%ecx
	movl	$-3, %r13d
	cmpl	$84, %eax
	jg	LBB0_32
## %bb.10:
	movl	$2, %r13d
	cmpl	$74, %eax
	jle	LBB0_32
## %bb.11:
	movl	$0, 24(%r15)
	jmp	LBB0_35
LBB0_31:
	movq	_DISCARD_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	movl	%ebx, %ecx
	callq	_gspca_frame_add
LBB0_32:
	movl	24(%r15), %eax
	leal	(%rax,%r13), %ecx
	movl	%ecx, 24(%r15)
	addl	%r13d, %eax
	addl	$-12, %eax
	cmpl	$-19, %eax
	ja	LBB0_35
## %bb.33:
	movl	$0, 24(%r15)
	movl	28(%r15), %ecx
	addl	%ecx, %r13d
	movq	_QUALITY_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_QUALITY_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	cmovll	%r13d, %eax
	cmpl	%edx, %r13d
	cmovll	%edx, %eax
	cmpl	%ecx, %eax
	je	LBB0_35
## %bb.34:
	movl	%eax, 28(%r15)
	leaq	40(%r15), %rdi
	callq	_schedule_work
LBB0_35:
	movq	$0, (%r15)
	leal	62(%rbx), %r13d
	movl	%r13d, %eax
	subl	%r14d, %eax
	jle	LBB0_38
## %bb.36:
	movl	%eax, 8(%r15)
	jmp	LBB0_37
LBB0_38:
	cmpq	$0, 32(%r15)
	js	LBB0_40
## %bb.39:
	movslq	%ebx, %rax
	leaq	(%r12,%rax,4), %rsi
	movq	%r15, %rdi
	callq	_set_lum
LBB0_40:
	cmpl	%r14d, %r13d
	jge	LBB0_37
## %bb.41:
	movslq	%r13d, %rax
	leaq	(%r12,%rax,4), %rbx
	subl	%r13d, %r14d
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	16(%r15), %rdx
	movq	_JPEG_HDR_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	callq	_gspca_frame_add
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	jmp	LBB0_24
LBB0_37:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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
	.comm	_DISCARD_PACKET,8,3             ## @DISCARD_PACKET
	.comm	_QUALITY_MIN,4,2                ## @QUALITY_MIN
	.comm	_QUALITY_MAX,4,2                ## @QUALITY_MAX
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldp	w8, w9, [x0]
	add	w8, w8, #1
	add	w9, w9, w2
	stp	w8, w9, [x0]
	ldr	w22, [x0, #8]
	cbz	w22, LBB0_9
; %bb.1:
	str	wzr, [x19, #8]
	ldr	w8, [x21]
	cmp	w8, #255
	tbnz	w22, #31, LBB0_3
; %bb.2:
	b.eq	LBB0_5
	b	LBB0_7
LBB0_3:
	b.ne	LBB0_7
; %bb.4:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_25
LBB0_5:
	ldr	w8, [x21, #4]
	cmp	w8, #255
	b.ne	LBB0_7
; %bb.6:
	mov	w22, #0
	b	LBB0_25
LBB0_7:
	sub	w20, w20, w22
	cmp	w20, #1
	b.lt	LBB0_45
; %bb.8:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	sxtw	x8, w22
	add	x21, x21, x8, lsl #2
LBB0_9:
	sub	w8, w20, #1
	subs	w22, w20, #2
	b.lt	LBB0_21
; %bb.10:
	mov	x9, x8
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	sub	w22, w9, #2
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	mov	x9, x22
	sub	w22, w22, #1
	cmp	w9, #0
	b.le	LBB0_21
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x21, w22, uxtw #2]
	cmp	w10, #255
	b.ne	LBB0_11
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w10, [x21, w9, uxtw #2]
	cmp	w10, #255
	b.ne	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	w10, w9, #1
	cmp	w10, w20
	b.ge	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w10, [x21, w10, uxtw #2]
	cbnz	w10, LBB0_12
LBB0_17:
	cmp	w9, #4
	b.lo	LBB0_25
; %bb.18:
	sub	w8, w9, #3
	ldr	w8, [x21, w8, uxtw #2]
	cmp	w8, #255
	b.ne	LBB0_20
; %bb.19:
	sub	w8, w9, #2
	ldr	w8, [x21, w8, uxtw #2]
	cmp	w8, #217
	b.eq	LBB0_27
LBB0_20:
	mov	w23, #-3
	b	LBB0_32
LBB0_21:
	ldr	w8, [x21, w8, sxtw #2]
	cmp	w8, #255
	b.ne	LBB0_23
; %bb.22:
	mov	w8, #-1
	str	w8, [x19, #8]
LBB0_23:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _LAST_PACKET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LAST_PACKET@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_44
; %bb.24:
Lloh3:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
	b	LBB0_43
LBB0_25:
	add	w8, w22, #6
	cmp	w8, w20
	b.ge	LBB0_27
; %bb.26:
	ldr	w8, [x21, w8, sxtw #2]
	tbnz	w8, #3, LBB0_31
LBB0_27:
Lloh5:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_gspca_frame_add
	mov	w8, #100
	ldp	w10, w9, [x19]
	mul	w8, w9, w8
	ldr	x9, [x19, #8]
	ldr	x9, [x9]
	ldr	x9, [x9]
	ldr	w9, [x9]
	mul	w9, w9, w10
	sdiv	w8, w8, w9
	cmp	w8, #84
	b.le	LBB0_29
; %bb.28:
	mov	w23, #-3
	b	LBB0_33
LBB0_29:
	cmp	w8, #74
	b.gt	LBB0_36
; %bb.30:
	mov	w23, #2
	b	LBB0_33
LBB0_31:
	mov	w23, #-5
LBB0_32:
Lloh8:
	adrp	x8, _DISCARD_PACKET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DISCARD_PACKET@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh11:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh13:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_gspca_frame_add
LBB0_33:
	ldr	w8, [x19, #24]
	add	w8, w8, w23
	str	w8, [x19, #24]
	sub	w8, w8, #12
	cmn	w8, #19
	b.hi	LBB0_37
; %bb.34:
	str	wzr, [x19, #24]
	ldr	w9, [x19, #28]
Lloh14:
	adrp	x8, _QUALITY_MIN@GOTPAGE
Lloh15:
	ldr	x8, [x8, _QUALITY_MIN@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x10, _QUALITY_MAX@GOTPAGE
Lloh18:
	ldr	x10, [x10, _QUALITY_MAX@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	add	w11, w9, w23
	cmp	w11, w10
	csel	w10, w11, w10, lt
	cmp	w11, w8
	csel	w8, w8, w10, lt
	cmp	w8, w9
	b.eq	LBB0_37
; %bb.35:
	str	w8, [x19, #28]
	add	x0, x19, #40
	bl	_schedule_work
	b	LBB0_37
LBB0_36:
	str	wzr, [x19, #24]
LBB0_37:
	str	xzr, [x19]
	sxtw	x8, w22
	add	x22, x8, #62
	subs	w9, w22, w20
	b.le	LBB0_39
; %bb.38:
	str	w9, [x19, #8]
	b	LBB0_45
LBB0_39:
	ldr	x9, [x19, #32]
	tbnz	x9, #63, LBB0_41
; %bb.40:
	add	x1, x21, x8, lsl #2
	mov	x0, x19
	bl	_set_lum
LBB0_41:
	cmp	w22, w20
	b.ge	LBB0_45
; %bb.42:
	add	x21, x21, x22, lsl #2
Lloh20:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
	sub	w20, w20, w22
LBB0_43:
	ldr	x1, [x8]
	ldr	x2, [x19, #16]
Lloh22:
	adrp	x8, _JPEG_HDR_SZ@GOTPAGE
Lloh23:
	ldr	x8, [x8, _JPEG_HDR_SZ@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_gspca_frame_add
LBB0_44:
Lloh25:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh26:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh27:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x20
	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_45:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.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
	.comm	_DISCARD_PACKET,8,3             ; @DISCARD_PACKET
	.comm	_QUALITY_MIN,4,2                ; @QUALITY_MIN
	.comm	_QUALITY_MAX,4,2                ; @QUALITY_MAX
	.no_dead_strip	_sd_pkt_scan
.subsections_via_symbols
