	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_thread_release_buffer       ## -- Begin function ff_thread_release_buffer
	.p2align	4, 0x90
_ff_thread_release_buffer:              ## @ff_thread_release_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	movq	_FF_THREAD_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_THREAD_SAFE_CALLBACKS
	testq	%rax, %rax
	setne	%r14b
	jmp	LBB0_3
LBB0_1:
	movb	$1, %r14b
LBB0_3:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_12
## %bb.5:
	movq	_FF_DEBUG_BUFFERS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_7
## %bb.6:
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	callq	_av_log
LBB0_7:
	leaq	16(%r15), %rdi
	callq	_av_buffer_unref
	movq	8(%r15), %rax
	movq	$0, 8(%rax)
	movq	8(%r15), %rax
	movq	$0, (%rax)
	testb	%r14b, %r14b
	je	LBB0_8
## %bb.13:
	movq	(%r15), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_av_frame_unref                 ## TAILCALL
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	24(%r12), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movslq	(%r12), %rdx
	incq	%rdx
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	shrq	$2, %rax
	cmpq	%rdx, %rax
	jbe	LBB0_11
## %bb.9:
	movq	8(%r12), %rdi
	leaq	16(%r12), %rsi
	shll	$2, %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_av_fast_realloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, 8(%r12)
	movslq	(%r12), %rcx
	leaq	(%rax,%rcx,4), %rdi
	movq	(%r15), %rsi
	callq	_av_frame_move_ref
	incl	(%r12)
LBB0_11:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FF_THREAD_FRAME,4,2            ## @FF_THREAD_FRAME
	.comm	_FF_DEBUG_BUFFERS,4,2           ## @FF_DEBUG_BUFFERS
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"thread_release_buffer called on pic %p\n"

	.comm	_INT_MAX,4,2                    ## @INT_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ff_thread_release_buffer       ; -- Begin function ff_thread_release_buffer
	.p2align	2
_ff_thread_release_buffer:              ; @ff_thread_release_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, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	x21, [x8]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _FF_THREAD_FRAME@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FF_THREAD_FRAME@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_THREAD_SAFE_CALLBACKS
	cmp	x0, #0
	cset	w22, ne
	ldr	x8, [x19]
	cbnz	x8, LBB0_3
	b	LBB0_8
LBB0_2:
	mov	w22, #1
	ldr	x8, [x19]
	cbz	x8, LBB0_8
LBB0_3:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_8
; %bb.4:
	ldr	w8, [x20, #4]
Lloh3:
	adrp	x9, _FF_DEBUG_BUFFERS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _FF_DEBUG_BUFFERS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh6:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	bl	_av_log
LBB0_6:
	add	x0, x19, #16
	bl	_av_buffer_unref
	ldr	x8, [x19, #8]
	str	xzr, [x8, #8]
	ldr	x8, [x19, #8]
	str	xzr, [x8]
	cbz	w22, LBB0_9
; %bb.7:
	ldr	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_frame_unref
LBB0_8:
	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_9:
	ldr	x20, [x21, #24]
	mov	x0, x20
	bl	_pthread_mutex_lock
	ldrsw	x8, [x21]
	add	x8, x8, #1
Lloh11:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh12:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh13:
	ldrsw	x9, [x9]
	cmp	x8, x9, lsr #2
	b.hs	LBB0_12
; %bb.10:
	ldr	x0, [x21, #8]
	add	x1, x21, #16
	lsl	w2, w8, #2
	bl	_av_fast_realloc
	cbz	x0, LBB0_12
; %bb.11:
	str	x0, [x21, #8]
	ldrsw	x8, [x21]
	add	x0, x0, x8, lsl #2
	ldr	x1, [x19]
	bl	_av_frame_move_ref
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
LBB0_12:
	mov	x0, x20
	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	_pthread_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_FF_THREAD_FRAME,4,2            ; @FF_THREAD_FRAME
	.comm	_FF_DEBUG_BUFFERS,4,2           ; @FF_DEBUG_BUFFERS
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"thread_release_buffer called on pic %p\n"

	.comm	_INT_MAX,4,2                    ; @INT_MAX
.subsections_via_symbols
