	.file	"extr_lwob.c_lwGetObject5.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	lwGetObject5
	.type	lwGetObject5, @function
lwGetObject5:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 16[rsp], rdx
	mov	QWORD PTR 8[rsp], rcx
	test	rsi, rsi
	je	.L53
	mov	r12, rsi
	xor	edi, edi
	call	set_flen@PLT
	mov	rdi, r12
	call	getU4@PLT
	mov	rdi, r12
	mov	ebx, eax
	call	getU4@PLT
	mov	rdi, r12
	mov	r14d, eax
	call	getU4@PLT
	mov	ebp, eax
	xor	eax, eax
	call	get_flen@PLT
	cmp	eax, 12
	jne	.L53
	cmp	DWORD PTR ID_FORM[rip], ebx
	jne	.L5
	cmp	DWORD PTR ID_LWOB[rip], ebp
	jne	.L5
	mov	esi, 24
	mov	edi, 1
	call	_pico_calloc@PLT
	mov	r13, rax
	test	rax, rax
	je	.L7
	mov	esi, 12
	mov	edi, 1
	call	_pico_calloc@PLT
	mov	r15, rax
	test	rax, rax
	je	.L7
	mov	QWORD PTR 16[r13], rax
	mov	rdi, r12
	mov	DWORD PTR 0[r13], 1
	call	getU4@PLT
	mov	rdi, r12
	mov	ebx, eax
	call	getU4@PLT
	mov	ebp, eax
	xor	eax, eax
	call	get_flen@PLT
	test	eax, eax
	js	.L7
	lea	rax, 4[r15]
	mov	QWORD PTR 24[rsp], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L55:
	cmp	ebx, 129
	jne	.L12
	lea	rdx, 12[r13]
	mov	rdi, r12
	call	lwGetTags@PLT
	test	eax, eax
	je	.L7
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, r12
	call	_pico_memstream_tell@PLT
	sub	eax, 8
	cmp	eax, r14d
	jnb	.L15
	xor	edi, edi
	call	set_flen@PLT
	mov	rdi, r12
	call	getU4@PLT
	mov	rdi, r12
	mov	ebx, eax
	call	getU4@PLT
	mov	ebp, eax
	xor	eax, eax
	call	get_flen@PLT
	cmp	eax, 8
	jne	.L7
.L16:
	lea	esi, 1[rbp]
	and	esi, -2
	cmp	ebx, 130
	je	.L8
	ja	.L9
	cmp	ebx, 128
	jne	.L55
	mov	rdx, r13
	mov	rdi, r12
	call	lwGetSurface5@PLT
	mov	rsi, rax
	test	rax, rax
	je	.L7
	lea	rdi, 8[r13]
	call	lwListAdd@PLT
	add	DWORD PTR 4[r13], 1
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rbp, 4[r15]
	mov	esi, DWORD PTR 8[r15]
	mov	rdi, rbp
	call	lwGetBoundingBox@PLT
	mov	rsi, r15
	mov	rdi, rbp
	call	lwGetPolyNormals@PLT
	mov	rsi, r15
	mov	rdi, rbp
	call	lwGetPointPolygons@PLT
	test	eax, eax
	jne	.L56
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR 16[rsp]
	test	rax, rax
	je	.L17
	mov	DWORD PTR [rax], ebx
.L17:
	mov	rbx, QWORD PTR 8[rsp]
	test	rbx, rbx
	je	.L18
	mov	rdi, r12
	call	_pico_memstream_tell@PLT
	mov	DWORD PTR [rbx], eax
.L18:
	mov	rdi, r13
	call	lwFreeObject@PLT
.L53:
	xor	r13d, r13d
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r13
	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
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rsp]
	test	rax, rax
	je	.L53
	mov	DWORD PTR [rax], 12
	xor	r13d, r13d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	ebx, 131
	jne	.L12
	mov	rdx, QWORD PTR 24[rsp]
	mov	rdi, r12
	call	lwGetPoints@PLT
	test	eax, eax
	jne	.L13
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	mov	ecx, DWORD PTR 4[r15]
	mov	rdx, r15
	mov	rdi, r12
	call	lwGetPolygons5@PLT
	test	eax, eax
	jne	.L13
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edx, DWORD PTR PICO_SEEK_CUR[rip]
	mov	rdi, r12
	call	_pico_memstream_seek@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L56:
	lea	rcx, 4[r13]
	lea	rdx, 8[r13]
	mov	rdi, r15
	lea	rsi, 12[r13]
	call	lwResolvePolySurfaces@PLT
	test	eax, eax
	je	.L7
	mov	rsi, r15
	mov	rdi, rbp
	call	lwGetVertNormals@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	lwGetObject5, .-lwGetObject5
	.comm	PICO_SEEK_CUR,4,4
	.comm	ID_LWOB,4,4
	.comm	ID_FORM,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_lwob.c_lwGetObject5.c"
	.text
	.align	2
	.global	lwGetObject5
	.syntax unified
	.arm
	.fpu softvfp
	.type	lwGetObject5, %function
