	.file	"extr_tpl.c_TPL_OpenTPLFromMemory.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	TPL_OpenTPLFromMemory
	.type	TPL_OpenTPLFromMemory, @function
TPL_OpenTPLFromMemory:
.LFB0:
	.cfi_startproc
	endbr64
	test	rsi, rsi
	je	.L6
	test	rdx, rdx
	je	.L6
	mov	eax, DWORD PTR TPL_FILE_TYPE_MEM[rip]
	mov	QWORD PTR 16[rdi], 0
	movsx	r9, DWORD PTR TPL_HDR_DESCR_FIELD[rip]
	mov	DWORD PTR 24[rdi], eax
	movsx	rax, DWORD PTR TPL_HDR_NTEXTURE_FIELD[rip]
	add	r9, rsi
	mov	r8, QWORD PTR [rsi+rax]
	mov	QWORD PTR [rdi], r8
	test	r8, r8
	je	.L3
	sal	r8, 4
	mov	rax, r9
	add	r8, r9
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rcx, QWORD PTR 8[rax]
	mov	rdx, QWORD PTR [rax]
	add	rcx, rsi
	add	QWORD PTR [rcx], rsi
	test	rdx, rdx
	je	.L4
	add	rdx, rsi
	add	QWORD PTR [rdx], rsi
.L4:
	mov	QWORD PTR 8[rax], rcx
	add	rax, 16
	mov	QWORD PTR -16[rax], rdx
	cmp	r8, rax
	jne	.L5
.L3:
	mov	QWORD PTR 8[rdi], r9
	mov	eax, 1
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	mov	eax, -1
	ret
	.cfi_endproc
.LFE0:
	.size	TPL_OpenTPLFromMemory, .-TPL_OpenTPLFromMemory
	.comm	TPL_HDR_NTEXTURE_FIELD,4,4
	.comm	TPL_HDR_DESCR_FIELD,4,4
	.comm	TPL_FILE_TYPE_MEM,4,4
	.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_tpl.c_TPL_OpenTPLFromMemory.c"
	.text
	.align	2
	.global	TPL_OpenTPLFromMemory
	.syntax unified
	.arm
	.fpu softvfp
	.type	TPL_OpenTPLFromMemory, %function
TPL_OpenTPLFromMemory:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	clz	r2, r2
	cmp	r1, #0
	lsr	r2, r2, #5
	moveq	r2, #1
	cmp	r2, #0
	bne	.L6
	ldr	r3, .L19
	push	{r4, r5, r6, lr}
	ldr	ip, [r3]
	str	r2, [r0, #8]
	ldr	r3, .L19+4
	ldr	r2, .L19+8
	ldr	r5, [r1, ip]
	ldr	r3, [r3]
	ldr	r6, [r2]
	cmp	r5, #0
	str	r5, [r0]
	str	r3, [r0, #12]
	add	r6, r1, r6
	beq	.L3
	mov	r2, r6
	add	r5, r6, r5, lsl #3
	add	lr, r6, #4
.L5:
	ldr	r3, [r2, #4]
	ldr	ip, [lr, #-4]
	ldr	r4, [r1, r3]
	cmp	ip, #0
	add	r4, r4, r1
	str	r4, [r1, r3]
	ldrne	r4, [ip, r1]!
	add	r3, r1, r3
	addne	r4, r4, r1
	strne	r4, [ip]
	add	r2, r2, #8
	str	r3, [r2, #-4]
	cmp	r5, r2
	str	ip, [lr, #-4]
	add	lr, lr, #8
	bne	.L5
.L3:
	str	r6, [r0, #4]
	mov	r0, #1
	pop	{r4, r5, r6, pc}
.L6:
	mvn	r0, #0
	bx	lr
.L20:
	.align	2
.L19:
	.word	TPL_HDR_NTEXTURE_FIELD
	.word	TPL_FILE_TYPE_MEM
	.word	TPL_HDR_DESCR_FIELD
	.size	TPL_OpenTPLFromMemory, .-TPL_OpenTPLFromMemory
	.comm	TPL_HDR_NTEXTURE_FIELD,4,4
	.comm	TPL_HDR_DESCR_FIELD,4,4
	.comm	TPL_FILE_TYPE_MEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
