	.file	"extr_pngvalid.c_read_palette.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"validate: invalid PLTE count"
.LC1:
	.string	"validate: invalid PLTE result"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"validate: unexpected png_get_tRNS (palette) result"
	.text
	.p2align 4
	.type	read_palette, @function
read_palette:
.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	r13d, ecx
	mov	rcx, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	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
	mov	rbx, rdi
	mov	edi, r12d
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	DWORD PTR [rsi], -1
	lea	rdx, 8[rsp]
	mov	esi, r13d
	mov	QWORD PTR 8[rsp], 0
	call	png_get_PLTE@PLT
	test	DWORD PTR PNG_INFO_PLTE[rip], eax
	je	.L2
	movsx	r14, DWORD PTR 0[rbp]
	lea	r15d, -1[r14]
	cmp	r15d, 255
	ja	.L43
.L3:
	test	r14d, r14d
	jle	.L7
	mov	rax, QWORD PTR 8[rsp]
	lea	rdx, [r14+r14*2]
	sal	r14, 4
	sal	r15, 4
	lea	rsi, -16[rbx+r14]
	lea	rdx, -12[rax+rdx*4]
	sub	rsi, r15
	lea	rax, [rbx+r14]
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, DWORD PTR 8[rdx]
	sub	rax, 16
	sub	rdx, 12
	mov	DWORD PTR 12[rax], ecx
	mov	ecx, DWORD PTR 16[rdx]
	mov	DWORD PTR 8[rax], ecx
	mov	ecx, DWORD PTR 12[rdx]
	mov	DWORD PTR 4[rax], ecx
	cmp	rsi, rax
	jne	.L6
.L7:
	movsx	rdi, DWORD PTR 0[rbp]
	mov	edx, 256
	mov	esi, 126
	mov	rax, rdi
	sub	edx, edi
	sal	rax, 4
	sal	edx, 4
	lea	rdi, [rbx+rax]
	call	memset@PLT
.L5:
	xor	r8d, r8d
	lea	rcx, 4[rsp]
	lea	rdx, 16[rsp]
	mov	esi, r13d
	mov	edi, r12d
	mov	DWORD PTR 4[rsp], 2
	mov	QWORD PTR 16[rsp], 0
	call	png_get_tRNS@PLT
	test	DWORD PTR PNG_INFO_tRNS[rip], eax
	je	.L9
	mov	rdi, QWORD PTR 16[rsp]
	mov	eax, DWORD PTR 4[rsp]
	test	rdi, rdi
	je	.L44
	test	eax, eax
	je	.L9
	lea	edx, -1[rax]
	cmp	edx, 255
	jbe	.L45
.L11:
	lea	rsi, .LC2[rip]
	mov	edi, r12d
	call	png_error@PLT
	mov	eax, DWORD PTR 4[rsp]
	test	eax, eax
	jle	.L13
	mov	rdi, QWORD PTR 16[rsp]
.L12:
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L16:
	mov	esi, DWORD PTR [rdi+rdx*4]
	mov	rcx, rdx
	add	rdx, 1
	sal	rcx, 4
	mov	DWORD PTR [rbx+rcx], esi
	cmp	eax, edx
	jg	.L16
	test	eax, eax
	mov	edx, 1
	mov	esi, DWORD PTR 0[rbp]
	cmovle	eax, edx
	cmp	esi, eax
	jle	.L17
.L14:
	movsx	rdx, eax
	mov	ecx, eax
	sal	rdx, 4
	add	rdx, rbx
	.p2align 4,,10
	.p2align 3
.L18:
	add	ecx, 1
	mov	DWORD PTR [rdx], 255
	add	rdx, 16
	cmp	esi, ecx
	jg	.L18
	lea	edx, -1[rsi]
	mov	ecx, 0
	sub	edx, eax
	cmp	esi, eax
	cmovle	edx, ecx
	lea	eax, 1[rax+rdx]
.L17:
	cmp	eax, 255
	jg	.L21
.L15:
	movsx	rdi, eax
	sal	rdi, 4
	add	rdi, rbx
	.p2align 4,,10
	.p2align 3
.L20:
	add	eax, 1
	mov	DWORD PTR [rdi], 33
	add	rdi, 16
	cmp	eax, 256
	jne	.L20
.L21:
	mov	eax, 1
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L46
	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
.L44:
	.cfi_restore_state
	cmp	eax, 1
	jne	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edx, DWORD PTR 0[rbp]
	test	edx, edx
	jle	.L28
	lea	ecx, -1[rdx]
	mov	rax, rbx
	sal	rcx, 4
	lea	rcx, 16[rbx+rcx]
	.p2align 4,,10
	.p2align 3
.L23:
	mov	DWORD PTR [rax], 255
	add	rax, 16
	cmp	rax, rcx
	jne	.L23
	cmp	edx, 255
	jg	.L25
.L22:
	movsx	rdi, edx
	sal	rdi, 4
	add	rdi, rbx
	.p2align 4,,10
	.p2align 3
.L24:
	add	edx, 1
	mov	DWORD PTR [rdi], 55
	add	rdi, 16
	cmp	edx, 256
	jne	.L24
.L25:
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	cmp	DWORD PTR 0[rbp], -1
	je	.L8
	lea	rsi, .LC1[rip]
	mov	edi, r12d
	call	png_error@PLT
.L8:
	mov	DWORD PTR 0[rbp], 0
	mov	edx, 8
	mov	esi, 113
	mov	rdi, rbx
	call	memset@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L43:
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	png_error@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L45:
	cmp	DWORD PTR 0[rbp], eax
	jge	.L12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L28:
	xor	edx, edx
	jmp	.L22
