	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CG_AddToTeamChat
_CG_AddToTeamChat:                      ## @CG_AddToTeamChat
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_cg_teamChatHeight@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_TEAMCHAT_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r14d
	cmpl	%r14d, %eax
	cmovll	%eax, %r14d
	testl	%r14d, %r14d
	jle	LBB0_2
## %bb.1:
	movq	_cg_teamChatTime@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jle	LBB0_2
## %bb.3:
	movq	%rdi, %rbx
	movq	_cgs@GOTPCREL(%rip), %rax
	movq	8(%rax), %rcx
	movl	(%rax), %eax
	cltd
	idivl	%r14d
	movslq	%edx, %rax
	movq	(%rcx,%rax,8), %r12
	movb	$0, (%r12)
	cmpb	$0, (%rdi)
	je	LBB0_12
## %bb.4:
	xorl	%r13d, %r13d
	movb	$55, -41(%rbp)                  ## 1-byte Folded Spill
	xorl	%r15d, %r15d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movb	%cl, (%r12)
	incq	%r12
	incl	%r15d
	cmpb	$0, 1(%rbx)
	leaq	1(%rbx), %rbx
	movq	%rax, %r13
	je	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_TEAMCHAT_WIDTH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rax
	subq	%r12, %rax
	testq	%r13, %r13
	leaq	1(%rbx,%rax), %rcx
	cmovneq	%rcx, %rbx
	cmoveq	%r13, %rax
	movb	$0, (%r12,%rax)
	movq	_cg@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_cgs@GOTPCREL(%rip), %rdi
	movq	16(%rdi), %rsi
	movl	(%rdi), %eax
	cltd
	idivl	%r14d
	movslq	%edx, %rax
	movl	%ecx, (%rsi,%rax,4)
	movl	(%rdi), %eax
	incl	%eax
	movl	%eax, (%rdi)
	movq	8(%rdi), %rcx
	cltd
	idivl	%r14d
	movslq	%edx, %rax
	movq	(%rcx,%rax,8), %r12
	movb	$0, (%r12)
	movq	_Q_COLOR_ESCAPE@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	movb	%al, (%r12)
	movzbl	-41(%rbp), %eax                 ## 1-byte Folded Reload
	movb	%al, 1(%r12)
	addq	$2, %r12
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_Q_IsColorString
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movzbl	(%rbx), %ecx
	movq	%r12, %rax
	cmpb	$32, %cl
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rax
	jmp	LBB0_11
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movzbl	(%rbx), %eax
	movb	%al, (%r12)
	movzbl	1(%rbx), %eax
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	movb	%al, 1(%r12)
	addq	$2, %r12
	cmpb	$0, 2(%rbx)
	leaq	2(%rbx), %rbx
	jne	LBB0_5
LBB0_12:
	movb	$0, (%r12)
	movq	_cg@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_cgs@GOTPCREL(%rip), %rdi
	movq	16(%rdi), %rsi
	movl	(%rdi), %eax
	cltd
	idivl	%r14d
	movslq	%edx, %rax
	movl	%ecx, (%rsi,%rax,4)
	movl	(%rdi), %eax
	incl	%eax
	movl	%eax, (%rdi)
	movl	%eax, %ecx
	subl	4(%rdi), %ecx
	cmpl	%r14d, %ecx
	jle	LBB0_14
## %bb.13:
	subl	%r14d, %eax
	movl	%eax, 4(%rdi)
	jmp	LBB0_14
LBB0_2:
	movq	_cgs@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cg_teamChatHeight,4,2          ## @cg_teamChatHeight
	.comm	_TEAMCHAT_HEIGHT,4,2            ## @TEAMCHAT_HEIGHT
	.comm	_cg_teamChatTime,8,3            ## @cg_teamChatTime
	.comm	_cgs,24,3                       ## @cgs
	.comm	_TEAMCHAT_WIDTH,4,2             ## @TEAMCHAT_WIDTH
	.comm	_cg,4,2                         ## @cg
	.comm	_Q_COLOR_ESCAPE,4,2             ## @Q_COLOR_ESCAPE
	.no_dead_strip	_CG_AddToTeamChat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CG_AddToTeamChat
