	.file	"extr_io.c_mrb_io_sysread.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"i|S"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"negative expanding string size"
	.section	.rodata.str1.1
.LC2:
	.string	"not opened for reading"
.LC3:
	.string	""
.LC4:
	.string	"sysread failed: End of File"
.LC5:
	.string	"sysread failed"
	.text
	.p2align 4
	.globl	mrb_io_sysread
	.type	mrb_io_sysread, @function
mrb_io_sysread:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	sub	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	mrb_nil_value@PLT
	lea	rcx, 12[rsp]
	lea	rdx, 16[rsp]
	mov	rdi, rbp
	lea	rsi, .LC0[rip]
	mov	DWORD PTR 12[rsp], eax
	call	mrb_get_args@PLT
	cmp	QWORD PTR 16[rsp], 0
	js	.L18
	je	.L19
.L3:
	mov	edi, DWORD PTR 12[rsp]
	call	mrb_nil_p@PLT
	test	rax, rax
	jne	.L5
	mov	edi, DWORD PTR 12[rsp]
.L6:
	call	RSTRING_LEN@PLT
	mov	rdx, QWORD PTR 16[rsp]
	cdqe
	cmp	rax, rdx
	je	.L7
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, rbp
	call	mrb_str_resize@PLT
	mov	DWORD PTR 12[rsp], eax
.L8:
	mov	esi, r12d
	mov	rdi, rbp
	call	io_get_open_fptr@PLT
	mov	r12, rax
	mov	eax, DWORD PTR 4[rax]
	test	eax, eax
	je	.L20
