	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function process_frame
_process_frame:                         ## @process_frame
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	(%rax), %rbx
	movl	24(%rax), %esi
	movl	24(%rcx), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	movq	8(%r14), %rax
	movl	8(%rax), %edi
	movl	12(%rax), %edx
	cmpl	%edx, %edi
	jle	LBB0_2
## %bb.1:
	movl	%edi, 12(%rax)
	movl	%edi, %edx
LBB0_2:
	cmpb	$-1, (%rbx)
	jne	LBB0_18
## %bb.3:
	cmpb	$-40, 1(%rbx)
	jne	LBB0_18
## %bb.4:
	incl	_process_frame.frame_count(%rip)
	cmpl	$0, (%r14)
	je	LBB0_5
## %bb.6:
	cmpl	$4, %edi
	jl	LBB0_16
## %bb.7:
	cmpq	$0, 24(%r14)
	je	LBB0_8
## %bb.9:
	subl	%edi, %edx
	jle	LBB0_10
## %bb.11:
	addq	(%rax), %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r14), %rax
	movl	8(%rax), %ecx
	cmpq	$0, 24(%r14)
	movl	%ecx, 12(%rax)
	movq	_FRAME_READY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax)
	jne	LBB0_15
	jmp	LBB0_12
LBB0_18:
	movq	_FRAME_ERROR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DBG                            ## TAILCALL
LBB0_5:
	movl	$1, (%r14)
	movq	_FRAME_EMPTY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax)
	jmp	LBB0_17
LBB0_16:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	movq	_FRAME_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r14), %rcx
	movq	%rax, 16(%rcx)
LBB0_17:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movl	%edi, 12(%rax)
	movq	_FRAME_READY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, 16(%rax)
LBB0_12:
	cmpl	$3, 4(%r14)
	jl	LBB0_15
## %bb.13:
	movq	16(%r14), %rcx
	movq	_FRAME_EMPTY@GOTPCREL(%rip), %rdx
	jmp	LBB0_14
LBB0_10:
	movl	%edi, 12(%rax)
	movq	_FRAME_READY@GOTPCREL(%rip), %rdx
	movq	%rax, %rcx
LBB0_14:
	movq	(%rdx), %rdx
	movq	%rdx, 16(%rcx)
LBB0_15:
	movq	%rax, 16(%r14)
	movq	32(%rax), %rcx
	movq	%rcx, 8(%r14)
	movl	24(%rcx), %esi
	movl	24(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_DBG                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_process_frame.frame_count,4,2 ## @process_frame.frame_count
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Processing frame #%d, current:%d\n"

	.comm	_FRAME_ERROR,8,3                ## @FRAME_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Start of frame not found\n"

	.comm	_FRAME_EMPTY,8,3                ## @FRAME_EMPTY
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
L_.str.2:                               ## @.str.2
	.asciz	"Changed buffers, work:%d, current:%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Not enough data for an image.\n"

	.no_dead_strip	_process_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function process_frame
_process_frame:                         ; @process_frame
	.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, x0
	ldp	x8, x9, [x0, #8]
	ldr	x20, [x8]
	ldr	w8, [x8, #24]
	ldr	w9, [x9, #24]
	stp	x8, x9, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	ldr	x8, [x19, #8]
	ldp	w9, w10, [x8, #8]
	cmp	w9, w10
	b.le	LBB0_2
; %bb.1:
	str	w9, [x8, #12]
	mov	x10, x9
LBB0_2:
	ldrb	w11, [x20]
	cmp	w11, #255
	b.ne	LBB0_9
; %bb.3:
	ldrb	w11, [x20, #1]
	cmp	w11, #216
	b.ne	LBB0_9
; %bb.4:
	adrp	x11, _process_frame.frame_count@PAGE
	ldr	w12, [x11, _process_frame.frame_count@PAGEOFF]
	add	w12, w12, #1
	str	w12, [x11, _process_frame.frame_count@PAGEOFF]
	ldr	w11, [x19]
	cbz	w11, LBB0_10
; %bb.5:
	cmp	w9, #4
	b.lt	LBB0_11
; %bb.6:
	ldr	x11, [x19, #24]
	cbz	x11, LBB0_12
; %bb.7:
	subs	w2, w10, w9
	b.le	LBB0_15
; %bb.8:
	ldr	x8, [x8]
	add	x0, x8, x9
	mov	w1, #0
	bl	_memset
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #8]
	ldr	x10, [x19, #24]
	str	w9, [x8, #12]
Lloh2:
	adrp	x9, _FRAME_READY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FRAME_READY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	str	x9, [x8, #16]
	cbnz	x10, LBB0_17
	b	LBB0_13
LBB0_9:
Lloh5:
	adrp	x9, _FRAME_ERROR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FRAME_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	str	x9, [x8, #16]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_DBG
LBB0_10:
	mov	w9, #1
	str	w9, [x19]
Lloh10:
	adrp	x9, _FRAME_EMPTY@GOTPAGE
Lloh11:
	ldr	x9, [x9, _FRAME_EMPTY@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	str	x9, [x8, #16]
	b	LBB0_18
LBB0_11:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DBG
Lloh15:
	adrp	x8, _FRAME_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FRAME_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	str	x8, [x9, #16]
	b	LBB0_18
LBB0_12:
	str	w9, [x8, #12]
Lloh18:
	adrp	x9, _FRAME_READY@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FRAME_READY@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	str	x9, [x8, #16]
LBB0_13:
	ldr	w9, [x19, #4]
	cmp	w9, #3
	b.lt	LBB0_17
; %bb.14:
	ldr	x9, [x19, #16]
Lloh21:
	adrp	x10, _FRAME_EMPTY@GOTPAGE
Lloh22:
	ldr	x10, [x10, _FRAME_EMPTY@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
	str	w9, [x8, #12]
Lloh23:
	adrp	x10, _FRAME_READY@GOTPAGE
Lloh24:
	ldr	x10, [x10, _FRAME_READY@GOTPAGEOFF]
	mov	x9, x8
LBB0_16:
	ldr	x10, [x10]
	str	x10, [x9, #16]
LBB0_17:
	ldr	x9, [x8, #32]
	stp	x9, x8, [x19, #8]
	ldr	w9, [x9, #24]
	ldr	w8, [x8, #24]
	stp	x9, x8, [sp]
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_process_frame.frame_count,4,2 ; @process_frame.frame_count
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Processing frame #%d, current:%d\n"

	.comm	_FRAME_ERROR,8,3                ; @FRAME_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Start of frame not found\n"

	.comm	_FRAME_EMPTY,8,3                ; @FRAME_EMPTY
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
l_.str.2:                               ; @.str.2
	.asciz	"Changed buffers, work:%d, current:%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Not enough data for an image.\n"

	.no_dead_strip	_process_frame
.subsections_via_symbols