_CG_AddToTeamChat:                      ; @CG_AddToTeamChat
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, _cg_teamChatHeight@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cg_teamChatHeight@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _TEAMCHAT_HEIGHT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TEAMCHAT_HEIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w20, w8, w9, lt
Lloh6:
	adrp	x8, _cg_teamChatTime@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cg_teamChatTime@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	w20, #1
	ccmp	x8, #0, #4, ge
	b.gt	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _cgs@GOTPAGE
Lloh10:
	ldr	x8, [x8, _cgs@GOTPAGEOFF]
Lloh11:
	str	xzr, [x8]
	b	LBB0_11
LBB0_2:
	mov	x19, x0
Lloh12:
	adrp	x21, _cgs@GOTPAGE
Lloh13:
	ldr	x21, [x21, _cgs@GOTPAGEOFF]
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	sdiv	w10, w9, w20
	msub	w9, w10, w20, w9
	ldr	x24, [x8, w9, sxtw #3]
	strb	wzr, [x24]
	ldrb	w8, [x0]
Lloh14:
	adrp	x22, _cg@GOTPAGE
Lloh15:
	ldr	x22, [x22, _cg@GOTPAGEOFF]
	cbz	w8, LBB0_9
; %bb.3:
	mov	x28, #0
	mov	w23, #0
	mov	w27, #55
Lloh16:
	adrp	x25, _TEAMCHAT_WIDTH@GOTPAGE
Lloh17:
	ldr	x25, [x25, _TEAMCHAT_WIDTH@GOTPAGEOFF]
Lloh18:
	adrp	x26, _Q_COLOR_ESCAPE@GOTPAGE
Lloh19:
	ldr	x26, [x26, _Q_COLOR_ESCAPE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	cmp	w23, w8
	b.lt	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w23, #0
	sub	x8, x28, x24
	add	x9, x19, x8
	cmp	x28, #0
	csel	x8, xzr, x8, eq
	csinc	x19, x19, x9, eq
	strb	wzr, [x24, x8]
	ldr	w8, [x22]
	ldr	w9, [x21]
	sdiv	w10, w9, w20
	msub	w9, w10, w20, w9
	ldp	x11, x10, [x21, #8]
	str	w8, [x10, w9, sxtw #2]
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	sdiv	w9, w8, w20
	msub	w8, w9, w20, w8
	ldr	x8, [x11, w8, sxtw #3]
	strb	wzr, [x8]
	ldr	w9, [x26]
	strb	w9, [x8]
	add	x24, x8, #2
	strb	w27, [x8, #1]
	mov	x28, #0
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	bl	_Q_IsColorString
	cbnz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w8, [x19]
	cmp	w8, #32
	csel	x28, x24, x28, eq
	strb	w8, [x24], #1
	ldrb	w8, [x19, #1]!
	add	w23, w23, #1
	cbnz	w8, LBB0_4
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w8, [x19]
	strb	w8, [x24]
	ldrb	w27, [x19, #1]
	strb	w27, [x24, #1]
	ldrb	w8, [x19, #2]!
	add	x24, x24, #2
	cbnz	w8, LBB0_4
LBB0_9:
	strb	wzr, [x24]
	ldr	w8, [x22]
	ldr	x9, [x21, #16]
	ldr	w10, [x21]
	sdiv	w11, w10, w20
	msub	w10, w11, w20, w10
	str	w8, [x9, w10, sxtw #2]
	ldp	w8, w9, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	sub	w9, w8, w9
	cmp	w9, w20
	b.le	LBB0_11
; %bb.10:
	sub	w8, w8, w20
	str	w8, [x21, #4]
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_cg_teamChatHeight,4,2          ; @cg_teamChatHeight
	.comm	_TEAMCHAT_HEIGHT,4,2            ; @TEAMCHAT_HEIGHT
	.comm	_cg_teamChatTime,8,3            ; @cg_teamChatTime
	.comm	_cgs,24,3                       ; @cgs
	.comm	_TEAMCHAT_WIDTH,4,2             ; @TEAMCHAT_WIDTH
	.comm	_cg,4,2                         ; @cg
	.comm	_Q_COLOR_ESCAPE,4,2             ; @Q_COLOR_ESCAPE
	.no_dead_strip	_CG_AddToTeamChat
.subsections_via_symbols
