	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function v4l2_free_buffer
_v4l2_free_buffer:                      ## @v4l2_free_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_buf_to_m2mctx
	movq	%rax, %r14
	leaq	20(%rbx), %rdi
	movl	$1, %esi
	callq	_atomic_fetch_sub
	cmpl	$1, %eax
	jne	LBB0_9
## %bb.1:
	leaq	12(%r14), %r15
	movq	_memory_order_acq_rel@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_atomic_fetch_sub_explicit
	cmpq	$0, 16(%r14)
	je	LBB0_4
## %bb.2:
	movq	%r15, %rdi
	callq	_atomic_load
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_sem_post
	jmp	LBB0_8
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	cmpq	$0, (%r14)
	je	LBB0_6
## %bb.5:
	movq	_V4L2BUF_AVAILABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	jmp	LBB0_8
LBB0_6:
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_ff_v4l2_buffer_enqueue
LBB0_8:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_av_buffer_unref                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_memory_order_acq_rel,4,2       ## @memory_order_acq_rel
	.comm	_V4L2BUF_AVAILABLE,4,2          ## @V4L2BUF_AVAILABLE
	.no_dead_strip	_v4l2_free_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function v4l2_free_buffer
_v4l2_free_buffer:                      ; @v4l2_free_buffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_buf_to_m2mctx
	mov	x20, x0
	add	x0, x19, #20
	mov	w1, #1
	bl	_atomic_fetch_sub
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.1:
	add	x21, x20, #12
Lloh0:
	adrp	x8, _memory_order_acq_rel@GOTPAGE
Lloh1:
	ldr	x8, [x8, _memory_order_acq_rel@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w1, #1
	bl	_atomic_fetch_sub_explicit
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_5
; %bb.2:
	mov	x0, x21
	bl	_atomic_load
	cbnz	w0, LBB0_9
; %bb.3:
	add	x0, x20, #8
	bl	_sem_post
	b	LBB0_9
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x8, [x20]
	cbz	x8, LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _V4L2BUF_AVAILABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2BUF_AVAILABLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	b	LBB0_9
LBB0_7:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_ff_v4l2_buffer_enqueue
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_av_buffer_unref
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_memory_order_acq_rel,4,2       ; @memory_order_acq_rel
	.comm	_V4L2BUF_AVAILABLE,4,2          ; @V4L2BUF_AVAILABLE
	.no_dead_strip	_v4l2_free_buffer
.subsections_via_symbols
