	.file	"extr_g_team.c_SelectRandomTeamSpawnPoint.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"team_CTF_redplayer"
.LC1:
	.string	"team_CTF_blueplayer"
.LC2:
	.string	"team_CTF_redspawn"
.LC3:
	.string	"team_CTF_bluespawn"
	.text
	.p2align 4
	.globl	SelectRandomTeamSpawnPoint
	.type	SelectRandomTeamSpawnPoint, @function
SelectRandomTeamSpawnPoint:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 16
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_TEAM_SPAWN_POINTS[rip]
	mov	rcx, rsp
	lea	rax, 15[0+rax*8]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L23:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L23
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L24
.L4:
	cmp	DWORD PTR TEAM_BEGIN[rip], edi
	mov	rax, QWORD PTR TEAM_RED[rip]
	mov	r14, rsp
	je	.L25
	cmp	rax, rsi
	je	.L16
	xor	eax, eax
	cmp	QWORD PTR TEAM_BLUE[rip], rsi
	lea	r13, .LC3[rip]
	jne	.L1
.L6:
	xor	ebx, ebx
	xor	r12d, r12d
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r13
	call	FOFS@PLT
	mov	rdi, r12
	mov	rdx, r13
	mov	esi, eax
	call	G_Find@PLT
	mov	r12, rax
	test	rax, rax
	je	.L10
	mov	rdi, r12
	call	SpotWouldTelefrag@PLT
	test	rax, rax
	jne	.L8
	movsx	rax, ebx
	add	ebx, 1
	cmp	DWORD PTR MAX_TEAM_SPAWN_POINTS[rip], ebx
	mov	QWORD PTR [r14+rax*8], r12
	jne	.L8
.L10:
	test	ebx, ebx
	je	.L26
	xor	eax, eax
	call	rand@PLT
	cdq
	idiv	ebx
	movsx	rdx, edx
	mov	rax, QWORD PTR [r14+rdx*8]
.L1:
	mov	rcx, QWORD PTR -40[rbp]
	xor	rcx, QWORD PTR fs:40
	jne	.L27
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	cmp	rax, rsi
	je	.L14
	xor	eax, eax
	cmp	QWORD PTR TEAM_BLUE[rip], rsi
	lea	r13, .LC1[rip]
	je	.L6
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, r13
	call	FOFS@PLT
	mov	rdx, r13
	xor	edi, edi
	mov	esi, eax
	call	G_Find@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L16:
	lea	r13, .LC2[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L24:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	lea	r13, .LC0[rip]
	jmp	.L6
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	SelectRandomTeamSpawnPoint, .-SelectRandomTeamSpawnPoint
	.comm	TEAM_RED,8,8
	.comm	TEAM_BLUE,8,8
	.comm	TEAM_BEGIN,4,4
	.comm	MAX_TEAM_SPAWN_POINTS,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_g_team.c_SelectRandomTeamSpawnPoint.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"team_CTF_redplayer\000"
	.align	2
.LC1:
	.ascii	"team_CTF_blueplayer\000"
	.align	2
.LC2:
	.ascii	"team_CTF_redspawn\000"
	.align	2
.LC3:
	.ascii	"team_CTF_bluespawn\000"
	.global	__aeabi_idivmod
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	SelectRandomTeamSpawnPoint
	.syntax unified
	.arm
	.fpu softvfp
	.type	SelectRandomTeamSpawnPoint, %function
SelectRandomTeamSpawnPoint:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, fp, lr}
	add	fp, sp, #24
	sub	sp, sp, #12
	ldr	r7, .L20
	ldr	r2, .L20+4
	ldr	r3, [r7]
	ldr	ip, [r2]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r2, .L20+8
	ldr	r3, .L20+12
	cmp	ip, r0
	ldr	r3, [r3]
	str	r3, [fp, #-32]
	mov	r3,#0
	mov	r8, sp
	ldr	r3, [r2]
	beq	.L17
	cmp	r3, r1
	beq	.L13
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, r1
	bne	.L14
	ldr	r6, .L20+20
.L3:
	mov	r5, #0
	mov	r4, r5
.L5:
	mov	r0, r6
	bl	FOFS
	mov	r2, r6
	mov	r1, r0
	mov	r0, r4
	bl	G_Find
	subs	r4, r0, #0
	beq	.L7
	bl	SpotWouldTelefrag
	cmp	r0, #0
	bne	.L5
	ldr	r3, [r7]
	str	r4, [r8, r5, lsl #2]
	add	r5, r5, #1
	cmp	r3, r5
	bne	.L5
.L7:
	cmp	r5, #0
	beq	.L18
	bl	rand
	mov	r1, r5
	bl	__aeabi_idivmod
	ldr	r0, [r8, r1, lsl #2]
.L1:
	ldr	r3, .L20+12
	ldr	r2, [r3]
	ldr	r3, [fp, #-32]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	sub	sp, fp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, fp, pc}
.L13:
	ldr	r6, .L20+24
	b	.L3
.L17:
	cmp	r3, r1
	beq	.L11
	ldr	r3, .L20+16
	ldr	r3, [r3]
	cmp	r3, r1
	ldreq	r6, .L20+28
	beq	.L3
.L14:
	mov	r0, #0
	b	.L1
.L18:
	mov	r0, r6
	bl	FOFS
	mov	r2, r6
	mov	r1, r0
	mov	r0, r5
	bl	G_Find
	b	.L1
.L11:
	ldr	r6, .L20+32
	b	.L3
.L19:
	bl	__stack_chk_fail
.L21:
	.align	2
.L20:
	.word	MAX_TEAM_SPAWN_POINTS
	.word	TEAM_BEGIN
	.word	TEAM_RED
	.word	.LC4
	.word	TEAM_BLUE
	.word	.LC3
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.size	SelectRandomTeamSpawnPoint, .-SelectRandomTeamSpawnPoint
	.comm	TEAM_RED,4,4
	.comm	TEAM_BLUE,4,4
	.comm	TEAM_BEGIN,4,4
	.comm	MAX_TEAM_SPAWN_POINTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
