	.file	"extr_liolib.c_read_line.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	read_line, @function
read_line:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 8[rsp], rdi
	lea	r14, 20[rsp]
	mov	DWORD PTR 4[rsp], edx
	mov	rsi, r14
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	luaL_buffinit@PLT
	mov	esi, DWORD PTR EOF[rip]
	test	esi, esi
	je	.L39
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, r14
	mov	DWORD PTR [rsp], edx
	xor	r15d, r15d
	xor	r13d, r13d
	call	luaL_prepbuffer@PLT
	mov	rdi, rbp
	mov	r12, rax
	call	l_lockfile@PLT
	mov	ecx, DWORD PTR LUAL_BUFFERSIZE[rip]
	mov	edx, DWORD PTR [rsp]
	test	ecx, ecx
	jg	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L44:
	cmp	eax, 10
	je	.L43
	mov	BYTE PTR [r12+r15], dl
	add	ebx, 1
	add	r15, 1
	cmp	DWORD PTR LUAL_BUFFERSIZE[rip], r15d
	jle	.L5
.L3:
	mov	rdi, rbp
	mov	ebx, r15d
	mov	r13d, r15d
	call	l_getc@PLT
	cmp	DWORD PTR EOF[rip], eax
	mov	edx, eax
	jne	.L44
.L4:
	mov	rdi, rbp
	mov	DWORD PTR [rsp], edx
	call	l_unlockfile@PLT
	mov	esi, r13d
	mov	rdi, r14
	call	luaL_addsize@PLT
	mov	edx, DWORD PTR [rsp]
	cmp	DWORD PTR EOF[rip], edx
	je	.L8
	cmp	edx, 10
	jne	.L10
.L9:
	mov	edx, DWORD PTR 4[rsp]
	test	edx, edx
	jne	.L40
.L14:
	mov	esi, 10
	mov	rdi, r14
	call	luaL_addchar@PLT
	mov	rdi, r14
	call	luaL_pushresult@PLT
	mov	eax, 1
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rdi, rbp
	call	l_unlockfile@PLT
	mov	esi, r15d
	mov	rdi, r14
	call	luaL_addsize@PLT
	cmp	DWORD PTR EOF[rip], 10
	jne	.L9
	mov	eax, DWORD PTR 4[rsp]
	test	eax, eax
	je	.L14
.L40:
	mov	rdi, r14
	call	luaL_pushresult@PLT
.L41:
	mov	eax, 1
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L45
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rdi, rbp
	mov	DWORD PTR [rsp], edx
	call	l_unlockfile@PLT
	mov	esi, ebx
	mov	rdi, r14
	call	luaL_addsize@PLT
	mov	edx, DWORD PTR [rsp]
	cmp	edx, DWORD PTR EOF[rip]
	jne	.L10
.L39:
	mov	rdi, r14
	call	luaL_pushresult@PLT
.L11:
	mov	rdi, QWORD PTR 8[rsp]
	mov	esi, -1
	call	lua_rawlen@PLT
	test	rax, rax
	setg	al
	movzx	eax, al
	jmp	.L1
.L45:
	call	__stack_chk_fail@PLT
.L8:
	cmp	DWORD PTR 4[rsp], 0
	jne	.L12
	cmp	edx, 10
	je	.L14
.L12:
	mov	rdi, r14
	mov	DWORD PTR [rsp], edx
	call	luaL_pushresult@PLT
	mov	edx, DWORD PTR [rsp]
	cmp	edx, 10
	jne	.L11
	jmp	.L41
	.cfi_endproc
.LFE0:
	.size	read_line, .-read_line
	.comm	LUAL_BUFFERSIZE,4,4
	.comm	EOF,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_liolib.c_read_line.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_line, %function
read_line:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L39
	sub	sp, sp, #12
	ldr	r8, .L39+4
	mov	r7, r1
	mov	r1, sp
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r10, r2
	mov	fp, r0
	bl	luaL_buffinit
	ldr	r3, [r8]
	cmp	r3, #0
	beq	.L32
	mov	r4, #0
	ldr	r9, .L39+8
.L10:
	mov	r0, sp
	bl	luaL_prepbuffer
	mov	r6, r0
	mov	r0, r7
	bl	l_lockfile
	ldr	r3, [r9]
	cmp	r3, #0
	ble	.L18
	mov	r5, #0
	sub	r6, r6, #1
	b	.L4
.L37:
	cmp	r0, #10
	beq	.L36
	strb	r4, [r6, #1]!
	ldr	r3, [r9]
	add	r5, r5, #1
	cmp	r3, r5
	ble	.L5
.L4:
	mov	r0, r7
	bl	l_getc
	ldr	r3, [r8]
	mov	r4, r0
	cmp	r3, r0
	bne	.L37
.L3:
	mov	r0, r7
	bl	l_unlockfile
	mov	r1, r5
	mov	r0, sp
	bl	luaL_addsize
	ldr	r3, [r8]
	cmp	r3, r4
	beq	.L8
	cmp	r4, #10
	bne	.L10
.L9:
	cmp	r10, #0
	bne	.L33
.L14:
	mov	r1, #10
	mov	r0, sp
	bl	luaL_addchar
	mov	r0, sp
	bl	luaL_pushresult
	mov	r0, #1
	b	.L1
.L36:
	mov	r0, r7
	bl	l_unlockfile
	mov	r1, r5
	mov	r0, sp
	bl	luaL_addsize
	ldr	r3, [r8]
	cmp	r3, #10
	bne	.L9
	cmp	r10, #0
	beq	.L14
.L33:
	mov	r0, sp
	bl	luaL_pushresult
.L34:
	mov	r0, #1
.L1:
	ldr	r3, .L39
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L38
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	mov	r0, r7
	bl	l_unlockfile
	mov	r1, r5
	mov	r0, sp
	bl	luaL_addsize
	ldr	r3, [r8]
	cmp	r4, r3
	bne	.L10
.L32:
	mov	r0, sp
	bl	luaL_pushresult
.L11:
	mov	r0, fp
	mvn	r1, #0
	bl	lua_rawlen
	cmp	r0, #0
	movle	r0, #0
	movgt	r0, #1
	b	.L1
.L18:
	mov	r5, #0
	b	.L3
.L38:
	bl	__stack_chk_fail
.L8:
	cmp	r10, #0
	cmpeq	r4, #10
	beq	.L14
	mov	r0, sp
	bl	luaL_pushresult
	cmp	r4, #10
	bne	.L11
	b	.L34
.L40:
	.align	2
.L39:
	.word	.LC0
	.word	EOF
	.word	LUAL_BUFFERSIZE
	.size	read_line, .-read_line
	.comm	LUAL_BUFFERSIZE,4,4
	.comm	EOF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
