	.file	"extr_imagelib.c_WritePCXfile.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	WritePCXfile
	.type	WritePCXfile, @function
WritePCXfile:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, edx
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	imul	eax, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r8
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	lea	edi, 1000[rax+rax]
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	safe_malloc@PLT
	mov	edx, 88
	xor	esi, esi
	mov	rdi, rax
	mov	r12, rax
	call	memset@PLT
	lea	edi, -1[r14]
	movabs	rax, 21474836490
	mov	QWORD PTR 80[r12], 0
	mov	QWORD PTR [r12], rax
	movsx	edi, di
	movabs	rax, 34359738369
	mov	QWORD PTR 8[r12], rax
	mov	QWORD PTR 72[r12], 0
	call	LittleShort@PLT
	lea	edi, -1[r15]
	mov	QWORD PTR 64[r12], rax
	movsx	edi, di
	call	LittleShort@PLT
	movsx	r8d, r14w
	mov	QWORD PTR 56[r12], rax
	mov	edi, r8d
	mov	DWORD PTR 12[rsp], r8d
	call	LittleShort@PLT
	movsx	edi, r15w
	mov	QWORD PTR 48[r12], rax
	call	LittleShort@PLT
	mov	r8d, DWORD PTR 12[rsp]
	mov	DWORD PTR 16[r12], 1
	mov	QWORD PTR 40[r12], rax
	mov	edi, r8d
	call	LittleShort@PLT
	mov	edi, 1
	mov	QWORD PTR 32[r12], rax
	call	LittleShort@PLT
	lea	rdx, 20[r12]
	mov	QWORD PTR 24[r12], rax
	test	r15d, r15d
	jle	.L2
	lea	eax, -1[r14]
	xor	ecx, ecx
	lea	r8, 4[0+rax*4]
	.p2align 4,,10
	.p2align 3
.L3:
	lea	rdi, [rbx+r8]
	test	r14d, r14d
	jg	.L6
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L15:
	mov	DWORD PTR [rdx], eax
	add	rdx, 4
	cmp	rdi, rbx
	je	.L8
.L6:
	mov	eax, DWORD PTR [rbx]
	add	rbx, 4
	mov	esi, eax
	and	esi, 192
	cmp	esi, 192
	jne	.L15
	mov	DWORD PTR [rdx], 193
	mov	eax, DWORD PTR -4[rbx]
	add	rdx, 8
	mov	DWORD PTR -4[rdx], eax
	cmp	rdi, rbx
	jne	.L6
.L8:
	add	ecx, 1
	cmp	r15d, ecx
	jne	.L3
.L2:
	mov	DWORD PTR [rdx], 12
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L9:
	mov	ecx, DWORD PTR 0[r13+rax]
	mov	DWORD PTR 4[rdx+rax], ecx
	add	rax, 4
	cmp	rax, 3072
	jne	.L9
	add	rdx, 3076
	mov	rdi, rbp
	mov	rsi, r12
	sub	rdx, r12
	sar	rdx, 2
	call	SaveFile@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 56
	mov	rdi, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE0:
	.size	WritePCXfile, .-WritePCXfile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_imagelib.c_WritePCXfile.c"
	.text
	.align	2
	.global	WritePCXfile
	.syntax unified
	.arm
	.fpu softvfp
	.type	WritePCXfile, %function
WritePCXfile:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	mul	r0, r3, r2
	add	r0, r0, #500
	lsl	r0, r0, #1
	mov	r10, r3
	mov	r6, r2
	mov	r9, r1
	ldr	r5, [sp, #40]
	bl	safe_malloc
	mov	r2, #40
	mov	r7, r0
	mov	r1, #0
	add	r0, r0, #16
	bl	memset
	mov	fp, #1
	mov	r1, #10
	mov	r2, #5
	mov	r3, #8
	sub	r0, r6, #1
	lsl	r0, r0, #16
	str	r1, [r7]
	str	r2, [r7, #4]
	str	r3, [r7, #12]
	asr	r0, r0, #16
	str	fp, [r7, #8]
	bl	LittleShort
	mov	r3, r0
	sub	r0, r10, #1
	lsl	r0, r0, #16
	str	r3, [r7, #44]
	asr	r0, r0, #16
	bl	LittleShort
	lsl	r4, r6, #16
	asr	r4, r4, #16
	str	r0, [r7, #40]
	mov	r0, r4
	bl	LittleShort
	mov	r3, r0
	lsl	r0, r10, #16
	str	r3, [r7, #36]
	asr	r0, r0, #16
	bl	LittleShort
	str	fp, [r7, #16]
	str	r0, [r7, #32]
	mov	r0, r4
	bl	LittleShort
	mov	r3, r0
	mov	r0, fp
	str	r3, [r7, #28]
	bl	LittleShort
	cmp	r10, #0
	str	r0, [r7, #24]
	add	r4, r7, #20
	ble	.L2
	mov	r2, #0
	mov	r1, #193
	lsl	r0, r6, #2
.L3:
	cmp	r6, #0
	movgt	r3, r9
	movgt	ip, #0
	ble	.L7
.L6:
	ldr	lr, [r3], #4
	add	ip, ip, #1
	and	fp, lr, #192
	cmp	fp, #192
	moveq	lr, r4
	streq	r1, [lr], #8
	ldreq	fp, [r3, #-4]
	strne	lr, [r4], #4
	streq	fp, [r4, #4]
	moveq	r4, lr
	cmp	r6, ip
	bne	.L6
	add	r9, r9, r0
.L7:
	add	r2, r2, #1
	cmp	r10, r2
	bne	.L3
.L2:
	mov	r2, #12
	mov	r3, r4
	str	r2, [r4]
	add	r1, r5, #3072
.L8:
	ldr	r2, [r5], #4
	cmp	r1, r5
	str	r2, [r3, #4]!
	bne	.L8
	add	r4, r4, #3072
	add	r4, r4, #4
	sub	r4, r4, r7
	mov	r0, r8
	mov	r1, r7
	asr	r2, r4, #2
	bl	SaveFile
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	free
	.size	WritePCXfile, .-WritePCXfile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
