	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thread_get_buffer_internal
_thread_get_buffer_internal:            ## @thread_get_buffer_internal
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	16(%rdi), %rax
	movq	8(%rax), %r13
	movq	16(%rsi), %rax
	movq	%rdi, 8(%rax)
	movq	16(%rsi), %rax
	movq	%rdi, (%rax)
	movq	_FF_THREAD_FRAME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_21
## %bb.1:
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	leaq	24(%r13), %r15
	movq	%r15, %rdi
	callq	_atomic_load
	movq	_STATE_SETTING_UP@GOTPCREL(%rip), %r14
	cmpq	(%r14), %rax
	jne	LBB0_2
LBB0_5:
	movq	16(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.6:
	movl	$8, %edi
	callq	_av_buffer_alloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_22
## %bb.7:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	movl	$-1, %esi
	callq	_atomic_init
	addq	$4, %rbx
	movq	%rbx, %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	$-1, %esi
	callq	_atomic_init
LBB0_8:
	movq	8(%r13), %rdi
	callq	_pthread_mutex_lock
	movq	%r12, %rdi
	callq	_THREAD_SAFE_CALLBACKS
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movl	8(%rbx), %esi
	movq	%r12, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	callq	_ff_get_buffer
	movl	%eax, %r15d
	jmp	LBB0_14
LBB0_21:
	movl	8(%rbx), %esi
	movq	%r12, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ff_get_buffer                  ## TAILCALL
LBB0_2:
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movl	$-1, %r15d
	jmp	LBB0_20
LBB0_3:
	movq	%r12, %rdi
	callq	_THREAD_SAFE_CALLBACKS
	testq	%rax, %rax
	jne	LBB0_5
	jmp	LBB0_4
LBB0_10:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rbx
	addq	$16, %r13
	movq	%r13, %rdi
	callq	_pthread_mutex_lock
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movq	_STATE_GET_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_memory_order_release@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_atomic_store_explicit
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_pthread_cond_broadcast
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_atomic_load
	cmpq	(%r14), %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_pthread_cond_wait
	jmp	LBB0_12
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %r15d
	movq	%r13, %rdi
	movq	%rax, %r13
	callq	_pthread_mutex_unlock
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_14:
	movq	%r12, %rdi
	callq	_THREAD_SAFE_CALLBACKS
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:
	movq	8(%r12), %rax
	cmpq	$0, (%rax)
	jne	LBB0_17
## %bb.16:
	movq	%r12, %rdi
	callq	_ff_thread_finish_setup
LBB0_17:
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_av_buffer_unref
LBB0_19:
	movq	8(%r13), %rdi
	callq	_pthread_mutex_unlock
LBB0_20:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FF_THREAD_FRAME,4,2            ## @FF_THREAD_FRAME
	.comm	_STATE_SETTING_UP,8,3           ## @STATE_SETTING_UP
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"get_buffer() cannot be called after ff_thread_finish_setup()\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_STATE_GET_BUFFER,4,2           ## @STATE_GET_BUFFER
	.comm	_memory_order_release,4,2       ## @memory_order_release
	.no_dead_strip	_thread_get_buffer_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thread_get_buffer_internal
_thread_get_buffer_internal:            ; @thread_get_buffer_internal
	.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
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0, #16]
	ldr	x24, [x8, #8]
	ldr	x8, [x1, #16]
	str	x0, [x8, #8]
	ldr	x8, [x1, #16]
	str	x0, [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_7
; %bb.1:
	add	x21, x24, #24
	mov	x0, x21
	bl	_atomic_load
Lloh3:
	adrp	x25, _STATE_SETTING_UP@GOTPAGE
Lloh4:
	ldr	x25, [x25, _STATE_SETTING_UP@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_8
LBB0_2:
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.3:
	mov	w0, #8
	bl	_av_buffer_alloc
	str	x0, [x19]
	cbz	x0, LBB0_22
; %bb.4:
	ldr	x23, [x0]
	mov	x0, x23
	mov	w1, #-1
	bl	_atomic_init
	add	x0, x23, #4
	mov	w1, #-1
	bl	_atomic_init
LBB0_5:
	ldr	x0, [x24, #8]
	bl	_pthread_mutex_lock
	mov	x0, x20
	bl	_THREAD_SAFE_CALLBACKS
	cbz	x0, LBB0_11
; %bb.6:
	ldr	w1, [x19, #8]
	mov	x0, x20
	mov	x2, x22
	bl	_ff_get_buffer
	mov	x21, x0
	b	LBB0_15
LBB0_7:
	ldr	w1, [x19, #8]
	mov	x0, x20
	mov	x2, x22
	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	_ff_get_buffer
LBB0_8:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
LBB0_9:
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	mov	w21, #-1
	b	LBB0_21
LBB0_10:
	mov	x0, x20
	bl	_THREAD_SAFE_CALLBACKS
	cbnz	x0, LBB0_2
	b	LBB0_9
LBB0_11:
	add	x23, x24, #16
	mov	x0, x23
	bl	_pthread_mutex_lock
	ldr	w8, [x19, #8]
	str	w8, [x24, #28]
	str	w22, [x24]
Lloh10:
	adrp	x8, _STATE_GET_BUFFER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STATE_GET_BUFFER@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _memory_order_release@GOTPAGE
Lloh14:
	ldr	x8, [x8, _memory_order_release@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_atomic_store_explicit
	add	x22, x24, #20
	mov	x0, x22
	bl	_pthread_cond_broadcast
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_atomic_load
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_pthread_cond_wait
	b	LBB0_12
LBB0_14:
	ldr	w21, [x24, #4]
	mov	x0, x23
	bl	_pthread_mutex_unlock
LBB0_15:
	mov	x0, x20
	bl	_THREAD_SAFE_CALLBACKS
	cbnz	x0, LBB0_18
; %bb.16:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbnz	x8, LBB0_18
; %bb.17:
	mov	x0, x20
	bl	_ff_thread_finish_setup
LBB0_18:
	cbz	w21, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_av_buffer_unref
LBB0_20:
	ldr	x0, [x24, #8]
	bl	_pthread_mutex_unlock
LBB0_21:
	mov	x0, x21
	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
LBB0_22:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_FF_THREAD_FRAME,4,2            ; @FF_THREAD_FRAME
	.comm	_STATE_SETTING_UP,8,3           ; @STATE_SETTING_UP
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"get_buffer() cannot be called after ff_thread_finish_setup()\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_STATE_GET_BUFFER,4,2           ; @STATE_GET_BUFFER
	.comm	_memory_order_release,4,2       ; @memory_order_release
	.no_dead_strip	_thread_get_buffer_internal
.subsections_via_symbols
