	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_pkt_scan_janggu
_sd_pkt_scan_janggu:                    ## @sd_pkt_scan_janggu
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdi)
	jne	LBB0_25
## %bb.1:
	movq	%rdi, %rcx
	movl	12(%rdi), %esi
	imull	8(%rdi), %esi
	movq	(%rdi), %rax
	movq	_LAST_PACKET@GOTPCREL(%rip), %rdi
	cmpl	$1024, %edx                     ## imm = 0x400
	jne	LBB0_3
## %bb.2:
	cmpq	(%rdi), %rax
	jne	LBB0_3
## %bb.24:
	movq	_DISCARD_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	jmp	LBB0_25
LBB0_3:
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	testl	%edx, %edx
	jle	LBB0_25
## %bb.4:
	shrq	$32, %rax
	xorl	%r15d, %r15d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	cmpl	$3, %eax
	jg	LBB0_6
	.p2align	4, 0x90
LBB0_7:
	movl	$4, %esi
	subl	%eax, %esi
	movl	%edx, %ebx
	subl	%r15d, %ebx
	cmpl	%ebx, %esi
	cmovll	%esi, %ebx
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	8(%rcx), %rdi
	movslq	%r15d, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %eax
	addl	%ebx, %eax
	movl	%eax, 4(%rcx)
	cmpl	$4, %eax
	jl	LBB0_25
## %bb.8:
	addl	%r15d, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_6:
	movl	%r15d, %ebx
LBB0_9:
	movq	8(%rcx), %rcx
	movl	12(%rcx), %edi
	movl	8(%rcx), %esi
	shll	$8, %esi
	leal	(%rdi,%rsi), %r12d
	addl	$47, %r12d
	sarl	$3, %r12d
	andl	$-2, %r12d
	cmpl	$1025, %r12d                    ## imm = 0x401
	jge	LBB0_10
## %bb.11:
	movl	(%rcx), %r14d
	movl	%r14d, %r13d
	shrl	$6, %r13d
	andl	$3, %r13d
	cmpl	$3, %r13d
	je	LBB0_12
## %bb.13:
	andl	$63, %r14d
	shll	$8, %r14d
	addl	4(%rcx), %r14d
	movl	%r12d, %esi
	subl	%eax, %esi
	movl	%edx, %r15d
	subl	%ebx, %r15d
	cmpl	%r15d, %esi
	cmovll	%esi, %r15d
	movl	%eax, %eax
	leaq	(%rcx,%rax,4), %rdi
	movslq	%ebx, %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	4(%rcx), %eax
	addl	%r15d, %eax
	movl	%eax, 4(%rcx)
	cmpl	%r12d, %eax
	jl	LBB0_25
## %bb.14:
	movl	16(%rcx), %esi
	addl	%r14d, %esi
	movl	%esi, 16(%rcx)
	movl	$0, 4(%rcx)
	testl	%r13d, %r13d
	je	LBB0_26
## %bb.15:
	cmpl	$2, %r13d
	je	LBB0_21
## %bb.16:
	cmpl	$1, %r13d
	jne	LBB0_22
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_26:
	movq	_INTER_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	8(%rcx), %rdx
	movq	%rcx, %rdi
	movl	%r12d, %ecx
	callq	_gspca_frame_add
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_21:
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	8(%rcx), %rdx
	movq	%rcx, %rdi
	movl	%r12d, %ecx
	callq	_gspca_frame_add
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r14d, 16(%rcx)
LBB0_22:
	addl	%ebx, %r15d
	cmpl	%edx, %r15d
	jge	LBB0_25
## %bb.23:
	movl	4(%rcx), %eax
	cmpl	$3, %eax
	jg	LBB0_6
	jmp	LBB0_7
LBB0_25:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_19
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_19:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	$1, (%rbx)
	movq	_FIRST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gspca_frame_add
	movq	_LAST_PACKET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gspca_frame_add                ## TAILCALL
LBB0_17:
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, %esi
	jne	LBB0_18
## %bb.20:
	movq	8(%rcx), %rsi
	movq	%rcx, %rdi
	movl	%r12d, %edx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sd_complete_frame              ## TAILCALL
LBB0_18:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_LAST_PACKET,8,3                ## @LAST_PACKET
	.comm	_DISCARD_PACKET,8,3             ## @DISCARD_PACKET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid packet len %d restarting stream\n"

L_.str.1:                               ## @.str.1
	.asciz	"unknown frame info value restarting stream\n"

	.comm	_INTER_PACKET,8,3               ## @INTER_PACKET
