	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_cap_to_ref
_copy_cap_to_ref:                       ## @copy_cap_to_ref
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rsi), %r9d
	testl	%r9d, %r9d
	jle	LBB0_13
## %bb.1:
	movq	%rdx, %r8
	movl	(%rdx), %r11d
	movl	4(%rdx), %r13d
	movq	16(%rdx), %r14
	xorl	%ebx, %ebx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	12(%r8), %eax
	xorl	%edx, %edx
	divl	%r12d
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, %ecx
	imull	%r11d, %ecx
	leaq	(%rdi,%rcx,4), %rdi
	imull	%r13d, %eax
	leaq	(%r14,%rax,4), %r14
	incl	%ebx
	cmpl	%r9d, %ebx
	jge	LBB0_13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	leal	-1(%rbx), %eax
	movl	$1, %r12d
	cmpl	$1, %eax
	ja	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%rsi), %r12d
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, %eax
	xorl	$1, %eax
	movl	%r9d, %ecx
	xorl	$3, %ecx
	orl	%eax, %ecx
	sete	%cl
	shrl	%cl, %r11d
	shrl	%cl, %r13d
	cmpl	$1, %ebx
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rsi), %rax
	movq	_V4L2_PIX_FMT_NV24@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_V4L2_PIX_FMT_NV42@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	%r11d, %r11d
	addl	%r13d, %r13d
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	8(%r8), %r12d
	ja	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r13d, %eax
	movl	%r11d, -44(%rbp)                ## 4-byte Spill
	movl	%r11d, %ecx
	shlq	$2, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	shlq	$2, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	movq	%r8, %r12
	callq	_memcpy
	movq	%r12, %r8
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	incl	%r15d
	movl	8(%r8), %eax
	xorl	%edx, %edx
	divl	%r12d
	addq	-96(%rbp), %r14                 ## 8-byte Folded Reload
	addq	-88(%rbp), %rbx                 ## 8-byte Folded Reload
	cmpl	%eax, %r15d
	jb	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi), %r9d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %r11d                ## 4-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_PIX_FMT_NV24,8,3          ## @V4L2_PIX_FMT_NV24
	.comm	_V4L2_PIX_FMT_NV42,8,3          ## @V4L2_PIX_FMT_NV42
	.no_dead_strip	_copy_cap_to_ref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_cap_to_ref
_copy_cap_to_ref:                       ; @copy_cap_to_ref
	.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, [x1]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x19, x2
	mov	x23, x0
	mov	w25, #0
	ldp	w12, w22, [x2]
	ldr	x27, [x2, #16]
	str	x1, [sp, #8]                    ; 8-byte Folded Spill
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19, #12]
	udiv	w9, w9, w28
	mul	w10, w9, w12
	add	x23, x23, w10, uxtw #2
	mul	w9, w9, w22
	add	x27, x27, w9, uxtw #2
	add	w25, w25, #1
	cmp	w25, w8
	b.ge	LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	sub	w9, w25, #1
	cmp	w9, #1
	b.hi	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w28, [x1, #4]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w28, #1
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, #3
	cset	w9, eq
	cmp	w25, #1
	cset	w10, eq
	and	w9, w9, w10
	lsr	w12, w12, w9
	lsr	w22, w22, w9
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x1, #8]
Lloh0:
	adrp	x10, _V4L2_PIX_FMT_NV24@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V4L2_PIX_FMT_NV24@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _V4L2_PIX_FMT_NV42@GOTPAGE
Lloh4:
	ldr	x11, [x11, _V4L2_PIX_FMT_NV42@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	lsl	w9, w12, #1
	lsl	w10, w22, #1
	csel	w12, w12, w9, ne
	csel	w22, w22, w10, ne
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19, #8]
	cmp	w28, w9
	b.hi	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w20, #0
	mov	w8, w22
	str	w12, [sp, #20]                  ; 4-byte Folded Spill
	mov	w9, w12
	lsl	x26, x8, #2
	lsl	x21, x9, #2
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	mov	x24, x27
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
	add	w20, w20, #1
	ldr	w8, [x19, #8]
	udiv	w8, w8, w28
	add	x24, x24, x26
	add	x23, x23, x21
	cmp	w20, w8
	b.lo	LBB0_10
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w8, [x1]
	ldr	x23, [sp, #24]                  ; 8-byte Folded Reload
	ldr	w12, [sp, #20]                  ; 4-byte Folded Reload
	b	LBB0_2
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_PIX_FMT_NV24,8,3          ; @V4L2_PIX_FMT_NV24
	.comm	_V4L2_PIX_FMT_NV42,8,3          ; @V4L2_PIX_FMT_NV42
	.no_dead_strip	_copy_cap_to_ref
.subsections_via_symbols
