	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function RestoreModel
_RestoreModel:                          ## @RestoreModel
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	xorl	%edi, %edi
	callq	_RESET_TEXT
	movq	40(%r14), %rbx
	cmpq	%r15, %rbx
	jne	LBB0_4
LBB0_1:
	cmpq	%r15, 48(%r14)
	jne	LBB0_2
LBB0_11:
	movq	(%r14), %rax
	movq	_PPMD8_RESTORE_METHOD_RESTART@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_19
## %bb.12:
	movq	%r14, %rdi
	callq	_GetUsedMemory
	movl	16(%r14), %ecx
	sarl	%ecx
	cmpl	%ecx, %eax
	jge	LBB0_13
LBB0_19:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_RestartModel                   ## TAILCALL
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$2, %rdx
	shrq	%rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%ecx, %ecx
	callq	_Refresh
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_SUFFIX
	movq	%rax, %rbx
	cmpq	%r15, %rax
	je	LBB0_1
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	movq	%rdx, %rax
	decq	%rax
	movq	%rax, (%rbx)
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_STATS
	movq	%rax, %r12
	movl	8(%rbx), %eax
	andl	$16, %eax
	xorl	%ecx, %ecx
	cmpl	$64, (%r12)
	setge	%cl
	leal	(%rax,%rcx,8), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_ONE_STATE
	movq	(%r12), %rcx
	movq	%rcx, (%rax)
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_SpecialFreeUnit
	movq	%rbx, %rdi
	callq	_ONE_STATE
	movl	4(%rax), %r12d
	addl	$11, %r12d
	shrl	$3, %r12d
	movq	%rbx, %rdi
	callq	_ONE_STATE
	movl	%r12d, 4(%rax)
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_ONE_STATE
	movl	4(%rax), %ebx
	movq	%r15, %rdi
	callq	_ONE_STATE
	movl	4(%rax), %eax
	sarl	%eax
	subl	%eax, %ebx
	movq	%r15, %rdi
	callq	_ONE_STATE
	movl	%ebx, 4(%rax)
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_SUFFIX
	movq	%rax, %r15
	cmpq	%rax, 48(%r14)
	je	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdx
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	12(%r15), %rax
	addq	$4, %rax
	movl	%eax, 12(%r15)
	leaq	128(,%rdx,4), %rcx
	cmpq	%rax, %rcx
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$2, %rdx
	shrq	%rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	movl	$1, %ecx
	callq	_Refresh
	jmp	LBB0_10
LBB0_13:
	movq	40(%r14), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_15
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_SUFFIX
	movq	%rax, 40(%r14)
	cmpq	$0, 16(%rax)
	jne	LBB0_20
LBB0_15:
	movq	%r14, %rdi
	movq	%rax, %rsi
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	xorl	%edx, %edx
	callq	_CutOff
	movq	%r14, %rdi
	callq	_ExpandTextArea
	movq	%r14, %rdi
	callq	_GetUsedMemory
	movl	16(%r14), %ecx
	sarl	$2, %ecx
	leal	(%rcx,%rcx,2), %ecx
	cmpl	%ecx, %eax
	jle	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	40(%r14), %rsi
	movq	%r14, %rdi
	jmp	LBB0_17
LBB0_18:
	movq	$0, 32(%r14)
	movl	20(%r14), %eax
	movl	%eax, 24(%r14)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PPMD8_RESTORE_METHOD_RESTART,8,3 ## @PPMD8_RESTORE_METHOD_RESTART
	.comm	_PPMD8_RESTORE_METHOD_FREEZE,8,3 ## @PPMD8_RESTORE_METHOD_FREEZE
	.no_dead_strip	_RestoreModel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function RestoreModel
_RestoreModel:                          ; @RestoreModel
	.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
	mov	x20, x1
	mov	x19, x0
	mov	w0, #0
	bl	_RESET_TEXT
	ldr	x21, [x19, #40]
	cmp	x21, x20
	b.ne	LBB0_7
LBB0_1:
	ldr	x8, [x19, #48]
	cmp	x8, x20
	b.ne	LBB0_11
LBB0_2:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _PPMD8_RESTORE_METHOD_RESTART@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PPMD8_RESTORE_METHOD_RESTART@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_GetUsedMemory
	ldr	w8, [x19, #16]
	cmp	w0, w8, asr #1
	b.ge	LBB0_14
LBB0_4:
	mov	x0, x19
	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	_RestartModel
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x8, #2
	lsr	x2, x8, #1
	mov	x0, x19
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	w3, #0
	bl	_Refresh
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_SUFFIX
	mov	x21, x0
	cmp	x0, x20
	b.eq	LBB0_1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
	subs	x9, x8, #1
	str	x9, [x21]
	b.ne	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_STATS
	mov	x22, x0
	ldr	w8, [x21, #8]
	and	w8, w8, #0x10
	ldr	w9, [x0]
	cmp	w9, #63
	cset	w9, gt
	bfi	w8, w9, #3, #1
	str	w8, [x21, #8]
	mov	x0, x21
	bl	_ONE_STATE
	ldr	x8, [x22]
	str	x8, [x0]
	mov	x0, x19
	mov	x1, x22
	bl	_SpecialFreeUnit
	mov	x0, x21
	bl	_ONE_STATE
	ldr	w8, [x0, #4]
	add	w8, w8, #11
	lsr	w22, w8, #3
	mov	x0, x21
	bl	_ONE_STATE
	str	w22, [x0, #4]
	b	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	bl	_ONE_STATE
	ldr	w21, [x0, #4]
	mov	x0, x20
	bl	_ONE_STATE
	ldr	w8, [x0, #4]
	sub	w21, w21, w8, asr #1
	mov	x0, x20
	bl	_ONE_STATE
	str	w21, [x0, #4]
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x20
	bl	_SUFFIX
	mov	x20, x0
	ldr	x8, [x19, #48]
	cmp	x8, x0
	b.eq	LBB0_2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	cbz	x8, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldrsw	x9, [x20, #12]
	add	x9, x9, #4
	str	w9, [x20, #12]
	lsl	x10, x8, #2
	add	x10, x10, #128
	cmp	x10, x9
	b.ge	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x8, x8, #2
	lsr	x2, x8, #1
	mov	x0, x19
	mov	x1, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	w3, #1
	bl	_Refresh
	b	LBB0_10
LBB0_14:
	ldr	x1, [x19, #40]
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x1
	bl	_SUFFIX
	mov	x1, x0
	str	x0, [x19, #40]
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_15
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	x1, [x19, #40]
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w2, #0
	bl	_CutOff
	mov	x0, x19
	bl	_ExpandTextArea
	mov	x0, x19
	bl	_GetUsedMemory
	ldr	w8, [x19, #16]
	asr	w8, w8, #2
	add	w8, w8, w8, lsl #1
	cmp	w0, w8
	b.gt	LBB0_16
; %bb.18:
	str	xzr, [x19, #32]
	ldr	w8, [x19, #20]
	str	w8, [x19, #24]
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PPMD8_RESTORE_METHOD_RESTART,8,3 ; @PPMD8_RESTORE_METHOD_RESTART
	.comm	_PPMD8_RESTORE_METHOD_FREEZE,8,3 ; @PPMD8_RESTORE_METHOD_FREEZE
	.no_dead_strip	_RestoreModel
.subsections_via_symbols
