	.file	"280142.c"
	.intel_syntax noprefix
	.text
	.globl	getEndianness
	.type	getEndianness, @function
getEndianness:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -20[rbp], 1
	lea	rax, -20[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 1
	sete	al
	movzx	eax, al
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getEndianness, .-getEndianness
	.globl	readline
	.type	readline, @function
readline:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 144
	mov	QWORD PTR -136[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -104[rbp], 0
	mov	DWORD PTR -108[rbp], 0
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -113[rbp], al
	jmp	.L5
.L10:
	mov	DWORD PTR -112[rbp], 0
	jmp	.L6
.L8:
	mov	eax, DWORD PTR -112[rbp]
	cdqe
	movzx	edx, BYTE PTR -113[rbp]
	mov	BYTE PTR -96[rbp+rax], dl
	add	DWORD PTR -112[rbp], 1
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -113[rbp], al
.L6:
	cmp	DWORD PTR -112[rbp], 79
	jg	.L7
	cmp	BYTE PTR -113[rbp], 10
	je	.L7
	cmp	BYTE PTR -113[rbp], 13
	je	.L7
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L8
.L7:
	cmp	DWORD PTR -112[rbp], 0
	je	.L5
	mov	edx, DWORD PTR -108[rbp]
	mov	eax, DWORD PTR -112[rbp]
	add	eax, edx
	add	eax, 1
	movsx	rdx, eax
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -104[rbp], rax
	mov	eax, DWORD PTR -112[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -108[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -104[rbp]
	add	rcx, rax
	lea	rax, -96[rbp]
	mov	rsi, rax
	mov	rdi, rcx
	call	memcpy@PLT
	mov	edx, DWORD PTR -108[rbp]
	mov	eax, DWORD PTR -112[rbp]
	add	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -104[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	eax, DWORD PTR -112[rbp]
	add	DWORD PTR -108[rbp], eax
.L5:
	cmp	BYTE PTR -113[rbp], 10
	je	.L9
	cmp	BYTE PTR -113[rbp], 13
	je	.L9
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L10
.L9:
	cmp	BYTE PTR -113[rbp], 10
	jne	.L11
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -113[rbp], al
	cmp	BYTE PTR -113[rbp], 13
	jne	.L12
.L11:
	cmp	BYTE PTR -113[rbp], 13
	jne	.L13
	mov	rax, QWORD PTR -136[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -113[rbp], al
	cmp	BYTE PTR -113[rbp], 10
	je	.L13
.L12:
	movsx	eax, BYTE PTR -113[rbp]
	mov	rdx, QWORD PTR -136[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ungetc@PLT
.L13:
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	readline, .-readline
	.globl	getTokenString
	.type	getTokenString, @function
getTokenString:
.LFB8:
	.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, 200
	.cfi_offset 3, -24
	mov	QWORD PTR -152[rbp], rdi
	mov	QWORD PTR -160[rbp], rsi
	mov	QWORD PTR -168[rbp], rdx
	mov	QWORD PTR -176[rbp], rcx
	mov	QWORD PTR -184[rbp], r8
	mov	QWORD PTR -192[rbp], r9
	mov	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -140[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -128[rbp], 0
	mov	DWORD PTR -136[rbp], 0
	mov	DWORD PTR -132[rbp], 0
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
	cmp	BYTE PTR -141[rbp], 80
	jne	.L17
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
	movsx	eax, BYTE PTR -141[rbp]
	cmp	eax, 50
	je	.L20
	jmp	.L43
.L17:
	mov	eax, -1
	jmp	.L41
.L43:
	cmp	eax, 53
	jne	.L21
.L20:
	movsx	eax, BYTE PTR -141[rbp]
	lea	edx, -48[rax]
	mov	rax, QWORD PTR -160[rbp]
	mov	DWORD PTR [rax], edx
	nop
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
	jmp	.L23
.L21:
	mov	eax, -1
	jmp	.L41
.L25:
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -192[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -128[rbp], rax
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -128[rbp]
	lea	rbx, [rdx+rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	readline
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
.L24:
	cmp	BYTE PTR -141[rbp], 35
	je	.L25
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	movsx	rax, BYTE PTR -141[rbp]
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 8192
	test	eax, eax
	je	.L26
	cmp	DWORD PTR -140[rbp], 0
	jle	.L44
	mov	rax, QWORD PTR -168[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L28
	mov	rax, QWORD PTR -168[rbp]
	mov	edx, DWORD PTR -140[rbp]
	mov	DWORD PTR [rax], edx
	jmp	.L29
.L28:
	mov	rax, QWORD PTR -176[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L30
	mov	rax, QWORD PTR -176[rbp]
	mov	edx, DWORD PTR -140[rbp]
	mov	DWORD PTR [rax], edx
	jmp	.L29
.L30:
	mov	rax, QWORD PTR -184[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L29
	mov	rax, QWORD PTR -184[rbp]
	mov	edx, DWORD PTR -140[rbp]
	mov	DWORD PTR [rax], edx
.L29:
	add	DWORD PTR -136[rbp], 1
	mov	DWORD PTR -140[rbp], 0
	jmp	.L44
.L26:
	call	__ctype_b_loc@PLT
	mov	rdx, QWORD PTR [rax]
	movsx	rax, BYTE PTR -141[rbp]
	add	rax, rax
	add	rax, rdx
	movzx	eax, WORD PTR [rax]
	movzx	eax, ax
	and	eax, 2048
	test	eax, eax
	je	.L32
	mov	edx, DWORD PTR -140[rbp]
	mov	eax, edx
	sal	eax, 2
	add	eax, edx
	add	eax, eax
	mov	edx, eax
	movsx	eax, BYTE PTR -141[rbp]
	add	eax, edx
	sub	eax, 48
	mov	DWORD PTR -140[rbp], eax
	jmp	.L31
.L32:
	mov	DWORD PTR -132[rbp], -2
	jmp	.L33
.L44:
	nop
.L31:
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
.L23:
	cmp	BYTE PTR -141[rbp], 0
	je	.L35
	cmp	DWORD PTR -136[rbp], 2
	jle	.L24
.L33:
	jmp	.L35
.L36:
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -192[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	QWORD PTR -128[rbp], rax
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 3
	lea	rdx, -8[rax]
	mov	rax, QWORD PTR -128[rbp]
	lea	rbx, [rdx+rax]
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	readline
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	fgetc@PLT
	mov	BYTE PTR -141[rbp], al
.L35:
	cmp	BYTE PTR -141[rbp], 35
	je	.L36
	movsx	eax, BYTE PTR -141[rbp]
	mov	rdx, QWORD PTR -152[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	ungetc@PLT
	cmp	QWORD PTR -200[rbp], 0
	je	.L39
	mov	rax, QWORD PTR -200[rbp]
	mov	rdx, QWORD PTR -128[rbp]
	mov	QWORD PTR [rax], rdx
	jmp	.L38
.L40:
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, -1[rax]
	mov	rax, QWORD PTR -192[rbp]
	mov	DWORD PTR [rax], edx
.L39:
	mov	rax, QWORD PTR -192[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L40
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	free@PLT
.L38:
	mov	eax, 1
.L41:
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L42
	call	__stack_chk_fail@PLT
.L42:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	getTokenString, .-getTokenString
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	readData
	.type	readData, @function
readData:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -36[rbp], edx
	cmp	DWORD PTR -36[rbp], 5
	je	.L46
	cmp	DWORD PTR -36[rbp], 6
	jne	.L47
.L46:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR [rax]
	movzx	ecx, ax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	eax, ax
	imul	ecx, eax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	imul	eax, ecx
	movsx	rsi, eax
	mov	rax, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR -32[rbp]
	movzx	edx, WORD PTR 4[rdx]
	movzx	edx, dx
	cmp	rax, rdx
	sete	al
	movzx	eax, al
	jmp	.L45
.L47:
	cmp	DWORD PTR -36[rbp], 2
	jne	.L49
	mov	DWORD PTR -4[rbp], 0
	jmp	.L50
.L52:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	add	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	add	DWORD PTR -4[rbp], 1
.L50:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	eax, ax
	imul	eax, edx
	cmp	DWORD PTR -4[rbp], eax
	jge	.L51
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L52
.L51:
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 4[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	eax, ax
	imul	eax, edx
	cmp	DWORD PTR -4[rbp], eax
	je	.L49
	mov	eax, 0
	jmp	.L45
.L49:
.L45:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	readData, .-readData
	.section	.rodata
.LC1:
	.string	"rb"
.LC2:
	.string	"%d %d %d %d\n"
	.text
	.globl	readPgm
	.type	readPgm, @function
readPgm:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 112
	mov	QWORD PTR -72[rbp], rdi
	mov	QWORD PTR -80[rbp], rsi
	mov	QWORD PTR -88[rbp], rdx
	mov	QWORD PTR -96[rbp], rcx
	mov	QWORD PTR -104[rbp], r8
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -56[rbp], 0
	mov	DWORD PTR -52[rbp], 0
	mov	DWORD PTR -48[rbp], 0
	mov	DWORD PTR -40[rbp], 0
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	DWORD PTR -32[rbp], 1
	mov	DWORD PTR -44[rbp], 0
	mov	r8, QWORD PTR -88[rbp]
	lea	rdi, -48[rbp]
	lea	rcx, -56[rbp]
	lea	rdx, -52[rbp]
	lea	rsi, -44[rbp]
	mov	rax, QWORD PTR -24[rbp]
	sub	rsp, 8
	push	QWORD PTR -96[rbp]
	mov	r9, r8
	mov	r8, rdi
	mov	rdi, rax
	call	getTokenString
	add	rsp, 16
	mov	rax, QWORD PTR -88[rbp]
	mov	esi, DWORD PTR [rax]
	mov	ecx, DWORD PTR -48[rbp]
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -56[rbp]
	mov	r8d, esi
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -36[rbp], 0
	jmp	.L54
.L55:
	mov	rax, QWORD PTR -96[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	eax, DWORD PTR -36[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	puts@PLT
	add	DWORD PTR -36[rbp], 1
.L54:
	mov	rax, QWORD PTR -88[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -36[rbp], eax
	jl	.L55
	mov	eax, DWORD PTR -48[rbp]
	test	eax, eax
	jle	.L56
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, 65535
	jg	.L56
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, 255
	jle	.L57
	mov	eax, DWORD PTR -48[rbp]
	cmp	eax, 65534
	jg	.L57
	mov	eax, 2
	jmp	.L58
.L57:
	mov	eax, 1
.L58:
	mov	DWORD PTR -48[rbp], eax
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, 2
	je	.L59
	jmp	.L72
.L56:
	mov	eax, -2
	jmp	.L70
.L72:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, 5
	jne	.L62
.L59:
	mov	DWORD PTR -40[rbp], 1
	jmp	.L63
.L62:
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, 3
	je	.L64
	mov	eax, DWORD PTR -44[rbp]
	cmp	eax, 6
	jne	.L65
.L64:
	mov	DWORD PTR -40[rbp], 1
.L63:
	jmp	.L65
.L68:
	mov	eax, DWORD PTR -56[rbp]
	mov	DWORD PTR -28[rbp], eax
	mov	edi, 24
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -56[rbp]
	imul	edx, eax
	mov	eax, DWORD PTR -48[rbp]
	imul	eax, edx
	imul	eax, DWORD PTR -40[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR 8[rax], rdx
	mov	eax, DWORD PTR -56[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	WORD PTR 4[rax], dx
	mov	eax, DWORD PTR -52[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	WORD PTR 2[rax], dx
	mov	eax, DWORD PTR -48[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	WORD PTR 6[rax], dx
	mov	eax, DWORD PTR -40[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	WORD PTR [rax], dx
	mov	edx, DWORD PTR -44[rbp]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	readData
	test	eax, eax
	je	.L73
	mov	rax, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR [rax]
	add	eax, 1
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -104[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rsi, rdx
	mov	rdi, rax
	call	realloc@PLT
	mov	rdx, QWORD PTR -104[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR [rax]
	lea	edx, 1[rax]
	mov	rax, QWORD PTR -80[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -104[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -80[rbp]
	mov	eax, DWORD PTR [rax]
	cdqe
	sal	rax, 3
	sub	rax, 8
	add	rdx, rax
	mov	rax, QWORD PTR -16[rbp]
	mov	QWORD PTR [rdx], rax
.L65:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	feof@PLT
	test	eax, eax
	je	.L68
	jmp	.L67
.L73:
	nop
.L67:
	cmp	QWORD PTR -24[rbp], 0
	je	.L69
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L69:
	mov	eax, DWORD PTR -32[rbp]
.L70:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L71
	call	__stack_chk_fail@PLT
.L71:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	readPgm, .-readPgm
	.section	.rodata
.LC3:
	.string	"%s_%03d.pgm"
.LC4:
	.string	"wb+"
.LC5:
	.string	"P5 %d %d %d "
	.text
	.globl	writePgm
	.type	writePgm, @function
writePgm:
.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, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	DWORD PTR -24[rbp], 0
	mov	QWORD PTR -8[rbp], 0
	mov	eax, 0
	call	getEndianness
	mov	DWORD PTR -20[rbp], eax
	mov	DWORD PTR -28[rbp], 0
	jmp	.L75
.L76:
	add	DWORD PTR -28[rbp], 1
.L75:
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L76
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 8
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L77
	mov	DWORD PTR -24[rbp], -1
	jmp	.L78
.L77:
	mov	DWORD PTR -32[rbp], 0
	jmp	.L79
.L83:
	mov	ecx, DWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	sprintf@PLT
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 0
	jne	.L80
	mov	DWORD PTR -24[rbp], -2
	jmp	.L78
.L80:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, WORD PTR 6[rax]
	cmp	ax, 8
	jne	.L81
	mov	esi, 255
	jmp	.L82
.L81:
	mov	esi, 65025
.L82:
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, WORD PTR 4[rax]
	movzx	ecx, ax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, WORD PTR 2[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -16[rbp]
	mov	r8d, esi
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	movzx	eax, WORD PTR 4[rax]
	movzx	edx, ax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	movzx	eax, WORD PTR 2[rax]
	movzx	esi, ax
	mov	eax, DWORD PTR -32[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -48[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR -16[rbp], 0
	add	DWORD PTR -32[rbp], 1
.L79:
	mov	eax, DWORD PTR -32[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L83
	nop
.L78:
	cmp	QWORD PTR -8[rbp], 0
	je	.L84
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
.L84:
	cmp	QWORD PTR -16[rbp], 0
	je	.L85
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L85:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	writePgm, .-writePgm
	.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	"280142.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getEndianness
	.syntax unified
	.arm
	.fpu softvfp
	.type	getEndianness, %function
getEndianness:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-16]
	sub	r3, fp, #16
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #1
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	ldr	r2, .L4
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L3
	bl	__stack_chk_fail
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L5:
	.align	2
.L4:
	.word	.LC0
	.size	getEndianness, .-getEndianness
	.section	.rodata
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	readline
	.syntax unified
	.arm
	.fpu softvfp
	.type	readline, %function
readline:
	@ args = 0, pretend = 0, frame = 112
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #112
	str	r0, [fp, #-112]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-100]
	mov	r3, #0
	str	r3, [fp, #-92]
	ldr	r0, [fp, #-112]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-101]
	b	.L7
.L12:
	mov	r3, #0
	str	r3, [fp, #-96]
	b	.L8
.L10:
	sub	r2, fp, #88
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	ldrb	r2, [fp, #-101]
	strb	r2, [r3]
	ldr	r3, [fp, #-96]
	add	r3, r3, #1
	str	r3, [fp, #-96]
	ldr	r0, [fp, #-112]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-101]
.L8:
	ldr	r3, [fp, #-96]
	cmp	r3, #79
	bgt	.L9
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L9
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #13
	beq	.L9
	ldr	r0, [fp, #-112]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
.L9:
	ldr	r3, [fp, #-96]
	cmp	r3, #0
	beq	.L7
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-100]
	bl	realloc
	str	r0, [fp, #-100]
	ldr	r3, [fp, #-92]
	ldr	r2, [fp, #-100]
	add	r3, r2, r3
	ldr	r2, [fp, #-96]
	sub	r1, fp, #88
	mov	r0, r3
	bl	memcpy
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-100]
	add	r3, r3, r2
	mov	r2, #0
	strb	r2, [r3]
	ldr	r2, [fp, #-92]
	ldr	r3, [fp, #-96]
	add	r3, r2, r3
	str	r3, [fp, #-92]
.L7:
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L11
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #13
	beq	.L11
	ldr	r0, [fp, #-112]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
.L11:
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #10
	bne	.L13
	ldr	r0, [fp, #-112]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-101]
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #13
	bne	.L14
.L13:
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #13
	bne	.L15
	ldr	r0, [fp, #-112]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-101]
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	cmp	r3, #10
	beq	.L15
.L14:
	ldrb	r3, [fp, #-101]	@ zero_extendqisi2
	ldr	r1, [fp, #-112]
	mov	r0, r3
	bl	ungetc
.L15:
	ldr	r3, [fp, #-100]
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC1
	.size	readline, .-readline
	.section	.rodata
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getTokenString
	.syntax unified
	.arm
	.fpu softvfp
	.type	getTokenString, %function
getTokenString:
	@ args = 12, pretend = 0, frame = 144
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #148
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	str	r2, [fp, #-136]
	str	r3, [fp, #-140]
	ldr	r3, [fp, #4]
	str	r3, [fp, #-144]
	ldr	r3, [fp, #8]
	str	r3, [fp, #-148]
	ldr	r3, [fp, #12]
	str	r3, [fp, #-152]
	ldr	r3, .L49
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-104]
	mov	r3, #0
	str	r3, [fp, #-112]
	mov	r3, #0
	str	r3, [fp, #-108]
	mov	r3, #0
	str	r3, [fp, #-100]
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	cmp	r3, #80
	bne	.L21
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	cmp	r3, #50
	beq	.L24
	b	.L47
.L21:
	mvn	r3, #0
	b	.L45
.L47:
	cmp	r3, #53
	bne	.L25
.L24:
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	sub	r2, r3, #48
	ldr	r3, [fp, #-132]
	str	r2, [r3]
	nop
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
	b	.L27
.L25:
	mvn	r3, #0
	b	.L45
.L29:
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-148]
	str	r2, [r3]
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	realloc
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-112]
	add	r4, r2, r3
	ldr	r0, [fp, #-128]
	bl	readline
	mov	r3, r0
	str	r3, [r4]
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
.L28:
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	cmp	r3, #35
	beq	.L29
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #8192
	cmp	r3, #0
	beq	.L30
	ldr	r3, [fp, #-116]
	cmp	r3, #0
	ble	.L48
	ldr	r3, [fp, #-136]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L32
	ldr	r3, [fp, #-136]
	ldr	r2, [fp, #-116]
	str	r2, [r3]
	b	.L33
.L32:
	ldr	r3, [fp, #-140]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L34
	ldr	r3, [fp, #-140]
	ldr	r2, [fp, #-116]
	str	r2, [r3]
	b	.L33
.L34:
	ldr	r3, [fp, #-144]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L33
	ldr	r3, [fp, #-144]
	ldr	r2, [fp, #-116]
	str	r2, [r3]
.L33:
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
	mov	r3, #0
	str	r3, [fp, #-116]
	b	.L48
.L30:
	bl	__ctype_b_loc
	mov	r3, r0
	ldr	r2, [r3]
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	lsl	r3, r3, #1
	add	r3, r2, r3
	ldrh	r3, [r3]
	and	r3, r3, #2048
	cmp	r3, #0
	beq	.L36
	ldr	r2, [fp, #-116]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	mov	r2, r3
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	add	r3, r2, r3
	sub	r3, r3, #48
	str	r3, [fp, #-116]
	b	.L35
.L36:
	mvn	r3, #1
	str	r3, [fp, #-100]
	b	.L37
.L48:
	nop
.L35:
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
.L27:
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L39
	ldr	r3, [fp, #-108]
	cmp	r3, #2
	ble	.L28
.L37:
	b	.L39
.L40:
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-148]
	str	r2, [r3]
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	lsl	r3, r3, #2
	mov	r1, r3
	ldr	r0, [fp, #-112]
	bl	realloc
	str	r0, [fp, #-112]
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	ldr	r2, [fp, #-112]
	add	r4, r2, r3
	ldr	r0, [fp, #-128]
	bl	readline
	mov	r3, r0
	str	r3, [r4]
	ldr	r0, [fp, #-128]
	bl	fgetc
	mov	r3, r0
	strb	r3, [fp, #-117]
.L39:
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	cmp	r3, #35
	beq	.L40
	ldrb	r3, [fp, #-117]	@ zero_extendqisi2
	ldr	r1, [fp, #-128]
	mov	r0, r3
	bl	ungetc
	ldr	r3, [fp, #-152]
	cmp	r3, #0
	beq	.L43
	ldr	r3, [fp, #-152]
	ldr	r2, [fp, #-112]
	str	r2, [r3]
	b	.L42
.L44:
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-112]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, [fp, #-148]
	str	r2, [r3]
.L43:
	ldr	r3, [fp, #-148]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L44
	ldr	r0, [fp, #-112]
	bl	free
.L42:
	mov	r3, #1
.L45:
	ldr	r2, .L49
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L46
	bl	__stack_chk_fail
.L46:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L50:
	.align	2
.L49:
	.word	.LC2
	.size	getTokenString, .-getTokenString
	.section	.rodata
	.align	2
.LC3:
	.ascii	"%d\000"
	.text
	.align	2
	.global	readData
	.syntax unified
	.arm
	.fpu softvfp
	.type	readData, %function
readData:
	@ 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	r0, [fp, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #5
	beq	.L52
	ldr	r3, [fp, #-24]
	cmp	r3, #6
	bne	.L53
.L52:
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #8]
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #2]
	mul	r3, r2, r3
	ldr	r2, [fp, #-20]
	ldrh	r2, [r2, #6]
	mul	r3, r2, r3
	mov	r1, r3
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-16]
	bl	fread
	mov	r2, r0
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #4]
	cmp	r2, r3
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	b	.L51
.L53:
	ldr	r3, [fp, #-24]
	cmp	r3, #2
	bne	.L55
	mov	r3, #0
	str	r3, [fp, #-8]
	b	.L56
.L58:
	ldr	r3, [fp, #-20]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r1, .L59
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L56:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #2]
	mul	r3, r2, r3
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L57
	ldr	r0, [fp, #-16]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L58
.L57:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #2]
	mul	r3, r2, r3
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L55
	mov	r3, #0
	b	.L51
.L55:
.L51:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L60:
	.align	2
.L59:
	.word	.LC3
	.size	readData, .-readData
	.section	.rodata
	.align	2
.LC4:
	.ascii	"rb\000"
	.align	2
.LC5:
	.ascii	"%d %d %d %d\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	readPgm
	.syntax unified
	.arm
	.fpu softvfp
	.type	readPgm, %function
readPgm:
	@ args = 4, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	str	r2, [fp, #-64]
	str	r3, [fp, #-68]
	ldr	r3, [fp, #4]
	str	r3, [fp, #-72]
	ldr	r3, .L82
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-48]
	mov	r3, #0
	str	r3, [fp, #-44]
	mov	r3, #0
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-32]
	ldr	r1, .L82+4
	ldr	r0, [fp, #-56]
	bl	fopen
	str	r0, [fp, #-24]
	mov	r3, #1
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-36]
	sub	r0, fp, #48
	sub	r2, fp, #44
	sub	r1, fp, #36
	ldr	r3, [fp, #-68]
	str	r3, [sp, #8]
	ldr	r3, [fp, #-64]
	str	r3, [sp, #4]
	sub	r3, fp, #40
	str	r3, [sp]
	mov	r3, r0
	ldr	r0, [fp, #-24]
	bl	getTokenString
	ldr	r1, [fp, #-48]
	ldr	r2, [fp, #-44]
	ldr	r0, [fp, #-40]
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
	str	r3, [sp]
	mov	r3, r0
	ldr	r0, .L82+8
	bl	printf
	mov	r3, #0
	str	r3, [fp, #-28]
	b	.L62
.L63:
	ldr	r3, [fp, #-68]
	ldr	r2, [r3]
	ldr	r3, [fp, #-28]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L62:
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L63
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	ble	.L64
	ldr	r3, [fp, #-40]
	cmp	r3, #65536
	bge	.L64
	ldr	r3, [fp, #-40]
	cmp	r3, #255
	ble	.L65
	ldr	r3, [fp, #-40]
	ldr	r2, .L82+12
	cmp	r3, r2
	bgt	.L65
	mov	r3, #2
	b	.L66
.L65:
	mov	r3, #1
.L66:
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-36]
	cmp	r3, #2
	beq	.L67
	b	.L80
.L64:
	mvn	r3, #1
	b	.L78
.L80:
	ldr	r3, [fp, #-36]
	cmp	r3, #5
	bne	.L70
.L67:
	mov	r3, #1
	str	r3, [fp, #-32]
	b	.L71
.L70:
	ldr	r3, [fp, #-36]
	cmp	r3, #3
	beq	.L72
	ldr	r3, [fp, #-36]
	cmp	r3, #6
	bne	.L73
.L72:
	mov	r3, #1
	str	r3, [fp, #-32]
.L71:
	b	.L73
.L76:
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-16]
	mov	r0, #16
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-44]
	ldr	r2, [fp, #-48]
	mul	r3, r2, r3
	ldr	r2, [fp, #-40]
	mul	r3, r2, r3
	ldr	r2, [fp, #-32]
	mul	r3, r2, r3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-12]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-12]
	strh	r2, [r3, #4]	@ movhi
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-12]
	strh	r2, [r3, #2]	@ movhi
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-12]
	strh	r2, [r3, #6]	@ movhi
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-12]
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-36]
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-24]
	bl	readData
	mov	r3, r0
	cmp	r3, #0
	beq	.L81
	ldr	r3, [fp, #-72]
	ldr	r2, [r3]
	ldr	r3, [fp, #-60]
	ldr	r3, [r3]
	add	r3, r3, #1
	lsl	r3, r3, #2
	mov	r1, r3
	mov	r0, r2
	bl	realloc
	mov	r2, r0
	ldr	r3, [fp, #-72]
	str	r2, [r3]
	ldr	r3, [fp, #-60]
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r3, [fp, #-60]
	str	r2, [r3]
	ldr	r3, [fp, #-72]
	ldr	r2, [r3]
	ldr	r3, [fp, #-60]
	ldr	r3, [r3]
	sub	r3, r3, #-1073741823
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [fp, #-12]
	str	r2, [r3]
.L73:
	ldr	r0, [fp, #-24]
	bl	feof
	mov	r3, r0
	cmp	r3, #0
	beq	.L76
	b	.L75
.L81:
	nop
.L75:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L77
	ldr	r0, [fp, #-24]
	bl	fclose
.L77:
	ldr	r3, [fp, #-20]
.L78:
	ldr	r2, .L82
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L79
	bl	__stack_chk_fail
.L79:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L83:
	.align	2
.L82:
	.word	.LC6
	.word	.LC4
	.word	.LC5
	.word	65534
	.size	readPgm, .-readPgm
	.section	.rodata
	.align	2
.LC7:
	.ascii	"%s_%03d.pgm\000"
	.align	2
.LC8:
	.ascii	"wb+\000"
	.align	2
.LC9:
	.ascii	"P5 %d %d %d \000"
	.text
	.align	2
	.global	writePgm
	.syntax unified
	.arm
	.fpu softvfp
	.type	writePgm, %function
writePgm:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	str	r2, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-12]
	bl	getEndianness
	str	r0, [fp, #-8]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L85
.L86:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L85:
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L86
	ldr	r3, [fp, #-20]
	add	r3, r3, #8
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-32]
	cmp	r3, #0
	bne	.L87
	mvn	r3, #0
	str	r3, [fp, #-16]
	b	.L88
.L87:
	mov	r3, #0
	str	r3, [fp, #-24]
	b	.L89
.L93:
	ldr	r3, [fp, #-24]
	ldr	r2, [fp, #-32]
	ldr	r1, .L96
	ldr	r0, [fp, #-12]
	bl	sprintf
	ldr	r1, .L96+4
	ldr	r0, [fp, #-12]
	bl	fopen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L90
	mvn	r3, #1
	str	r3, [fp, #-16]
	b	.L88
.L90:
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrh	r3, [r3, #2]
	mov	r1, r3
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrh	r3, [r3, #4]
	mov	r0, r3
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrh	r3, [r3, #6]
	cmp	r3, #8
	bne	.L91
	mov	r3, #255
	b	.L92
.L91:
	ldr	r3, .L96+8
.L92:
	str	r3, [sp]
	mov	r3, r0
	mov	r2, r1
	ldr	r1, .L96+12
	ldr	r0, [fp, #-28]
	bl	fprintf
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r0, [r3, #8]
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrh	r3, [r3, #2]
	mov	r1, r3
	ldr	r3, [fp, #-24]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	ldr	r3, [r3]
	ldrh	r3, [r3, #4]
	mov	r2, r3
	ldr	r3, [fp, #-28]
	bl	fwrite
	ldr	r0, [fp, #-28]
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-24]
.L89:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L93
	nop
.L88:
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	beq	.L94
	ldr	r0, [fp, #-12]
	bl	free
.L94:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	beq	.L95
	ldr	r0, [fp, #-28]
	bl	fclose
.L95:
	nop
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L97:
	.align	2
.L96:
	.word	.LC7
	.word	.LC8
	.word	65025
	.word	.LC9
	.size	writePgm, .-writePgm
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
