	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_s_jpegcomp
_cpia2_s_jpegcomp:                      ## @cpia2_s_jpegcomp
	.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
	movq	%rdx, %rbx
	callq	_video_drvdata
	movq	%rax, %r14
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	_V4L2_JPEG_MARKER_DHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	8(%rbx), %eax
	sete	%cl
	movl	%ecx, 20(%r14)
	movl	(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_5
## %bb.1:
	leal	-1(%rdx), %eax
	movl	12(%rbx), %esi
	cmpl	$3, %eax
	ja	LBB0_4
## %bb.2:
	cmpl	$15, %esi
	ja	LBB0_4
## %bb.3:
	movl	%esi, (%r14)
	movl	%edx, 4(%r14)
	movl	16(%r14), %edi
	movl	20(%rbx), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	jmp	LBB0_6
LBB0_5:
	movl	$0, 4(%r14)
LBB0_6:
	movl	4(%rbx), %edx
	xorl	%r15d, %r15d
	testl	%edx, %edx
	je	LBB0_11
## %bb.7:
	leal	-1(%rdx), %eax
	cmpl	$3, %eax
	ja	LBB0_9
## %bb.8:
	movl	%edx, 8(%r14)
	movl	12(%r14), %edi
	movl	16(%rbx), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_LOG
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%edx, %esi
	xorl	%eax, %eax
	callq	_LOG
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"S_JPEGCOMP APP_len:%d COM_len:%d\n"

	.comm	_V4L2_JPEG_MARKER_DHT,4,2       ## @V4L2_JPEG_MARKER_DHT
L_.str.1:                               ## @.str.1
	.asciz	"Bad APPn Params n=%d len=%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Bad COM_len=%d\n"

	.no_dead_strip	_cpia2_s_jpegcomp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_s_jpegcomp
_cpia2_s_jpegcomp:                      ; @cpia2_s_jpegcomp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x2
	bl	_video_drvdata
	mov	x20, x0
	ldp	w1, w2, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
Lloh2:
	adrp	x8, _V4L2_JPEG_MARKER_DHT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V4L2_JPEG_MARKER_DHT@GOTPAGEOFF]
	ldr	w9, [x19, #8]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w9
	cset	w8, eq
	str	w8, [x20, #20]
	ldr	w2, [x19]
	cbz	w2, LBB0_3
; %bb.1:
	sub	w8, w2, #1
	ldr	w1, [x19, #12]
	cmp	w8, #3
	ccmp	w1, #15, #2, ls
	b.ls	LBB0_6
; %bb.2:
	str	x2, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_3:
	str	wzr, [x20, #4]
	ldr	w2, [x19, #4]
	cbz	w2, LBB0_7
LBB0_4:
	sub	w8, w2, #1
	cmp	w8, #3
	b.hi	LBB0_8
; %bb.5:
	str	w2, [x20, #8]
	ldr	w0, [x20, #12]
	ldr	w1, [x19, #16]
	bl	_memcpy
	mov	w0, #0
	b	LBB0_10
LBB0_6:
	stp	w1, w2, [x20]
	ldr	w0, [x20, #16]
	ldr	w1, [x19, #20]
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldr	w2, [x19, #4]
	cbnz	w2, LBB0_4
LBB0_7:
	mov	w0, #0
	b	LBB0_10
LBB0_8:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x2
LBB0_9:
	bl	_LOG
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"S_JPEGCOMP APP_len:%d COM_len:%d\n"

	.comm	_V4L2_JPEG_MARKER_DHT,4,2       ; @V4L2_JPEG_MARKER_DHT
l_.str.1:                               ; @.str.1
	.asciz	"Bad APPn Params n=%d len=%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Bad COM_len=%d\n"

	.no_dead_strip	_cpia2_s_jpegcomp
.subsections_via_symbols
