	.file	"extr_imagelib.c_WriteTGA.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"wb"
	.text
	.p2align 4
	.globl	WriteTGA
	.type	WriteTGA, @function
WriteTGA:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	imul	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sal	r14d, 2
	mov	rbx, rsi
	lea	r12d, 18[r14]
	mov	edi, r12d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR 12[rsp], edx
	call	malloc@PLT
	mov	edx, 18
	xor	esi, esi
	mov	rdi, rax
	mov	rbp, rax
	call	memset@PLT
	mov	r8d, DWORD PTR 12[rsp]
	mov	DWORD PTR 8[rbp], 2
	mov	DWORD PTR 64[rbp], 32
	movzx	eax, r8b
	sar	r8d, 8
	mov	DWORD PTR 48[rbp], eax
	movzx	eax, r15b
	sar	r15d, 8
	mov	DWORD PTR 52[rbp], r8d
	mov	DWORD PTR 56[rbp], eax
	mov	DWORD PTR 60[rbp], r15d
	cmp	r12d, 18
	jle	.L2
	sub	r14d, 1
	mov	rsi, rbx
	lea	rax, 72[rbp]
	shr	r14d, 2
	sal	r14, 4
	lea	rcx, 16[rbx+r14]
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edx, DWORD PTR 8[rsi]
	add	rsi, 16
	add	rax, 16
	mov	DWORD PTR -16[rax], edx
	mov	edx, DWORD PTR -12[rsi]
	mov	DWORD PTR -12[rax], edx
	mov	edx, DWORD PTR -16[rsi]
	mov	DWORD PTR -8[rax], edx
	mov	edx, DWORD PTR -4[rsi]
	mov	DWORD PTR -4[rax], edx
	cmp	rsi, rcx
	jne	.L3
.L2:
	mov	rdi, r13
	lea	rsi, .LC0[rip]
	call	fopen@PLT
	mov	edx, r12d
	mov	rdi, rbp
	mov	esi, 1
	mov	r13, rax
	mov	rcx, rax
	call	fwrite@PLT
	mov	rdi, r13
	call	fclose@PLT
	add	rsp, 24
	.cfi_def_cfa_offset 56
	mov	rdi, rbp
	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	WriteTGA, .-WriteTGA
	.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_WriteTGA.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"wb\000"
	.text
	.align	2
	.global	WriteTGA
	.syntax unified
	.arm
	.fpu softvfp
	.type	WriteTGA, %function
WriteTGA:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mul	r7, r3, r2
	lsl	r7, r7, #2
	add	r8, r7, #18
	mov	r9, r0
	mov	r0, r8
	mov	r10, r2
	mov	r6, r3
	mov	r4, r1
	bl	malloc
	mov	r1, #2
	mov	r3, #0
	mov	r2, #32
	str	r1, [r0, #8]
	and	r1, r10, #255
	str	r1, [r0, #48]
	asr	r10, r10, #8
	and	r1, r6, #255
	cmp	r8, #18
	asr	r6, r6, #8
	mov	r5, r0
	str	r10, [r0, #52]
	str	r1, [r0, #56]
	str	r6, [r0, #60]
	str	r2, [r0, #64]
	str	r3, [r0]
	str	r3, [r0, #4]
	str	r3, [r0, #12]
	strh	r3, [r0, #16]	@ movhi
	ble	.L2
	mov	r1, r4
	mov	r3, r0
	add	r7, r0, r7, lsl #2
.L3:
	ldr	lr, [r1]
	ldr	ip, [r1, #12]
	ldmib	r1, {r4, r6}
	str	lr, [r3, #80]
	str	r6, [r3, #72]
	str	r4, [r3, #76]
	str	ip, [r3, #84]
	add	r3, r3, #16
	cmp	r7, r3
	add	r1, r1, #16
	bne	.L3
.L2:
	mov	r0, r9
	ldr	r1, .L7
	bl	fopen
	mov	r4, r0
	mov	r2, r8
	mov	r3, r0
	mov	r1, #1
	mov	r0, r5
	bl	fwrite
	mov	r0, r4
	bl	fclose
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	free
.L8:
	.align	2
.L7:
	.word	.LC0
	.size	WriteTGA, .-WriteTGA
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
