	.file	"extr_path_init.c_AddGamePath.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	AddGamePath
	.type	AddGamePath, @function
AddGamePath:
.LFB0:
	.cfi_startproc
	endbr64
	test	rdi, rdi
	je	.L14
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	BYTE PTR [rdi], 0
	je	.L1
	mov	rbx, QWORD PTR numGamePaths[rip]
	cmp	rbx, QWORD PTR MAX_GAME_PATHS[rip]
	jb	.L18
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	call	strlen@PLT
	mov	rdx, QWORD PTR gamePaths[rip]
	lea	rdi, 1[rax]
	lea	rbx, [rdx+rbx*8]
	call	safe_malloc@PLT
	mov	rdx, QWORD PTR numGamePaths[rip]
	mov	rsi, rbp
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR gamePaths[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	strcpy@PLT
	mov	rdx, QWORD PTR numGamePaths[rip]
	mov	rax, QWORD PTR gamePaths[rip]
	mov	rdi, QWORD PTR [rax+rdx*8]
	call	CleanPath@PLT
	mov	rdx, QWORD PTR numGamePaths[rip]
	lea	rax, 1[rdx]
	mov	QWORD PTR numGamePaths[rip], rax
	test	rdx, rdx
	je	.L1
	xor	ebx, ebx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR numGamePaths[rip]
	add	rbx, 1
	lea	rdx, -1[rax]
	cmp	rdx, rbx
	jbe	.L1
.L5:
	mov	rdx, QWORD PTR gamePaths[rip]
	mov	rsi, QWORD PTR -8[rdx+rax*8]
	mov	rdi, QWORD PTR [rdx+rbx*8]
	call	strcmp@PLT
	test	rax, rax
	jne	.L3
	mov	rdx, QWORD PTR numGamePaths[rip]
	mov	rax, QWORD PTR gamePaths[rip]
	mov	rdi, QWORD PTR -8[rax+rdx*8]
	call	free@PLT
	mov	rax, QWORD PTR numGamePaths[rip]
	mov	rdx, QWORD PTR gamePaths[rip]
	mov	QWORD PTR -8[rdx+rax*8], 0
	sub	rax, 1
	mov	QWORD PTR numGamePaths[rip], rax
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE0:
	.size	AddGamePath, .-AddGamePath
	.comm	numGamePaths,8,8
	.comm	gamePaths,8,8
	.comm	MAX_GAME_PATHS,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_path_init.c_AddGamePath.c"
	.text
	.align	2
	.global	AddGamePath
	.syntax unified
	.arm
	.fpu softvfp
	.type	AddGamePath, %function
AddGamePath:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r4, r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldrb	r3, [r4]	@ zero_extendqisi2
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r7, .L18
	ldr	r3, .L18+4
	ldr	r5, [r7]
	ldr	r3, [r3]
	cmp	r5, r3
	popcs	{r4, r5, r6, r7, r8, r9, r10, pc}
	bl	strlen
	ldr	r8, .L18+8
	add	r0, r0, #1
	ldr	r6, [r8]
	bl	safe_malloc
	ldr	r3, [r8]
	ldr	r2, [r7]
	str	r0, [r6, r5, lsl #2]
	ldr	r0, [r3, r2, lsl #2]
	mov	r1, r4
	bl	strcpy
	ldr	r3, [r8]
	ldr	r2, [r7]
	ldr	r0, [r3, r2, lsl #2]
	bl	CleanPath
	ldr	r9, [r7]
	add	r3, r9, #1
	cmp	r9, #0
	str	r3, [r7]
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r6, [r8]
	mov	r5, #0
	ldr	r10, [r6, r9, lsl #2]
	sub	r6, r6, #4
	b	.L5
.L3:
	cmp	r5, r9
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	mov	r1, r10
	ldr	r0, [r6, #4]!
	bl	strcmp
	subs	r4, r0, #0
	add	r5, r5, #1
	bne	.L3
	mov	r0, r10
	bl	free
	ldr	r3, [r7]
	ldr	r2, [r8]
	sub	r1, r3, #-1073741823
	sub	r3, r3, #1
	str	r4, [r2, r1, lsl #2]
	str	r3, [r7]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L19:
	.align	2
.L18:
	.word	numGamePaths
	.word	MAX_GAME_PATHS
	.word	gamePaths
	.size	AddGamePath, .-AddGamePath
	.comm	numGamePaths,4,4
	.comm	gamePaths,4,4
	.comm	MAX_GAME_PATHS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
