	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_bufref_to_buf
_v4l2_bufref_to_buf:                    ## @v4l2_bufref_to_buf
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, (%rdi)
	jle	LBB0_5
## %bb.1:
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movq	%rdi, %rbx
	movq	24(%rdi), %rax
	movslq	%esi, %r15
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	shlq	$4, %r15
	movl	(%rax,%r15), %r14d
	leal	(%r12,%r13), %edi
	movl	%r14d, %esi
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	callq	_FFMIN
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	24(%rbx), %rax
	movslq	%r12d, %rcx
	leaq	(,%rcx,4), %r12
	addq	8(%rax,%r15), %r12
	movl	%r14d, %esi
	subl	%ecx, %esi
	movl	%r13d, %edi
	callq	_FFMIN
	movq	%r12, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%eax, %edx
	callq	_memcpy
	movl	12(%rbx), %edi
	callq	_V4L2_TYPE_IS_MULTIPLANAR
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	16(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax,%rcx,8)
	movl	%r14d, 4(%rax,%rcx,8)
	jmp	LBB0_4
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_3:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rbx)
	movl	%r14d, 8(%rbx)
LBB0_4:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_v4l2_bufref_to_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_bufref_to_buf
_v4l2_bufref_to_buf:                    ; @v4l2_bufref_to_buf
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_3
; %bb.1:
	mov	x25, x4
	mov	x24, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #24]
	sbfiz	x26, x20, #4, #32
	ldr	w21, [x8, x26]
	add	w0, w4, w3
	mov	x1, x21
	bl	_FFMIN
	mov	x23, x0
	ldr	x8, [x19, #24]
	add	x8, x8, x26
	ldr	x8, [x8, #8]
	add	x26, x8, w25, sxtw #2
	sub	w1, w21, w25
	mov	x0, x24
	bl	_FFMIN
	mov	x2, x0
	mov	x0, x26
	mov	x1, x22
	bl	_memcpy
	ldr	w0, [x19, #12]
	bl	_V4L2_TYPE_IS_MULTIPLANAR
	cbz	x0, LBB0_4
; %bb.2:
	sxtw	x8, w20
	ldr	x9, [x19, #16]
	add	x8, x9, x8, lsl #3
	stp	w23, w21, [x8]
	b	LBB0_5
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_4:
	stp	w23, w21, [x19, #4]
LBB0_5:
	mov	w0, #0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_v4l2_bufref_to_buf
.subsections_via_symbols
