	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buffer_read
_buffer_read:                           ## @buffer_read
	.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
	xorl	%eax, %eax
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.1:
	movq	%rdi, %r13
	movq	8(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_22
## %bb.2:
	cmpq	$0, (%r13)
	je	LBB0_22
## %bb.3:
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%r13, %rdi
	callq	_BIO_clear_retry_flags
	movl	(%r12), %ebx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	je	LBB0_6
	.p2align	4, 0x90
LBB0_4:
	cmpl	%r15d, %ebx
	movl	%r15d, %r13d
	cmovll	%ebx, %r13d
	movq	8(%r12), %rsi
	addq	16(%r12), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_memcpy
	movslq	%r13d, %rax
	addq	%rax, 16(%r12)
	subl	%eax, (%r12)
	addl	%eax, -44(%rbp)                 ## 4-byte Folded Spill
	cmpl	%ebx, %r15d
	jle	LBB0_18
## %bb.5:
	movl	%r15d, %ecx
	subl	%eax, %ecx
	addq	%rax, %r14
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:
	movl	%r15d, %ecx
LBB0_7:
	movl	24(%r12), %edx
	movq	(%r13), %rdi
	cmpl	%edx, %ecx
	jg	LBB0_10
## %bb.8:
	movl	%ecx, %r15d
	movq	8(%r12), %rsi
	callq	_BIO_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_14
## %bb.9:
	movq	$0, 16(%r12)
	movl	%ebx, (%r12)
	testl	%ebx, %ebx
	jne	LBB0_4
	jmp	LBB0_6
LBB0_10:
	movq	%r14, %r15
	movq	%r14, %rsi
	movl	%ecx, %ebx
	movl	%ecx, %edx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	callq	_BIO_read
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	addl	%r14d, -44(%rbp)                ## 4-byte Folded Spill
	subl	%r14d, %ebx
	je	LBB0_18
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	%r14d, %eax
	addq	%rax, %r15
	movq	(%r13), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	jmp	LBB0_11
LBB0_14:
	movq	%r13, %rdi
	callq	_BIO_copy_next_retry
	testl	%ebx, %ebx
	jns	LBB0_18
## %bb.19:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	cmovlel	%ebx, %eax
	jmp	LBB0_22
LBB0_16:
	movq	%r13, %rdi
	callq	_BIO_copy_next_retry
	testl	%r14d, %r14d
	js	LBB0_21
LBB0_18:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	cmovlel	%r14d, %eax
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_buffer_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffer_read
_buffer_read:                           ; @buffer_read
	.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
	cbz	x1, LBB0_13
; %bb.1:
	mov	x20, x0
	ldr	x25, [x0, #8]
	cbz	x25, LBB0_13
; %bb.2:
	ldr	x8, [x20]
	cbz	x8, LBB0_13
; %bb.3:
	mov	x21, x2
	mov	x22, x1
	mov	x0, x20
	bl	_BIO_clear_retry_flags
	mov	w19, #0
	ldr	w23, [x25]
	cbz	w23, LBB0_6
LBB0_4:
	cmp	w23, w21
	csel	w24, w23, w21, lt
	ldp	x8, x9, [x25, #8]
	add	x1, x8, x9
	mov	x0, x22
	mov	x2, x24
	bl	_memcpy
	sxtw	x8, w24
	ldr	x9, [x25, #16]
	add	x9, x9, x8
	str	x9, [x25, #16]
	ldr	w9, [x25]
	sub	w9, w9, w24
	str	w9, [x25]
	add	w19, w24, w19
	cmp	w21, w23
	b.le	LBB0_14
; %bb.5:
	sub	w21, w21, w8
	add	x22, x22, x8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x25, #24]
	ldr	x0, [x20]
	cmp	w21, w2
	b.gt	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x1, [x25, #8]
	bl	_BIO_read
	mov	x23, x0
	cmp	w0, #0
	b.le	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	xzr, [x25, #16]
	str	w23, [x25]
	cbnz	w23, LBB0_4
	b	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	add	w19, w23, w19
	subs	w21, w21, w23
	b.eq	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x22, x22, w23, uxtw
	ldr	x0, [x20]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x1, x22
	mov	x2, x21
	bl	_BIO_read
	mov	x23, x0
	cmp	w0, #1
	b.ge	LBB0_9
LBB0_12:
	mov	x0, x20
	bl	_BIO_copy_next_retry
	cmp	w19, #0
	csel	w8, w19, w23, gt
	tst	w23, #0x80000000
	csel	w19, w19, w8, eq
	b	LBB0_14
LBB0_13:
	mov	w19, #0
LBB0_14:
	mov	x0, x19
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_buffer_read
.subsections_via_symbols