.L9:
	mov	edi, DWORD PTR 12[rsp]
	mov	rbx, QWORD PTR 16[rsp]
	call	RSTRING_PTR@PLT
	mov	edi, DWORD PTR [r12]
	mov	edx, ebx
	mov	esi, eax
	call	read@PLT
	mov	r12d, eax
	cmp	eax, -1
	je	.L10
	test	eax, eax
	je	.L21
	mov	edi, DWORD PTR 12[rsp]
	call	RSTRING_LEN@PLT
	cmp	eax, r12d
	jne	.L14
	mov	eax, DWORD PTR 12[rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L21:
	cmp	QWORD PTR 16[rsp], 0
	jne	.L12
	lea	rsi, .LC3[rip]
	mov	rdi, rbp
	call	mrb_str_new_cstr@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	edi, DWORD PTR 12[rsp]
	call	RSTRING@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	mrb_str_modify@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	lea	rsi, .LC5[rip]
	mov	rdi, rbp
	call	mrb_sys_fail@PLT
	mov	eax, DWORD PTR 12[rsp]
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L22
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbx
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdx, QWORD PTR 16[rsp]
	mov	rdi, rbp
	xor	esi, esi
	call	mrb_str_new@PLT
	mov	DWORD PTR 12[rsp], eax
	mov	edi, eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L20:
	mov	esi, DWORD PTR E_IO_ERROR[rip]
	lea	rdx, .LC2[rip]
	mov	rdi, rbp
	call	mrb_raise@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	mov	esi, DWORD PTR E_ARGUMENT_ERROR[rip]
	lea	rdx, .LC1[rip]
	mov	rdi, rbp
	call	mrb_raise@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, DWORD PTR E_EOF_ERROR[rip]
	lea	rdx, .LC4[rip]
	mov	rdi, rbp
	call	mrb_raise@PLT
	mov	eax, DWORD PTR 12[rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	esi, DWORD PTR 12[rsp]
	mov	edx, r12d
	mov	rdi, rbp
	call	mrb_str_resize@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbp
	call	mrb_str_new@PLT
	jmp	.L1
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mrb_io_sysread, .-mrb_io_sysread
	.comm	E_IO_ERROR,4,4
	.comm	E_EOF_ERROR,4,4
	.comm	E_ARGUMENT_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_io.c_mrb_io_sysread.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"i|S\000"
	.align	2
.LC1:
	.ascii	"negative expanding string size\000"
	.align	2
.LC2:
	.ascii	"not opened for reading\000"
	.align	2
.LC3:
	.ascii	"\000"
	.align	2
.LC4:
	.ascii	"sysread failed: End of File\000"
	.align	2
.LC5:
	.ascii	"sysread failed\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	mrb_io_sysread
	.syntax unified
	.arm
	.fpu softvfp
	.type	mrb_io_sysread, %function
mrb_io_sysread:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	ldr	r3, .L23
	sub	sp, sp, #20
	mov	r4, r0
	mov	r5, r1
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	mrb_nil_value
	mov	ip, r0
	add	r2, sp, #8
	mov	r0, r4
	ldr	r1, .L23+4
	add	r3, sp, #4
	str	ip, [sp, #4]
	bl	mrb_get_args
	ldr	r2, [sp, #8]
	cmp	r2, #0
	blt	.L18
	beq	.L19
.L3:
	ldr	r0, [sp, #4]
	bl	mrb_nil_p
	cmp	r0, #0
	bne	.L5
	ldr	r0, [sp, #4]
.L6:
	bl	RSTRING_LEN
	ldr	r2, [sp, #8]
	cmp	r0, r2
	beq	.L7
	mov	r0, r4
	ldr	r1, [sp, #4]
	bl	mrb_str_resize
	str	r0, [sp, #4]
.L8:
	mov	r1, r5
	mov	r0, r4
	bl	io_get_open_fptr
	ldr	r3, [r0, #4]
	mov	r5, r0
	cmp	r3, #0
	beq	.L20
.L9:
	ldr	r0, [sp, #4]
	ldr	r5, [r5]
	bl	RSTRING_PTR
	ldr	r2, [sp, #8]
	mov	r1, r0
	mov	r0, r5
	bl	read
	cmn	r0, #1
	mov	r5, r0
	beq	.L10
	cmp	r0, #0
	beq	.L21
	ldr	r0, [sp, #4]
	bl	RSTRING_LEN
	cmp	r0, r5
	bne	.L14
	ldr	r0, [sp, #4]
	b	.L1
.L21:
	ldr	r3, [sp, #8]
	cmp	r3, #0
	bne	.L12
	mov	r0, r4
	ldr	r1, .L23+8
	bl	mrb_str_new_cstr
	b	.L1
.L7:
	ldr	r0, [sp, #4]
	bl	RSTRING
	mov	r1, r0
	mov	r0, r4
	bl	mrb_str_modify
	b	.L8
.L10:
	mov	r0, r4
	ldr	r1, .L23+12
	bl	mrb_sys_fail
	ldr	r0, [sp, #4]
.L1:
	ldr	r3, .L23
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L22
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, pc}
.L5:
	mov	r1, #0
	mov	r0, r4
	ldr	r2, [sp, #8]
	bl	mrb_str_new
	str	r0, [sp, #4]
	b	.L6
.L20:
	ldr	r3, .L23+16
	mov	r0, r4
	ldr	r2, .L23+20
	ldr	r1, [r3]
	bl	mrb_raise
	b	.L9
.L18:
	ldr	r3, .L23+24
	mov	r0, r4
	ldr	r2, .L23+28
	ldr	r1, [r3]
	bl	mrb_raise
	b	.L3
.L12:
	ldr	r3, .L23+32
	mov	r0, r4
	ldr	r1, [r3]
	ldr	r2, .L23+36
	bl	mrb_raise
	ldr	r0, [sp, #4]
	b	.L1
.L14:
	mov	r2, r5
	mov	r0, r4
	ldr	r1, [sp, #4]
	bl	mrb_str_resize
	b	.L1
.L19:
	mov	r0, r4
	mov	r1, r2
	bl	mrb_str_new
	b	.L1
.L22:
	bl	__stack_chk_fail
.L24:
	.align	2
.L23:
	.word	.LC6
	.word	.LC0
	.word	.LC3
	.word	.LC5
	.word	E_IO_ERROR
	.word	.LC2
	.word	E_ARGUMENT_ERROR
	.word	.LC1
	.word	E_EOF_ERROR
	.word	.LC4
	.size	mrb_io_sysread, .-mrb_io_sysread
	.comm	E_IO_ERROR,4,4
	.comm	E_EOF_ERROR,4,4
	.comm	E_ARGUMENT_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
