	.file	"extr_ber.c_ber_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ber_read, @function
ber_read:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdx, rdx
	jle	.L11
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	mov	edi, DWORD PTR 0[rbp]
	mov	rdx, rbx
	mov	rsi, r13
	cmp	edi, -1
	je	.L19
.L3:
	call	read@PLT
.L4:
	cmp	rax, -1
	je	.L20
	test	rax, rax
	je	.L16
	sub	rbx, rax
	lea	r13, 0[r13+rax*4]
	test	rbx, rbx
	jg	.L10
.L16:
	mov	rax, r13
	sub	rax, r12
	sar	rax, 2
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	mov	rdx, QWORD PTR errno[rip]
	cmp	rdx, QWORD PTR EINTR[rip]
	je	.L10
	cmp	rdx, QWORD PTR EAGAIN[rip]
	jne	.L1
	mov	edi, DWORD PTR 0[rbp]
	mov	rdx, rbx
	mov	rsi, r13
	cmp	edi, -1
	jne	.L3
.L19:
	mov	rdi, rbp
	call	ber_readbuf@PLT
	jmp	.L4
.L11:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	xor	eax, eax
	ret
	.cfi_endproc
.LFE0:
	.size	ber_read, .-ber_read
	.comm	errno,8,8
	.comm	EINTR,8,8
	.comm	EAGAIN,8,8
	.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_ber.c_ber_read.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ber_read, %function
ber_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r9, r2, #0
	ble	.L11
	mov	r4, r0
	mov	r7, r1
	mov	r10, r1
	ldr	r6, .L18
	ldr	r5, .L18+4
	ldr	r8, .L18+8
.L10:
	ldr	r0, [r4]
	mov	r2, r9
	cmn	r0, #1
	mov	r1, r10
	beq	.L16
	bl	read
.L4:
	cmn	r0, #1
	beq	.L17
	cmp	r0, #0
	beq	.L14
	sub	r9, r9, r0
	cmp	r9, #0
	add	r10, r10, r0, lsl #2
	bgt	.L10
.L14:
	sub	r0, r10, r7
	asr	r0, r0, #2
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	ldr	r3, [r6]
	ldr	r2, [r5]
	cmp	r3, r2
	beq	.L10
	ldr	r2, [r8]
	cmp	r3, r2
	beq	.L10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	mov	r0, r4
	bl	ber_readbuf
	b	.L4
.L11:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	.align	2
.L18:
	.word	errno
	.word	EINTR
	.word	EAGAIN
	.size	ber_read, .-ber_read
	.comm	errno,4,4
	.comm	EINTR,4,4
	.comm	EAGAIN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
