	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mrb_input_stream_read
_mrb_input_stream_read:                 ## @mrb_input_stream_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-28(%rbp), %rcx
	callq	_mrb_get_args
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_DATA_PTR
	movq	%rax, %rbx
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_assert_is_open
	movslq	(%rbx), %rax
	movl	16(%rbx), %esi
	movl	%esi, %edx
	subl	%eax, %edx
	jle	LBB0_1
## %bb.4:
	movl	%eax, %edi
	addq	8(%rbx), %rax
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.6:
	movl	-32(%rbp), %ecx
	addl	%edi, %ecx
	cmpl	%esi, %ecx
	cmovgel	%esi, %ecx
	movl	%ecx, (%rbx)
	cmpl	$1, %r14d
	jne	LBB0_8
## %bb.7:
	subl	%edi, %ecx
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	%ecx, %edx
	callq	_mrb_str_new
	jmp	LBB0_9
LBB0_1:
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.3:
	xorl	%eax, %eax
	callq	_mrb_nil_value
	jmp	LBB0_9
LBB0_5:
	movl	%esi, (%rbx)
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_mrb_str_new
	jmp	LBB0_9
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_mrb_str_new_lit
	jmp	LBB0_9
LBB0_8:
	movl	-28(%rbp), %esi
	subl	%edi, %ecx
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_mrb_str_cat
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"|iS"

L_.str.1:                               ## @.str.1
	.space	1

	.no_dead_strip	_mrb_input_stream_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mrb_input_stream_read
_mrb_input_stream_read:                 ; @mrb_input_stream_read
	.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	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	add	x3, sp, #8
	bl	_mrb_get_args
	mov	x20, x0
	mov	x0, x21
	bl	_DATA_PTR
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_assert_is_open
	ldrsw	x9, [x21]
	ldr	w10, [x21, #16]
	subs	w2, w10, w9
	b.le	LBB0_4
; %bb.1:
	ldr	x8, [x21, #8]
	add	x8, x8, x9
	cbz	w20, LBB0_6
; %bb.2:
	ldr	w11, [sp, #12]
	add	w11, w11, w9
	cmp	w11, w10
	csel	w10, w11, w10, lt
	str	w10, [x21]
	cmp	w20, #1
	b.ne	LBB0_9
; %bb.3:
	sub	w2, w10, w9
	b	LBB0_7
LBB0_4:
	cbz	w20, LBB0_8
; %bb.5:
	bl	_mrb_nil_value
	b	LBB0_10
LBB0_6:
	str	w10, [x21]
LBB0_7:
	mov	x0, x19
	mov	x1, x8
	bl	_mrb_str_new
	b	LBB0_10
LBB0_8:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_mrb_str_new_lit
	b	LBB0_10
LBB0_9:
	ldr	w1, [sp, #8]
	sub	w3, w10, w9
	mov	x0, x19
	mov	x2, x8
	bl	_mrb_str_cat
LBB0_10:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"|iS"

l_.str.1:                               ; @.str.1
	.space	1

	.no_dead_strip	_mrb_input_stream_read
.subsections_via_symbols
