	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fifo_write_packet
_fifo_write_packet:                     ## @fifo_write_packet
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movl	$0, -40(%rbp)
	testq	%rsi, %rsi
	jne	LBB0_2
## %bb.1:
	movq	_FIFO_FLUSH_OUTPUT@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_FIFO_WRITE_PACKET@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	je	LBB0_5
## %bb.4:
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_av_init_packet
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_av_packet_ref
	testl	%eax, %eax
	js	LBB0_12
LBB0_5:
	movl	16(%r12), %edi
	xorl	%edx, %edx
	cmpq	$0, 8(%r12)
	je	LBB0_7
## %bb.6:
	movq	_AV_THREAD_MESSAGE_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_7:
	leaq	-40(%rbp), %rsi
	callq	_av_thread_message_queue_send
	movl	%eax, %ebx
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	cmpl	%eax, %ebx
	jne	LBB0_10
## %bb.8:
	leaq	4(%r12), %rbx
	movq	%rbx, %rdi
	callq	_pthread_mutex_lock
	cmpl	$0, (%r12)
	je	LBB0_13
## %bb.9:
	movq	%rbx, %rdi
	callq	_pthread_mutex_unlock
	jmp	LBB0_14
LBB0_10:
	testl	%ebx, %ebx
	jns	LBB0_16
## %bb.11:
	testq	%r15, %r15
	jne	LBB0_15
	jmp	LBB0_16
LBB0_12:
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_13:
	movl	$1, (%r12)
	movq	%rbx, %rdi
	callq	_pthread_mutex_unlock
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
LBB0_14:
	xorl	%ebx, %ebx
	testq	%r15, %r15
	je	LBB0_16
LBB0_15:
	leaq	-40(%rbp), %rdi
	callq	_av_packet_unref
LBB0_16:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FIFO_WRITE_PACKET,4,2          ## @FIFO_WRITE_PACKET
	.comm	_FIFO_FLUSH_OUTPUT,4,2          ## @FIFO_FLUSH_OUTPUT
	.comm	_AV_THREAD_MESSAGE_NONBLOCK,4,2 ## @AV_THREAD_MESSAGE_NONBLOCK
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FIFO queue full\n"

	.no_dead_strip	_fifo_write_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fifo_write_packet
_fifo_write_packet:                     ; @fifo_write_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, [x0]
	str	wzr, [sp, #8]
Lloh0:
	adrp	x8, _FIFO_WRITE_PACKET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FIFO_WRITE_PACKET@GOTPAGEOFF]
Lloh2:
	adrp	x9, _FIFO_FLUSH_OUTPUT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FIFO_FLUSH_OUTPUT@GOTPAGEOFF]
	cmp	x1, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [sp, #12]
	cbz	x1, LBB0_2
; %bb.1:
	add	x0, sp, #8
	bl	_av_init_packet
	add	x0, sp, #8
	mov	x1, x19
	bl	_av_packet_ref
	tbnz	w0, #31, LBB0_7
LBB0_2:
	ldr	w0, [x22, #16]
	ldr	x8, [x22, #8]
Lloh4:
	adrp	x9, _AV_THREAD_MESSAGE_NONBLOCK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _AV_THREAD_MESSAGE_NONBLOCK@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w2, wzr, w9, eq
	add	x1, sp, #8
	bl	_av_thread_message_queue_send
	mov	x21, x0
Lloh7:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_AVERROR
	cmp	w21, w0
	b.ne	LBB0_5
; %bb.3:
	add	x21, x22, #4
	mov	x0, x21
	bl	_pthread_mutex_lock
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.4:
	mov	x0, x21
	bl	_pthread_mutex_unlock
	mov	w21, #0
	cbnz	x19, LBB0_9
	b	LBB0_10
LBB0_5:
	tbz	w21, #31, LBB0_10
; %bb.6:
	cbnz	x19, LBB0_9
	b	LBB0_10
LBB0_7:
	mov	x21, x0
	b	LBB0_10
LBB0_8:
	mov	w8, #1
	str	w8, [x22]
	mov	x0, x21
	bl	_pthread_mutex_unlock
Lloh10:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	mov	w21, #0
	cbz	x19, LBB0_10
LBB0_9:
	add	x0, sp, #8
	bl	_av_packet_unref
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_FIFO_WRITE_PACKET,4,2          ; @FIFO_WRITE_PACKET
	.comm	_FIFO_FLUSH_OUTPUT,4,2          ; @FIFO_FLUSH_OUTPUT
	.comm	_AV_THREAD_MESSAGE_NONBLOCK,4,2 ; @AV_THREAD_MESSAGE_NONBLOCK
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FIFO queue full\n"

	.no_dead_strip	_fifo_write_packet
.subsections_via_symbols
