	.file	"extr_convert_ase.c_ConvertBSPToASE.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"--- Convert BSP to ASE ---\n"
.LC1:
	.string	".ase"
.LC2:
	.string	"writing %s\n"
.LC3:
	.string	".bsp"
.LC4:
	.string	"wb"
.LC5:
	.string	"Open failed on %s\n"
.LC6:
	.string	"*3DSMAX_ASCIIEXPORT\t200\r\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC7:
	.string	"*COMMENT\t\"Generated by Q3Map2 (ydnar) -convert -format ase\"\r\n"
	.section	.rodata.str1.1
.LC8:
	.string	"*SCENE\t{\r\n"
.LC9:
	.string	"\t*SCENE_FILENAME\t\"%s\"\r\n"
.LC10:
	.string	"\t*SCENE_FIRSTFRAME\t0\r\n"
.LC11:
	.string	"\t*SCENE_LASTFRAME\t100\r\n"
.LC12:
	.string	"\t*SCENE_FRAMESPEED\t30\r\n"
.LC13:
	.string	"\t*SCENE_TICKSPERFRAME\t160\r\n"
	.section	.rodata.str1.8
	.align 8
.LC14:
	.string	"\t*SCENE_BACKGROUND_STATIC\t0.0000\t0.0000\t0.0000\r\n"
	.align 8
.LC15:
	.string	"\t*SCENE_AMBIENT_STATIC\t0.0000\t0.0000\t0.0000\r\n"
	.section	.rodata.str1.1
.LC16:
	.string	"}\r\n"
.LC17:
	.string	"*MATERIAL_LIST\t{\r\n"
.LC18:
	.string	"\t*MATERIAL_COUNT\t%d\r\n"
.LC19:
	.string	"model"
.LC20:
	.string	"origin"
	.text
	.p2align 4
	.globl	ConvertBSPToASE
	.type	ConvertBSPToASE, @function
ConvertBSPToASE:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	lea	rdi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 2064
	.cfi_def_cfa_offset 2112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 2056[rsp], rax
	xor	eax, eax
	mov	r12, rsp
	lea	r13, 1024[rsp]
	call	Sys_Printf@PLT
	mov	rsi, rbp
	mov	rdi, r12
	call	strcpy@PLT
	mov	rdi, r12
	call	StripExtension@PLT
	lea	rsi, .LC1[rip]
	mov	rdi, r12
	call	strcat@PLT
	mov	rsi, r12
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	Sys_Printf@PLT
	mov	rdi, rbp
	mov	rsi, r13
	call	ExtractFileBase@PLT
	lea	rsi, .LC3[rip]
	mov	rdi, r13
	call	strcat@PLT
	lea	rsi, .LC4[rip]
	mov	rdi, r12
	call	fopen@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L22
