	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ClientDisconnect               ## -- Begin function ClientDisconnect
	.p2align	4, 0x90
_ClientDisconnect:                      ## @ClientDisconnect
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r12d
	callq	_G_RemoveQueuedBotBegin
	movq	_g_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movslq	%r12d, %rax
	leaq	(%rax,%rax,2), %rbx
	shlq	$4, %rbx
	movq	16(%r15,%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_18
## %bb.1:
	leaq	(%r15,%rbx), %rax
	addq	$16, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_level@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.2:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	$8, %r14d
	xorl	%r15d, %r15d
	movq	_TEAM_SPECTATOR@GOTPCREL(%rip), %rdi
	movq	_SPECTATOR_FOLLOW@GOTPCREL(%rip), %rsi
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	addq	$48, %r15
	addq	$12, %r14
	cmpq	%rcx, %rbx
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rcx
	movq	-16(%rcx,%r14,2), %rdx
	cmpq	(%rdi), %rdx
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-8(%rcx,%r14,2), %rdx
	cmpq	(%rsi), %rdx
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmpl	%edx, (%rcx,%r14,2)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_g_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r15, %rdi
	movq	%r13, %r12
	movq	%rsi, %r13
	callq	_StopFollowing
	movq	_TEAM_SPECTATOR@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	movq	%r12, %r13
	movl	(%r12), %eax
	jmp	LBB0_7
LBB0_8:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_9:
	leaq	(%r15,%rbx), %r14
	movq	24(%rcx), %rax
	movq	_CON_CONNECTED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_12
## %bb.10:
	movq	(%rcx), %rax
	movq	_TEAM_SPECTATOR@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_12
## %bb.11:
	movl	16(%rcx), %edi
	movq	_EV_PLAYER_TELEPORT_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_G_TempEntity
	movl	40(%r15,%rbx), %ecx
	movl	%ecx, 40(%rax)
	movq	%r14, %rdi
	callq	_TossClientItems
LBB0_12:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	callq	_G_LogPrintf
	movq	_g_gametype@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_GT_TOURNAMENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.13:
	cmpl	$0, 28(%r13)
	jne	LBB0_17
## %bb.14:
	cmpl	$0, 24(%r13)
	jne	LBB0_17
## %bb.15:
	movq	8(%r13), %rax
	cmpl	%r12d, 4(%rax)
	jne	LBB0_17
## %bb.16:
	movq	16(%r13), %rcx
	movslq	(%rax), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	incl	20(%rcx,%rdx,8)
	movslq	(%rax), %rdi
	callq	_ClientUserinfoChanged
LBB0_17:
	movq	%r14, %rdi
	callq	_trap_UnlinkEntity
	movq	$0, 32(%r15,%rbx)
	movq	_qfalse@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, 24(%r15,%rbx)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%r14)
	movq	_CON_DISCONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rcx
	movq	%rax, 24(%rcx)
	movq	_TEAM_FREE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	8(%rcx), %rcx
	movq	_PERS_TEAM@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	%rdx, (%rcx,%rsi,8)
	movq	(%rax), %rax
	movq	(%rdi), %rcx
	movq	%rax, (%rcx)
	movq	_CS_PLAYERS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%r12d, %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_trap_SetConfigstring
	xorl	%eax, %eax
	callq	_CalculateRanks
	movq	_SVF_BOT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%r15,%rbx)
	je	LBB0_18
## %bb.19:
	movl	(%r13), %esi
	movl	%r12d, %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_BotAIShutdownClient            ## TAILCALL
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_entities,8,3                 ## @g_entities
	.comm	_level,32,3                     ## @level
	.comm	_TEAM_SPECTATOR,8,3             ## @TEAM_SPECTATOR
	.comm	_SPECTATOR_FOLLOW,8,3           ## @SPECTATOR_FOLLOW
	.comm	_CON_CONNECTED,8,3              ## @CON_CONNECTED
	.comm	_EV_PLAYER_TELEPORT_OUT,4,2     ## @EV_PLAYER_TELEPORT_OUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ClientDisconnect: %i\n"

	.comm	_g_gametype,8,3                 ## @g_gametype
	.comm	_GT_TOURNAMENT,8,3              ## @GT_TOURNAMENT
	.comm	_qfalse,4,2                     ## @qfalse
