	.file	"extr_pnmdec.c_ReadPAMFields.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
.LC1:
	.string	" MAXVAL"
.LC2:
	.string	" DEPTH"
.LC3:
	.string	" HEIGHT"
.LC4:
	.string	" WIDTH"
.LC5:
	.string	"WIDTH %d"
.LC6:
	.string	"WIDTH"
.LC7:
	.string	"HEIGHT %d"
.LC8:
	.string	"HEIGHT"
.LC9:
	.string	"DEPTH %d"
.LC10:
	.string	"DEPTH"
.LC11:
	.string	"MAXVAL %d"
.LC12:
	.string	"MAXVAL"
.LC13:
	.string	"TUPLTYPE RGB_ALPHA"
.LC14:
	.string	"TUPLTYPE RGB"
.LC15:
	.string	"TUPLTYPE GRAYSCALE"
.LC16:
	.string	"ENDHDR"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC17:
	.string	"PAM header error: unrecognized entry [%s]\n"
	.align 8
.LC18:
	.string	"PAM header error: missing tags%s%s%s%s\n"
	.align 8
.LC19:
	.string	"PAM header error: expected DEPTH %d but got DEPTH %d\n"
	.text
	.p2align 4
	.type	ReadPAMFields, @function
ReadPAMFields:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	.cfi_offset 15, -24
	mov	r15, rsi
	push	r14
	.cfi_offset 14, -32
	mov	r14, rdi
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR MAX_LINE_SIZE[rip]
	mov	rcx, rsp
	add	eax, 1
	cdqe
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L45:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L45
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L46
.L4:
	xor	edi, edi
	test	r14, r14
	lea	r13, -64[rbp]
	mov	r12, rsp
	setne	dil
	lea	rbx, -68[rbp]
	call	assert@PLT
	mov	DWORD PTR -84[rbp], -1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR 20[r14]
	mov	edi, DWORD PTR 24[r14]
	mov	rsi, r15
	mov	r8, r13
	mov	rcx, r12
	call	ReadLine@PLT
	mov	r15, rax
	test	rax, rax
	je	.L6
	mov	rdx, rbx
	lea	rsi, .LC5[rip]
	mov	rdi, r12
	call	sscanf@PLT
	cmp	eax, 1
	jne	.L7
	mov	eax, DWORD PTR [r14]
	mov	edx, DWORD PTR WIDTH_FLAG[rip]
	test	eax, edx
	jne	.L47
	or	eax, edx
	mov	DWORD PTR [r14], eax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR 4[r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdx, rbx
	lea	rsi, .LC7[rip]
	mov	rdi, r12
	call	sscanf@PLT
	cmp	eax, 1
	jne	.L10
	mov	eax, DWORD PTR [r14]
	mov	edx, DWORD PTR HEIGHT_FLAG[rip]
	test	eax, edx
	jne	.L48
	or	eax, edx
	mov	DWORD PTR [r14], eax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR 8[r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdx, rbx
	lea	rsi, .LC9[rip]
	mov	rdi, r12
	call	sscanf@PLT
	cmp	eax, 1
	jne	.L12
	mov	eax, DWORD PTR [r14]
	mov	edx, DWORD PTR DEPTH_FLAG[rip]
	test	eax, edx
	jne	.L49
	or	eax, edx
	mov	DWORD PTR [r14], eax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR 12[r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdx, rbx
	lea	rsi, .LC11[rip]
	mov	rdi, r12
	call	sscanf@PLT
	cmp	eax, 1
	je	.L50
	mov	ecx, 19
	mov	rsi, r12
	lea	rdi, .LC13[rip]
	repz cmpsb
	seta	al
	sbb	al, 0
	test	al, al
	jne	.L16
	mov	eax, DWORD PTR TUPLE_FLAG[rip]
	mov	DWORD PTR -84[rbp], 4
	or	DWORD PTR [r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L50:
	mov	eax, DWORD PTR [r14]
	mov	edx, DWORD PTR MAXVAL_FLAG[rip]
	test	eax, edx
	jne	.L51
	or	eax, edx
	mov	DWORD PTR [r14], eax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR 16[r14], eax
	jmp	.L5
.L18:
	mov	ecx, 7
	lea	rdi, .LC16[rip]
	mov	rsi, r12
	repz cmpsb
	seta	al
	sbb	al, 0
	test	al, al
	jne	.L52
	mov	edx, DWORD PTR [r14]
	test	DWORD PTR ALL_NEEDED_FLAGS[rip], edx
	je	.L53
	mov	eax, DWORD PTR -84[rbp]
	cmp	eax, -1
	je	.L6
	mov	ecx, DWORD PTR 12[r14]
	cmp	eax, ecx
	je	.L6
	mov	edi, DWORD PTR stderr[rip]
	mov	edx, eax
	lea	rsi, .LC19[rip]
	xor	eax, eax
	xor	r15d, r15d
	call	fprintf@PLT
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L54
	lea	rsp, -40[rbp]
	mov	rax, r15
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	ecx, 13
	mov	rsi, r12
	lea	rdi, .LC14[rip]
	repz cmpsb
	seta	al
	sbb	al, 0
	test	al, al
	jne	.L17
	mov	eax, DWORD PTR TUPLE_FLAG[rip]
	mov	DWORD PTR -84[rbp], 3
	or	DWORD PTR [r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	mov	ecx, 19
	mov	rsi, r12
	lea	rdi, .LC15[rip]
	repz cmpsb
	seta	al
	sbb	al, 0
	test	al, al
	jne	.L18
	mov	eax, DWORD PTR TUPLE_FLAG[rip]
	mov	DWORD PTR -84[rbp], 1
	or	DWORD PTR [r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L47:
	lea	rdi, .LC6[rip]
	call	FlagError@PLT
	mov	r15, rax
	jmp	.L6
.L46:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L48:
	lea	rdi, .LC8[rip]
	call	FlagError@PLT
	mov	r15, rax
	jmp	.L6
.L49:
	lea	rdi, .LC10[rip]
	call	FlagError@PLT
	mov	r15, rax
	jmp	.L6
.L51:
	lea	rdi, .LC12[rip]
	call	FlagError@PLT
	mov	r15, rax
	jmp	.L6
.L52:
	cmp	QWORD PTR -64[rbp], 20
	ja	.L55
.L20:
	xor	ebx, ebx
	jmp	.L21
.L23:
	movsx	edi, BYTE PTR [r12+rbx]
	call	isprint@PLT
	test	eax, eax
	jne	.L22
	mov	BYTE PTR [r12+rbx], 32
.L22:
	add	rbx, 1
.L21:
	mov	rdi, r12
	call	strlen@PLT
	cmp	eax, ebx
	jg	.L23
	mov	edi, DWORD PTR stderr[rip]
	mov	rdx, r12
	xor	eax, eax
	xor	r15d, r15d
	lea	rsi, .LC17[rip]
	call	fprintf@PLT
	jmp	.L6
.L53:
	lea	rax, .LC0[rip]
	test	DWORD PTR MAXVAL_FLAG[rip], edx
	lea	r9, .LC1[rip]
	mov	edi, DWORD PTR stderr[rip]
	cmovne	r9, rax
	lea	r8, .LC2[rip]
	test	DWORD PTR DEPTH_FLAG[rip], edx
	cmovne	r8, rax
	lea	rcx, .LC3[rip]
	test	DWORD PTR HEIGHT_FLAG[rip], edx
	cmovne	rcx, rax
	test	DWORD PTR WIDTH_FLAG[rip], edx
	lea	rdx, .LC4[rip]
	lea	rsi, .LC18[rip]
	cmovne	rdx, rax
	xor	eax, eax
	xor	r15d, r15d
	call	fprintf@PLT
	jmp	.L6
.L55:
	lea	rdi, kEllipsis.1969[rip]
	call	strlen@PLT
	mov	rcx, r12
	lea	rsi, kEllipsis.1969[rip]
	cdqe
	sub	rcx, rax
	lea	rdi, 20[rcx]
	call	sprintf@PLT
	jmp	.L20
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ReadPAMFields, .-ReadPAMFields
	.section	.rodata
	.type	kEllipsis.1969, @object
	.size	kEllipsis.1969, 5
kEllipsis.1969:
	.string	" ..."
	.comm	stderr,4,4
	.comm	WIDTH_FLAG,4,4
	.comm	TUPLE_FLAG,4,4
	.comm	MAX_LINE_SIZE,4,4
	.comm	MAXVAL_FLAG,4,4
	.comm	HEIGHT_FLAG,4,4
	.comm	DEPTH_FLAG,4,4
	.comm	ALL_NEEDED_FLAGS,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_pnmdec.c_ReadPAMFields.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	" WIDTH\000"
	.align	2
.LC2:
	.ascii	" HEIGHT\000"
	.align	2
.LC3:
	.ascii	" DEPTH\000"
	.align	2
.LC4:
	.ascii	" MAXVAL\000"
	.align	2
.LC5:
	.ascii	"WIDTH %d\000"
	.align	2
.LC6:
	.ascii	"WIDTH\000"
	.align	2
.LC7:
	.ascii	"HEIGHT %d\000"
	.align	2
.LC8:
	.ascii	"HEIGHT\000"
	.align	2
.LC9:
	.ascii	"DEPTH %d\000"
	.align	2
.LC10:
	.ascii	"DEPTH\000"
	.align	2
.LC11:
	.ascii	"MAXVAL %d\000"
	.align	2
.LC12:
	.ascii	"MAXVAL\000"
	.align	2
.LC13:
	.ascii	"TUPLTYPE RGB_ALPHA\000"
	.align	2
.LC14:
	.ascii	"TUPLTYPE RGB\000"
	.align	2
.LC15:
	.ascii	"TUPLTYPE GRAYSCALE\000"
	.align	2
.LC16:
	.ascii	"ENDHDR\000"
	.align	2
.LC17:
	.ascii	"PAM header error: unrecognized entry [%s]\012\000"
	.align	2
.LC18:
	.ascii	"PAM header error: missing tags%s%s%s%s\012\000"
	.align	2
.LC19:
	.ascii	"PAM header error: expected DEPTH %d but got DEPTH %"
	.ascii	"d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC20:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ReadPAMFields, %function
ReadPAMFields:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r3, .L50
	mov	r5, r0
	ldr	r3, [r3]
	subs	r0, r0, #0
	add	r3, r3, #8
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L50+4
	movne	r0, #1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mvn	r3, #0
	mov	r4, r1
	str	r3, [fp, #-56]
	bl	assert
	ldr	r8, .L50+8
	ldr	r9, .L50+12
	ldr	r10, .L50+16
	add	r6, sp, #8
	sub	r7, fp, #48
.L2:
	str	r7, [sp]
	mov	r1, r4
	mov	r3, r6
	ldr	r2, [r5, #20]
	ldr	r0, [r5, #24]
	bl	ReadLine
	subs	r4, r0, #0
	beq	.L3
	mov	r1, r8
	mov	r0, r6
	sub	r2, fp, #44
	bl	sscanf
	cmp	r0, #1
	bne	.L4
	ldr	r2, .L50+20
	ldr	r3, [r5]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L40
	ldr	r1, [fp, #-44]
	orr	r3, r3, r2
	str	r3, [r5]
	str	r1, [r5, #4]
	b	.L2
.L4:
	mov	r1, r9
	mov	r0, r6
	sub	r2, fp, #44
	bl	sscanf
	cmp	r0, #1
	bne	.L7
	ldr	r2, .L50+24
	ldr	r3, [r5]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L41
	ldr	r1, [fp, #-44]
	orr	r3, r3, r2
	str	r3, [r5]
	str	r1, [r5, #8]
	b	.L2
.L7:
	mov	r1, r10
	mov	r0, r6
	sub	r2, fp, #44
	bl	sscanf
	cmp	r0, #1
	bne	.L9
	ldr	r2, .L50+28
	ldr	r3, [r5]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L42
	ldr	r1, [fp, #-44]
	orr	r3, r3, r2
	str	r3, [r5]
	str	r1, [r5, #12]
	b	.L2
.L9:
	mov	r0, r6
	ldr	r1, .L50+32
	sub	r2, fp, #44
	bl	sscanf
	cmp	r0, #1
	beq	.L43
	mov	r0, r6
	ldr	r1, .L50+36
	bl	strcmp
	cmp	r0, #0
	bne	.L13
	mov	r1, #4
	ldr	r2, .L50+40
	ldr	r3, [r5]
	ldr	r2, [r2]
	str	r1, [fp, #-56]
	orr	r3, r3, r2
	str	r3, [r5]
	b	.L2
.L43:
	ldr	r2, .L50+44
	ldr	r3, [r5]
	ldr	r2, [r2]
	tst	r3, r2
	bne	.L44
	ldr	r1, [fp, #-44]
	orr	r3, r3, r2
	str	r3, [r5]
	str	r1, [r5, #16]
	b	.L2
.L15:
	mov	r0, r6
	ldr	r1, .L50+48
	bl	strcmp
	cmp	r0, #0
	bne	.L45
	ldr	r3, .L50+52
	ldr	r0, [r5]
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L46
	ldr	r2, [fp, #-56]
	cmn	r2, #1
	beq	.L3
	ldr	r3, [r5, #12]
	cmp	r2, r3
	beq	.L3
	ldr	r1, .L50+56
	mov	r4, #0
	ldr	r0, [r1]
	ldr	r1, .L50+60
	bl	fprintf
.L3:
	ldr	r3, .L50+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L47
	mov	r0, r4
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	mov	r0, r6
	ldr	r1, .L50+64
	bl	strcmp
	cmp	r0, #0
	beq	.L48
	mov	r0, r6
	ldr	r1, .L50+68
	bl	strcmp
	cmp	r0, #0
	bne	.L15
	mov	r1, #1
	ldr	r2, .L50+40
	ldr	r3, [r5]
	ldr	r2, [r2]
	str	r1, [fp, #-56]
	orr	r3, r3, r2
	str	r3, [r5]
	b	.L2
.L48:
	mov	r1, #3
	ldr	r2, .L50+40
	ldr	r3, [r5]
	ldr	r2, [r2]
	str	r1, [fp, #-56]
	orr	r3, r3, r2
	str	r3, [r5]
	b	.L2
.L40:
	ldr	r0, .L50+72
	bl	FlagError
	mov	r4, r0
	b	.L3
.L41:
	ldr	r0, .L50+76
	bl	FlagError
	mov	r4, r0
	b	.L3
.L42:
	ldr	r0, .L50+80
	bl	FlagError
	mov	r4, r0
	b	.L3
.L44:
	ldr	r0, .L50+84
	bl	FlagError
	mov	r4, r0
	b	.L3
.L45:
	ldr	r3, [fp, #-48]
	cmp	r3, #20
	bhi	.L49
.L17:
	mov	r0, r6
	bl	strlen
	mov	r5, #0
	mov	r4, r0
	mov	r7, #32
	b	.L18
.L20:
	ldrb	r0, [r6, r5]	@ zero_extendqisi2
	bl	isprint
	cmp	r0, #0
	bne	.L19
	mov	r0, r6
	strb	r7, [r6, r5]
	bl	strlen
	mov	r4, r0
.L19:
	add	r5, r5, #1
.L18:
	cmp	r5, r4
	blt	.L20
	ldr	r3, .L50+56
	mov	r2, r6
	ldr	r0, [r3]
	ldr	r1, .L50+88
	bl	fprintf
	mov	r4, #0
	b	.L3
.L46:
	ldr	r3, .L50+20
	ldr	ip, .L50+24
	ldr	lr, [r3]
	ldr	r3, .L50+28
	ldr	r1, .L50+92
	ldr	ip, [ip]
	ldr	r4, .L50+44
	tst	r0, lr
	ldr	lr, [r3]
	ldr	r4, [r4]
	ldr	r2, .L50+96
	movne	r2, r1
	tst	r0, ip
	ldr	r3, .L50+100
	movne	r3, r1
	tst	r0, lr
	ldr	lr, .L50+104
	ldr	ip, .L50+108
	movne	ip, r1
	tst	r0, r4
	moveq	r1, lr
	ldr	r0, .L50+56
	str	r1, [sp, #4]
	str	ip, [sp]
	ldr	r0, [r0]
	ldr	r1, .L50+112
	bl	fprintf
	mov	r4, #0
	b	.L3
.L49:
	ldr	r1, .L50+116
	add	r0, r6, #16
	bl	sprintf
	b	.L17
.L47:
	bl	__stack_chk_fail
.L51:
	.align	2
.L50:
	.word	MAX_LINE_SIZE
	.word	.LC20
	.word	.LC5
	.word	.LC7
	.word	.LC9
	.word	WIDTH_FLAG
	.word	HEIGHT_FLAG
	.word	DEPTH_FLAG
	.word	.LC11
	.word	.LC13
	.word	TUPLE_FLAG
	.word	MAXVAL_FLAG
	.word	.LC16
	.word	ALL_NEEDED_FLAGS
	.word	stderr
	.word	.LC19
	.word	.LC14
	.word	.LC15
	.word	.LC6
	.word	.LC8
	.word	.LC10
	.word	.LC12
	.word	.LC17
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC4
	.word	.LC3
	.word	.LC18
	.word	.LANCHOR0
	.size	ReadPAMFields, .-ReadPAMFields
	.comm	stderr,4,4
	.comm	WIDTH_FLAG,4,4
	.comm	TUPLE_FLAG,4,4
	.comm	MAX_LINE_SIZE,4,4
	.comm	MAXVAL_FLAG,4,4
	.comm	HEIGHT_FLAG,4,4
	.comm	DEPTH_FLAG,4,4
	.comm	ALL_NEEDED_FLAGS,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
	.type	kEllipsis.4253, %object
	.size	kEllipsis.4253, 5
kEllipsis.4253:
	.ascii	" ...\000"
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
