	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_ParseBSPEntities           ## -- Begin function AAS_ParseBSPEntities
	.p2align	4, 0x90
_AAS_ParseBSPEntities:                  ## @AAS_ParseBSPEntities
	.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	_bspworld@GOTPCREL(%rip), %rbx
	movl	16(%rbx), %esi
	movl	20(%rbx), %edi
	leaq	L_.str(%rip), %rdx
	callq	_LoadScriptMemory
	movq	%rax, %r13
	movq	_SCFL_NOSTRINGWHITESPACES@GOTPCREL(%rip), %rax
	movq	_SCFL_NOSTRINGESCAPECHARS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r13, %rdi
	callq	_SetScriptFlags
	movl	$1, (%rbx)
	leaq	-56(%rbp), %r14
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	-48(%rbp), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	movq	_bspworld@GOTPCREL(%rip), %rbx
	jne	LBB0_14
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_PS_ReadToken
	testq	%rax, %rax
	je	LBB0_16
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-48(%rbp), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movslq	(%rbx), %r12
	movq	_MAX_BSPENTITIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jge	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rcx
	leal	1(%r12), %eax
	movl	%eax, (%rbx)
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	$0, (%rcx,%r12,8)
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_PS_ReadToken
	testq	%rax, %rax
	je	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	movl	-48(%rbp), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=2
	movl	$24, %edi
	callq	_GetClearedHunkMemory
	movq	%rax, %rbx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%r12,8), %rax
	movq	%rax, 16(%rbx)
	movq	%rbx, (%rcx,%r12,8)
	movq	-56(%rbp), %rax
	movl	-48(%rbp), %edx
	movq	_TT_STRING@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	%edx, %edi
	callq	_StripDoubleQuotes
	movl	-48(%rbp), %edi
	callq	_strlen
	leaq	1(%rax), %rdi
	callq	_GetHunkMemory
	movq	%rax, (%rbx)
	movl	-48(%rbp), %esi
	movq	%rax, %rdi
	callq	_strcpy
	movq	(%r15), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	movq	%r14, %rcx
	callq	_PS_ExpectTokenType
	testl	%eax, %eax
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_7 Depth=2
	movl	-48(%rbp), %edi
	callq	_StripDoubleQuotes
	movl	-48(%rbp), %edi
	callq	_strlen
	leaq	1(%rax), %rdi
	callq	_GetHunkMemory
	movq	%rax, 8(%rbx)
	movl	-48(%rbp), %esi
	movq	%rax, %rdi
	callq	_strcpy
	jmp	LBB0_7
LBB0_3:
	movl	-48(%rbp), %edx
LBB0_10:
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_ScriptError
LBB0_15:
	xorl	%eax, %eax
	callq	_AAS_FreeBSPEntities
LBB0_16:
	movq	%r13, %rdi
	callq	_FreeScript
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_botimport@GOTPCREL(%rip), %rax
	movq	_PRT_MESSAGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	*(%rax)
	jmp	LBB0_16
LBB0_14:
	leaq	L_.str.5(%rip), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_ScriptError
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_bspworld,24,3                  ## @bspworld
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entdata"

	.comm	_SCFL_NOSTRINGWHITESPACES,4,2   ## @SCFL_NOSTRINGWHITESPACES
	.comm	_SCFL_NOSTRINGESCAPECHARS,4,2   ## @SCFL_NOSTRINGESCAPECHARS
L_.str.1:                               ## @.str.1
	.asciz	"{"

L_.str.2:                               ## @.str.2
	.asciz	"invalid %s\n"

	.comm	_MAX_BSPENTITIES,4,2            ## @MAX_BSPENTITIES
	.comm	_botimport,8,3                  ## @botimport
	.comm	_PRT_MESSAGE,4,2                ## @PRT_MESSAGE
L_.str.3:                               ## @.str.3
	.asciz	"too many entities in BSP file\n"

L_.str.4:                               ## @.str.4
	.asciz	"}"

	.comm	_TT_STRING,8,3                  ## @TT_STRING
L_.str.5:                               ## @.str.5
	.asciz	"missing }\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_ParseBSPEntities           ; -- Begin function AAS_ParseBSPEntities
	.p2align	2
