	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov51x_new_frame
_ov51x_new_frame:                       ## @ov51x_new_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	%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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	(%rdi), %edx
	movslq	%esi, %rcx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	$4, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
	cmpl	$0, 32(%r15)
	je	LBB0_1
## %bb.2:
	cmpl	$-1, (%r15)
	jne	LBB0_8
## %bb.3:
	movq	_OV511_NUMFRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	(%r14,%rcx), %eax
	decl	%eax
	cltd
	idivl	%ecx
	movq	24(%r15), %r13
	movslq	%edx, %rax
	leaq	(%rax,%rax,4), %rcx
	movq	(%r13,%rcx,8), %rcx
	movq	_FRAME_READY@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	cmovnel	%r14d, %eax
	movslq	%eax, %r12
	leaq	(%r12,%r12,4), %rbx
	leaq	8(,%rbx,8), %r14
	addq	%r13, %r14
	movq	8(%r13,%rbx,8), %rcx
	movq	16(%r13,%rbx,8), %r8
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_PDEBUG
	movq	_FRAME_GRABBING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r13,%rbx,8)
	movq	_STATE_SCANNING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13,%rbx,8)
	movq	$0, 24(%r13,%rbx,8)
	movl	%r12d, (%r15)
	movq	8(%r13,%rbx,8), %rax
	movq	8(%r15), %rcx
	cmpq	%rcx, %rax
	jle	LBB0_5
## %bb.4:
	movq	%rcx, (%r14)
	movq	%rcx, %rax
LBB0_5:
	andq	$-8, %rax
	movq	%rax, (%r14)
	movq	8(%r14), %rax
	movq	16(%r15), %rcx
	cmpq	%rcx, %rax
	jle	LBB0_7
## %bb.6:
	movq	%rcx, 8(%r14)
	movq	%rcx, %rax
LBB0_7:
	andq	$-4, %rax
	movq	%rax, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_1:
	movl	$-1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ov->curframe = %d, framenum = %d"

	.comm	_OV511_NUMFRAMES,4,2            ## @OV511_NUMFRAMES
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
L_.str.1:                               ## @.str.1
	.asciz	"framenum = %d, width = %d, height = %d"

	.comm	_FRAME_GRABBING,8,3             ## @FRAME_GRABBING
	.comm	_STATE_SCANNING,4,2             ## @STATE_SCANNING
	.no_dead_strip	_ov51x_new_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov51x_new_frame
_ov51x_new_frame:                       ; @ov51x_new_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x19, x0
	ldr	w2, [x0]
	sxtw	x3, w20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	bl	_PDEBUG
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	w8, [x19]
	cmn	w8, #1
	b.eq	LBB0_4
; %bb.2:
	mov	w0, #0
	b	LBB0_9
LBB0_3:
	mov	w0, #-1
	b	LBB0_9
LBB0_4:
Lloh2:
	adrp	x8, _OV511_NUMFRAMES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OV511_NUMFRAMES@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	add	w9, w20, w8
	sub	w9, w9, #1
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	ldr	x9, [x19, #24]
	mov	w10, #40
	smull	x11, w8, w10
	ldr	x11, [x9, x11]
Lloh5:
	adrp	x12, _FRAME_READY@GOTPAGE
Lloh6:
	ldr	x12, [x12, _FRAME_READY@GOTPAGEOFF]
Lloh7:
	ldr	x12, [x12]
	cmp	x11, x12
	csel	w20, w8, w20, eq
	smaddl	x23, w20, w10, x9
	mov	x22, x23
	ldr	x3, [x22, #8]!
	mov	x21, x23
	ldr	x8, [x21, #16]!
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #4
	mov	x2, x20
	bl	_PDEBUG
Lloh10:
	adrp	x8, _FRAME_GRABBING@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FRAME_GRABBING@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	str	x8, [x23]
Lloh13:
	adrp	x8, _STATE_SCANNING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STATE_SCANNING@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x23, #32]
	str	xzr, [x23, #24]
	str	w20, [x19]
	ldr	x8, [x22]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.le	LBB0_6
; %bb.5:
	str	x9, [x22]
	mov	x8, x9
LBB0_6:
	and	x8, x8, #0xfffffffffffffff8
	str	x8, [x22]
	ldr	x8, [x21]
	ldr	x9, [x19, #16]
	cmp	x8, x9
	b.le	LBB0_8
; %bb.7:
	str	x9, [x21]
	mov	x8, x9
LBB0_8:
	mov	w0, #0
	and	x8, x8, #0xfffffffffffffffc
	str	x8, [x21]
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ov->curframe = %d, framenum = %d"

	.comm	_OV511_NUMFRAMES,4,2            ; @OV511_NUMFRAMES
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
l_.str.1:                               ; @.str.1
	.asciz	"framenum = %d, width = %d, height = %d"

	.comm	_FRAME_GRABBING,8,3             ; @FRAME_GRABBING
	.comm	_STATE_SCANNING,4,2             ; @STATE_SCANNING
	.no_dead_strip	_ov51x_new_frame
.subsections_via_symbols
