	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function copy_avframe_to_pixel_buffer
_copy_avframe_to_pixel_buffer:          ## @copy_avframe_to_pixel_buffer
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	%edx, %edi
	xorl	%esi, %esi
	callq	_CVPixelBufferLockBaseAddress
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_2:
	movl	%r12d, %edi
	callq	_CVPixelBufferIsPlanar
	testq	%rax, %rax
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_13
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_CVPixelBufferGetPlaneCount
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_21
## %bb.4:
	xorl	%r15d, %r15d
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	imull	%edx, %ecx
	movslq	%ecx, %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_memcpy
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rax
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	cmpq	$0, 8(%rax,%rcx,8)
	leaq	1(%rcx), %r15
	je	LBB0_21
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	cmpq	%r15, -96(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_CVPixelBufferGetBaseAddressOfPlane
	movq	%rax, %r12
	movq	(%rbx), %rax
	movq	(%rax,%r15,8), %rbx
	movl	%r14d, %edi
	movl	%r15d, %esi
	callq	_CVPixelBufferGetBytesPerRowOfPlane
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%r15,8), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx,%r15,8), %rdx
	cmpl	%ecx, %eax
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ecx, %esi
	cmovll	%eax, %esi
	testl	%edx, %edx
	jle	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movslq	%esi, %rsi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movslq	%eax, %r14
	movl	%edx, %r15d
	movslq	%ecx, %r13
	shlq	$2, %r13
	shlq	$2, %r14
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_memcpy
	addq	%r13, %rbx
	addq	%r14, %r12
	decq	%r15
	jne	LBB0_11
	jmp	LBB0_12
LBB0_13:
	movq	(%rbx), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_16
## %bb.14:
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_CVPixelBufferUnlockBaseAddress
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	jmp	LBB0_15
LBB0_6:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_CVPixelBufferUnlockBaseAddress
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_15:
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_23
LBB0_16:
	movl	%r12d, %edi
	callq	_CVPixelBufferGetBaseAddress
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	(%rax), %r13
	movl	%r12d, %edi
	callq	_CVPixelBufferGetBytesPerRow
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rdx
	cmpl	%ecx, %eax
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_18
## %bb.17:
	imull	%edx, %ecx
	movslq	%ecx, %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_memcpy
	jmp	LBB0_21
LBB0_18:
	movl	%ecx, %esi
	cmovll	%eax, %esi
	testl	%edx, %edx
	jle	LBB0_21
## %bb.19:
	movslq	%esi, %rsi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movslq	%eax, %r12
	movl	%edx, %ebx
	movslq	%ecx, %r14
	shlq	$2, %r14
	shlq	$2, %r12
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_memcpy
	addq	%r14, %r13
	addq	%r12, %r15
	decq	%rbx
	jne	LBB0_20
LBB0_21:
	xorl	%ebx, %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	callq	_CVPixelBufferUnlockBaseAddress
	testl	%eax, %eax
	je	LBB0_24
## %bb.22:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
LBB0_23:
	movq	_AVERROR_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: Could not lock base address of CVPixelBuffer: %d.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error: different number of planes in AVFrame and CVPixelBuffer.\n"

	.comm	_AVERROR_EXTERNAL,4,2           ## @AVERROR_EXTERNAL
L_.str.2:                               ## @.str.2
	.asciz	"Error: different number of planes in AVFrame and non-planar CVPixelBuffer.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Error: Could not unlock CVPixelBuffer base address: %d.\n"

	.no_dead_strip	_copy_avframe_to_pixel_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function copy_avframe_to_pixel_buffer
