	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function async_read_internal
_async_read_internal:                   ## @async_read_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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movl	%ecx, -64(%rbp)                 ## 4-byte Spill
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	movq	(%rdi), %rbx
	leaq	8(%rbx), %rdi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_pthread_mutex_lock
	testl	%r13d, %r13d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	leaq	32(%rbx), %rax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	leaq	12(%rbx), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	leaq	16(%rbx), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movl	%r13d, -60(%rbp)                ## 4-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_pthread_cond_signal
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_pthread_cond_wait
	movq	%r12, %r14
	testl	%r13d, %r13d
	jle	LBB0_15
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_async_check_interrupt
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_ring_size
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_FFMIN
	testl	%eax, %eax
	jle	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_ring_generic_read
	testq	%rbx, %rbx
	movl	%r15d, %eax
	leaq	(%r14,%rax,4), %r12
	cmovneq	%r14, %r12
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r15d, (%rax)
	subl	%r15d, %r13d
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	subl	%r13d, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	testl	%r13d, %r13d
	jg	LBB0_8
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 24(%rax)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %r12
	jmp	LBB0_8
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_15
LBB0_4:
	movq	_AVERROR_EXIT@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_15:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	addq	$12, %rdi
	callq	_pthread_cond_signal
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_pthread_mutex_unlock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jg	LBB0_15
## %bb.12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EXIT,4,2               ## @AVERROR_EXIT
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
	.no_dead_strip	_async_read_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function async_read_internal
_async_read_internal:                   ; @async_read_internal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x4
	str	w3, [sp, #4]                    ; 4-byte Folded Spill
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	ldr	x19, [x0]
	add	x0, x19, #8
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	bl	_pthread_mutex_lock
	cmp	w23, #1
	b.lt	LBB0_8
; %bb.1:
	mov	w20, #0
	add	x26, x19, #32
	add	x27, x19, #12
	add	x28, x19, #16
	str	w23, [sp]                       ; 4-byte Folded Spill
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19, #24]
	cbnz	x8, LBB0_11
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x27
	bl	_pthread_cond_signal
	mov	x0, x28
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_pthread_cond_wait
	cmp	w23, #0
	b.le	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_async_check_interrupt
	cbnz	x0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x26
	bl	_ring_size
	mov	x1, x0
	mov	x0, x23
	bl	_FFMIN
	cmp	w0, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x22, x0
	mov	x0, x26
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	bl	_ring_generic_read
	add	x8, x24, w22, uxtw #2
	cmp	x21, #0
	csel	x24, x8, x24, eq
	ldr	w8, [x19]
	add	w8, w8, w22
	str	w8, [x19]
	sub	w23, w23, w22
	ldr	w8, [sp]                        ; 4-byte Folded Reload
	sub	w20, w8, w23
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w23, #0
	b.gt	LBB0_3
	b	LBB0_10
LBB0_8:
	mov	w20, #0
	b	LBB0_10
LBB0_9:
Lloh0:
	adrp	x8, _AVERROR_EXIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EXIT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
LBB0_10:
	add	x0, x19, #12
	bl	_pthread_cond_signal
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_pthread_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	cmp	w20, #0
	b.gt	LBB0_10
; %bb.12:
	ldr	w8, [x19, #4]
Lloh3:
	adrp	x9, _AVERROR_EOF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVERROR_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w20, w9, w8, eq
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EXIT,4,2               ; @AVERROR_EXIT
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
	.no_dead_strip	_async_read_internal
.subsections_via_symbols
