	.file	"713882.c"
	.intel_syntax noprefix
	.text
	.globl	pbmfile
	.bss
	.align 8
	.type	pbmfile, @object
	.size	pbmfile, 8
pbmfile:
	.zero	8
	.globl	pbmwidth
	.align 4
	.type	pbmwidth, @object
	.size	pbmwidth, 4
pbmwidth:
	.zero	4
	.globl	pbmheight
	.align 4
	.type	pbmheight, @object
	.size	pbmheight, 4
pbmheight:
	.zero	4
	.globl	pbmdepth
	.align 4
	.type	pbmdepth, @object
	.size	pbmdepth, 4
pbmdepth:
	.zero	4
	.globl	mapwidth
	.align 4
	.type	mapwidth, @object
	.size	mapwidth, 4
mapwidth:
	.zero	4
	.globl	mapheight
	.align 4
	.type	mapheight, @object
	.size	mapheight, 4
mapheight:
	.zero	4
	.globl	clrgamma
	.align 32
	.type	clrgamma, @object
	.size	clrgamma, 256
clrgamma:
	.zero	256
	.globl	pixmap
	.align 8
	.type	pixmap, @object
	.size	pixmap, 8
pixmap:
	.zero	8
	.globl	hashlist
	.align 32
	.type	hashlist, @object
	.size	hashlist, 2048
hashlist:
	.zero	2048
	.globl	hashcount
	.align 32
	.type	hashcount, @object
	.size	hashcount, 1024
hashcount:
	.zero	1024
	.globl	tilecount
	.align 4
	.type	tilecount, @object
	.size	tilecount, 4
tilecount:
	.zero	4
	.data
	.align 32
	.type	ddithmask, @object
	.size	ddithmask, 64
ddithmask:
	.long	0
	.long	32768
	.long	32800
	.long	32928
	.long	41120
	.long	42144
	.long	42145
	.long	42149
	.long	42405
	.long	44453
	.long	44455
	.long	44463
	.long	44975
	.long	61359
	.long	61375
	.long	61439
	.align 32
	.type	bdithmask, @object
	.size	bdithmask, 64
bdithmask:
	.long	0
	.long	32768
	.long	32800
	.long	32928
	.long	41120
	.long	42144
	.long	42145
	.long	42149
	.long	42405
	.long	44453
	.long	44455
	.long	44463
	.long	44975
	.long	61359
	.long	61375
	.long	65535
	.text
	.globl	brush
	.type	brush, @function
brush:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, esi
	mov	DWORD PTR -28[rbp], edx
	mov	QWORD PTR -40[rbp], rcx
	mov	edx, edi
	mov	BYTE PTR -20[rbp], dl
	mov	BYTE PTR -24[rbp], al
	movzx	eax, BYTE PTR -20[rbp]
	cmp	al, BYTE PTR -24[rbp]
	jb	.L2
	movzx	eax, BYTE PTR -20[rbp]
	cmp	DWORD PTR -28[rbp], eax
	ja	.L2
	movzx	eax, BYTE PTR -20[rbp]
	mov	BYTE PTR -1[rbp], al
	jmp	.L3
.L2:
	movzx	eax, BYTE PTR -24[rbp]
	cmp	al, BYTE PTR -20[rbp]
	jb	.L4
	movzx	eax, BYTE PTR -24[rbp]
	cmp	DWORD PTR -28[rbp], eax
	ja	.L4
	movzx	eax, BYTE PTR -24[rbp]
	mov	BYTE PTR -1[rbp], al
	jmp	.L3
.L4:
	mov	eax, DWORD PTR -28[rbp]
	mov	BYTE PTR -1[rbp], al
.L3:
	movzx	eax, BYTE PTR -1[rbp]
	test	al, al
	jns	.L5
	movzx	eax, BYTE PTR -1[rbp]
	shr	al, 3
	movzx	eax, al
	and	eax, 15
	mov	ecx, eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 12[rax]
	movsx	rax, ecx
	lea	rcx, 0[0+rax*4]
	lea	rax, bdithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	movzx	eax, BYTE PTR -20[rbp]
	sal	eax, 4
	movzx	edx, BYTE PTR -1[rbp]
	lea	esi, 8[rdx]
	cdq
	idiv	esi
	mov	ecx, eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 8[rax]
	movsx	rax, ecx
	lea	rcx, 0[0+rax*4]
	lea	rax, bdithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	movzx	eax, BYTE PTR -24[rbp]
	sal	eax, 4
	movzx	edx, BYTE PTR -1[rbp]
	lea	esi, 8[rdx]
	cdq
	idiv	esi
	mov	ecx, eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 4[rax]
	movsx	rax, ecx
	lea	rcx, 0[0+rax*4]
	lea	rax, bdithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -28[rbp]
	sal	eax, 4
	movzx	edx, BYTE PTR -1[rbp]
	add	edx, 8
	mov	edi, edx
	mov	edx, 0
	div	edi
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, bdithmask[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	movzx	eax, BYTE PTR -20[rbp]
	sar	eax, 5
	and	eax, 4
	or	eax, 8
	mov	edx, eax
	movzx	eax, BYTE PTR -24[rbp]
	sar	eax, 6
	and	eax, 2
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -28[rbp]
	shr	eax, 7
	and	eax, 1
	or	eax, edx
	mov	BYTE PTR -2[rbp], al
	jmp	.L6
.L5:
	movzx	eax, BYTE PTR -1[rbp]
	movzx	edx, BYTE PTR -20[rbp]
	sub	eax, edx
	mov	ecx, eax
	movzx	eax, BYTE PTR -1[rbp]
	movzx	edx, BYTE PTR -24[rbp]
	sub	eax, edx
	add	eax, ecx
	mov	edx, eax
	movzx	eax, BYTE PTR -1[rbp]
	sub	eax, DWORD PTR -28[rbp]
	add	eax, edx
	cmp	eax, 7
	ja	.L7
	cmp	BYTE PTR -1[rbp], 63
	jbe	.L8
	movzx	eax, BYTE PTR -1[rbp]
	sub	eax, 64
	sar	eax, 2
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 12
	not	edx
	mov	DWORD PTR [rax], edx
	movzx	eax, BYTE PTR -1[rbp]
	sub	eax, 64
	sar	eax, 2
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	rdx, QWORD PTR -40[rbp]
	mov	edx, DWORD PTR [rdx]
	mov	DWORD PTR [rax], edx
	mov	rdx, QWORD PTR -40[rbp]
	add	rdx, 8
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdx], eax
	mov	BYTE PTR -2[rbp], 7
	jmp	.L6
.L8:
	movzx	eax, BYTE PTR -1[rbp]
	shr	al, 2
	movzx	eax, al
	mov	rdx, QWORD PTR -40[rbp]
	add	rdx, 12
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 8
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 4
	mov	DWORD PTR [rax], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], 0
	cmp	BYTE PTR -1[rbp], 31
	jbe	.L9
	mov	eax, 8
	jmp	.L10
.L9:
	mov	eax, 0