lwGetObject5:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r5, r1, #0
	sub	sp, sp, #12
	beq	.L55
	mov	r0, #0
	mov	r10, r2
	mov	r9, r3
	bl	set_flen
	mov	r0, r5
	bl	getU4
	mov	r6, r0
	mov	r0, r5
	bl	getU4
	mov	r8, r0
	mov	r0, r5
	bl	getU4
	mov	r7, r0
	bl	get_flen
	cmp	r0, #12
	mov	r4, r0
	bne	.L55
	ldr	r3, .L57
	ldr	r3, [r3]
	cmp	r3, r6
	bne	.L5
	ldr	r3, .L57+4
	ldr	r3, [r3]
	cmp	r3, r7
	bne	.L5
	mov	r1, #20
	mov	r0, #1
	bl	_pico_calloc
	subs	r7, r0, #0
	beq	.L7
	mov	r1, r4
	mov	r0, #1
	bl	_pico_calloc
	subs	fp, r0, #0
	beq	.L7
	mov	r3, #1
	mov	r0, r5
	str	r3, [r7]
	str	fp, [r7, #16]
	bl	getU4
	mov	r6, r0
	mov	r0, r5
	bl	getU4
	mov	r4, r0
	bl	get_flen
	cmp	r0, #0
	blt	.L7
	add	r3, r7, #8
	add	r2, r7, #12
	str	r10, [sp]
	str	r9, [sp, #4]
	mov	r10, r2
	mov	r9, r4
	mov	r4, r3
.L17:
	add	r0, r9, #1
	sub	r3, r6, #128
	bic	r1, r0, #1
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L8
.L10:
	.word	.L13
	.word	.L12
	.word	.L11
	.word	.L9
.L9:
	mov	r0, r5
	add	r2, fp, #4
	bl	lwGetPoints
	cmp	r0, #0
	beq	.L53
.L14:
	mov	r0, r5
	bl	_pico_memstream_tell
	sub	r0, r0, #8
	cmp	r0, r8
	bcs	.L16
	mov	r0, #0
	bl	set_flen
	mov	r0, r5
	bl	getU4
	mov	r6, r0
	mov	r0, r5
	bl	getU4
	mov	r9, r0
	bl	get_flen
	cmp	r0, #8
	beq	.L17
.L53:
	ldr	r10, [sp]
	ldr	r9, [sp, #4]
.L7:
	cmp	r10, #0
	strne	r6, [r10]
	cmp	r9, #0
	beq	.L19
	mov	r0, r5
	bl	_pico_memstream_tell
	str	r0, [r9]
.L19:
	mov	r0, r7
	bl	lwFreeObject
.L55:
	mov	r7, #0
.L1:
	mov	r0, r7
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	cmp	r9, #0
	beq	.L55
	mov	r7, #0
	mov	r3, #12
	mov	r0, r7
	str	r3, [r9]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L11:
	mov	r2, fp
	mov	r0, r5
	ldr	r3, [fp, #4]
	bl	lwGetPolygons5
	cmp	r0, #0
	bne	.L14
	b	.L53
.L12:
	mov	r2, r10
	mov	r0, r5
	bl	lwGetTags
	cmp	r0, #0
	bne	.L14
	b	.L53
.L13:
	mov	r2, r7
	mov	r0, r5
	bl	lwGetSurface5
	subs	r1, r0, #0
	beq	.L53
	mov	r0, r4
	bl	lwListAdd
	ldr	r3, [r7, #4]
	add	r3, r3, #1
	str	r3, [r7, #4]
	b	.L14
.L16:
	add	r4, fp, #4
	ldr	r1, [fp, #8]
	mov	r0, r4
	ldr	r10, [sp]
	ldr	r9, [sp, #4]
	bl	lwGetBoundingBox
	mov	r1, fp
	mov	r0, r4
	bl	lwGetPolyNormals
	mov	r1, fp
	mov	r0, r4
	bl	lwGetPointPolygons
	cmp	r0, #0
	beq	.L7
	mov	r0, fp
	add	r3, r7, #4
	add	r2, r7, #8
	add	r1, r7, #12
	bl	lwResolvePolySurfaces
	cmp	r0, #0
	beq	.L7
	mov	r1, fp
	mov	r0, r4
	bl	lwGetVertNormals
	b	.L1
.L8:
	ldr	r3, .L57+8
	mov	r0, r5
	ldr	r2, [r3]
	bl	_pico_memstream_seek
	b	.L14
.L58:
	.align	2
.L57:
	.word	ID_FORM
	.word	ID_LWOB
	.word	PICO_SEEK_CUR
	.size	lwGetObject5, .-lwGetObject5
	.comm	PICO_SEEK_CUR,4,4
	.comm	ID_LWOB,4,4
	.comm	ID_FORM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
