	.file	"157514.c"
	.intel_syntax noprefix
	.text
	.globl	bwtorgba
	.type	bwtorgba, @function
bwtorgba:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR -20[rbp], edx
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -8[rbp]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 2[rax]
	mov	rax, QWORD PTR -8[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 3
	mov	BYTE PTR [rax], -1
	add	QWORD PTR -16[rbp], 4
	add	QWORD PTR -8[rbp], 1
.L2:
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -20[rbp], edx
	test	eax, eax
	jne	.L3
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	bwtorgba, .-bwtorgba
	.globl	rgbtorgba
	.type	rgbtorgba, @function
rgbtorgba:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	mov	QWORD PTR -32[rbp], rcx
	mov	DWORD PTR -36[rbp], r8d
	jmp	.L5
.L6:
	mov	rax, QWORD PTR -8[rbp]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -32[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 2[rax]
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 3
	mov	BYTE PTR [rax], -1
	add	QWORD PTR -32[rbp], 4
	add	QWORD PTR -8[rbp], 1
	add	QWORD PTR -16[rbp], 1
	add	QWORD PTR -24[rbp], 1
.L5:
	mov	eax, DWORD PTR -36[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -36[rbp], edx
	test	eax, eax
	jne	.L6
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	rgbtorgba, .-rgbtorgba
	.globl	rgbatorgba
	.type	rgbatorgba, @function
rgbatorgba:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	QWORD PTR -24[rbp], rdx
	mov	QWORD PTR -32[rbp], rcx
	mov	QWORD PTR -40[rbp], r8
	mov	DWORD PTR -44[rbp], r9d
	jmp	.L8
.L9:
	mov	rax, QWORD PTR -8[rbp]
	movzx	edx, BYTE PTR [rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	BYTE PTR [rax], dl
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -16[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 2[rax]
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 3[rax]
	mov	rax, QWORD PTR -32[rbp]
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	add	QWORD PTR -40[rbp], 4
	add	QWORD PTR -8[rbp], 1
	add	QWORD PTR -16[rbp], 1
	add	QWORD PTR -24[rbp], 1
	add	QWORD PTR -32[rbp], 1
.L8:
	mov	eax, DWORD PTR -44[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -44[rbp], edx
	test	eax, eax
	jne	.L9
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	rgbatorgba, .-rgbatorgba
	.type	ConvertShort, @function
ConvertShort:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -24[rbp], rdi
	mov	DWORD PTR -28[rbp], esi
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L11
.L12:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	WORD PTR -12[rbp], ax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	WORD PTR -10[rbp], ax
	movzx	eax, WORD PTR -12[rbp]
	sal	eax, 8
	mov	edx, eax
	movzx	eax, WORD PTR -10[rbp]
	mov	ecx, edx
	or	ecx, eax
	mov	rax, QWORD PTR -24[rbp]
	lea	rdx, 2[rax]
	mov	QWORD PTR -24[rbp], rdx
	mov	edx, ecx
	mov	WORD PTR [rax], dx
.L11:
	mov	eax, DWORD PTR -28[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -28[rbp], edx
	test	eax, eax
	jne	.L12
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	ConvertShort, .-ConvertShort
	.type	ConvertUint, @function
ConvertUint:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -44[rbp], esi
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	jmp	.L14
.L15:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -24[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -20[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -16[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -24[rbp]
	sal	eax, 24
	mov	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	sal	eax, 16
	or	edx, eax
	mov	eax, DWORD PTR -16[rbp]
	sal	eax, 8
	mov	ecx, edx
	or	ecx, eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 4[rax]
	mov	QWORD PTR -40[rbp], rdx
	or	ecx, DWORD PTR -12[rbp]
	mov	edx, ecx
	mov	DWORD PTR [rax], edx
.L14:
	mov	eax, DWORD PTR -44[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -44[rbp], edx
	test	eax, eax
	jne	.L15
	nop
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	ConvertUint, .-ConvertUint
	.section	.rodata
.LC0:
	.string	"Out of memory!\n"
.LC1:
	.string	"rb"
	.text
	.type	ImageOpen, @function
ImageOpen:
.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, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -12[rbp], 1
	movzx	eax, BYTE PTR -12[rbp]
	cmp	al, 1
	jne	.L17
	mov	DWORD PTR -32[rbp], 1
	jmp	.L18
.L17:
	mov	DWORD PTR -32[rbp], 0
.L18:
	mov	edi, 176
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L19
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 15
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L19:
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rdx, QWORD PTR -24[rbp]
	mov	QWORD PTR 112[rdx], rax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 112[rax]
	test	rax, rax
	jne	.L20
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
.L20:
	mov	rax, QWORD PTR -24[rbp]
	mov	rdx, QWORD PTR 112[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, rdx
	mov	edx, 12
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	DWORD PTR -32[rbp], 0
	je	.L21
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 6
	mov	rdi, rax
	call	ConvertShort
.L21:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	eax, 8
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 120[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	eax, 8
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 128[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	eax, 8
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 136[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	eax, 8
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 144[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 120[rax]
	test	rax, rax
	je	.L22
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 128[rax]
	test	rax, rax
	je	.L22
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 136[rax]
	test	rax, rax
	je	.L22
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 144[rax]
	test	rax, rax
	jne	.L23
.L22:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 15
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L23:
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	eax, ax
	and	eax, 65280
	cmp	eax, 256
	jne	.L24
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, WORD PTR 10[rax]
	movzx	eax, ax
	imul	eax, edx
	sal	eax, 2
	mov	DWORD PTR -28[rbp], eax
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 160[rax], rdx
	mov	eax, DWORD PTR -28[rbp]
	cdqe
	mov	rdi, rax
	call	malloc@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 168[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 160[rax]
	test	rax, rax
	je	.L25
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 168[rax]
	test	rax, rax
	jne	.L26
.L25:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 15
	mov	esi, 1
	lea	rdi, .LC0[rip]
	call	fwrite@PLT
	mov	edi, 1
	call	exit@PLT
.L26:
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 256
	add	eax, eax
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR 152[rax], rdx
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 112[rax]
	mov	edx, 0
	mov	esi, 512
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR 112[rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 160[rax]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR 112[rax]
	mov	eax, DWORD PTR -28[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 168[rax]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	cmp	DWORD PTR -32[rbp], 0
	je	.L24
	mov	eax, DWORD PTR -28[rbp]
	lea	edx, 3[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 2
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 160[rax]
	mov	esi, edx
	mov	rdi, rax
	call	ConvertUint
	mov	eax, DWORD PTR -28[rbp]
	lea	edx, 3[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 2
	mov	edx, eax
	mov	rax, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR 168[rax]
	mov	esi, edx
	mov	rdi, rax
	call	ConvertUint
.L24:
	mov	rax, QWORD PTR -24[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	ImageOpen, .-ImageOpen
	.type	ImageClose, @function
ImageClose:
.LFB12:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	QWORD PTR -8[rbp], rdi
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 112[rax]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 120[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 128[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 136[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR 144[rax]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	ImageClose, .-ImageClose
	.type	ImageGetRow, @function
ImageGetRow:
.LFB13:
	.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 -56[rbp], ecx
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 2[rax]
	movzx	eax, ax
	and	eax, 65280
	cmp	eax, 256
	jne	.L31
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 160[rax]
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	eax, ax
	imul	eax, DWORD PTR -56[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -52[rbp]
	add	eax, ecx
	cdqe
	sal	rax, 2
	add	rax, rdx
	mov	eax, DWORD PTR [rax]
	mov	ecx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 112[rax]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 112[rax]
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR 168[rax]
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	eax, ax
	imul	eax, DWORD PTR -56[rbp]
	mov	esi, eax
	mov	eax, DWORD PTR -52[rbp]
	add	eax, esi
	cdqe
	sal	rax, 2
	add	rax, rcx
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 120[rax]
	mov	rcx, rdx
	mov	rdx, rsi
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 120[rax]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR -8[rbp], rax
.L40:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -16[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -21[rbp], al
	movzx	eax, BYTE PTR -21[rbp]
	and	eax, 127
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	je	.L41
	movzx	eax, BYTE PTR -21[rbp]
	test	al, al
	jns	.L34
	jmp	.L35
.L36:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, 1[rdx]
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, 1[rax]
	mov	QWORD PTR -8[rbp], rcx
	movzx	edx, BYTE PTR [rdx]
	mov	BYTE PTR [rax], dl
.L35:
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -20[rbp], edx
	test	eax, eax
	jne	.L36
	jmp	.L40
.L34:
	mov	rax, QWORD PTR -16[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -16[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR -21[rbp], al
	jmp	.L38
.L39:
	mov	rax, QWORD PTR -8[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -8[rbp], rdx
	movzx	edx, BYTE PTR -21[rbp]
	mov	BYTE PTR [rax], dl
.L38:
	mov	eax, DWORD PTR -20[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -20[rbp], edx
	test	eax, eax
	jne	.L39
	jmp	.L40
.L31:
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	imul	eax, DWORD PTR -52[rbp]
	lea	ecx, 512[rax]
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	imul	eax, DWORD PTR -56[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	eax, ax
	imul	eax, edx
	add	eax, ecx
	movsx	rcx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 112[rax]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR 112[rax]
	mov	rax, QWORD PTR -40[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	jmp	.L30
.L41:
	nop
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	ImageGetRow, .-ImageGetRow
	.globl	read_texture
	.type	read_texture, @function
read_texture:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	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	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	ImageOpen
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L43
	mov	eax, 0
	jmp	.L44
.L43:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -80[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -88[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 10[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -96[rbp]
	mov	DWORD PTR [rax], edx
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edx, ax
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	eax, ax
	imul	eax, edx
	cdqe
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -40[rbp], 0
	je	.L45
	cmp	QWORD PTR -32[rbp], 0
	je	.L45
	cmp	QWORD PTR -24[rbp], 0
	je	.L45
	cmp	QWORD PTR -16[rbp], 0
	jne	.L46
.L45:
	mov	eax, 0
	jmp	.L44
.L46:
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -56[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	jmp	.L47
.L51:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 10[rax]
	cmp	ax, 3
	jbe	.L48
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 0
	mov	rdi, rax
	call	ImageGetRow
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 1
	mov	rdi, rax
	call	ImageGetRow
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 2
	mov	rdi, rax
	call	ImageGetRow
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 3
	mov	rdi, rax
	call	ImageGetRow
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	r8d, ax
	mov	rdi, QWORD PTR -56[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	r9d, r8d
	mov	r8, rdi
	mov	rdi, rax
	call	rgbatorgba
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	rax, 2
	add	QWORD PTR -56[rbp], rax
	jmp	.L49
.L48:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 10[rax]
	cmp	ax, 3
	jne	.L50
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 0
	mov	rdi, rax
	call	ImageGetRow
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 1
	mov	rdi, rax
	call	ImageGetRow
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 2
	mov	rdi, rax
	call	ImageGetRow
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edi, ax
	mov	rcx, QWORD PTR -56[rbp]
	mov	rdx, QWORD PTR -16[rbp]
	mov	rsi, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	r8d, edi
	mov	rdi, rax
	call	rgbtorgba
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	rax, 2
	add	QWORD PTR -56[rbp], rax
	jmp	.L49
.L50:
	mov	edx, DWORD PTR -60[rbp]
	mov	rsi, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -48[rbp]
	mov	ecx, 0
	mov	rdi, rax
	call	ImageGetRow
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	edx, ax
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	bwtorgba
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 6[rax]
	movzx	eax, ax
	sal	rax, 2
	add	QWORD PTR -56[rbp], rax
.L49:
	add	DWORD PTR -60[rbp], 1
.L47:
	mov	rax, QWORD PTR -48[rbp]
	movzx	eax, WORD PTR 8[rax]
	movzx	eax, ax
	cmp	DWORD PTR -60[rbp], eax
	jl	.L51
	mov	rax, QWORD PTR -48[rbp]
	mov	rdi, rax
	call	ImageClose
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -40[rbp]
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	read_texture, .-read_texture
	.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	"157514.c"
	.text
	.align	2
	.global	bwtorgba
	.syntax unified
	.arm
	.fpu softvfp
	.type	bwtorgba, %function
bwtorgba:
	@ 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]
	str	r2, [fp, #-16]
	b	.L2
.L3:
	ldr	r3, [fp, #-8]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-12]
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	ldr	r2, [fp, #-8]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #2
	ldr	r2, [fp, #-8]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #3
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
.L2:
	ldr	r3, [fp, #-16]
	sub	r2, r3, #1
	str	r2, [fp, #-16]
	cmp	r3, #0
	bne	.L3
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	bwtorgba, .-bwtorgba
	.align	2
	.global	rgbtorgba
	.syntax unified
	.arm
	.fpu softvfp
	.type	rgbtorgba, %function
rgbtorgba:
	@ args = 4, 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]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	b	.L5
.L6:
	ldr	r3, [fp, #-8]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #-20]
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #2
	ldr	r2, [fp, #-16]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #3
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #4
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L5:
	ldr	r3, [fp, #4]
	sub	r2, r3, #1
	str	r2, [fp, #4]
	cmp	r3, #0
	bne	.L6
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	rgbtorgba, .-rgbtorgba
	.align	2
	.global	rgbatorgba
	.syntax unified
	.arm
	.fpu softvfp
	.type	rgbatorgba, %function
rgbatorgba:
	@ args = 8, 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]
	str	r2, [fp, #-16]
	str	r3, [fp, #-20]
	b	.L8
.L9:
	ldr	r3, [fp, #-8]
	ldrb	r2, [r3]	@ zero_extendqisi2
	ldr	r3, [fp, #4]
	strb	r2, [r3]
	ldr	r3, [fp, #4]
	add	r3, r3, #1
	ldr	r2, [fp, #-12]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #4]
	add	r3, r3, #2
	ldr	r2, [fp, #-16]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #4]
	add	r3, r3, #3
	ldr	r2, [fp, #-20]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #4]
	add	r3, r3, #4
	str	r3, [fp, #4]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L8:
	ldr	r3, [fp, #8]
	sub	r2, r3, #1
	str	r2, [fp, #8]
	cmp	r3, #0
	bne	.L9
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	rgbatorgba, .-rgbatorgba
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ConvertShort, %function
ConvertShort:
	@ 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, #-16]
	str	r1, [fp, #-20]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-8]
	b	.L11
.L12:
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	str	r2, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	strh	r3, [fp, #-12]	@ movhi
	ldr	r3, [fp, #-8]
	add	r2, r3, #1
	str	r2, [fp, #-8]
	ldrb	r3, [r3]	@ zero_extendqisi2
	strh	r3, [fp, #-10]	@ movhi
	ldrh	r3, [fp, #-12]
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldrsh	r3, [fp, #-10]
	orr	r3, r2, r3
	lsl	r3, r3, #16
	asr	r2, r3, #16
	ldr	r3, [fp, #-16]
	add	r1, r3, #2
	str	r1, [fp, #-16]
	lsl	r2, r2, #16
	lsr	r2, r2, #16
	strh	r2, [r3]	@ movhi
.L11:
	ldr	r3, [fp, #-20]
	sub	r2, r3, #1
	str	r2, [fp, #-20]
	cmp	r3, #0
	bne	.L12
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	ConvertShort, .-ConvertShort
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ConvertUint, %function
ConvertUint:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #36
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, [fp, #-32]
	str	r3, [fp, #-24]
	b	.L14
.L15:
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	str	r2, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	str	r2, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	str	r2, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-24]
	add	r2, r3, #1
	str	r2, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-20]
	lsl	r2, r3, #24
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #16
	orr	r2, r2, r3
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #8
	orr	r1, r2, r3
	ldr	r3, [fp, #-32]
	add	r2, r3, #4
	str	r2, [fp, #-32]
	ldr	r2, [fp, #-8]
	orr	r2, r1, r2
	str	r2, [r3]
.L14:
	ldr	r3, [fp, #-36]
	sub	r2, r3, #1
	str	r2, [fp, #-36]
	cmp	r3, #0
	bne	.L15
	nop
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
	.size	ConvertUint, .-ConvertUint
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Out of memory!\012\000"
	.align	2
.LC1:
	.ascii	"rb\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ImageOpen, %function
ImageOpen:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-12]
	ldrb	r3, [fp, #-12]	@ zero_extendqisi2
	cmp	r3, #1
	bne	.L17
	mov	r3, #1
	str	r3, [fp, #-24]
	b	.L18
.L17:
	mov	r3, #0
	str	r3, [fp, #-24]
.L18:
	mov	r0, #140
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L19
	ldr	r3, .L29+4
	ldr	r3, [r3]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, .L29+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L19:
	ldr	r1, .L29+12
	ldr	r0, [fp, #-32]
	bl	fopen
	mov	r2, r0
	ldr	r3, [fp, #-20]
	str	r2, [r3, #108]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #108]
	cmp	r3, #0
	bne	.L20
	ldr	r0, [fp, #-32]
	bl	perror
	mov	r0, #1
	bl	exit
.L20:
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #108]
	mov	r2, #12
	mov	r1, #1
	ldr	r0, [fp, #-20]
	bl	fread
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L21
	ldr	r3, [fp, #-20]
	mov	r1, #6
	mov	r0, r3
	bl	ConvertShort
.L21:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #8
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #112]
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #8
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #116]
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #8
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #120]
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #8
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #124]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #112]
	cmp	r3, #0
	beq	.L22
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #116]
	cmp	r3, #0
	beq	.L22
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #120]
	cmp	r3, #0
	beq	.L22
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #124]
	cmp	r3, #0
	bne	.L23
.L22:
	ldr	r3, .L29+4
	ldr	r3, [r3]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, .L29+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L23:
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #2]
	and	r3, r3, #65280
	cmp	r3, #256
	bne	.L24
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #8]
	mov	r2, r3
	ldr	r3, [fp, #-20]
	ldrh	r3, [r3, #10]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #132]
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #136]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #132]
	cmp	r3, #0
	beq	.L25
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #136]
	cmp	r3, #0
	bne	.L26
.L25:
	ldr	r3, .L29+4
	ldr	r3, [r3]
	mov	r2, #15
	mov	r1, #1
	ldr	r0, .L29+8
	bl	fwrite
	mov	r0, #1
	bl	exit
.L26:
	ldr	r3, [fp, #-16]
	add	r3, r3, #256
	lsl	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-20]
	str	r2, [r3, #128]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #108]
	mov	r2, #0
	mov	r1, #512
	mov	r0, r3
	bl	fseek
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #132]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #108]
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #136]
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #108]
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L24
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #132]
	ldr	r3, [fp, #-16]
	add	r2, r3, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #2
	mov	r1, r3
	bl	ConvertUint
	ldr	r3, [fp, #-20]
	ldr	r0, [r3, #136]
	ldr	r3, [fp, #-16]
	add	r2, r3, #3
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #2
	mov	r1, r3
	bl	ConvertUint
.L24:
	ldr	r3, [fp, #-20]
	ldr	r2, .L29
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC2
	.word	stderr
	.word	.LC0
	.word	.LC1
	.size	ImageOpen, .-ImageOpen
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ImageClose, %function
ImageClose:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #108]
	mov	r0, r3
	bl	fclose
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #112]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #116]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #120]
	mov	r0, r3
	bl	free
	ldr	r3, [fp, #-8]
	ldr	r3, [r3, #124]
	mov	r0, r3
	bl	free
	ldr	r0, [fp, #-8]
	bl	free
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	ImageClose, .-ImageClose
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ImageGetRow, %function
ImageGetRow:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	str	r3, [fp, #-36]
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #2]
	and	r3, r3, #65280
	cmp	r3, #256
	bne	.L33
	ldr	r3, [fp, #-24]
	ldr	r0, [r3, #108]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #132]
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #8]
	mov	r1, r3
	ldr	r3, [fp, #-36]
	mul	r1, r3, r1
	ldr	r3, [fp, #-32]
	add	r3, r1, r3
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, r3
	bl	fseek
	ldr	r3, [fp, #-24]
	ldr	r0, [r3, #112]
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #136]
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #8]
	mov	r1, r3
	ldr	r3, [fp, #-36]
	mul	r1, r3, r1
	ldr	r3, [fp, #-32]
	add	r3, r1, r3
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #108]
	mov	r1, #1
	bl	fread
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #112]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	str	r3, [fp, #-12]
.L42:
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	ldrb	r3, [r3]
	strb	r3, [fp, #-17]
	ldrb	r3, [fp, #-17]	@ zero_extendqisi2
	and	r3, r3, #127
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L43
	ldrsb	r3, [fp, #-17]
	cmp	r3, #0
	bge	.L36
	b	.L37
.L38:
	ldr	r2, [fp, #-16]
	add	r3, r2, #1
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-12]
	add	r1, r3, #1
	str	r1, [fp, #-12]
	ldrb	r2, [r2]	@ zero_extendqisi2
	strb	r2, [r3]
.L37:
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	str	r2, [fp, #-8]
	cmp	r3, #0
	bne	.L38
	b	.L42
.L36:
	ldr	r3, [fp, #-16]
	add	r2, r3, #1
	str	r2, [fp, #-16]
	ldrb	r3, [r3]
	strb	r3, [fp, #-17]
	b	.L40
.L41:
	ldr	r3, [fp, #-12]
	add	r2, r3, #1
	str	r2, [fp, #-12]
	ldrb	r2, [fp, #-17]
	strb	r2, [r3]
.L40:
	ldr	r3, [fp, #-8]
	sub	r2, r3, #1
	str	r2, [fp, #-8]
	cmp	r3, #0
	bne	.L41
	b	.L42
.L33:
	ldr	r3, [fp, #-24]
	ldr	r0, [r3, #108]
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #6]
	mov	r2, r3
	ldr	r3, [fp, #-32]
	mul	r3, r2, r3
	add	r2, r3, #512
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #6]
	mov	r1, r3
	ldr	r3, [fp, #-36]
	mul	r3, r1, r3
	ldr	r1, [fp, #-24]
	ldrh	r1, [r1, #8]
	mul	r3, r1, r3
	add	r3, r2, r3
	mov	r2, #0
	mov	r1, r3
	bl	fseek
	ldr	r3, [fp, #-24]
	ldrh	r3, [r3, #6]
	mov	r2, r3
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #108]
	mov	r1, #1
	ldr	r0, [fp, #-28]
	bl	fread
	b	.L32
.L43:
	nop
.L32:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	ImageGetRow, .-ImageGetRow
	.align	2
	.global	read_texture
	.syntax unified
	.arm
	.fpu softvfp
	.type	read_texture, %function
read_texture:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #56
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	str	r3, [fp, #-52]
	ldr	r0, [fp, #-40]
	bl	ImageOpen
	str	r0, [fp, #-28]
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	bne	.L45
	mov	r3, #0
	b	.L46
.L45:
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r2, r3
	ldr	r3, [fp, #-44]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #8]
	mov	r2, r3
	ldr	r3, [fp, #-48]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #10]
	mov	r2, r3
	ldr	r3, [fp, #-52]
	str	r2, [r3]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r2, r3
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #8]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	beq	.L47
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L47
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	beq	.L47
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L48
.L47:
	mov	r3, #0
	b	.L46
.L48:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-36]
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L49
.L53:
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #10]
	cmp	r3, #3
	bls	.L50
	mov	r3, #0
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	mov	r3, #1
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	mov	r3, #2
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	mov	r3, #3
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-8]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	str	r3, [sp, #4]
	ldr	r3, [fp, #-36]
	str	r3, [sp]
	ldr	r3, [fp, #-8]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	rgbatorgba
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	b	.L51
.L50:
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #10]
	cmp	r3, #3
	bne	.L52
	mov	r3, #0
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	mov	r3, #1
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	mov	r3, #2
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	str	r3, [sp]
	ldr	r3, [fp, #-36]
	ldr	r2, [fp, #-12]
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-20]
	bl	rgbtorgba
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-36]
	b	.L51
.L52:
	mov	r3, #0
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-28]
	bl	ImageGetRow
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	mov	r2, r3
	ldr	r1, [fp, #-36]
	ldr	r0, [fp, #-20]
	bl	bwtorgba
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #6]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-36]
	add	r3, r2, r3
	str	r3, [fp, #-36]
.L51:
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L49:
	ldr	r3, [fp, #-28]
	ldrh	r3, [r3, #8]
	mov	r2, r3
	ldr	r3, [fp, #-32]
	cmp	r3, r2
	blt	.L53
	ldr	r0, [fp, #-28]
	bl	ImageClose
	ldr	r0, [fp, #-20]
	bl	free
	ldr	r0, [fp, #-16]
	bl	free
	ldr	r0, [fp, #-12]
	bl	free
	ldr	r0, [fp, #-8]
	bl	free
	ldr	r3, [fp, #-24]
.L46:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	read_texture, .-read_texture
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
