	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ffmmal_set_ref
_ffmmal_set_ref:                        ## @ffmmal_set_ref
	.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	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	$16, %edi
	callq	_av_mallocz
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	movq	%r12, 8(%rax)
	movq	%r15, (%rax)
	movq	_ffmmal_release_frame@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AV_BUFFER_FLAG_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%rbx, %rdi
	movl	$16, %esi
	xorl	%ecx, %ecx
	callq	_av_buffer_create
	movq	16(%r14), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	movq	8(%rbx), %rdi
	movq	_memory_order_relaxed@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	callq	_atomic_fetch_add_explicit
	movq	%r15, %rdi
	callq	_mmal_buffer_header_acquire
	movq	_AV_PIX_FMT_MMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	(%rbx), %rax
	movq	(%r14), %rcx
	movq	%rax, 24(%rcx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_av_free
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ffmmal_release_frame,4,2       ## @ffmmal_release_frame
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ## @AV_BUFFER_FLAG_READONLY
	.comm	_memory_order_relaxed,4,2       ## @memory_order_relaxed
	.comm	_AV_PIX_FMT_MMAL,4,2            ## @AV_PIX_FMT_MMAL
	.no_dead_strip	_ffmmal_set_ref
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ffmmal_set_ref
_ffmmal_set_ref:                        ; @ffmmal_set_ref
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	w0, #16
	bl	_av_mallocz
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	stp	x21, x22, [x0]
Lloh0:
	adrp	x8, _ffmmal_release_frame@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ffmmal_release_frame@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _AV_BUFFER_FLAG_READONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_BUFFER_FLAG_READONLY@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	w1, #16
	mov	x3, #0
	bl	_av_buffer_create
	ldr	x8, [x19, #16]
	str	w0, [x8]
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x0, [x20, #8]
Lloh6:
	adrp	x8, _memory_order_relaxed@GOTPAGE
Lloh7:
	ldr	x8, [x8, _memory_order_relaxed@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #1
	bl	_atomic_fetch_add_explicit
	mov	x0, x21
	bl	_mmal_buffer_header_acquire
Lloh9:
	adrp	x8, _AV_PIX_FMT_MMAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_PIX_FMT_MMAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	ldr	x8, [x20]
	ldr	x9, [x19]
	str	x8, [x9, #24]
	mov	w0, #0
	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_3:
	mov	x0, x20
	bl	_av_free
LBB0_4:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	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	_AVERROR
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ffmmal_release_frame,4,2       ; @ffmmal_release_frame
	.comm	_AV_BUFFER_FLAG_READONLY,4,2    ; @AV_BUFFER_FLAG_READONLY
	.comm	_memory_order_relaxed,4,2       ; @memory_order_relaxed
	.comm	_AV_PIX_FMT_MMAL,4,2            ; @AV_PIX_FMT_MMAL
	.no_dead_strip	_ffmmal_set_ref
.subsections_via_symbols