L_.str.2:                               ## @.str.2
	.asciz	"frame size %d expected %d\n"

	.comm	_FIRST_PACKET,8,3               ## @FIRST_PACKET
	.no_dead_strip	_sd_pkt_scan_janggu
.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_janggu
_sd_pkt_scan_janggu:                    ; @sd_pkt_scan_janggu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x0]
	cbnz	w8, LBB0_18
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldp	w8, w9, [x0, #8]
	ldr	x10, [x0]
Lloh0:
	adrp	x11, _LAST_PACKET@GOTPAGE
Lloh1:
	ldr	x11, [x11, _LAST_PACKET@GOTPAGEOFF]
	cmp	w2, #1024
	b.ne	LBB0_4
; %bb.2:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _DISCARD_PACKET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DISCARD_PACKET@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_18
LBB0_4:
	cmp	w20, #1
	b.lt	LBB0_18
; %bb.5:
	mov	w27, #0
	mul	w8, w9, w8
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	lsr	x8, x10, #32
	mov	w28, #4
	cmp	w8, #3
	b.gt	LBB0_8
LBB0_6:
	sub	w9, w28, w8
	sub	w10, w20, w27
	cmp	w9, w10
	csel	w22, w9, w10, lt
	ldr	x9, [x19, #8]
	add	x0, x9, w8, sxtw #2
	add	x1, x21, w27, sxtw #2
	mov	x2, x22
	bl	_memcpy
	ldr	w8, [x19, #4]
	add	w8, w8, w22
	str	w8, [x19, #4]
	cmp	w8, #4
	b.lt	LBB0_18
; %bb.7:
	add	w27, w22, w27
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldp	w11, w10, [x9, #8]
	add	w10, w10, w11, lsl #8
	add	w10, w10, #47
	asr	w10, w10, #3
	and	w22, w10, #0xfffffffe
	cmp	w22, #1025
	b.ge	LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w26, [x9]
	ubfx	w25, w26, #6, #2
	cmp	w25, #3
	b.eq	LBB0_20
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w24, [x9, #4]
	sub	w10, w22, w8
	sub	w11, w20, w27
	cmp	w10, w11
	csel	w23, w10, w11, lt
	add	x0, x9, w8, uxtw #2
	add	x1, x21, w27, sxtw #2
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x19, #4]
	add	w8, w8, w23
	cmp	w8, w22
	str	w8, [x19, #4]
	b.lt	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ubfiz	w8, w26, #8, #6
	ldr	w9, [x19, #16]
	add	w24, w8, w24
	add	w8, w9, w24
	str	w8, [x19, #16]
	str	wzr, [x19, #4]
	cbz	w25, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w25, #2
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	w25, #1
	b.ne	LBB0_16
	b	LBB0_22
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh5:
	adrp	x8, _INTER_PACKET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INTER_PACKET@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x8]
	ldr	x2, [x19, #8]
	mov	x0, x19
	mov	x3, x22
	bl	_gspca_frame_add
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh8:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
Lloh10:
	ldr	x1, [x8]
	ldr	x2, [x19, #8]
	mov	x0, x19
	mov	x3, x22
	bl	_gspca_frame_add
	str	w24, [x19, #16]
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w27, w23, w27
	cmp	w27, w20
	b.ge	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x19, #4]
	cmp	w8, #3
	b.le	LBB0_6
	b	LBB0_8
LBB0_18:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_19:
	str	x22, [sp]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_21
LBB0_20:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_21:
	bl	_pr_err
	mov	w8, #1
	str	w8, [x19]
Lloh15:
	adrp	x8, _FIRST_PACKET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FIRST_PACKET@GOTPAGEOFF]
Lloh17:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	bl	_gspca_frame_add
Lloh18:
	adrp	x8, _LAST_PACKET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LAST_PACKET@GOTPAGEOFF]
Lloh20:
	ldr	x1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_gspca_frame_add
LBB0_22:
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.23:
	ldr	x1, [x19, #8]
	mov	x0, x19
	mov	x2, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_sd_complete_frame
LBB0_24:
	stp	x8, x9, [sp]
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_21
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_LAST_PACKET,8,3                ; @LAST_PACKET
	.comm	_DISCARD_PACKET,8,3             ; @DISCARD_PACKET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid packet len %d restarting stream\n"

l_.str.1:                               ; @.str.1
	.asciz	"unknown frame info value restarting stream\n"

	.comm	_INTER_PACKET,8,3               ; @INTER_PACKET
l_.str.2:                               ; @.str.2
	.asciz	"frame size %d expected %d\n"

	.comm	_FIRST_PACKET,8,3               ; @FIRST_PACKET
	.no_dead_strip	_sd_pkt_scan_janggu
.subsections_via_symbols