.L10:
	mov	BYTE PTR -2[rbp], al
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 12
	mov	DWORD PTR [rax], 0
	movzx	eax, BYTE PTR -20[rbp]
	shr	al, 3
	movzx	eax, al
	mov	rdx, QWORD PTR -40[rbp]
	add	rdx, 8
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	movzx	eax, BYTE PTR -24[rbp]
	shr	al, 3
	movzx	eax, al
	mov	rdx, QWORD PTR -40[rbp]
	add	rdx, 4
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	eax, DWORD PTR [rcx+rax]
	mov	DWORD PTR [rdx], eax
	mov	eax, DWORD PTR -28[rbp]
	shr	eax, 3
	mov	eax, eax
	lea	rdx, 0[0+rax*4]
	lea	rax, ddithmask[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	DWORD PTR [rax], edx
	movzx	eax, BYTE PTR -20[rbp]
	sar	eax, 4
	and	eax, 4
	mov	edx, eax
	movzx	eax, BYTE PTR -24[rbp]
	sar	eax, 5
	and	eax, 2
	or	eax, edx
	mov	edx, eax
	mov	eax, DWORD PTR -28[rbp]
	shr	eax, 6
	and	eax, 1
	or	eax, edx
	mov	BYTE PTR -2[rbp], al
.L6:
	movzx	eax, BYTE PTR -2[rbp]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	brush, .-brush
	.globl	plot
	.type	plot, @function
plot:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, edx
	mov	BYTE PTR -12[rbp], al
	mov	eax, DWORD PTR -4[rbp]
	and	eax, 1
	test	eax, eax
	je	.L13
	sal	BYTE PTR -12[rbp], 4
.L13:
	mov	rcx, QWORD PTR pixmap[rip]
	mov	eax, DWORD PTR mapwidth[rip]
	imul	eax, DWORD PTR -8[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	movsx	rax, edx
	add	rax, rcx
	movzx	eax, BYTE PTR [rax]
	mov	rcx, QWORD PTR pixmap[rip]
	movsx	rdx, edx
	add	rdx, rcx
	or	al, BYTE PTR -12[rbp]
	mov	BYTE PTR [rdx], al
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	plot, .-plot
	.globl	plotrgb
	.type	plotrgb, @function
plotrgb:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	DWORD PTR -52[rbp], edi
	mov	DWORD PTR -56[rbp], esi
	mov	eax, ecx
	mov	ecx, r8d
	mov	BYTE PTR -60[rbp], dl
	mov	BYTE PTR -64[rbp], al
	mov	eax, ecx
	mov	BYTE PTR -68[rbp], al
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movzx	edx, BYTE PTR -68[rbp]
	movzx	esi, BYTE PTR -64[rbp]
	movzx	eax, BYTE PTR -60[rbp]
	lea	rcx, -32[rbp]
	mov	edi, eax
	call	brush
	mov	eax, DWORD PTR -56[rbp]
	and	eax, 3
	lea	edx, 0[0+rax*4]
	mov	eax, DWORD PTR -52[rbp]
	and	eax, 3
	add	eax, edx
	mov	BYTE PTR -33[rbp], al
	mov	edx, DWORD PTR -20[rbp]
	movzx	eax, BYTE PTR -33[rbp]
	mov	ecx, eax
	shr	edx, cl
	mov	eax, edx
	sal	eax, 3
	and	eax, 8
	mov	BYTE PTR -34[rbp], al
	mov	edx, DWORD PTR -24[rbp]
	movzx	eax, BYTE PTR -33[rbp]
	mov	ecx, eax
	shr	edx, cl
	mov	eax, edx
	sal	eax, 2
	and	eax, 4
	or	BYTE PTR -34[rbp], al
	mov	edx, DWORD PTR -28[rbp]
	movzx	eax, BYTE PTR -33[rbp]
	mov	ecx, eax
	shr	edx, cl
	mov	eax, edx
	add	eax, eax
	and	eax, 2
	or	BYTE PTR -34[rbp], al
	mov	edx, DWORD PTR -32[rbp]
	movzx	eax, BYTE PTR -33[rbp]
	mov	ecx, eax
	shr	edx, cl
	mov	eax, edx
	and	eax, 1
	or	BYTE PTR -34[rbp], al
	mov	eax, DWORD PTR -52[rbp]
	and	eax, 1
	test	eax, eax
	je	.L15
	sal	BYTE PTR -34[rbp], 4
.L15:
	mov	rcx, QWORD PTR pixmap[rip]
	mov	eax, DWORD PTR mapwidth[rip]
	imul	eax, DWORD PTR -56[rbp]
	mov	edx, eax
	mov	eax, DWORD PTR -52[rbp]
	add	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	mov	edx, eax
	movsx	rax, edx
	add	rax, rcx
	movzx	eax, BYTE PTR [rax]
	mov	rcx, QWORD PTR pixmap[rip]
	movsx	rdx, edx
	add	rdx, rcx
	or	al, BYTE PTR -34[rbp]
	mov	BYTE PTR [rdx], al
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	plotrgb, .-plotrgb
	.globl	addtile
	.type	addtile, @function
addtile:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 216
	.cfi_offset 3, -24
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -224[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -197[rbp], 0
	mov	DWORD PTR -196[rbp], 0
	jmp	.L18
.L21:
	mov	DWORD PTR -192[rbp], 0
	jmp	.L19
.L20:
	mov	eax, DWORD PTR -192[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	add	BYTE PTR -197[rbp], al
	mov	eax, DWORD PTR -192[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -224[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -196[rbp]
	lea	ecx, 0[0+rdx*8]
	mov	edx, DWORD PTR -192[rbp]
	add	ecx, edx
	movzx	edx, BYTE PTR [rax]
	movsx	rax, ecx
	mov	BYTE PTR -176[rbp+rax], dl
	add	DWORD PTR -192[rbp], 1
.L19:
	cmp	DWORD PTR -192[rbp], 7
	jle	.L20
	mov	eax, DWORD PTR mapwidth[rip]
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cdqe
	add	QWORD PTR -224[rbp], rax
	add	DWORD PTR -196[rbp], 1
.L18:
	cmp	DWORD PTR -196[rbp], 15
	jle	.L21
	movzx	eax, BYTE PTR -197[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, hashlist[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	QWORD PTR -184[rbp], rax
	jmp	.L22
.L25:
	mov	rcx, QWORD PTR -184[rbp]
	lea	rax, -176[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	je	.L30
	mov	rax, QWORD PTR -184[rbp]
	mov	rax, QWORD PTR 128[rax]
	mov	QWORD PTR -184[rbp], rax
.L22:
	cmp	QWORD PTR -184[rbp], 0
	jne	.L25
	jmp	.L24
.L30:
	nop
.L24:
	cmp	QWORD PTR -184[rbp], 0
	jne	.L26
	mov	eax, DWORD PTR tilecount[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR tilecount[rip], edx
	mov	DWORD PTR -188[rbp], eax
	mov	eax, DWORD PTR -188[rbp]
	mov	DWORD PTR -40[rbp], eax
	movzx	eax, BYTE PTR -197[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, hashlist[rip]
	mov	rax, QWORD PTR [rdx+rax]
	mov	QWORD PTR -48[rbp], rax
	movzx	ebx, BYTE PTR -197[rbp]
	mov	edi, 144
	call	malloc@PLT
	mov	rcx, rax
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, hashlist[rip]
	mov	QWORD PTR [rdx+rax], rcx
	movzx	eax, BYTE PTR -197[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, hashlist[rip]
	mov	rax, QWORD PTR [rdx+rax]
	lea	rcx, -176[rbp]
	mov	edx, 144
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
	mov	rdx, QWORD PTR -216[rbp]
	lea	rax, -176[rbp]
	mov	rcx, rdx
	mov	edx, 8
	mov	esi, 16
	mov	rdi, rax
	call	fwrite@PLT
	movzx	eax, BYTE PTR -197[rbp]
	movsx	rdx, eax
	lea	rcx, 0[0+rdx*4]
	lea	rdx, hashcount[rip]
	mov	edx, DWORD PTR [rcx+rdx]
	lea	ecx, 1[rdx]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, hashcount[rip]
	mov	DWORD PTR [rdx+rax], ecx
	jmp	.L27
.L26:
	mov	rax, QWORD PTR -184[rbp]
	mov	eax, DWORD PTR 136[rax]
	mov	DWORD PTR -188[rbp], eax
.L27:
	mov	eax, DWORD PTR -188[rbp]
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	addtile, .-addtile
	.section	.rodata
.LC0:
	.string	"P6\n"
.LC1:
	.string	"PBM header: Missing P6 %s\n"
.LC2:
	.string	"%d %d\n"
.LC3:
	.string	"PBM header: Missing width %s\n"
.LC4:
	.string	"%d\n"
	.align 8
.LC5:
	.string	"PBM header: Missing height %s\n"
	.text
	.globl	readheader
	.type	readheader, @function
readheader:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	add	rsp, -128
	mov	QWORD PTR -104[rbp], rdi
	mov	QWORD PTR -112[rbp], rsi
	mov	QWORD PTR -120[rbp], rdx
	mov	QWORD PTR -128[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR -104[rbp]
	lea	rax, -96[rbp]
	mov	esi, 80
	mov	rdi, rax
	call	fgets@PLT
	lea	rax, -96[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	je	.L32
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -96[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	jmp	.L38
.L32:
	mov	rdx, QWORD PTR -104[rbp]
	lea	rax, -96[rbp]
	mov	esi, 80
	mov	rdi, rax
	call	fgets@PLT
	movzx	eax, BYTE PTR -96[rbp]
	cmp	al, 35
	je	.L32
	mov	rcx, QWORD PTR -120[rbp]
	mov	rdx, QWORD PTR -112[rbp]
	lea	rax, -96[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 2
	je	.L40
	cmp	eax, 2
	jg	.L35
	test	eax, eax
	je	.L36
	cmp	eax, 1
	je	.L37
	jmp	.L35
.L36:
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -96[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	jmp	.L38
.L37:
	mov	rdx, QWORD PTR -120[rbp]
	mov	rax, QWORD PTR -104[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	test	eax, eax
	jne	.L40
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -96[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 0
	jmp	.L38
.L40:
	nop
.L35:
	mov	rdx, QWORD PTR -128[rbp]
	mov	rax, QWORD PTR -104[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	cmp	eax, 1
	sete	al
	movzx	eax, al
.L38:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	readheader, .-readheader
	.section	.rodata
.LC7:
	.string	"%s.pnm"
.LC8:
	.string	"rb"
.LC9:
	.string	"Can't open %s\n"
.LC10:
	.string	"Missing basename\n"
.LC11:
	.string	"Not a valid PBM file.\n"
.LC12:
	.string	"%s.set"
.LC13:
	.string	"%s.map"
.LC14:
	.string	"wb"
.LC15:
	.string	"Hash count[%d]: %d\n"
.LC16:
	.string	"Tile count: %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 384
	mov	DWORD PTR -372[rbp], edi
	mov	QWORD PTR -384[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -336[rbp], 0
	jmp	.L42
.L43:
	mov	eax, DWORD PTR -336[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -336[rbp]
	cdqe
	lea	rdx, clrgamma[rip]
	mov	BYTE PTR [rax+rdx], cl
	add	DWORD PTR -336[rbp], 1
.L42:
	cmp	DWORD PTR -336[rbp], 255
	jle	.L43
	mov	BYTE PTR -353[rbp], 1
	mov	BYTE PTR -352[rbp], 0
	jmp	.L44
.L51:
	cmp	DWORD PTR -372[rbp], 2
	jle	.L45
	mov	rax, QWORD PTR -384[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 103
	jne	.L45
	mov	rax, QWORD PTR -384[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atof@PLT
	cvtsd2ss	xmm0, xmm0
	movss	DWORD PTR -324[rbp], xmm0
	mov	DWORD PTR -336[rbp], 0
	jmp	.L46
.L47:
	pxor	xmm2, xmm2
	cvtss2sd	xmm2, DWORD PTR -324[rbp]
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, DWORD PTR -336[rbp]
	cvtss2sd	xmm0, xmm0
	movsd	xmm1, QWORD PTR .LC6[rip]
	divsd	xmm0, xmm1
	movq	rax, xmm0
	movapd	xmm1, xmm2
	movq	xmm0, rax
	call	pow@PLT
	movsd	xmm1, QWORD PTR .LC6[rip]
	mulsd	xmm0, xmm1
	cvttsd2si	eax, xmm0
	mov	ecx, eax
	mov	eax, DWORD PTR -336[rbp]
	cdqe
	lea	rdx, clrgamma[rip]
	mov	BYTE PTR [rax+rdx], cl
	add	DWORD PTR -336[rbp], 1
.L46:
	cmp	DWORD PTR -336[rbp], 255
	jle	.L47
	sub	DWORD PTR -372[rbp], 1
	add	QWORD PTR -384[rbp], 8
	jmp	.L48
.L45:
	mov	rax, QWORD PTR -384[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 110
	jne	.L49
	mov	BYTE PTR -353[rbp], 0
	jmp	.L48
.L49:
	mov	rax, QWORD PTR -384[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	cmp	al, 115
	jne	.L48
	mov	BYTE PTR -352[rbp], 1
.L48:
	sub	DWORD PTR -372[rbp], 1
	add	QWORD PTR -384[rbp], 8
.L44:
	cmp	DWORD PTR -372[rbp], 1
	jle	.L50
	mov	rax, QWORD PTR -384[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L51
.L50:
	cmp	DWORD PTR -372[rbp], 1
	jle	.L52
	mov	rax, QWORD PTR -384[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -320[rbp], rax
	mov	rdx, QWORD PTR -320[rbp]
	lea	rax, -256[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	lea	rax, -256[rbp]
	lea	rsi, .LC8[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -312[rbp], rax
	cmp	QWORD PTR -312[rbp], 0
	jne	.L53
	mov	rax, QWORD PTR stderr[rip]
	lea	rdx, -256[rbp]
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, -1
	jmp	.L71
.L52:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 17
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L71
.L53:
	lea	rcx, -340[rbp]
	lea	rdx, -344[rbp]
	lea	rsi, -348[rbp]
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	readheader
	test	eax, eax
	jne	.L55
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	eax, -1
	jmp	.L71
.L55:
	mov	eax, DWORD PTR -348[rbp]
	add	eax, 15
	and	eax, 65520
	mov	DWORD PTR mapwidth[rip], eax
	mov	eax, DWORD PTR -344[rbp]
	add	eax, 15
	and	eax, 65520
	mov	DWORD PTR mapheight[rip], eax
	mov	edx, DWORD PTR mapwidth[rip]
	mov	eax, DWORD PTR mapheight[rip]
	imul	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR pixmap[rip], rax
	mov	edx, DWORD PTR mapwidth[rip]
	mov	eax, DWORD PTR mapheight[rip]
	imul	eax, edx
	mov	edx, eax
	shr	edx, 31
	add	eax, edx
	sar	eax
	movsx	rdx, eax
	mov	rax, QWORD PTR pixmap[rip]
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -332[rbp], 0
	jmp	.L56
.L61:
	mov	DWORD PTR -336[rbp], 0
	jmp	.L57
.L60:
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	getc@PLT
	cdqe
	lea	rdx, clrgamma[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	mov	BYTE PTR -351[rbp], al
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	getc@PLT
	cdqe
	lea	rdx, clrgamma[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	mov	BYTE PTR -350[rbp], al
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	getc@PLT
	cdqe
	lea	rdx, clrgamma[rip]
	movzx	eax, BYTE PTR [rax+rdx]
	mov	BYTE PTR -349[rbp], al
	cmp	BYTE PTR -353[rbp], 0
	je	.L58
	movzx	edi, BYTE PTR -349[rbp]
	movzx	ecx, BYTE PTR -350[rbp]
	movzx	edx, BYTE PTR -351[rbp]
	mov	esi, DWORD PTR -332[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	r8d, edi
	mov	edi, eax
	call	plotrgb
	jmp	.L59
.L58:
	movzx	edx, BYTE PTR -349[rbp]
	movzx	esi, BYTE PTR -350[rbp]
	movzx	eax, BYTE PTR -351[rbp]
	lea	rcx, -288[rbp]
	mov	edi, eax
	call	brush
	movzx	edx, al
	mov	ecx, DWORD PTR -332[rbp]
	mov	eax, DWORD PTR -336[rbp]
	mov	esi, ecx
	mov	edi, eax
	call	plot
.L59:
	add	DWORD PTR -336[rbp], 1
.L57:
	mov	eax, DWORD PTR -348[rbp]
	cmp	DWORD PTR -336[rbp], eax
	jl	.L60
	add	DWORD PTR -332[rbp], 1
.L56:
	mov	eax, DWORD PTR -344[rbp]
	cmp	DWORD PTR -332[rbp], eax
	jl	.L61
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rdx, QWORD PTR -320[rbp]
	lea	rax, -176[rbp]
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rdx, QWORD PTR -320[rbp]
	lea	rax, -96[rbp]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	DWORD PTR -328[rbp], 0
	jmp	.L62
.L63:
	mov	eax, DWORD PTR -328[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	lea	rax, hashlist[rip]
	mov	QWORD PTR [rdx+rax], 0
	mov	eax, DWORD PTR -328[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, hashcount[rip]
	mov	DWORD PTR [rdx+rax], 0
	add	DWORD PTR -328[rbp], 1
.L62:
	cmp	DWORD PTR -328[rbp], 255
	jle	.L63
	lea	rax, -176[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -304[rbp], rax
	lea	rax, -96[rbp]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -296[rbp], rax
	mov	eax, DWORD PTR mapwidth[rip]
	lea	edx, 15[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 4
	mov	BYTE PTR -260[rbp], al
	mov	eax, DWORD PTR mapwidth[rip]
	lea	edx, 15[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 4
	sar	eax, 8
	mov	BYTE PTR -259[rbp], al
	mov	eax, DWORD PTR mapheight[rip]
	lea	edx, 15[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 4
	mov	BYTE PTR -258[rbp], al
	mov	eax, DWORD PTR mapheight[rip]
	lea	edx, 15[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 4
	sar	eax, 8
	mov	BYTE PTR -257[rbp], al
	mov	rdx, QWORD PTR -296[rbp]
	lea	rax, -260[rbp]
	mov	rcx, rdx
	mov	edx, 4
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	DWORD PTR -332[rbp], 0
	jmp	.L64
.L67:
	mov	DWORD PTR -336[rbp], 0
	jmp	.L65
.L66:
	mov	rdx, QWORD PTR pixmap[rip]
	mov	eax, DWORD PTR mapwidth[rip]
	imul	eax, DWORD PTR -332[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -336[rbp]
	add	eax, ecx
	mov	ecx, eax
	shr	ecx, 31
	add	eax, ecx
	sar	eax
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -304[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	addtile
	mov	DWORD PTR -328[rbp], eax
	mov	eax, DWORD PTR -328[rbp]
	mov	BYTE PTR -260[rbp], al
	mov	eax, DWORD PTR -328[rbp]
	sar	eax, 8
	mov	BYTE PTR -259[rbp], al
	mov	rdx, QWORD PTR -296[rbp]
	lea	rax, -260[rbp]
	mov	rcx, rdx
	mov	edx, 2
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	add	DWORD PTR -336[rbp], 16
.L65:
	mov	eax, DWORD PTR mapwidth[rip]
	cmp	DWORD PTR -336[rbp], eax
	jl	.L66
	add	DWORD PTR -332[rbp], 16
.L64:
	mov	eax, DWORD PTR mapheight[rip]
	cmp	DWORD PTR -332[rbp], eax
	jl	.L67
	mov	rax, QWORD PTR -304[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -296[rbp]
	mov	rdi, rax
	call	fclose@PLT
	cmp	BYTE PTR -352[rbp], 0
	je	.L68
	mov	DWORD PTR -328[rbp], 0
	jmp	.L69
.L70:
	mov	eax, DWORD PTR -328[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, hashcount[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -328[rbp]
	mov	esi, eax
	lea	rdi, .LC15[rip]
	mov	eax, 0
	call	printf@PLT
	add	DWORD PTR -328[rbp], 1
.L69:
	cmp	DWORD PTR -328[rbp], 255
	jle	.L70
	mov	eax, DWORD PTR tilecount[rip]
	mov	esi, eax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
.L68:
	mov	eax, 0
.L71:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L72
	call	__stack_chk_fail@PLT
.L72:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC6:
	.long	0
	.long	1081073664
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"713882.c"
	.text
	.comm	pbmfile,4,4
	.comm	pbmwidth,4,4
	.comm	pbmheight,4,4
	.comm	pbmdepth,4,4
	.comm	mapwidth,4,4
	.comm	mapheight,4,4
	.comm	clrgamma,256,4
	.comm	pixmap,4,4
	.comm	hashlist,1024,4
	.comm	hashcount,1024,4
	.global	tilecount
	.bss
	.align	2
	.type	tilecount, %object
	.size	tilecount, 4
tilecount:
	.space	4
	.data
	.align	2
	.type	ddithmask, %object
	.size	ddithmask, 64
ddithmask:
	.word	0
	.word	32768
	.word	32800
	.word	32928
	.word	41120
	.word	42144
	.word	42145
	.word	42149
	.word	42405
	.word	44453
	.word	44455
	.word	44463
	.word	44975
	.word	61359
	.word	61375
	.word	61439
	.align	2
	.type	bdithmask, %object
	.size	bdithmask, 64
bdithmask:
	.word	0
	.word	32768
	.word	32800
	.word	32928
	.word	41120
	.word	42144
	.word	42145
	.word	42149
	.word	42405
	.word	44453
	.word	44455
	.word	44463
	.word	44975
	.word	61359
	.word	61375
	.word	65535
	.global	__aeabi_idiv
	.global	__aeabi_uidiv
	.text
	.align	2
	.global	brush
	.syntax unified
	.arm
	.fpu softvfp
	.type	brush, %function
brush:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r2, [fp, #-20]
	str	r3, [fp, #-24]
	mov	r3, r0
	strb	r3, [fp, #-13]
	mov	r3, r1
	strb	r3, [fp, #-14]
	ldrb	r2, [fp, #-13]	@ zero_extendqisi2
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	cmp	r2, r3
	bcc	.L2
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bhi	.L2
	ldrb	r3, [fp, #-13]
	strb	r3, [fp, #-5]
	b	.L3
.L2:
	ldrb	r2, [fp, #-14]	@ zero_extendqisi2
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	cmp	r2, r3
	bcc	.L4
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bhi	.L4
	ldrb	r3, [fp, #-14]
	strb	r3, [fp, #-5]
	b	.L3
.L4:
	ldr	r3, [fp, #-20]
	strb	r3, [fp, #-5]
.L3:
	ldrsb	r3, [fp, #-5]
	cmp	r3, #0
	bge	.L5
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	lsr	r3, r3, #3
	and	r3, r3, #255
	and	r2, r3, #15
	ldr	r3, [fp, #-24]
	add	r3, r3, #12
	ldr	r1, .L12
	ldr	r2, [r1, r2, lsl #2]
	str	r2, [r3]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	lsl	r2, r3, #4
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #8
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idiv
	mov	r3, r0
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #8
	ldr	r2, .L12
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [r3]
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	lsl	r2, r3, #4
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #8
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_idiv
	mov	r3, r0
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r2, .L12
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	lsl	r2, r3, #4
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	add	r3, r3, #8
	mov	r1, r3
	mov	r0, r2
	bl	__aeabi_uidiv
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L12
	ldr	r2, [r3, r2, lsl #2]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	asr	r3, r3, #5
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, #4
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r3, #8
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	asr	r3, r3, #6
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, #2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r2, r3, #255
	ldr	r3, [fp, #-20]
	lsr	r3, r3, #7
	and	r3, r3, #255
	and	r3, r3, #1
	and	r3, r3, #255
	orr	r3, r2, r3
	strb	r3, [fp, #-6]
	b	.L6
.L5:
	ldrb	r2, [fp, #-5]	@ zero_extendqisi2
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	sub	r2, r2, r3
	ldrb	r1, [fp, #-5]	@ zero_extendqisi2
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	sub	r3, r1, r3
	add	r3, r2, r3
	mov	r1, r3
	ldrb	r2, [fp, #-5]	@ zero_extendqisi2
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	add	r3, r1, r3
	cmp	r3, #7
	bhi	.L7
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #63
	bls	.L8
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	sub	r3, r3, #64
	asr	r3, r3, #2
	ldr	r2, .L12+4
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-24]
	add	r3, r3, #12
	mvn	r2, r2
	str	r2, [r3]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	sub	r3, r3, #64
	asr	r3, r3, #2
	ldr	r2, .L12+4
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r2, [fp, #-24]
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r2, [fp, #-24]
	add	r2, r2, #8
	ldr	r3, [r3]
	str	r3, [r2]
	mov	r3, #7
	strb	r3, [fp, #-6]
	b	.L6
.L8:
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	lsr	r3, r3, #2
	and	r3, r3, #255
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #12
	ldr	r2, .L12+4
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #8
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-24]
	mov	r2, #0
	str	r2, [r3]
	ldrb	r3, [fp, #-5]	@ zero_extendqisi2
	cmp	r3, #31
	bls	.L9
	mov	r3, #8
	b	.L10
.L9:
	mov	r3, #0
.L10:
	strb	r3, [fp, #-6]
	b	.L6
.L7:
	ldr	r3, [fp, #-24]
	add	r3, r3, #12
	mov	r2, #0
	str	r2, [r3]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	lsr	r3, r3, #3
	and	r3, r3, #255
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #8
	ldr	r2, .L12+4
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [r3]
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	lsr	r3, r3, #3
	and	r3, r3, #255
	mov	r1, r3
	ldr	r3, [fp, #-24]
	add	r3, r3, #4
	ldr	r2, .L12+4
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [r3]
	ldr	r3, [fp, #-20]
	lsr	r3, r3, #3
	ldr	r2, .L12+4
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-24]
	str	r2, [r3]
	ldrb	r3, [fp, #-13]	@ zero_extendqisi2
	asr	r3, r3, #4
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, #4
	lsl	r3, r3, #24
	asr	r2, r3, #24
	ldrb	r3, [fp, #-14]	@ zero_extendqisi2
	asr	r3, r3, #5
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r3, r3, #2
	lsl	r3, r3, #24
	asr	r3, r3, #24
	orr	r3, r2, r3
	lsl	r3, r3, #24
	asr	r3, r3, #24
	and	r2, r3, #255
	ldr	r3, [fp, #-20]
	lsr	r3, r3, #6
	and	r3, r3, #255
	and	r3, r3, #1
	and	r3, r3, #255
	orr	r3, r2, r3
	strb	r3, [fp, #-6]
.L6:
	ldrb	r3, [fp, #-6]	@ zero_extendqisi2
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	bdithmask
	.word	ddithmask
	.size	brush, .-brush
	.align	2
	.global	plot
	.syntax unified
	.arm
	.fpu softvfp
	.type	plot, %function
plot:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #20
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	mov	r3, r2
	strb	r3, [fp, #-13]
	ldr	r3, [fp, #-8]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L15
	ldrb	r3, [fp, #-13]
	lsl	r3, r3, #4
	strb	r3, [fp, #-13]
.L15:
	ldr	r3, .L16
	ldr	r2, [r3]
	ldr	r3, .L16+4
	ldr	r3, [r3]
	ldr	r1, [fp, #-12]
	mul	r1, r3, r1
	ldr	r3, [fp, #-8]
	add	r3, r1, r3
	lsr	r1, r3, #31
	add	r3, r1, r3
	asr	r3, r3, #1
	mov	r0, r3
	mov	r3, r0
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	ldr	r3, .L16
	ldr	r3, [r3]
	mov	r2, r0
	add	r3, r3, r2
	ldrb	r2, [fp, #-13]
	orr	r2, r1, r2
	and	r2, r2, #255
	strb	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L17:
	.align	2
.L16:
	.word	pixmap
	.word	mapwidth
	.size	plot, .-plot
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	plotrgb
	.syntax unified
	.arm
	.fpu softvfp
	.type	plotrgb, %function
plotrgb:
	@ args = 4, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	mov	r1, r2
	mov	r2, r3
	mov	r3, r1
	strb	r3, [fp, #-37]
	mov	r3, r2
	strb	r3, [fp, #-38]
	ldr	r3, .L21
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldrb	r2, [fp, #4]	@ zero_extendqisi2
	sub	r3, fp, #24
	ldrb	r1, [fp, #-38]	@ zero_extendqisi2
	ldrb	r0, [fp, #-37]	@ zero_extendqisi2
	bl	brush
	ldr	r3, [fp, #-36]
	and	r3, r3, #255
	and	r3, r3, #3
	and	r3, r3, #255
	lsl	r3, r3, #2
	and	r2, r3, #255
	ldr	r3, [fp, #-32]
	and	r3, r3, #255
	and	r3, r3, #3
	and	r3, r3, #255
	add	r3, r2, r3
	strb	r3, [fp, #-25]
	ldr	r2, [fp, #-12]
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	lsr	r3, r2, r3
	and	r3, r3, #255
	lsl	r3, r3, #3
	and	r3, r3, #255
	and	r3, r3, #8
	strb	r3, [fp, #-26]
	ldr	r2, [fp, #-16]
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	lsr	r3, r2, r3
	and	r3, r3, #255
	lsl	r3, r3, #2
	and	r3, r3, #255
	and	r3, r3, #4
	and	r2, r3, #255
	ldrb	r3, [fp, #-26]
	orr	r3, r2, r3
	strb	r3, [fp, #-26]
	ldr	r2, [fp, #-20]
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	lsr	r3, r2, r3
	and	r3, r3, #255
	lsl	r3, r3, #1
	and	r3, r3, #255
	and	r3, r3, #2
	and	r2, r3, #255
	ldrb	r3, [fp, #-26]
	orr	r3, r2, r3
	strb	r3, [fp, #-26]
	ldr	r2, [fp, #-24]
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	lsr	r3, r2, r3
	and	r3, r3, #255
	and	r3, r3, #1
	and	r2, r3, #255
	ldrb	r3, [fp, #-26]
	orr	r3, r2, r3
	strb	r3, [fp, #-26]
	ldr	r3, [fp, #-32]
	and	r3, r3, #1
	cmp	r3, #0
	beq	.L19
	ldrb	r3, [fp, #-26]
	lsl	r3, r3, #4
	strb	r3, [fp, #-26]
.L19:
	ldr	r3, .L21+4
	ldr	r2, [r3]
	ldr	r3, .L21+8
	ldr	r3, [r3]
	ldr	r1, [fp, #-36]
	mul	r1, r3, r1
	ldr	r3, [fp, #-32]
	add	r3, r1, r3
	lsr	r1, r3, #31
	add	r3, r1, r3
	asr	r3, r3, #1
	mov	r0, r3
	mov	r3, r0
	add	r3, r2, r3
	ldrb	r1, [r3]	@ zero_extendqisi2
	ldr	r3, .L21+4
	ldr	r3, [r3]
	mov	r2, r0
	add	r3, r3, r2
	ldrb	r2, [fp, #-26]
	orr	r2, r1, r2
	and	r2, r2, #255
	strb	r2, [r3]
	nop
	ldr	r3, .L21
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L20
	bl	__stack_chk_fail
.L20:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L22:
	.align	2
.L21:
	.word	.LC0
	.word	pixmap
	.word	mapwidth
	.size	plotrgb, .-plotrgb
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	addtile
	.syntax unified
	.arm
	.fpu softvfp
	.type	addtile, %function
addtile:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #172
	str	r0, [fp, #-176]
	str	r1, [fp, #-180]
	ldr	r3, .L37
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-169]
	mov	r3, #0
	str	r3, [fp, #-164]
	b	.L24
.L27:
	mov	r3, #0
	str	r3, [fp, #-160]
	b	.L25
.L26:
	ldr	r3, [fp, #-160]
	ldr	r2, [fp, #-180]
	add	r3, r2, r3
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldrb	r3, [fp, #-169]
	add	r3, r2, r3
	strb	r3, [fp, #-169]
	ldr	r3, [fp, #-160]
	ldr	r2, [fp, #-180]
	add	r2, r2, r3
	ldr	r3, [fp, #-164]
	lsl	r1, r3, #3
	ldr	r3, [fp, #-160]
	add	r3, r1, r3
	ldrb	r2, [r2]	@ zero_extendqisi2
	sub	r1, fp, #12
	add	r3, r1, r3
	strb	r2, [r3, #-140]
	ldr	r3, [fp, #-160]
	add	r3, r3, #1
	str	r3, [fp, #-160]
.L25:
	ldr	r3, [fp, #-160]
	cmp	r3, #7
	ble	.L26
	ldr	r3, .L37+4
	ldr	r3, [r3]
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-180]
	add	r3, r3, r2
	str	r3, [fp, #-180]
	ldr	r3, [fp, #-164]
	add	r3, r3, #1
	str	r3, [fp, #-164]
.L24:
	ldr	r3, [fp, #-164]
	cmp	r3, #15
	ble	.L27
	ldrb	r3, [fp, #-169]	@ zero_extendqisi2
	ldr	r2, .L37+8
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-168]
	b	.L28
.L31:
	ldr	r1, [fp, #-168]
	sub	r3, fp, #152
	mov	r2, #128
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L36
	ldr	r3, [fp, #-168]
	ldr	r3, [r3, #128]
	str	r3, [fp, #-168]
.L28:
	ldr	r3, [fp, #-168]
	cmp	r3, #0
	bne	.L31
	b	.L30
.L36:
	nop
.L30:
	ldr	r3, [fp, #-168]
	cmp	r3, #0
	bne	.L32
	ldr	r3, .L37+12
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L37+12
	str	r2, [r1]
	str	r3, [fp, #-156]
	ldr	r3, [fp, #-156]
	str	r3, [fp, #-20]
	ldrb	r3, [fp, #-169]	@ zero_extendqisi2
	ldr	r2, .L37+8
	ldr	r3, [r2, r3, lsl #2]
	str	r3, [fp, #-24]
	ldrb	r4, [fp, #-169]	@ zero_extendqisi2
	mov	r0, #136
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L37+8
	str	r2, [r3, r4, lsl #2]
	ldrb	r3, [fp, #-169]	@ zero_extendqisi2
	ldr	r2, .L37+8
	ldr	r3, [r2, r3, lsl #2]
	sub	r1, fp, #152
	mov	r2, #136
	mov	r0, r3
	bl	memcpy
	sub	r0, fp, #152
	ldr	r3, [fp, #-176]
	mov	r2, #8
	mov	r1, #16
	bl	fwrite
	ldrb	r3, [fp, #-169]	@ zero_extendqisi2
	ldr	r2, .L37+16
	ldr	r2, [r2, r3, lsl #2]
	add	r2, r2, #1
	ldr	r1, .L37+16
	str	r2, [r1, r3, lsl #2]
	b	.L33
.L32:
	ldr	r3, [fp, #-168]
	ldr	r3, [r3, #132]
	str	r3, [fp, #-156]
.L33:
	ldr	r3, [fp, #-156]
	ldr	r2, .L37
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L35
	bl	__stack_chk_fail
.L35:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L38:
	.align	2
.L37:
	.word	.LC1
	.word	mapwidth
	.word	hashlist
	.word	tilecount
	.word	hashcount
	.size	addtile, .-addtile
	.section	.rodata
	.align	2
.LC2:
	.ascii	"P6\012\000"
	.align	2
.LC3:
	.ascii	"PBM header: Missing P6 %s\012\000"
	.align	2
.LC4:
	.ascii	"%d %d\012\000"
	.align	2
.LC5:
	.ascii	"PBM header: Missing width %s\012\000"
	.align	2
.LC6:
	.ascii	"%d\012\000"
	.align	2
.LC7:
	.ascii	"PBM header: Missing height %s\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	readheader
	.syntax unified
	.arm
	.fpu softvfp
	.type	readheader, %function
readheader:
	@ args = 0, pretend = 0, frame = 104
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #104
	str	r0, [fp, #-96]
	str	r1, [fp, #-100]
	str	r2, [fp, #-104]
	str	r3, [fp, #-108]
	ldr	r3, .L49
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #88
	ldr	r2, [fp, #-96]
	mov	r1, #80
	mov	r0, r3
	bl	fgets
	sub	r3, fp, #88
	ldr	r1, .L49+4
	mov	r0, r3
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	beq	.L40
	ldr	r3, .L49+8
	ldr	r3, [r3]
	sub	r2, fp, #88
	ldr	r1, .L49+12
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	b	.L46
.L40:
	sub	r3, fp, #88
	ldr	r2, [fp, #-96]
	mov	r1, #80
	mov	r0, r3
	bl	fgets
	ldrb	r3, [fp, #-88]	@ zero_extendqisi2
	cmp	r3, #35
	beq	.L40
	sub	r0, fp, #88
	ldr	r3, [fp, #-104]
	ldr	r2, [fp, #-100]
	ldr	r1, .L49+16
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #2
	beq	.L48
	cmp	r3, #2
	bgt	.L43
	cmp	r3, #0
	beq	.L44
	cmp	r3, #1
	beq	.L45
	b	.L43
.L44:
	ldr	r3, .L49+8
	ldr	r3, [r3]
	sub	r2, fp, #88
	ldr	r1, .L49+20
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	b	.L46
.L45:
	ldr	r2, [fp, #-104]
	ldr	r1, .L49+24
	ldr	r0, [fp, #-96]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmp	r3, #0
	bne	.L48
	ldr	r3, .L49+8
	ldr	r3, [r3]
	sub	r2, fp, #88
	ldr	r1, .L49+28
	mov	r0, r3
	bl	fprintf
	mov	r3, #0
	b	.L46
.L48:
	nop
.L43:
	ldr	r2, [fp, #-108]
	ldr	r1, .L49+24
	ldr	r0, [fp, #-96]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmp	r3, #1
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
.L46:
	ldr	r2, .L49
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L47
	bl	__stack_chk_fail
.L47:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC8
	.word	.LC2
	.word	stderr
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	readheader, .-readheader
	.global	__aeabi_d2f
	.global	__aeabi_i2f
	.global	__aeabi_f2d
	.global	__aeabi_ddiv
	.global	__aeabi_dmul
	.global	__aeabi_d2uiz
	.section	.rodata
	.align	2
.LC9:
	.ascii	"%s.pnm\000"
	.align	2
.LC10:
	.ascii	"rb\000"
	.align	2
.LC11:
	.ascii	"Can't open %s\012\000"
	.align	2
.LC12:
	.ascii	"Missing basename\012\000"
	.align	2
.LC13:
	.ascii	"Not a valid PBM file.\012\000"
	.align	2
.LC14:
	.ascii	"%s.set\000"
	.align	2
.LC15:
	.ascii	"%s.map\000"
	.align	2
.LC16:
	.ascii	"wb\000"
	.align	2
.LC17:
	.ascii	"Hash count[%d]: %d\012\000"
	.align	2
.LC18:
	.ascii	"Tile count: %d\012\000"
	.align	2
.LC19:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 328
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #336
	str	r0, [fp, #-336]
	str	r1, [fp, #-340]
	ldr	r3, .L83
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L52
.L53:
	ldr	r3, [fp, #-308]
	and	r1, r3, #255
	ldr	r2, .L83+4
	ldr	r3, [fp, #-308]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-308]
.L52:
	ldr	r3, [fp, #-308]
	cmp	r3, #255
	ble	.L53
	mov	r3, #1
	strb	r3, [fp, #-325]
	mov	r3, #0
	strb	r3, [fp, #-324]
	b	.L54
.L61:
	ldr	r3, [fp, #-336]
	cmp	r3, #2
	ble	.L55
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #103
	bne	.L55
	ldr	r3, [fp, #-340]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	atof
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2f
	mov	r3, r0
	str	r3, [fp, #-296]	@ float
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L56
.L57:
	ldr	r0, [fp, #-308]
	bl	__aeabi_i2f
	mov	r3, r0
	mov	r0, r3
	bl	__aeabi_f2d
	mov	r2, #0
	ldr	r3, .L83+8
	bl	__aeabi_ddiv
	mov	r2, r0
	mov	r3, r1
	mov	r4, r2
	mov	r5, r3
	ldr	r0, [fp, #-296]	@ float
	bl	__aeabi_f2d
	mov	r2, r0
	mov	r3, r1
	mov	r0, r4
	mov	r1, r5
	bl	pow
	mov	r2, #0
	ldr	r3, .L83+8
	bl	__aeabi_dmul
	mov	r2, r0
	mov	r3, r1
	mov	r0, r2
	mov	r1, r3
	bl	__aeabi_d2uiz
	mov	r3, r0
	and	r1, r3, #255
	ldr	r2, .L83+4
	ldr	r3, [fp, #-308]
	add	r3, r2, r3
	mov	r2, r1
	strb	r2, [r3]
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-308]
.L56:
	ldr	r3, [fp, #-308]
	cmp	r3, #255
	ble	.L57
	ldr	r3, [fp, #-336]
	sub	r3, r3, #1
	str	r3, [fp, #-336]
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	str	r3, [fp, #-340]
	b	.L58
.L55:
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #110
	bne	.L59
	mov	r3, #0
	strb	r3, [fp, #-325]
	b	.L58
.L59:
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #115
	bne	.L58
	mov	r3, #1
	strb	r3, [fp, #-324]
.L58:
	ldr	r3, [fp, #-336]
	sub	r3, r3, #1
	str	r3, [fp, #-336]
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	str	r3, [fp, #-340]
.L54:
	ldr	r3, [fp, #-336]
	cmp	r3, #1
	ble	.L60
	ldr	r3, [fp, #-340]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L61
.L60:
	ldr	r3, [fp, #-336]
	cmp	r3, #1
	ble	.L62
	ldr	r3, [fp, #-340]
	ldr	r3, [r3, #4]
	str	r3, [fp, #-292]
	sub	r3, fp, #256
	ldr	r2, [fp, #-292]
	ldr	r1, .L83+12
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #256
	ldr	r1, .L83+16
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-288]
	ldr	r3, [fp, #-288]
	cmp	r3, #0
	bne	.L63
	ldr	r3, .L83+20
	ldr	r3, [r3]
	sub	r2, fp, #256
	ldr	r1, .L83+24
	mov	r0, r3
	bl	fprintf
	mvn	r3, #0
	b	.L81
.L62:
	ldr	r3, .L83+20
	ldr	r3, [r3]
	mov	r2, #17
	mov	r1, #1
	ldr	r0, .L83+28
	bl	fwrite
	mvn	r3, #0
	b	.L81
.L63:
	sub	r3, fp, #312
	sub	r2, fp, #316
	sub	r1, fp, #320
	ldr	r0, [fp, #-288]
	bl	readheader
	mov	r3, r0
	cmp	r3, #0
	bne	.L65
	ldr	r3, .L83+20
	ldr	r3, [r3]
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L83+32
	bl	fwrite
	mvn	r3, #0
	b	.L81
.L65:
	ldr	r3, [fp, #-320]
	add	r2, r3, #15
	ldr	r3, .L83+36
	and	r3, r3, r2
	ldr	r2, .L83+40
	str	r3, [r2]
	ldr	r3, [fp, #-316]
	add	r2, r3, #15
	ldr	r3, .L83+36
	and	r3, r3, r2
	ldr	r2, .L83+44
	str	r3, [r2]
	ldr	r3, .L83+40
	ldr	r3, [r3]
	ldr	r2, .L83+44
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L83+48
	str	r2, [r3]
	ldr	r3, .L83+48
	ldr	r0, [r3]
	ldr	r3, .L83+40
	ldr	r3, [r3]
	ldr	r2, .L83+44
	ldr	r2, [r2]
	mul	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	mov	r1, #0
	bl	memset
	mov	r3, #0
	str	r3, [fp, #-304]
	b	.L66
.L71:
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L67
.L70:
	ldr	r0, [fp, #-288]
	bl	getc
	mov	r3, r0
	ldr	r2, .L83+4
	ldrb	r3, [r2, r3]
	strb	r3, [fp, #-323]
	ldr	r0, [fp, #-288]
	bl	getc
	mov	r3, r0
	ldr	r2, .L83+4
	ldrb	r3, [r2, r3]
	strb	r3, [fp, #-322]
	ldr	r0, [fp, #-288]
	bl	getc
	mov	r3, r0
	ldr	r2, .L83+4
	ldrb	r3, [r2, r3]
	strb	r3, [fp, #-321]
	ldrb	r3, [fp, #-325]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L68
	ldrb	r1, [fp, #-322]	@ zero_extendqisi2
	ldrb	r2, [fp, #-323]	@ zero_extendqisi2
	ldrb	r3, [fp, #-321]	@ zero_extendqisi2
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, [fp, #-304]
	ldr	r0, [fp, #-308]
	bl	plotrgb
	b	.L69
.L68:
	ldrb	r2, [fp, #-321]	@ zero_extendqisi2
	sub	r3, fp, #276
	ldrb	r1, [fp, #-322]	@ zero_extendqisi2
	ldrb	r0, [fp, #-323]	@ zero_extendqisi2
	bl	brush
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-304]
	ldr	r0, [fp, #-308]
	bl	plot
.L69:
	ldr	r3, [fp, #-308]
	add	r3, r3, #1
	str	r3, [fp, #-308]
.L67:
	ldr	r3, [fp, #-320]
	ldr	r2, [fp, #-308]
	cmp	r2, r3
	blt	.L70
	ldr	r3, [fp, #-304]
	add	r3, r3, #1
	str	r3, [fp, #-304]
.L66:
	ldr	r3, [fp, #-316]
	ldr	r2, [fp, #-304]
	cmp	r2, r3
	blt	.L71
	ldr	r0, [fp, #-288]
	bl	fclose
	sub	r3, fp, #176
	ldr	r2, [fp, #-292]
	ldr	r1, .L83+52
	mov	r0, r3
	bl	sprintf
	sub	r3, fp, #96
	ldr	r2, [fp, #-292]
	ldr	r1, .L83+56
	mov	r0, r3
	bl	sprintf
	mov	r3, #0
	str	r3, [fp, #-300]
	b	.L72
.L73:
	ldr	r2, .L83+60
	ldr	r3, [fp, #-300]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r2, .L83+64
	ldr	r3, [fp, #-300]
	mov	r1, #0
	str	r1, [r2, r3, lsl #2]
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L72:
	ldr	r3, [fp, #-300]
	cmp	r3, #255
	ble	.L73
	sub	r3, fp, #176
	ldr	r1, .L83+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-284]
	sub	r3, fp, #96
	ldr	r1, .L83+68
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-280]
	ldr	r3, .L83+40
	ldr	r3, [r3]
	add	r2, r3, #15
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #4
	and	r3, r3, #255
	strb	r3, [fp, #-260]
	ldr	r3, .L83+40
	ldr	r3, [r3]
	add	r2, r3, #15
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #4
	asr	r3, r3, #8
	and	r3, r3, #255
	strb	r3, [fp, #-259]
	ldr	r3, .L83+44
	ldr	r3, [r3]
	add	r2, r3, #15
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #4
	and	r3, r3, #255
	strb	r3, [fp, #-258]
	ldr	r3, .L83+44
	ldr	r3, [r3]
	add	r2, r3, #15
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #4
	asr	r3, r3, #8
	and	r3, r3, #255
	strb	r3, [fp, #-257]
	sub	r0, fp, #260
	ldr	r3, [fp, #-280]
	mov	r2, #4
	mov	r1, #1
	bl	fwrite
	mov	r3, #0
	str	r3, [fp, #-304]
	b	.L74
.L77:
	mov	r3, #0
	str	r3, [fp, #-308]
	b	.L75
.L76:
	ldr	r3, .L83+48
	ldr	r2, [r3]
	ldr	r3, .L83+40
	ldr	r3, [r3]
	ldr	r1, [fp, #-304]
	mul	r1, r3, r1
	ldr	r3, [fp, #-308]
	add	r3, r1, r3
	lsr	r1, r3, #31
	add	r3, r1, r3
	asr	r3, r3, #1
	add	r3, r2, r3
	mov	r1, r3
	ldr	r0, [fp, #-284]
	bl	addtile
	str	r0, [fp, #-300]
	ldr	r3, [fp, #-300]
	and	r3, r3, #255
	strb	r3, [fp, #-260]
	ldr	r3, [fp, #-300]
	asr	r3, r3, #8
	and	r3, r3, #255
	strb	r3, [fp, #-259]
	sub	r0, fp, #260
	ldr	r3, [fp, #-280]
	mov	r2, #2
	mov	r1, #1
	bl	fwrite
	ldr	r3, [fp, #-308]
	add	r3, r3, #16
	str	r3, [fp, #-308]
.L75:
	ldr	r3, .L83+40
	ldr	r3, [r3]
	ldr	r2, [fp, #-308]
	cmp	r2, r3
	blt	.L76
	ldr	r3, [fp, #-304]
	add	r3, r3, #16
	str	r3, [fp, #-304]
.L74:
	ldr	r3, .L83+44
	ldr	r3, [r3]
	ldr	r2, [fp, #-304]
	cmp	r2, r3
	blt	.L77
	ldr	r0, [fp, #-284]
	bl	fclose
	ldr	r0, [fp, #-280]
	bl	fclose
	ldrb	r3, [fp, #-324]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L78
	mov	r3, #0
	str	r3, [fp, #-300]
	b	.L79
.L80:
	ldr	r2, .L83+64
	ldr	r3, [fp, #-300]
	ldr	r3, [r2, r3, lsl #2]
	mov	r2, r3
	ldr	r1, [fp, #-300]
	ldr	r0, .L83+72
	bl	printf
	ldr	r3, [fp, #-300]
	add	r3, r3, #1
	str	r3, [fp, #-300]
.L79:
	ldr	r3, [fp, #-300]
	cmp	r3, #255
	ble	.L80
	ldr	r3, .L83+76
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L83+80
	bl	printf
.L78:
	mov	r3, #0
.L81:
	ldr	r2, .L83
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L82
	bl	__stack_chk_fail
.L82:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L84:
	.align	2
.L83:
	.word	.LC19
	.word	clrgamma
	.word	1081073664
	.word	.LC9
	.word	.LC10
	.word	stderr
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	65520
	.word	mapwidth
	.word	mapheight
	.word	pixmap
	.word	.LC14
	.word	.LC15
	.word	hashlist
	.word	hashcount
	.word	.LC16
	.word	.LC17
	.word	tilecount
	.word	.LC18
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