.L2:
	mov	rcx, rbp
	mov	edx, 25
	mov	esi, 1
	xor	ebx, ebx
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 61
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 10
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	mov	rdx, r13
	mov	rdi, rbp
	xor	eax, eax
	lea	rsi, .LC9[rip]
	call	fprintf@PLT
	mov	rcx, rbp
	mov	edx, 22
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 23
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC13[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 48
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 45
	mov	esi, 1
	lea	rdi, .LC15[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 3
	mov	esi, 1
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	mov	rcx, rbp
	mov	edx, 18
	mov	esi, 1
	lea	rdi, .LC17[rip]
	call	fwrite@PLT
	mov	edx, DWORD PTR numBSPShaders[rip]
	mov	rdi, rbp
	xor	eax, eax
	lea	rsi, .LC18[rip]
	call	fprintf@PLT
	mov	edx, DWORD PTR numBSPShaders[rip]
	test	edx, edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR bspShaders[rip]
	mov	edx, ebx
	mov	rdi, rbp
	lea	rsi, [rax+rbx*4]
	add	rbx, 1
	call	ConvertShader@PLT
	cmp	DWORD PTR numBSPShaders[rip], ebx
	jg	.L3
.L6:
	mov	rcx, rbp
	mov	edx, 3
	mov	esi, 1
	xor	ebx, ebx
	lea	rdi, .LC16[rip]
	call	fwrite@PLT
	mov	eax, DWORD PTR numEntities[rip]
	test	eax, eax
	jg	.L4
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L24:
	lea	rsi, .LC19[rip]
	mov	rdi, r13
	call	ValueForKey@PLT
	cmp	BYTE PTR [rax], 42
	je	.L23
	add	rbx, 1
	cmp	DWORD PTR numEntities[rip], ebx
	jle	.L5
.L4:
	mov	rax, QWORD PTR entities[rip]
	lea	r13, [rax+rbx*4]
	test	rbx, rbx
	jne	.L24
	xor	r12d, r12d
	xor	r14d, r14d
.L7:
	lea	rsi, .LC20[rip]
	mov	rdi, r13
	add	r12, QWORD PTR bspModels[rip]
	call	ValueForKey@PLT
	xor	ecx, ecx
	cmp	BYTE PTR [rax], 0
	jne	.L9
	mov	edi, ecx
	call	VectorClear@PLT
.L10:
	xor	ecx, ecx
	mov	edx, r14d
	mov	rsi, r12
	mov	rdi, rbp
	call	ConvertModel@PLT
	add	rbx, 1
	cmp	DWORD PTR numEntities[rip], ebx
	jg	.L4
.L5:
	mov	rdi, rbp
	call	fclose@PLT
	mov	rax, QWORD PTR 2056[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L25
	add	rsp, 2064
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	edx, ecx
	lea	rsi, .LC20[rip]
	mov	rdi, r13
	call	GetVectorForKey@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	lea	rdi, 1[rax]
	call	atoi@PLT
	movsx	r12, eax
	mov	r14, r12
	sal	r12, 2
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rsi, r12
	lea	rdi, .LC5[rip]
	call	Error@PLT
	jmp	.L2
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ConvertBSPToASE, .-ConvertBSPToASE
	.comm	numEntities,4,4
	.comm	numBSPShaders,4,4
	.comm	entities,8,8
	.comm	bspShaders,8,8
	.comm	bspModels,8,8
	.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_convert_ase.c_ConvertBSPToASE.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"--- Convert BSP to ASE ---\012\000"
	.align	2
.LC1:
	.ascii	".ase\000"
	.align	2
.LC2:
	.ascii	"writing %s\012\000"
	.align	2
.LC3:
	.ascii	".bsp\000"
	.align	2
.LC4:
	.ascii	"wb\000"
	.align	2
.LC5:
	.ascii	"Open failed on %s\012\000"
	.align	2
.LC6:
	.ascii	"*3DSMAX_ASCIIEXPORT\011200\015\012\000"
	.align	2
.LC7:
	.ascii	"*COMMENT\011\"Generated by Q3Map2 (ydnar) -convert "
	.ascii	"-format ase\"\015\012\000"
	.align	2
.LC8:
	.ascii	"*SCENE\011{\015\012\000"
	.align	2
.LC9:
	.ascii	"\011*SCENE_FILENAME\011\"%s\"\015\012\000"
	.align	2
.LC10:
	.ascii	"\011*SCENE_FIRSTFRAME\0110\015\012\000"
	.align	2
.LC11:
	.ascii	"\011*SCENE_LASTFRAME\011100\015\012\000"
	.align	2
.LC12:
	.ascii	"\011*SCENE_FRAMESPEED\01130\015\012\000"
	.align	2
.LC13:
	.ascii	"\011*SCENE_TICKSPERFRAME\011160\015\012\000"
	.align	2
.LC14:
	.ascii	"\011*SCENE_BACKGROUND_STATIC\0110.0000\0110.0000\011"
	.ascii	"0.0000\015\012\000"
	.align	2
.LC15:
	.ascii	"\011*SCENE_AMBIENT_STATIC\0110.0000\0110.0000\0110."
	.ascii	"0000\015\012\000"
	.align	2
.LC16:
	.ascii	"}\015\012\000"
	.align	2
.LC17:
	.ascii	"*MATERIAL_LIST\011{\015\012\000"
	.align	2
.LC18:
	.ascii	"\011*MATERIAL_COUNT\011%d\015\012\000"
	.align	2
.LC19:
	.ascii	"model\000"
	.align	2
.LC20:
	.ascii	"origin\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC21:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ConvertBSPToASE
	.syntax unified
	.arm
	.fpu softvfp
	.type	ConvertBSPToASE, %function
ConvertBSPToASE:
	@ args = 0, pretend = 0, frame = 2056
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	ldr	r3, .L24
	sub	sp, sp, #2048
	sub	sp, sp, #12
	ldr	r0, .L24+4
	ldr	r3, [r3]
	str	r3, [sp, #2052]
	mov	r3,#0
	bl	Sys_Printf
	mov	r1, r4
	add	r0, sp, #4
	bl	strcpy
	add	r0, sp, #4
	bl	StripExtension
	add	r0, sp, #4
	bl	strlen
	add	r3, sp, #4
	mov	r2, #5
	add	r0, r3, r0
	ldr	r1, .L24+8
	bl	memcpy
	add	r1, sp, #4
	ldr	r0, .L24+12
	bl	Sys_Printf
	add	r1, sp, #1024
	add	r1, r1, #4
	mov	r0, r4
	bl	ExtractFileBase
	add	r0, sp, #1024
	add	r0, r0, #4
	bl	strlen
	add	r3, sp, #1024
	add	r3, r3, #4
	mov	r2, #5
	ldr	r1, .L24+16
	add	r0, r3, r0
	bl	memcpy
	ldr	r1, .L24+20
	add	r0, sp, #4
	bl	fopen
	subs	r5, r0, #0
	beq	.L20
.L2:
	mov	r3, r5
	mov	r2, #25
	mov	r1, #1
	ldr	r0, .L24+24
	bl	fwrite
	mov	r3, r5
	mov	r2, #61
	mov	r1, #1
	ldr	r0, .L24+28
	bl	fwrite
	mov	r3, r5
	mov	r2, #10
	mov	r1, #1
	ldr	r0, .L24+32
	bl	fwrite
	add	r2, sp, #1024
	ldr	r1, .L24+36
	add	r2, r2, #4
	mov	r0, r5
	bl	fprintf
	mov	r3, r5
	mov	r2, #22
	mov	r1, #1
	ldr	r0, .L24+40
	bl	fwrite
	mov	r3, r5
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L24+44
	bl	fwrite
	mov	r3, r5
	mov	r2, #23
	mov	r1, #1
	ldr	r0, .L24+48
	bl	fwrite
	mov	r3, r5
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L24+52
	bl	fwrite
	mov	r3, r5
	mov	r2, #48
	mov	r1, #1
	ldr	r0, .L24+56
	bl	fwrite
	mov	r3, r5
	mov	r2, #45
	mov	r1, #1
	ldr	r0, .L24+60
	bl	fwrite
	ldr	r6, .L24+64
	mov	r3, r5
	mov	r2, #3
	mov	r1, #1
	ldr	r0, .L24+68
	bl	fwrite
	mov	r3, r5
	mov	r2, #18
	mov	r1, #1
	ldr	r0, .L24+72
	bl	fwrite
	mov	r0, r5
	ldr	r2, [r6]
	ldr	r1, .L24+76
	bl	fprintf
	ldr	r3, [r6]
	cmp	r3, #0
	movgt	r4, #0
	ldrgt	r7, .L24+80
	ble	.L6
.L3:
	ldr	r1, [r7]
	mov	r2, r4
	add	r1, r1, r4, lsl #2
	mov	r0, r5
	bl	ConvertShader
	ldr	r3, [r6]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L3
.L6:
	ldr	r8, .L24+84
	mov	r3, r5
	mov	r2, #3
	mov	r1, #1
	ldr	r0, .L24+68
	bl	fwrite
	ldr	r3, [r8]
	cmp	r3, #0
	ble	.L5
	mov	r4, #0
	ldr	r10, .L24+88
	ldr	r9, .L24+92
	b	.L4
.L22:
	mov	r0, fp
	ldr	r1, .L24+96
	bl	ValueForKey
	ldrb	r2, [r0]	@ zero_extendqisi2
	cmp	r2, #42
	beq	.L21
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	ble	.L5
.L4:
	ldr	r3, [r10]
	cmp	r4, #0
	add	fp, r3, r4, lsl #2
	bne	.L22
	mov	r7, r4
	mov	r2, r4
.L7:
	ldr	r3, .L24+100
	mov	r1, r9
	ldr	r6, [r3]
	mov	r0, fp
	add	r6, r6, r2
	bl	ValueForKey
	ldrb	r2, [r0]	@ zero_extendqisi2
	cmp	r2, #0
	bne	.L9
	mov	r0, #0
	bl	VectorClear
.L10:
	mov	r3, #0
	mov	r2, r7
	mov	r1, r6
	mov	r0, r5
	bl	ConvertModel
	ldr	r3, [r8]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L4
.L5:
	mov	r0, r5
	bl	fclose
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #2052]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, #0
	add	sp, sp, #2048
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	mov	r0, fp
	mov	r2, #0
	mov	r1, r9
	bl	GetVectorForKey
	b	.L10
.L21:
	add	r0, r0, #1
	bl	atoi
	mov	r7, r0
	lsl	r2, r0, #2
	b	.L7
.L20:
	add	r1, sp, #4
	ldr	r0, .L24+104
	bl	Error
	b	.L2
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC21
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.word	numBSPShaders
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	bspShaders
	.word	numEntities
	.word	entities
	.word	.LC20
	.word	.LC19
	.word	bspModels
	.word	.LC5
	.size	ConvertBSPToASE, .-ConvertBSPToASE
	.comm	numEntities,4,4
	.comm	numBSPShaders,4,4
	.comm	entities,4,4
	.comm	bspShaders,4,4
	.comm	bspModels,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
