	.file	"extr_vfs.c_vfsInitDirectory.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"VFS Init: %s\n"
.LC1:
	.string	".pk3dir"
.LC2:
	.string	".dpkdir"
.LC3:
	.string	"%s/%s"
.LC4:
	.string	".dpk"
.LC5:
	.string	".pk3"
	.text
	.p2align 4
	.globl	vfsInitDirectory
	.type	vfsInitDirectory, @function
vfsInitDirectory:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 40
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR PATH_MAX[rip]
	mov	rcx, rsp
	mov	QWORD PTR -72[rbp], rsp
	add	rax, 15
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L34:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L34
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L35
.L4:
	mov	eax, DWORD PTR VFS_MAXDIRS[rip]
	mov	QWORD PTR -80[rbp], rsp
	sub	eax, 1
	cmp	eax, DWORD PTR g_numDirs[rip]
	je	.L8
	mov	rsi, rbx
	lea	rdi, .LC0[rip]
	call	Sys_Printf@PLT
	movsx	rdx, DWORD PTR g_numDirs[rip]
	mov	rax, QWORD PTR g_strDirs[rip]
	mov	rsi, rbx
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	strcpy@PLT
	movsx	rdx, DWORD PTR g_numDirs[rip]
	mov	rax, QWORD PTR g_strDirs[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	vfsFixDOSName@PLT
	movsx	rdx, DWORD PTR g_numDirs[rip]
	mov	rax, QWORD PTR g_strDirs[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	vfsAddSlash@PLT
	add	DWORD PTR g_numDirs[rip], 1
	cmp	QWORD PTR g_bUsePak[rip], 0
	jne	.L36
.L8:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	mov	rsp, QWORD PTR -72[rbp]
	jne	.L37
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	xor	edx, edx
	xor	esi, esi
	mov	rdi, rbx
	call	g_dir_open@PLT
	mov	r13, rax
	test	rax, rax
	je	.L8
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rdi, r13
	call	g_dir_read_name@PLT
	mov	r14, rax
	test	rax, rax
	je	.L11
.L38:
	mov	rdi, rax
	call	g_strdup@PLT
	mov	esi, 46
	mov	rdi, rax
	mov	r12, rax
	call	strrchr@PLT
	mov	r15, rax
	test	rax, rax
	je	.L12
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	Q_stricmp@PLT
	test	rax, rax
	jne	.L13
.L16:
	movsx	rax, DWORD PTR g_numDirs[rip]
	cmp	eax, DWORD PTR VFS_MAXDIRS[rip]
	je	.L12
	mov	rdx, QWORD PTR g_strDirs[rip]
	mov	esi, DWORD PTR PATH_MAX[rip]
	mov	r8, r14
	mov	rcx, rbx
	mov	rdi, QWORD PTR [rdx+rax*8]
	lea	rdx, .LC3[rip]
	call	snprintf@PLT
	movsx	rcx, DWORD PTR g_numDirs[rip]
	mov	rdx, QWORD PTR g_strDirs[rip]
	movsx	rax, DWORD PTR PATH_MAX[rip]
	mov	rdx, QWORD PTR [rdx+rcx*8]
	mov	BYTE PTR -1[rdx+rax], 0
	movsx	rdx, DWORD PTR g_numDirs[rip]
	mov	rax, QWORD PTR g_strDirs[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	vfsFixDOSName@PLT
	movsx	rdx, DWORD PTR g_numDirs[rip]
	mov	rax, QWORD PTR g_strDirs[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	vfsAddSlash@PLT
	add	DWORD PTR g_numDirs[rip], 1
.L17:
	lea	rsi, .LC5[rip]
	mov	rdi, r15
	call	Q_stricmp@PLT
	test	rax, rax
	je	.L20
	lea	rsi, .LC4[rip]
	mov	rdi, r15
	call	Q_stricmp@PLT
	test	rax, rax
	jne	.L12
.L20:
	mov	r14, QWORD PTR -80[rbp]
	mov	rcx, r12
	mov	rdx, rbx
	lea	rsi, .LC3[rip]
	mov	rdi, r14
	call	sprintf@PLT
	mov	rdi, r14
	call	vfsInitPakFile@PLT
	mov	rdi, r12
	call	g_free@PLT
	mov	rdi, r13
	call	g_dir_read_name@PLT
	mov	r14, rax
	test	rax, rax
	jne	.L38
.L11:
	mov	rdi, r13
	call	g_dir_close@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rsi, .LC2[rip]
	mov	rdi, r15
	call	Q_stricmp@PLT
	test	rax, rax
	je	.L16
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L35:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	vfsInitDirectory, .-vfsInitDirectory
	.comm	g_strDirs,8,8
	.comm	g_numDirs,4,4
	.comm	g_bUsePak,8,8
	.comm	VFS_MAXDIRS,4,4
	.comm	PATH_MAX,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_vfs.c_vfsInitDirectory.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"VFS Init: %s\012\000"
	.align	2
.LC1:
	.ascii	".pk3dir\000"
	.align	2
.LC2:
	.ascii	".dpkdir\000"
	.align	2
.LC3:
	.ascii	"%s/%s\000"
	.align	2
.LC4:
	.ascii	".dpk\000"
	.align	2
.LC5:
	.ascii	".pk3\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	vfsInitDirectory
	.syntax unified
	.arm
	.fpu softvfp
	.type	vfsInitDirectory, %function
vfsInitDirectory:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r10, .L30
	ldr	r8, .L30+4
	ldr	r3, [r10]
	ldr	r4, .L30+8
	add	r3, r3, #7
	bic	r3, r3, #7
	ldr	r2, [r8]
	mov	r6, sp
	ldr	r1, [r4]
	sub	sp, sp, r3
	ldr	r3, .L30+12
	sub	r2, r2, #1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	cmp	r2, r1
	add	r3, sp, #8
	str	r3, [fp, #-56]
	beq	.L5
	mov	r7, r0
	ldr	r9, .L30+16
	mov	r1, r0
	ldr	r0, .L30+20
	bl	Sys_Printf
	ldr	r3, [r9]
	ldr	r2, [r4]
	mov	r1, r7
	ldr	r0, [r3, r2, lsl #2]
	bl	strcpy
	ldr	r3, [r9]
	ldr	r2, [r4]
	ldr	r0, [r3, r2, lsl #2]
	bl	vfsFixDOSName
	ldr	r3, [r9]
	ldr	r2, [r4]
	ldr	r0, [r3, r2, lsl #2]
	bl	vfsAddSlash
	ldr	r2, .L30+24
	ldr	r3, [r4]
	ldr	r2, [r2]
	add	r3, r3, #1
	cmp	r2, #0
	str	r3, [r4]
	bne	.L28
.L5:
	ldr	r3, .L30+12
	mov	sp, r6
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L29
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L28:
	mov	r2, #0
	mov	r0, r7
	mov	r1, r2
	bl	g_dir_open
	subs	r3, r0, #0
	str	r3, [fp, #-48]
	beq	.L5
	str	r6, [fp, #-60]
.L9:
	ldr	r0, [fp, #-48]
	bl	g_dir_read_name
	subs	r3, r0, #0
	str	r3, [fp, #-52]
	beq	.L8
	bl	g_strdup
	mov	r1, #46
	mov	r6, r0
	bl	strrchr
	subs	r5, r0, #0
	beq	.L9
	ldr	r1, .L30+28
	bl	Q_stricmp
	cmp	r0, #0
	bne	.L10
.L13:
	ldr	r3, [r4]
	ldr	r2, [r8]
	cmp	r3, r2
	beq	.L9
	ldr	r2, [r9]
	ldr	r1, [r10]
	ldr	r0, [r2, r3, lsl #2]
	ldr	r3, [fp, #-52]
	ldr	r2, .L30+32
	str	r3, [sp]
	mov	r3, r7
	bl	snprintf
	mov	r2, #0
	ldr	r0, [r4]
	ldr	r3, [r9]
	ldr	r1, [r10]
	ldr	r3, [r3, r0, lsl #2]
	add	r3, r3, r1
	strb	r2, [r3, #-1]
	ldr	r2, [r4]
	ldr	r3, [r9]
	ldr	r0, [r3, r2, lsl #2]
	bl	vfsFixDOSName
	ldr	r3, [r9]
	ldr	r2, [r4]
	ldr	r0, [r3, r2, lsl #2]
	bl	vfsAddSlash
	ldr	r3, [r4]
	add	r3, r3, #1
	str	r3, [r4]
.L14:
	mov	r0, r5
	ldr	r1, .L30+36
	bl	Q_stricmp
	cmp	r0, #0
	beq	.L17
	mov	r0, r5
	ldr	r1, .L30+40
	bl	Q_stricmp
	cmp	r0, #0
	bne	.L9
.L17:
	ldr	r5, [fp, #-56]
	mov	r3, r6
	mov	r2, r7
	ldr	r1, .L30+32
	mov	r0, r5
	bl	sprintf
	mov	r0, r5
	bl	vfsInitPakFile
	mov	r0, r6
	bl	g_free
	b	.L9
.L10:
	mov	r0, r5
	ldr	r1, .L30+44
	bl	Q_stricmp
	cmp	r0, #0
	beq	.L13
	b	.L14
.L8:
	ldr	r0, [fp, #-48]
	ldr	r6, [fp, #-60]
	bl	g_dir_close
	b	.L5
.L29:
	bl	__stack_chk_fail
.L31:
	.align	2
.L30:
	.word	PATH_MAX
	.word	VFS_MAXDIRS
	.word	g_numDirs
	.word	.LC6
	.word	g_strDirs
	.word	.LC0
	.word	g_bUsePak
	.word	.LC1
	.word	.LC3
	.word	.LC5
	.word	.LC4
	.word	.LC2
	.size	vfsInitDirectory, .-vfsInitDirectory
	.comm	g_strDirs,4,4
	.comm	g_numDirs,4,4
	.comm	g_bUsePak,4,4
	.comm	VFS_MAXDIRS,4,4
	.comm	PATH_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
