	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_avio_read_partial              ## -- Begin function avio_read_partial
	.p2align	4, 0x90
_avio_read_partial:                     ## @avio_read_partial
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%edx, %edx
	js	LBB0_1
## %bb.2:
	movl	%edx, %ebx
	movq	%rsi, %r15
	movq	%rdi, %r14
	cmpq	$0, 32(%rdi)
	je	LBB0_6
## %bb.3:
	cmpq	$0, 24(%r14)
	je	LBB0_6
## %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_read_packet_wrapper
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_12
## %bb.5:
	addl	%ebx, (%r14)
	jmp	LBB0_12
LBB0_6:
	movl	4(%r14), %eax
	movl	8(%r14), %esi
	subl	%esi, %eax
	jne	LBB0_8
## %bb.7:
	movl	12(%r14), %eax
	movl	%eax, 8(%r14)
	movl	%eax, 4(%r14)
	movq	%r14, %rdi
	callq	_fill_buffer
	movl	4(%r14), %eax
	movl	8(%r14), %esi
	subl	%esi, %eax
LBB0_8:
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_memcpy
	addl	%ebx, 8(%r14)
	testl	%ebx, %ebx
	jne	LBB0_12
## %bb.9:
	movl	16(%r14), %ebx
	testl	%ebx, %ebx
	jne	LBB0_12
## %bb.10:
	movq	%r14, %rdi
	callq	_avio_feof
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	_AVERROR_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_1:
	movl	$-1, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVERROR_EOF,4,2                ## @AVERROR_EOF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_avio_read_partial              ; -- Begin function avio_read_partial
	.p2align	2
_avio_read_partial:                     ; @avio_read_partial
	.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
	tbnz	w2, #31, LBB0_5
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	cbz	x8, LBB0_6
; %bb.2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_6
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_read_packet_wrapper
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.4:
	ldr	w8, [x19]
	add	w8, w8, w21
	str	w8, [x19]
	b	LBB0_11
LBB0_5:
	mov	w21, #-1
	b	LBB0_11
LBB0_6:
	ldp	w8, w1, [x19, #4]
	subs	w8, w8, w1
	b.ne	LBB0_8
; %bb.7:
	ldr	w8, [x19, #12]
	stp	w8, w8, [x19, #4]
	mov	x0, x19
	bl	_fill_buffer
	ldp	w8, w1, [x19, #4]
	sub	w8, w8, w1
LBB0_8:
	cmp	w8, w21
	csel	w21, w8, w21, lt
	mov	x0, x20
	mov	x2, x21
	bl	_memcpy
	ldr	w8, [x19, #8]
	add	w8, w8, w21
	str	w8, [x19, #8]
	cbnz	w21, LBB0_11
; %bb.9:
	ldr	w21, [x19, #16]
	cbnz	w21, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_avio_feof
Lloh0:
	adrp	x8, _AVERROR_EOF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EOF@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w21, wzr, w8, eq
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AVERROR_EOF,4,2                ; @AVERROR_EOF
.subsections_via_symbols