_AAS_ParseBSPEntities:                  ; @AAS_ParseBSPEntities
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, _bspworld@GOTPAGE
Lloh1:
	ldr	x23, [x23, _bspworld@GOTPAGEOFF]
	ldp	w1, w0, [x23, #16]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	bl	_LoadScriptMemory
	mov	x19, x0
Lloh4:
	adrp	x8, _SCFL_NOSTRINGWHITESPACES@GOTPAGE
Lloh5:
	ldr	x8, [x8, _SCFL_NOSTRINGWHITESPACES@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _SCFL_NOSTRINGESCAPECHARS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SCFL_NOSTRINGESCAPECHARS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_SetScriptFlags
	mov	w8, #1
	str	w8, [x23]
Lloh10:
	adrp	x20, l_.str.1@PAGE
Lloh11:
	add	x20, x20, l_.str.1@PAGEOFF
Lloh12:
	adrp	x24, _MAX_BSPENTITIES@GOTPAGE
Lloh13:
	ldr	x24, [x24, _MAX_BSPENTITIES@GOTPAGEOFF]
Lloh14:
	adrp	x21, l_.str.4@PAGE
Lloh15:
	add	x21, x21, l_.str.4@PAGEOFF
Lloh16:
	adrp	x25, _TT_STRING@GOTPAGE
Lloh17:
	ldr	x25, [x25, _TT_STRING@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #24]
	mov	x1, x21
	bl	_strcmp
	cbnz	x0, LBB0_18
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	add	x1, sp, #16
	mov	x0, x19
	bl	_PS_ReadToken
	cbz	x0, LBB0_15
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #24]
	mov	x1, x20
	bl	_strcmp
	cbnz	x0, LBB0_16
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrsw	x26, [x23]
	ldr	w8, [x24]
	cmp	w26, w8
	b.ge	LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x27, [x23, #8]
	add	w8, w26, #1
	str	w8, [x23]
	str	xzr, [x27, x26, lsl #3]
LBB0_6:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x1, sp, #16
	mov	x0, x19
	bl	_PS_ReadToken
	cbz	x0, LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w0, [sp, #24]
	mov	x1, x21
	bl	_strcmp
	cbz	x0, LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	w0, #24
	bl	_GetClearedHunkMemory
	mov	x22, x0
	lsl	x8, x26, #3
	ldr	x9, [x27, x8]
	str	x9, [x0, #16]
	str	x0, [x27, x8]
	ldr	x8, [sp, #16]
	ldr	x9, [x25]
	ldr	w0, [sp, #24]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=2
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_StripDoubleQuotes
	ldr	w0, [sp, #24]
	bl	_strlen
	add	x0, x0, #1
	bl	_GetHunkMemory
	str	x0, [x22]
	ldr	w1, [sp, #24]
	bl	_strcpy
	ldr	x1, [x25]
	add	x3, sp, #16
	mov	x0, x19
	mov	w2, #0
	bl	_PS_ExpectTokenType
	cbz	w0, LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	ldr	w0, [sp, #24]
	bl	_StripDoubleQuotes
	ldr	w0, [sp, #24]
	bl	_strlen
	add	x0, x0, #1
	bl	_GetHunkMemory
	str	x0, [x22, #8]
	ldr	w1, [sp, #24]
	bl	_strcpy
	b	LBB0_6
LBB0_11:
	str	x0, [sp]
LBB0_12:
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_ScriptError
LBB0_14:
	bl	_AAS_FreeBSPEntities
LBB0_15:
	mov	x0, x19
	bl	_FreeScript
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_16:
	ldr	w8, [sp, #24]
	str	x8, [sp]
	b	LBB0_12
LBB0_17:
Lloh20:
	adrp	x8, _botimport@GOTPAGE
Lloh21:
	ldr	x8, [x8, _botimport@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	adrp	x9, _PRT_MESSAGE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PRT_MESSAGE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x9]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	blr	x8
	b	LBB0_15
LBB0_18:
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_bspworld,24,3                  ; @bspworld
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entdata"

	.comm	_SCFL_NOSTRINGWHITESPACES,4,2   ; @SCFL_NOSTRINGWHITESPACES
	.comm	_SCFL_NOSTRINGESCAPECHARS,4,2   ; @SCFL_NOSTRINGESCAPECHARS
l_.str.1:                               ; @.str.1
	.asciz	"{"

l_.str.2:                               ; @.str.2
	.asciz	"invalid %s\n"

	.comm	_MAX_BSPENTITIES,4,2            ; @MAX_BSPENTITIES
	.comm	_botimport,8,3                  ; @botimport
	.comm	_PRT_MESSAGE,4,2                ; @PRT_MESSAGE
l_.str.3:                               ; @.str.3
	.asciz	"too many entities in BSP file\n"

l_.str.4:                               ; @.str.4
	.asciz	"}"

	.comm	_TT_STRING,8,3                  ; @TT_STRING
l_.str.5:                               ; @.str.5
	.asciz	"missing }\n"

.subsections_via_symbols
