	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BotFreeChatState               ## -- Begin function BotFreeChatState
	.p2align	4, 0x90
_BotFreeChatState:                      ## @BotFreeChatState
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	testl	%edi, %edi
	jle	LBB0_2
## %bb.1:
	movq	_MAX_CLIENTS@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_2
## %bb.4:
	movq	_botchatstates@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	%ebx, %r12d
	cmpq	$0, (%rax,%r12,8)
	je	LBB0_5
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	callq	_LibVarGetValue
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	%ebx, %edi
	callq	_BotFreeChatFile
LBB0_8:
	leaq	-36(%rbp), %rsi
	movl	%ebx, %edi
	callq	_BotNextConsoleMessage
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	leaq	-36(%rbp), %r14
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_BotRemoveConsoleMessage
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_BotNextConsoleMessage
	testl	%eax, %eax
	jne	LBB0_10
LBB0_11:
	movq	(%r15), %rax
	movq	(%rax,%r12,8), %rdi
	callq	_FreeMemory
	movq	(%r15), %rax
	movq	$0, (%rax,%r12,8)
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_botimport@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PRT_FATAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_5:
	movq	_botimport@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_PRT_FATAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	movl	%ebx, %edx
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_CLIENTS,4,2                ## @MAX_CLIENTS
	.comm	_botimport,8,3                  ## @botimport
	.comm	_PRT_FATAL,4,2                  ## @PRT_FATAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"chat state handle %d out of range\n"

	.comm	_botchatstates,8,3              ## @botchatstates
L_.str.1:                               ## @.str.1
	.asciz	"invalid chat state %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"bot_reloadcharacters"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BotFreeChatState               ; -- Begin function BotFreeChatState
	.p2align	2
_BotFreeChatState:                      ; @BotFreeChatState
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _MAX_CLIENTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_CLIENTS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.lt	LBB0_9
; %bb.2:
Lloh3:
	adrp	x20, _botchatstates@GOTPAGE
Lloh4:
	ldr	x20, [x20, _botchatstates@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x8, [x8, w19, uxtw #3]
	cbz	x8, LBB0_10
; %bb.3:
	mov	w21, w19
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_LibVarGetValue
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_BotFreeChatFile
LBB0_5:
	add	x1, sp, #12
	mov	x0, x19
	bl	_BotNextConsoleMessage
	cbz	w0, LBB0_8
; %bb.6:
	mov	x1, x0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_BotRemoveConsoleMessage
	add	x1, sp, #12
	mov	x0, x19
	bl	_BotNextConsoleMessage
	mov	x1, x0
	cbnz	w0, LBB0_7
LBB0_8:
	ldr	x8, [x20]
	lsl	x19, x21, #3
	ldr	x0, [x8, x19]
	bl	_FreeMemory
	ldr	x8, [x20]
	str	xzr, [x8, x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
Lloh7:
	adrp	x8, _botimport@GOTPAGE
Lloh8:
	ldr	x8, [x8, _botimport@GOTPAGEOFF]
Lloh9:
	ldr	x3, [x8]
Lloh10:
	adrp	x8, _PRT_FATAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PRT_FATAL@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh15:
	adrp	x8, _botimport@GOTPAGE
Lloh16:
	ldr	x8, [x8, _botimport@GOTPAGEOFF]
Lloh17:
	ldr	x3, [x8]
Lloh18:
	adrp	x8, _PRT_FATAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PRT_FATAL@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_11:
	mov	x2, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	br	x3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_CLIENTS,4,2                ; @MAX_CLIENTS
	.comm	_botimport,8,3                  ; @botimport
	.comm	_PRT_FATAL,4,2                  ; @PRT_FATAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"chat state handle %d out of range\n"

	.comm	_botchatstates,8,3              ; @botchatstates
l_.str.1:                               ; @.str.1
	.asciz	"invalid chat state %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"bot_reloadcharacters"

.subsections_via_symbols
