	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FrLdrHeapCreate                ## -- Begin function FrLdrHeapCreate
	.p2align	4, 0x90
_FrLdrHeapCreate:                       ## @FrLdrHeapCreate
	.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
	movl	%esi, %r12d
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	movq	_MM_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_ALIGN_UP_BY
	movl	%eax, %ebx
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_MmAllocateMemoryWithType
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	%ebx, (%r14)
	movslq	%ebx, %rax
	movabsq	$17179869180, %r12              ## imm = 0x3FFFFFFFC
	addq	%rax, %r12
	shrq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%r14)
	movups	%xmm0, 48(%r14)
	movq	$0, 64(%r14)
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	callq	_TRACE
	addq	$8, %r15
	cmpl	$3, %r12d
	jle	LBB0_3
## %bb.4:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	addl	$-2, %r12d
	xorl	%r13d, %r13d
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_MAXUSHORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	-1(%r12), %esi
	callq	_min
	movq	%rax, %rbx
	movl	%ebx, (%r15)
	movl	%r13d, 4(%r15)
	movb	$0, 8(%r15)
	movq	%r15, %rax
	subq	-48(%rbp), %rax                 ## 8-byte Folded Reload
	shrq	$3, %rax
	imull	$-1431655765, %eax, %eax        ## imm = 0xAAAAAAAB
	leal	(%rax,%rbx), %ecx
	incl	%ecx
	movq	16(%r15), %rdx
	movl	%ecx, (%rdx)
	notl	%r13d
	addl	%eax, %r13d
	movl	%r13d, 4(%rdx)
	movl	%ebx, %r14d
	notl	%r14d
	addl	%r12d, %r14d
	movslq	%ebx, %rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%r15,%rax,8), %r15
	addq	$24, %r15
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	callq	_TRACE
	movl	%ebx, %r13d
	movl	%r14d, %r12d
	cmpl	$1, %r14d
	jg	LBB0_5
## %bb.6:
	movq	%r15, %rax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_ERR
	jmp	LBB0_8
LBB0_3:
	xorl	%ebx, %ebx
	movq	%r15, %rax
	movq	%r15, %rcx
LBB0_7:
	subq	%rcx, %rax
	shrq	$3, %rax
	imull	$-1431655765, %eax, %eax        ## imm = 0xAAAAAAAB
	movl	%eax, 4(%r14)
	movl	$0, (%r15)
	movl	%ebx, 4(%r15)
	movb	$35, 8(%r15)
	movq	16(%r15), %rcx
	movl	$0, (%rcx)
	notl	%ebx
	addl	%eax, %ebx
	movl	%ebx, 4(%rcx)
	movq	24(%r14), %rcx
	movl	%eax, 4(%rcx)
LBB0_8:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HeapCreate(MemoryType=%ld)\n"

	.comm	_MM_PAGE_SIZE,4,2               ## @MM_PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"HEAP: Failed to allocate heap of size 0x%lx, Type\n"

L_.str.2:                               ## @.str.2
	.asciz	"Remaining = %ld\n"

	.comm	_MAXUSHORT,4,2                  ## @MAXUSHORT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FrLdrHeapCreate                ; -- Begin function FrLdrHeapCreate
	.p2align	2
_FrLdrHeapCreate:                       ; @FrLdrHeapCreate
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh2:
	adrp	x8, _MM_PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MM_PAGE_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ALIGN_UP_BY
	mov	x21, x0
	mov	x1, x20
	bl	_MmAllocateMemoryWithType
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.1:
	str	w21, [x19]
	mov	x8, #17179869180
	add	x8, x8, w21, sxtw
	lsr	x20, x8, #2
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x19, #32]
	str	xzr, [x19, #64]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	add	x23, x19, #8
	cmp	w20, #3
	b.le	LBB0_5
; %bb.2:
	mov	w28, #0
Lloh7:
	adrp	x25, _MAXUSHORT@GOTPAGE
Lloh8:
	ldr	x25, [x25, _MAXUSHORT@GOTPAGEOFF]
	sub	w21, w20, #2
	mov	w26, #43691
	movk	w26, #43690, lsl #16
	mov	w27, #24
	mov	x24, x23
Lloh9:
	adrp	x22, l_.str.2@PAGE
Lloh10:
	add	x22, x22, l_.str.2@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	sub	w1, w21, #1
	bl	_min
	mov	x20, x0
	stp	w20, w28, [x24]
	strb	wzr, [x24, #8]
	sub	x8, x24, x23
	lsr	x8, x8, #3
	mul	w8, w8, w26
	add	w9, w8, w20
	add	w9, w9, #1
	ldr	x10, [x24, #16]
	mvn	w11, w28
	add	w8, w8, w11
	stp	w9, w8, [x10]
	mvn	w8, w20
	add	w21, w21, w8
	smaddl	x8, w20, w27, x24
	add	x24, x8, #24
	mov	x0, x22
	mov	x1, x21
	bl	_TRACE
	mov	x28, x20
	cmp	w21, #1
	b.gt	LBB0_3
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	x2, x20
	bl	_ERR
	b	LBB0_7
LBB0_5:
	mov	w20, #0
	mov	x24, x23
LBB0_6:
	sub	x8, x24, x23
	lsr	x8, x8, #3
	mov	w9, #43691
	movk	w9, #43690, lsl #16
	mul	w8, w8, w9
	str	w8, [x19, #4]
	stp	wzr, w20, [x24]
	mov	w9, #35
	strb	w9, [x24, #8]
	ldr	x9, [x24, #16]
	mvn	w10, w20
	add	w10, w8, w10
	stp	wzr, w10, [x9]
	ldr	x9, [x19, #24]
	str	w8, [x9, #4]
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HeapCreate(MemoryType=%ld)\n"

	.comm	_MM_PAGE_SIZE,4,2               ; @MM_PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"HEAP: Failed to allocate heap of size 0x%lx, Type\n"

l_.str.2:                               ; @.str.2
	.asciz	"Remaining = %ld\n"

	.comm	_MAXUSHORT,4,2                  ; @MAXUSHORT
.subsections_via_symbols
