	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___system_allocateHeaps         ## -- Begin function __system_allocateHeaps
	.p2align	4, 0x90
___system_allocateHeaps:                ## @__system_allocateHeaps
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	$0, -20(%rbp)
	leaq	-32(%rbp), %rdi
	leaq	-36(%rbp), %rsi
	callq	_svcQueryMemory
	movq	___stacksize__@GOTPCREL(%rip), %rax
	movl	$4095, %ecx                     ## imm = 0xFFF
	addl	(%rax), %ecx
	andl	$-4096, %ecx                    ## imm = 0xF000
	movl	%ecx, (%rax)
	xorl	%eax, %eax
	subl	-32(%rbp), %ecx
	cmovlel	%eax, %ecx
	movq	___stack_size_extra@GOTPCREL(%rip), %r14
	movl	%ecx, (%r14)
	movl	-28(%rbp), %esi
	subl	%ecx, %esi
	movq	___stack_bottom@GOTPCREL(%rip), %rbx
	movl	%esi, (%rbx)
	testl	%ecx, %ecx
	je	LBB0_2
## %bb.1:
	movq	_MEMOP_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MEMPERM_READ@GOTPCREL(%rip), %rax
	movq	_MEMPERM_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	orl	(%rax), %r9d
	leaq	-20(%rbp), %rdi
	xorl	%edx, %edx
	callq	_svcControlMemory
	movslq	(%rbx), %rdi
	movl	(%r14), %edx
	movl	$252, %esi
	callq	_memset
LBB0_2:
	movq	___heapBase@GOTPCREL(%rip), %rax
	movl	$134217728, (%rax)              ## imm = 0x8000000
	movq	___heap_size@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	___linear_heap_size@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MEMOP_ALLOC_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MEMPERM_READ@GOTPCREL(%rip), %rax
	movq	_MEMPERM_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	orl	(%rax), %r9d
	movq	___linear_heap@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_svcControlMemory
	movq	_fake_heap_end@GOTPCREL(%rip), %rax
	movq	$334495744, (%rax)              ## imm = 0x13F00000
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	___stacksize__,4,2              ## @__stacksize__
	.comm	___stack_size_extra,4,2         ## @__stack_size_extra
	.comm	___stack_bottom,4,2             ## @__stack_bottom
	.comm	_MEMOP_ALLOC,4,2                ## @MEMOP_ALLOC
	.comm	_MEMPERM_READ,4,2               ## @MEMPERM_READ
	.comm	_MEMPERM_WRITE,4,2              ## @MEMPERM_WRITE
	.comm	___heapBase,4,2                 ## @__heapBase
	.comm	___heap_size,8,3                ## @__heap_size
	.comm	___linear_heap,4,2              ## @__linear_heap
	.comm	___linear_heap_size,4,2         ## @__linear_heap_size
	.comm	_MEMOP_ALLOC_LINEAR,4,2         ## @MEMOP_ALLOC_LINEAR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___system_allocateHeaps         ; -- Begin function __system_allocateHeaps
	.p2align	2
___system_allocateHeaps:                ; @__system_allocateHeaps
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	str	wzr, [sp, #28]
	add	x0, sp, #16
	add	x1, sp, #12
	bl	_svcQueryMemory
Lloh0:
	adrp	x8, ___stacksize__@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stacksize__@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #4095
	and	w9, w9, #0xfffff000
	str	w9, [x8]
	ldp	w8, w10, [sp, #16]
	subs	w8, w9, w8
	csel	w3, w8, wzr, gt
Lloh2:
	adrp	x21, ___stack_size_extra@GOTPAGE
Lloh3:
	ldr	x21, [x21, ___stack_size_extra@GOTPAGEOFF]
	str	w3, [x21]
Lloh4:
	adrp	x22, ___stack_bottom@GOTPAGE
Lloh5:
	ldr	x22, [x22, ___stack_bottom@GOTPAGEOFF]
	sub	w1, w10, w3
	str	w1, [x22]
Lloh6:
	adrp	x19, _MEMPERM_READ@GOTPAGE
Lloh7:
	ldr	x19, [x19, _MEMPERM_READ@GOTPAGEOFF]
Lloh8:
	adrp	x20, _MEMPERM_WRITE@GOTPAGE
Lloh9:
	ldr	x20, [x20, _MEMPERM_WRITE@GOTPAGEOFF]
	cbz	w3, LBB0_2
; %bb.1:
Lloh10:
	adrp	x8, _MEMOP_ALLOC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MEMOP_ALLOC@GOTPAGEOFF]
Lloh12:
	ldr	w4, [x8]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w5, w9, w8
	add	x0, sp, #28
	mov	w2, #0
	bl	_svcControlMemory
	ldrsw	x0, [x22]
	ldr	w2, [x21]
	mov	w1, #252
	bl	_memset
LBB0_2:
Lloh13:
	adrp	x8, ___heapBase@GOTPAGE
Lloh14:
	ldr	x8, [x8, ___heapBase@GOTPAGEOFF]
	mov	w9, #134217728
Lloh15:
	str	w9, [x8]
Lloh16:
	adrp	x8, ___heap_size@GOTPAGE
Lloh17:
	ldr	x8, [x8, ___heap_size@GOTPAGEOFF]
Lloh18:
	str	xzr, [x8]
Lloh19:
	adrp	x8, ___linear_heap_size@GOTPAGE
Lloh20:
	ldr	x8, [x8, ___linear_heap_size@GOTPAGEOFF]
Lloh21:
	ldr	w3, [x8]
Lloh22:
	adrp	x8, _MEMOP_ALLOC_LINEAR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MEMOP_ALLOC_LINEAR@GOTPAGEOFF]
Lloh24:
	ldr	w4, [x8]
	ldr	w8, [x19]
	ldr	w9, [x20]
	orr	w5, w9, w8
Lloh25:
	adrp	x0, ___linear_heap@GOTPAGE
Lloh26:
	ldr	x0, [x0, ___linear_heap@GOTPAGEOFF]
	mov	w1, #0
	mov	w2, #0
	bl	_svcControlMemory
Lloh27:
	adrp	x8, _fake_heap_end@GOTPAGE
Lloh28:
	ldr	x8, [x8, _fake_heap_end@GOTPAGEOFF]
	mov	w9, #334495744
Lloh29:
	str	x9, [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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	___stacksize__,4,2              ; @__stacksize__
	.comm	___stack_size_extra,4,2         ; @__stack_size_extra
	.comm	___stack_bottom,4,2             ; @__stack_bottom
	.comm	_MEMOP_ALLOC,4,2                ; @MEMOP_ALLOC
	.comm	_MEMPERM_READ,4,2               ; @MEMPERM_READ
	.comm	_MEMPERM_WRITE,4,2              ; @MEMPERM_WRITE
	.comm	___heapBase,4,2                 ; @__heapBase
	.comm	___heap_size,8,3                ; @__heap_size
	.comm	___linear_heap,4,2              ; @__linear_heap
	.comm	___linear_heap_size,4,2         ; @__linear_heap_size
	.comm	_MEMOP_ALLOC_LINEAR,4,2         ; @MEMOP_ALLOC_LINEAR
.subsections_via_symbols
