	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_strbuf_read                    ## -- Begin function strbuf_read
	.p2align	4, 0x90
_strbuf_read:                           ## @strbuf_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	(%rdi), %r14
	movq	8(%rdi), %r12
	testl	%edx, %edx
	movl	$8192, %esi                     ## imm = 0x2000
	cmovnel	%edx, %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	callq	_strbuf_grow
	movq	(%rbx), %rdx
	movq	16(%rbx), %rsi
	addq	%rdx, %rsi
	notq	%rdx
	addq	8(%rbx), %rdx
	movl	%r15d, %edi
	callq	_read
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %eax
	addq	%rax, (%rbx)
	movq	%rbx, %rdi
	movl	$8192, %esi                     ## imm = 0x2000
	jmp	LBB0_1
LBB0_4:
	movq	%rbx, %rdi
	testq	%r12, %r12
	je	LBB0_7
## %bb.5:
	movq	%r14, %rsi
	callq	_strbuf_setlen
	jmp	LBB0_8
LBB0_6:
	movq	(%rbx), %rax
	movq	16(%rbx), %rcx
	movb	$0, (%rcx,%rax)
	movl	(%rbx), %eax
	subl	%r14d, %eax
	jmp	LBB0_9
LBB0_7:
	callq	_strbuf_release
LBB0_8:
	movl	$-1, %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_strbuf_read                    ; -- Begin function strbuf_read
	.p2align	2
_strbuf_read:                           ; @strbuf_read
	.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, x1
	mov	x19, x0
	ldp	x20, x22, [x0]
	mov	w8, #8192
	cmp	w2, #0
	csel	w1, w8, w2, eq
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_strbuf_grow
	ldp	x10, x8, [x19, #8]
	ldr	x9, [x19]
	add	x1, x8, x9
	mvn	x8, x9
	add	x2, x10, x8
	mov	x0, x21
	bl	_read
	tbnz	w0, #31, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19]
	add	x8, x8, w0, uxtw
	str	x8, [x19]
	mov	x0, x19
	mov	w1, #8192
	b	LBB0_1
LBB0_4:
	mov	x0, x19
	cbz	x22, LBB0_7
; %bb.5:
	mov	x1, x20
	bl	_strbuf_setlen
	b	LBB0_8
LBB0_6:
	ldr	x8, [x19, #16]
	ldr	x9, [x19]
	strb	wzr, [x8, x9]
	ldr	w8, [x19]
	sub	w0, w8, w20
	b	LBB0_9
LBB0_7:
	bl	_strbuf_release
LBB0_8:
	mov	w0, #-1
LBB0_9:
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
