	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_StoreTree_r                ## -- Begin function AAS_StoreTree_r
	.p2align	4, 0x90
_AAS_StoreTree_r:                       ## @AAS_StoreTree_r
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AAS_StoreArea                  ## TAILCALL
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_8
LBB0_3:
	movq	_aasworld@GOTPCREL(%rip), %r12
	movl	(%r12), %r14d
	testl	%r14d, %r14d
	jne	LBB0_5
## %bb.4:
	movl	$1, (%r12)
	movl	$1, %r14d
LBB0_5:
	movq	_max_aas@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	cmpl	%esi, %r14d
	jl	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movl	(%r12), %r14d
LBB0_7:
	movq	8(%r12), %r15
	leal	1(%r14), %eax
	movl	%eax, (%r12)
	movslq	%r14d, %r12
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %edi
	shlq	$4, %r12
	leaq	(%r15,%r12), %rdx
	addq	$8, %rdx
	callq	_AAS_GetPlane
	movq	8(%rbx), %rax
	movq	(%rax), %rdi
	callq	_AAS_StoreTree_r
	movq	(%r15,%r12), %rcx
	movl	%eax, (%rcx)
	movq	8(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_AAS_StoreTree_r
	movq	(%r15,%r12), %rcx
	movl	%eax, 4(%rcx)
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_aasworld,16,3                  ## @aasworld
	.comm	_max_aas,4,2                    ## @max_aas
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"AAS_MAX_NODES = %d"

	.comm	_mapplanes,8,3                  ## @mapplanes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_StoreTree_r                ; -- Begin function AAS_StoreTree_r
	.p2align	2
_AAS_StoreTree_r:                       ; @AAS_StoreTree_r
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0, #16]
	cbz	x0, LBB0_4
; %bb.2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AAS_StoreArea
LBB0_3:
	mov	w20, #0
	b	LBB0_9
LBB0_4:
Lloh0:
	adrp	x21, _aasworld@GOTPAGE
Lloh1:
	ldr	x21, [x21, _aasworld@GOTPAGEOFF]
	ldr	w20, [x21]
	cbnz	w20, LBB0_6
; %bb.5:
	mov	w20, #1
	str	w20, [x21]
LBB0_6:
Lloh2:
	adrp	x8, _max_aas@GOTPAGE
Lloh3:
	ldr	x8, [x8, _max_aas@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	cmp	w20, w1
	b.lt	LBB0_8
; %bb.7:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	w20, [x21]
LBB0_8:
	ldr	x8, [x21, #8]
	add	w9, w20, #1
	str	w9, [x21]
Lloh7:
	adrp	x9, _mapplanes@GOTPAGE
Lloh8:
	ldr	x9, [x9, _mapplanes@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	ldr	x10, [x19]
	add	x9, x9, x10, lsl #3
	ldp	w1, w0, [x9]
	add	x21, x8, w20, sxtw #4
	add	x2, x21, #8
	bl	_AAS_GetPlane
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	bl	_AAS_StoreTree_r
	ldr	x8, [x21]
	str	w0, [x8]
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #8]
	bl	_AAS_StoreTree_r
	ldr	x8, [x21]
	str	w0, [x8, #4]
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_aasworld,16,3                  ; @aasworld
	.comm	_max_aas,4,2                    ; @max_aas
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"AAS_MAX_NODES = %d"

	.comm	_mapplanes,8,3                  ; @mapplanes
.subsections_via_symbols