.L13:
	mov	esi, DWORD PTR 0[rbp]
	xor	eax, eax
	test	esi, esi
	jg	.L14
	jmp	.L15
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	read_palette, .-read_palette
	.comm	PNG_INFO_tRNS,4,4
	.comm	PNG_INFO_PLTE,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_pngvalid.c_read_palette.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"validate: invalid PLTE count\000"
	.align	2
.LC1:
	.ascii	"validate: invalid PLTE result\000"
	.align	2
.LC2:
	.ascii	"validate: unexpected png_get_tRNS (palette) result\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_palette, %function
read_palette:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, r2
	mov	r8, r3
	mvn	r2, #0
	mov	ip, #0
	ldr	r3, .L50
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r6, r1
	mov	r3, r1
	str	r2, [r1]
	mov	r4, r0
	mov	r1, r8
	mov	r0, r7
	add	r2, sp, #8
	str	ip, [sp, #8]
	bl	png_get_PLTE
	ldr	r3, .L50+4
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L2
	ldr	r5, [r6]
	sub	r3, r5, #1
	cmp	r3, #255
	bhi	.L46
.L3:
	cmp	r5, #0
	ble	.L7
	ldr	r2, [sp, #8]
	add	ip, r5, r5, lsl #1
	add	ip, r2, ip, lsl #2
	add	r0, r4, r5, lsl #4
.L6:
	ldr	r3, [ip, #-4]
	sub	r0, r0, #16
	str	r3, [r0, #12]
	ldr	r3, [ip, #-8]
	str	r3, [r0, #8]
	ldr	r3, [ip, #-12]!
	cmp	r2, ip
	str	r3, [r0, #4]
	bne	.L6
.L7:
	ldr	r0, [r6]
	mov	r1, #126
	rsb	r2, r0, #256
	lsl	r2, r2, #4
	add	r0, r4, r0, lsl #4
	bl	memset
.L5:
	mov	r0, #0
	mov	ip, #2
	str	r0, [sp]
	add	r3, sp, #16
	str	r0, [sp, #12]
	mov	r1, r8
	mov	r0, r7
	add	r2, sp, #12
	str	ip, [sp, #16]
	bl	png_get_tRNS
	ldr	r3, .L50+8
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L9
	ldr	r1, [sp, #12]
	ldr	r3, [sp, #16]
	cmp	r1, #0
	beq	.L47
	cmp	r3, #0
	beq	.L9
	sub	r2, r3, #1
	cmp	r2, #255
	bls	.L48
.L11:
	mov	r0, r7
	ldr	r1, .L50+12
	bl	png_error
	ldr	r3, [sp, #16]
	cmp	r3, #0
	ble	.L13
	ldr	r1, [sp, #12]
.L12:
	mov	r2, #0
	sub	r1, r1, #4
.L16:
	ldr	r0, [r1, #4]!
	str	r0, [r4, r2, lsl #4]
	add	r2, r2, #1
	cmp	r2, r3
	blt	.L16
	cmp	r3, #1
	movlt	r3, #1
	ldr	r1, [r6]
	cmp	r1, r3
	ble	.L17
.L14:
	mov	r2, r3
	mov	r0, #255
.L18:
	str	r0, [r4, r2, lsl #4]
	add	r2, r2, #1
	cmp	r1, r2
	bgt	.L18
	cmp	r3, r1
	sub	r2, r1, #1
	movge	r1, #0
	sublt	r1, r2, r3
	add	r3, r3, #1
	add	r3, r1, r3
.L17:
	cmp	r3, #255
	bgt	.L21
.L15:
	mov	r2, #33
.L20:
	str	r2, [r4, r3, lsl #4]
	add	r3, r3, #1
	cmp	r3, #256
	bne	.L20
.L21:
	mov	r0, #1
.L1:
	ldr	r3, .L50
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L49
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L47:
	cmp	r3, #1
	bne	.L11
.L9:
	ldr	r3, [r6]
	cmp	r3, #0
	ble	.L28
	mov	r2, #0
	mov	r1, #255
.L23:
	str	r1, [r4, r2, lsl #4]
	add	r2, r2, #1
	cmp	r3, r2
	bne	.L23
	cmp	r3, #255
	bgt	.L25
.L22:
	mov	r2, #55
.L24:
	str	r2, [r4, r3, lsl #4]
	add	r3, r3, #1
	cmp	r3, #256
	bne	.L24
.L25:
	mov	r0, #0
	b	.L1
.L2:
	ldr	r3, [r6]
	cmn	r3, #1
	beq	.L8
	mov	r0, r7
	ldr	r1, .L50+16
	bl	png_error
.L8:
	mov	r3, #113
	mov	r2, #0
	str	r2, [r6]
	strb	r3, [r4]
	strb	r3, [r4, #1]
	strb	r3, [r4, #2]
	strb	r3, [r4, #3]
	b	.L5
.L46:
	mov	r0, r7
	ldr	r1, .L50+20
	bl	png_error
	b	.L3
.L48:
	ldr	r2, [r6]
	cmp	r2, r3
	bge	.L12
	b	.L11
.L28:
	mov	r3, #0
	b	.L22
.L13:
	ldr	r1, [r6]
	mov	r3, #0
	cmp	r1, #0
	bgt	.L14
	b	.L15
.L49:
	bl	__stack_chk_fail
.L51:
	.align	2
.L50:
	.word	.LC3
	.word	PNG_INFO_PLTE
	.word	PNG_INFO_tRNS
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.size	read_palette, .-read_palette
	.comm	PNG_INFO_tRNS,4,4
	.comm	PNG_INFO_PLTE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