L_.str.1:                               ## @.str.1
	.asciz	"disconnected"

	.comm	_CON_DISCONNECTED,8,3           ## @CON_DISCONNECTED
	.comm	_TEAM_FREE,8,3                  ## @TEAM_FREE
	.comm	_PERS_TEAM,8,3                  ## @PERS_TEAM
	.comm	_CS_PLAYERS,4,2                 ## @CS_PLAYERS
L_.str.2:                               ## @.str.2
	.space	1

	.comm	_SVF_BOT,4,2                    ## @SVF_BOT
	.comm	_GT_HARVESTER,8,3               ## @GT_HARVESTER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ClientDisconnect               ; -- Begin function ClientDisconnect
	.p2align	2
_ClientDisconnect:                      ; @ClientDisconnect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	bl	_G_RemoveQueuedBotBegin
Lloh0:
	adrp	x25, _g_entities@GOTPAGE
Lloh1:
	ldr	x25, [x25, _g_entities@GOTPAGEOFF]
	ldr	x22, [x25]
	mov	w8, #48
	smaddl	x20, w19, w8, x22
	mov	x21, x20
	ldr	x9, [x21, #16]!
	cbz	x9, LBB0_17
; %bb.1:
Lloh2:
	adrp	x23, _level@GOTPAGE
Lloh3:
	ldr	x23, [x23, _level@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh4:
	adrp	x24, _TEAM_SPECTATOR@GOTPAGE
Lloh5:
	ldr	x24, [x24, _TEAM_SPECTATOR@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	str	x22, [sp, #8]                   ; 8-byte Folded Spill
	mov	x26, #0
	mov	x27, #0
	mov	x28, #0
Lloh6:
	adrp	x22, _SPECTATOR_FOLLOW@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SPECTATOR_FOLLOW@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #1
	add	x27, x27, #48
	add	x26, x26, #24
	cmp	x28, w8, sxtw
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x23, #16]
	ldr	x10, [x9, x26]
	ldr	x11, [x24]
	cmp	x10, x11
	b.ne	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, x26
	ldr	x10, [x9, #8]
	ldr	x11, [x22]
	cmp	x10, x11
	b.ne	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x9, #16]
	cmp	w9, w19
	b.ne	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	add	x0, x8, x27
	bl	_StopFollowing
	ldr	w8, [x23]
	b	LBB0_3
LBB0_8:
	ldr	x9, [x21]
	ldr	x22, [sp, #8]                   ; 8-byte Folded Reload
LBB0_9:
	sxtw	x25, w19
	ldr	x8, [x9, #24]
Lloh8:
	adrp	x10, _CON_CONNECTED@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CON_CONNECTED@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_12
; %bb.10:
	ldr	x8, [x9]
	ldr	x10, [x24]
	cmp	x8, x10
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x9, #16]
Lloh11:
	adrp	x8, _EV_PLAYER_TELEPORT_OUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EV_PLAYER_TELEPORT_OUT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_G_TempEntity
	mov	w8, #48
	madd	x8, x25, x8, x22
	ldr	w8, [x8, #40]
	str	w8, [x0, #40]
	mov	x0, x20
	bl	_TossClientItems
LBB0_12:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_G_LogPrintf
Lloh16:
	adrp	x8, _g_gametype@GOTPAGE
Lloh17:
	ldr	x8, [x8, _g_gametype@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
Lloh19:
	adrp	x9, _GT_TOURNAMENT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _GT_TOURNAMENT@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	ldp	w11, w10, [x23, #24]
	cmp	x8, x9
	ccmp	w10, #0, #0, eq
	ccmp	w11, #0, #0, eq
	b.ne	LBB0_15
; %bb.13:
	ldr	x8, [x23, #8]
	ldr	w9, [x8, #4]
	cmp	w9, w19
	b.ne	LBB0_15
; %bb.14:
	ldr	x9, [x23, #16]
	ldrsw	x10, [x8]
	mov	w11, #24
	madd	x9, x10, x11, x9
	ldr	w10, [x9, #20]
	add	w10, w10, #1
	str	w10, [x9, #20]
	ldrsw	x0, [x8]
	bl	_ClientUserinfoChanged
LBB0_15:
	mov	x0, x20
	bl	_trap_UnlinkEntity
	mov	w8, #48
	madd	x23, x25, x8, x22
	str	xzr, [x23, #32]
Lloh22:
	adrp	x22, _qfalse@GOTPAGE
Lloh23:
	ldr	x22, [x22, _qfalse@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [x23, #24]
Lloh24:
	adrp	x8, l_.str.1@PAGE
Lloh25:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x20]
Lloh26:
	adrp	x8, _CON_DISCONNECTED@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CON_DISCONNECTED@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	ldr	x9, [x21]
	str	x8, [x9, #24]
Lloh29:
	adrp	x8, _TEAM_FREE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TEAM_FREE@GOTPAGEOFF]
	ldr	x10, [x8]
	ldr	x9, [x9, #8]
Lloh31:
	adrp	x11, _PERS_TEAM@GOTPAGE
Lloh32:
	ldr	x11, [x11, _PERS_TEAM@GOTPAGEOFF]
Lloh33:
	ldr	x11, [x11]
	str	x10, [x9, x11, lsl #3]
	ldr	x8, [x8]
	ldr	x9, [x21]
	str	x8, [x9]
Lloh34:
	adrp	x8, _CS_PLAYERS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CS_PLAYERS@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	add	w0, w8, w19
Lloh37:
	adrp	x1, l_.str.2@PAGE
Lloh38:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_trap_SetConfigstring
	bl	_CalculateRanks
	ldr	w8, [x23, #8]
Lloh39:
	adrp	x9, _SVF_BOT@GOTPAGE
Lloh40:
	ldr	x9, [x9, _SVF_BOT@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	ldr	w1, [x22]
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_BotAIShutdownClient
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_g_entities,8,3                 ; @g_entities
	.comm	_level,32,3                     ; @level
	.comm	_TEAM_SPECTATOR,8,3             ; @TEAM_SPECTATOR
	.comm	_SPECTATOR_FOLLOW,8,3           ; @SPECTATOR_FOLLOW
	.comm	_CON_CONNECTED,8,3              ; @CON_CONNECTED
	.comm	_EV_PLAYER_TELEPORT_OUT,4,2     ; @EV_PLAYER_TELEPORT_OUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ClientDisconnect: %i\n"

	.comm	_g_gametype,8,3                 ; @g_gametype
	.comm	_GT_TOURNAMENT,8,3              ; @GT_TOURNAMENT
	.comm	_qfalse,4,2                     ; @qfalse
l_.str.1:                               ; @.str.1
	.asciz	"disconnected"

	.comm	_CON_DISCONNECTED,8,3           ; @CON_DISCONNECTED
	.comm	_TEAM_FREE,8,3                  ; @TEAM_FREE
	.comm	_PERS_TEAM,8,3                  ; @PERS_TEAM
	.comm	_CS_PLAYERS,4,2                 ; @CS_PLAYERS
l_.str.2:                               ; @.str.2
	.space	1

	.comm	_SVF_BOT,4,2                    ; @SVF_BOT
	.comm	_GT_HARVESTER,8,3               ; @GT_HARVESTER
.subsections_via_symbols
