	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BotLoadChatFile                ## -- Begin function BotLoadChatFile
	.p2align	4, 0x90
_BotLoadChatFile:                       ## @BotLoadChatFile
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movl	%edi, %ebx
	callq	_BotChatStateFromHandle
	movq	_BLERR_CANNOTLOADICHAT@GOTPCREL(%rip), %r15
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_BotFreeChatFile
	leaq	L_.str(%rip), %rdi
	callq	_LibVarGetValue
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_13:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_BotLoadInitialChat
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%rax, (%r13)
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	leaq	L_.str(%rip), %rdi
	callq	_LibVarGetValue
	movq	_BLERR_NOERROR@GOTPCREL(%rip), %r15
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movl	$4, %edi
	callq	_GetClearedMemory
	movq	%r14, %rsi
	movq	_ichatdata@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movslq	%ebx, %rbx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r13), %rax
	movq	(%r14), %rcx
	movq	(%rcx,%rbx,8), %rcx
	movq	%rax, 8(%rcx)
	movl	4(%rcx), %edi
	movl	$4, %edx
	callq	_Q_strncpyz
	movq	(%r14), %rax
	movq	(%rax,%rbx,8), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_Q_strncpyz
	jmp	LBB0_17
LBB0_2:
	movq	_MAX_CLIENTS@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_8
## %bb.3:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	movq	_ichatdata@GOTPCREL(%rip), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$-1, %ebx
	cmovel	%r14d, %ebx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	movslq	(%r13), %rax
	cmpq	%rax, %r14
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	(%rax,%r14,8), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movl	4(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.12:
	movq	(%r15), %rax
	movq	(%rax,%r14,8), %rax
	movq	8(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	_BLERR_NOERROR@GOTPCREL(%rip), %r15
	jmp	LBB0_17
LBB0_14:
	movq	_botimport@GOTPCREL(%rip), %rax
	movq	_PRT_FATAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_7:
	cmpl	$-1, %ebx
	movq	_BLERR_CANNOTLOADICHAT@GOTPCREL(%rip), %r15
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_13
LBB0_8:
	movq	_botimport@GOTPCREL(%rip), %rax
	movq	_PRT_FATAL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	movq	%r14, %rdx
	movq	%r12, %rcx
	callq	*(%rax)
LBB0_17:
	movl	(%r15), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BLERR_CANNOTLOADICHAT,4,2      ## @BLERR_CANNOTLOADICHAT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bot_reloadcharacters"

	.comm	_MAX_CLIENTS,4,2                ## @MAX_CLIENTS
	.comm	_ichatdata,8,3                  ## @ichatdata
	.comm	_BLERR_NOERROR,4,2              ## @BLERR_NOERROR
	.comm	_botimport,8,3                  ## @botimport
	.comm	_PRT_FATAL,4,2                  ## @PRT_FATAL
L_.str.1:                               ## @.str.1
	.asciz	"ichatdata table full; couldn't load chat %s from %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"couldn't load chat %s from %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BotLoadChatFile                ; -- Begin function BotLoadChatFile
	.p2align	2
_BotLoadChatFile:                       ; @BotLoadChatFile
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
	bl	_BotChatStateFromHandle
	cbz	x0, LBB0_19
; %bb.1:
	mov	x21, x0
	mov	x0, x22
	bl	_BotFreeChatFile
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LibVarGetValue
	cbz	w0, LBB0_6
; %bb.2:
	mov	w22, #0
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	bl	_BotLoadInitialChat
	str	x0, [x21]
	cbz	x0, LBB0_15
; %bb.4:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LibVarGetValue
	cbnz	w0, LBB0_14
; %bb.5:
	mov	w0, #4
	bl	_GetClearedMemory
Lloh4:
	adrp	x23, _ichatdata@GOTPAGE
Lloh5:
	ldr	x23, [x23, _ichatdata@GOTPAGEOFF]
	ldr	x8, [x23]
	sbfiz	x22, x22, #3, #32
	str	x0, [x8, x22]
	ldr	x8, [x21]
	ldr	x9, [x23]
	ldr	x9, [x9, x22]
	str	x8, [x9, #8]
	ldr	w0, [x9, #4]
	mov	x1, x20
	mov	w2, #4
	bl	_Q_strncpyz
	ldr	x8, [x23]
	ldr	x8, [x8, x22]
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #4
	bl	_Q_strncpyz
	b	LBB0_14
LBB0_6:
Lloh6:
	adrp	x23, _MAX_CLIENTS@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MAX_CLIENTS@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.7:
	mov	x24, #0
	mov	w22, #-1
Lloh8:
	adrp	x25, _ichatdata@GOTPAGE
Lloh9:
	ldr	x25, [x25, _ichatdata@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	cmn	w22, #1
	csel	w22, w24, w22, eq
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.ge	LBB0_16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	cbz	x8, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	w1, [x8]
	mov	x0, x19
	bl	_strcmp
	cbnz	x0, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	ldr	w1, [x8, #4]
	mov	x0, x20
	bl	_strcmp
	cbnz	x0, LBB0_9
; %bb.13:
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	ldr	x8, [x8, #8]
	str	x8, [x21]
LBB0_14:
Lloh10:
	adrp	x8, _BLERR_NOERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BLERR_NOERROR@GOTPAGEOFF]
	b	LBB0_20
LBB0_15:
Lloh12:
	adrp	x8, _botimport@GOTPAGE
Lloh13:
	ldr	x8, [x8, _botimport@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _PRT_FATAL@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PRT_FATAL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x9]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_16:
	cmn	w22, #1
	b.ne	LBB0_3
LBB0_17:
Lloh20:
	adrp	x8, _botimport@GOTPAGE
Lloh21:
	ldr	x8, [x8, _botimport@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, _PRT_FATAL@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PRT_FATAL@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x9]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_18:
	mov	x2, x20
	mov	x3, x19
	blr	x8
LBB0_19:
Lloh28:
	adrp	x8, _BLERR_CANNOTLOADICHAT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BLERR_CANNOTLOADICHAT@GOTPAGEOFF]
LBB0_20:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_BLERR_CANNOTLOADICHAT,4,2      ; @BLERR_CANNOTLOADICHAT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bot_reloadcharacters"

	.comm	_MAX_CLIENTS,4,2                ; @MAX_CLIENTS
	.comm	_ichatdata,8,3                  ; @ichatdata
	.comm	_BLERR_NOERROR,4,2              ; @BLERR_NOERROR
	.comm	_botimport,8,3                  ; @botimport
	.comm	_PRT_FATAL,4,2                  ; @PRT_FATAL
l_.str.1:                               ; @.str.1
	.asciz	"ichatdata table full; couldn't load chat %s from %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"couldn't load chat %s from %s\n"

.subsections_via_symbols
