	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_buf_to_bufref
_v4l2_buf_to_bufref:                    ## @v4l2_buf_to_bufref
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, (%rdi)
	jle	LBB0_1
## %bb.3:
	movq	%rdx, %r14
	movq	%rdi, %rbx
	movslq	%esi, %rax
	movq	8(%rdi), %rcx
	movq	16(%rdi), %rdx
	movslq	(%rdx,%rax,4), %rdi
	shlq	$4, %rax
	addq	8(%rcx,%rax), %rdi
	movl	(%rcx,%rax), %esi
	movq	_v4l2_free_buffer@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%rbx, %rcx
	xorl	%r8d, %r8d
	callq	_av_buffer_create
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	callq	_v4l2_buf_increase_ref
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_av_buffer_unref
	movl	%ebx, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_v4l2_free_buffer,4,2           ## @v4l2_free_buffer
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_v4l2_buf_to_bufref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_buf_to_bufref
_v4l2_buf_to_bufref:                    ; @v4l2_buf_to_bufref
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
	cmp	w8, w1
	b.le	LBB0_5
; %bb.1:
	mov	x19, x2
	mov	x20, x0
	ldp	x8, x9, [x0, #8]
	add	x8, x8, w1, sxtw #4
	ldrsw	x9, [x9, w1, sxtw #2]
	ldr	x10, [x8, #8]
	add	x0, x10, x9
	ldr	w1, [x8]
Lloh0:
	adrp	x8, _v4l2_free_buffer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _v4l2_free_buffer@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x3, x20
	mov	w4, #0
	bl	_av_buffer_create
	str	x0, [x19]
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_v4l2_buf_increase_ref
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_av_buffer_unref
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_v4l2_free_buffer,4,2           ; @v4l2_free_buffer
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_v4l2_buf_to_bufref
.subsections_via_symbols