_copy_avframe_to_pixel_buffer:          ; @copy_avframe_to_pixel_buffer
	.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
	stp	x3, x4, [sp, #16]               ; 16-byte Folded Spill
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	mov	x0, x2
	mov	w1, #0
	bl	_CVPixelBufferLockBaseAddress
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_2:
	mov	x0, x20
	bl	_CVPixelBufferIsPlanar
	cbz	x0, LBB0_12
; %bb.3:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	bl	_CVPixelBufferGetPlaneCount
	ldr	x8, [x23]
	ldr	x8, [x8]
	cbz	x8, LBB0_20
; %bb.4:
	mov	x24, x0
	mov	x25, #0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mul	w8, w8, w9
	sxtw	x2, w8
	mov	x0, x26
	mov	x1, x27
	bl	_memcpy
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	ldr	x8, [x23]
	ldr	x8, [x8, x25, lsl #3]
	cbz	x8, LBB0_20
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cmp	x24, x25
	b.eq	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	mov	x1, x25
	bl	_CVPixelBufferGetBaseAddressOfPlane
	mov	x26, x0
	ldr	x8, [x23]
	lsl	x19, x25, #3
	ldr	x27, [x8, x19]
	mov	x0, x20
	mov	x1, x25
	bl	_CVPixelBufferGetBytesPerRowOfPlane
                                        ; kill: def $w0 killed $w0 def $x0
	ldp	x8, x9, [sp, #16]               ; 16-byte Folded Reload
	ldr	x8, [x8, x19]
	ldr	x9, [x9, x19]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	csel	w10, w0, w8, lt
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	sxtw	x28, w10
	and	x19, x9, #0xffffffff
	sbfiz	x21, x8, #2, #32
	sbfiz	x22, x0, #2, #32
LBB0_11:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x26
	mov	x1, x27
	mov	x2, x28
	bl	_memcpy
	add	x27, x27, x21
	add	x26, x26, x22
	subs	x19, x19, #1
	b.ne	LBB0_11
	b	LBB0_6
LBB0_12:
	ldr	x8, [x23]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_15
; %bb.13:
	mov	x0, x20
	mov	w1, #0
	bl	_CVPixelBufferUnlockBaseAddress
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str.2@PAGE
Lloh9:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	b	LBB0_23
LBB0_14:
	mov	x0, x20
	mov	w1, #0
	bl	_CVPixelBufferUnlockBaseAddress
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_22
LBB0_15:
	mov	x0, x20
	bl	_CVPixelBufferGetBaseAddress
	mov	x24, x0
	ldr	x8, [x23]
	ldr	x23, [x8]
	mov	x0, x20
	bl	_CVPixelBufferGetBytesPerRow
                                        ; kill: def $w0 killed $w0 def $x0
	ldp	x8, x9, [sp, #16]               ; 16-byte Folded Reload
	ldr	x8, [x8]
	ldr	x9, [x9]
	cmp	w0, w8
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	b.ne	LBB0_17
; %bb.16:
	mul	w8, w8, w9
	sxtw	x2, w8
	mov	x0, x24
	mov	x1, x23
	bl	_memcpy
	b	LBB0_20
LBB0_17:
	csel	w10, w0, w8, lt
	cmp	w9, #1
	b.lt	LBB0_20
; %bb.18:
	sxtw	x21, w10
	and	x19, x9, #0xffffffff
	sbfiz	x22, x8, #2, #32
	sbfiz	x25, x0, #2, #32
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x23
	mov	x2, x21
	bl	_memcpy
	add	x23, x23, x22
	add	x24, x24, x25
	subs	x19, x19, #1
	b.ne	LBB0_19
LBB0_20:
	mov	x0, x20
	mov	w1, #0
	bl	_CVPixelBufferUnlockBaseAddress
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_24
; %bb.21:
Lloh15:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh18:
	adrp	x2, l_.str.3@PAGE
Lloh19:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_22:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
LBB0_23:
	bl	_av_log
Lloh20:
	adrp	x8, _AVERROR_EXTERNAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AVERROR_EXTERNAL@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
LBB0_24:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: Could not lock base address of CVPixelBuffer: %d.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error: different number of planes in AVFrame and CVPixelBuffer.\n"

	.comm	_AVERROR_EXTERNAL,4,2           ; @AVERROR_EXTERNAL
l_.str.2:                               ; @.str.2
	.asciz	"Error: different number of planes in AVFrame and non-planar CVPixelBuffer.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Error: Could not unlock CVPixelBuffer base address: %d.\n"

	.no_dead_strip	_copy_avframe_to_pixel_buffer
.subsections_via_symbols
