	.file	"extr_bf_buff.c_buffer_gets.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	buffer_gets, @function
buffer_gets:
.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
	lea	r14d, -1[rdx]
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	r15, QWORD PTR 8[rdi]
	call	BIO_clear_retry_flags@PLT
	mov	ebx, DWORD PTR [r15]
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rsi, QWORD PTR 8[r15]
	test	ebx, ebx
	jle	.L3
.L17:
	mov	rax, QWORD PTR 16[r15]
	test	r14d, r14d
	jle	.L4
	mov	edx, 1
	lea	r8, [rsi+rax]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdx, rsi
.L7:
	movzx	eax, BYTE PTR -1[r8+rdx]
	add	r13, 1
	mov	BYTE PTR -1[r13], al
	cmp	al, 10
	je	.L16
	mov	eax, DWORD PTR [r15]
	mov	ecx, r14d
	lea	rsi, 1[rdx]
	cmp	eax, r14d
	cmovle	ecx, eax
	cmp	ecx, edx
	jg	.L12
	sub	eax, edx
	add	r12d, edx
	sub	r14d, edx
	mov	ebx, eax
	mov	rax, QWORD PTR 16[r15]
	add	rax, rdx
.L4:
	mov	DWORD PTR [r15], ebx
	mov	QWORD PTR 16[r15], rax
	test	r14d, r14d
	je	.L6
	mov	rsi, QWORD PTR 8[r15]
	test	ebx, ebx
	jg	.L17
.L3:
	mov	edx, DWORD PTR 24[r15]
	mov	edi, DWORD PTR 0[rbp]
	call	BIO_read@PLT
	mov	ebx, eax
	test	eax, eax
	jle	.L18
	mov	DWORD PTR [r15], eax
	mov	QWORD PTR 16[r15], 0
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L16:
	sub	DWORD PTR [r15], edx
	add	r12d, edx
	add	QWORD PTR 16[r15], rdx
.L6:
	mov	BYTE PTR 0[r13], 0
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L18:
	.cfi_restore_state
	mov	rdi, rbp
	call	BIO_copy_next_retry@PLT
	mov	BYTE PTR 0[r13], 0
	test	r12d, r12d
	jne	.L1
	test	ebx, ebx
	cmovne	r12d, ebx
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	buffer_gets, .-buffer_gets
	.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_bf_buff.c_buffer_gets.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	buffer_gets, %function
buffer_gets:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r10, #0
	mov	r9, r10
	ldr	r6, [r0, #4]
	mov	r8, r0
	mov	r7, r1
	sub	r5, r2, #1
	bl	BIO_clear_retry_flags
	ldr	r4, [r6]
.L2:
	cmp	r4, #0
	ldr	r1, [r6, #4]
	ble	.L3
.L17:
	cmp	r5, #0
	ldr	r3, [r6, #8]
	ble	.L4
	mov	r2, #0
	sub	r3, r3, #1
	add	r1, r1, r3
.L7:
	ldrb	r3, [r1, #1]!	@ zero_extendqisi2
	add	r2, r2, #1
	cmp	r3, #10
	strb	r3, [r7], #1
	beq	.L16
	ldr	r3, [r6]
	cmp	r3, r5
	movlt	r0, r3
	movge	r0, r5
	cmp	r2, r0
	blt	.L7
	ldr	r1, [r6, #8]
	sub	r4, r3, r2
	add	r10, r10, r2
	sub	r5, r5, r2
	add	r3, r2, r1
.L4:
	cmp	r5, #0
	str	r4, [r6]
	str	r3, [r6, #8]
	beq	.L6
	cmp	r4, #0
	ldr	r1, [r6, #4]
	bgt	.L17
.L3:
	ldr	r2, [r6, #12]
	ldr	r0, [r8]
	bl	BIO_read
	subs	r4, r0, #0
	ble	.L18
	str	r4, [r6]
	str	r9, [r6, #8]
	b	.L2
.L16:
	ldr	r1, [r6]
	ldr	r3, [r6, #8]
	sub	r1, r1, r2
	add	r3, r3, r2
	add	r10, r10, r2
	str	r1, [r6]
	str	r3, [r6, #8]
.L6:
	mov	r3, #0
	mov	r0, r10
	strb	r3, [r7]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	mov	r0, r8
	bl	BIO_copy_next_retry
	clz	r3, r4
	cmp	r10, #0
	mov	r2, #0
	lsr	r3, r3, #5
	movne	r3, #1
	cmp	r3, r2
	moveq	r10, r4
	strb	r2, [r7]
	mov	r0, r10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
	.size	buffer_gets, .-buffer_gets
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
