	.file	"extr_pngimage.c_buffer_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"file truncated (%lu bytes)"
.LC1:
	.string	"damaged buffer list"
	.text
	.p2align 4
	.type	buffer_read, @function
buffer_read:
.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
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	r15, QWORD PTR 16[rsi]
	mov	rbp, QWORD PTR [rsi]
	mov	QWORD PTR 8[rsp], rdi
	test	rcx, rcx
	jle	.L2
	mov	r14, rdx
	mov	r12, rcx
	test	r15, r15
	jne	.L7
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	mov	r15, QWORD PTR 8[r15]
	mov	QWORD PTR 16[r13], r15
	test	r15, r15
	je	.L15
	mov	ebx, 8
	xor	ebp, ebp
.L6:
	cmp	r12, rbx
	mov	rsi, QWORD PTR [r15]
	mov	rdi, r14
	cmovbe	rbx, r12
	add	rsi, rbp
	mov	rdx, rbx
	sub	r12, rbx
	add	rbp, rbx
	add	r14, rbx
	call	memcpy@PLT
	test	r12, r12
	jle	.L2
.L7:
	cmp	QWORD PTR 24[r13], r15
	je	.L16
.L4:
	cmp	rbp, 7
	ja	.L17
	mov	ebx, 8
	sub	rbx, rbp
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	cmp	QWORD PTR 8[r13], rbp
	ja	.L4
.L3:
	mov	esi, DWORD PTR USER_ERROR[rip]
	mov	rdi, QWORD PTR 8[rsp]
	mov	rcx, r12
	xor	eax, eax
	lea	rdx, .LC0[rip]
	call	display_log@PLT
.L2:
	mov	QWORD PTR 0[r13], rbp
	add	rsp, 24
	.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
.L15:
	.cfi_restore_state
	mov	esi, DWORD PTR INTERNAL_ERROR[rip]
	mov	rdi, QWORD PTR 8[rsp]
	xor	eax, eax
	xor	ebp, ebp
	lea	rdx, .LC1[rip]
	call	display_log@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	buffer_read, .-buffer_read
	.comm	USER_ERROR,4,4
	.comm	INTERNAL_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_pngimage.c_buffer_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"file truncated (%lu bytes)\000"
	.align	2
.LC1:
	.ascii	"damaged buffer list\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	buffer_read, %function
buffer_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r6, r3, #0
	mov	r9, r1
	ldr	r7, [r1, #8]
	ldr	r5, [r1]
	ble	.L2
	cmp	r7, #0
	mov	r10, r0
	mov	r8, r2
	bne	.L7
	b	.L3
.L17:
	ldr	r7, [r7, #4]
	cmp	r7, #0
	str	r7, [r9, #8]
	beq	.L15
	mov	r4, #4
	mov	r5, #0
.L6:
	cmp	r6, r4
	movcc	r4, r6
	ldr	r1, [r7]
	mov	r0, r8
	add	r1, r5, r1
	mov	r2, r4
	sub	r6, r6, r4
	bl	memcpy
	cmp	r6, #0
	add	r5, r5, r4
	add	r8, r8, r4
	ble	.L2
.L7:
	ldr	r3, [r9, #12]
	cmp	r3, r7
	beq	.L16
.L4:
	cmp	r5, #3
	bhi	.L17
	rsb	r4, r5, #4
	b	.L6
.L16:
	ldr	r3, [r9, #4]
	cmp	r3, r5
	bhi	.L4
.L3:
	ldr	r2, .L18
	mov	r3, r6
	ldr	r1, [r2]
	mov	r0, r10
	ldr	r2, .L18+4
	bl	display_log
.L2:
	str	r5, [r9]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	mov	r5, r7
	ldr	r3, .L18+8
	mov	r0, r10
	ldr	r1, [r3]
	ldr	r2, .L18+12
	bl	display_log
	str	r5, [r9]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	.align	2
.L18:
	.word	USER_ERROR
	.word	.LC0
	.word	INTERNAL_ERROR
	.word	.LC1
	.size	buffer_read, .-buffer_read
	.comm	USER_ERROR,4,4
	.comm	INTERNAL_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
