	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__sbrk_r                        ## -- Begin function _sbrk_r
	.p2align	4, 0x90
__sbrk_r:                               ## @_sbrk_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	__sbrk_r.sbrk_top(%rip), %eax
	movq	___heapBase@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movl	%esi, __sbrk_r.sbrk_top(%rip)
	movl	%esi, %eax
LBB0_2:
	leal	(%r14,%rax), %ebx
	addl	$4095, %ebx                     ## imm = 0xFFF
	andl	$-4096, %ebx                    ## imm = 0xF000
	movq	___heap_size@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	subl	%eax, %ebx
	subl	%esi, %ebx
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.3:
	movl	%ebx, %edi
	shrl	$12, %edi
	callq	_ctr_request_free_pages
	movl	(%r12), %esi
	addl	(%r13), %esi
	movq	_MEMOP_ALLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MEMPERM_READ@GOTPCREL(%rip), %rax
	movq	_MEMPERM_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	orl	(%rax), %r9d
	leaq	-44(%rbp), %rdi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	callq	_svcControlMemory
	testq	%rax, %rax
	js	LBB0_5
## %bb.4:
	addl	%ebx, (%r12)
	jmp	LBB0_8
LBB0_6:
	addl	%ebx, %eax
	movl	%eax, (%r12)
	testl	%ebx, %ebx
	jns	LBB0_8
## %bb.7:
	addl	%eax, %esi
	negl	%ebx
	movq	_MEMOP_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_MEMPERM_READ@GOTPCREL(%rip), %rax
	movq	_MEMPERM_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	orl	(%rax), %r9d
	leaq	-44(%rbp), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	callq	_svcControlMemory
LBB0_8:
	movslq	__sbrk_r.sbrk_top(%rip), %rax
	addl	%eax, %r14d
	movl	%r14d, __sbrk_r.sbrk_top(%rip)
	jmp	LBB0_9
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	$-1, %rax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,__sbrk_r.sbrk_top,4,2 ## @_sbrk_r.sbrk_top
	.comm	___heapBase,4,2                 ## @__heapBase
	.comm	___heap_size,4,2                ## @__heap_size
	.comm	_MEMOP_ALLOC,4,2                ## @MEMOP_ALLOC
	.comm	_MEMPERM_READ,4,2               ## @MEMPERM_READ
	.comm	_MEMPERM_WRITE,4,2              ## @MEMPERM_WRITE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MEMOP_FREE,4,2                 ## @MEMOP_FREE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__sbrk_r                        ; -- Begin function _sbrk_r
	.p2align	2
__sbrk_r:                               ; @_sbrk_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x20, x0
	adrp	x22, __sbrk_r.sbrk_top@PAGE
	ldr	w9, [x22, __sbrk_r.sbrk_top@PAGEOFF]
Lloh0:
	adrp	x24, ___heapBase@GOTPAGE
Lloh1:
	ldr	x24, [x24, ___heapBase@GOTPAGEOFF]
	ldr	w8, [x24]
	cbnz	w9, LBB0_2
; %bb.1:
	str	w8, [x22, __sbrk_r.sbrk_top@PAGEOFF]
	mov	x9, x8
LBB0_2:
	add	w9, w19, w9
	add	w9, w9, #4095
	and	w10, w9, #0xfffff000
Lloh2:
	adrp	x23, ___heap_size@GOTPAGE
Lloh3:
	ldr	x23, [x23, ___heap_size@GOTPAGEOFF]
	ldr	w9, [x23]
	add	w11, w9, w8
	sub	w21, w10, w11
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.3:
	lsr	w0, w21, #12
	bl	_ctr_request_free_pages
	ldr	w8, [x24]
	ldr	w9, [x23]
	add	w1, w9, w8
Lloh4:
	adrp	x8, _MEMOP_ALLOC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MEMOP_ALLOC@GOTPAGEOFF]
Lloh6:
	adrp	x9, _MEMPERM_READ@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MEMPERM_READ@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
Lloh9:
	ldr	w8, [x9]
Lloh10:
	adrp	x9, _MEMPERM_WRITE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MEMPERM_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w5, w9, w8
	add	x0, sp, #12
	mov	w2, #0
	mov	x3, x21
	bl	_svcControlMemory
	tbnz	x0, #63, LBB0_8
; %bb.4:
	ldr	w8, [x23]
	add	w8, w8, w21
	str	w8, [x23]
	b	LBB0_7
LBB0_5:
	add	w9, w9, w21
	str	w9, [x23]
	tbz	w21, #31, LBB0_7
; %bb.6:
	add	w1, w8, w9
	neg	w3, w21
Lloh13:
	adrp	x8, _MEMOP_FREE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MEMOP_FREE@GOTPAGEOFF]
Lloh15:
	adrp	x9, _MEMPERM_READ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MEMPERM_READ@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	ldr	w8, [x9]
Lloh19:
	adrp	x9, _MEMPERM_WRITE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MEMPERM_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w5, w9, w8
	add	x0, sp, #12
	mov	w2, #0
	bl	_svcControlMemory
LBB0_7:
	ldrsw	x0, [x22, __sbrk_r.sbrk_top@PAGEOFF]
	add	w8, w0, w19
	str	w8, [x22, __sbrk_r.sbrk_top@PAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	x0, #-1
LBB0_9:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh8
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh17
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,__sbrk_r.sbrk_top,4,2 ; @_sbrk_r.sbrk_top
	.comm	___heapBase,4,2                 ; @__heapBase
	.comm	___heap_size,4,2                ; @__heap_size
	.comm	_MEMOP_ALLOC,4,2                ; @MEMOP_ALLOC
	.comm	_MEMPERM_READ,4,2               ; @MEMPERM_READ
	.comm	_MEMPERM_WRITE,4,2              ; @MEMPERM_WRITE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MEMOP_FREE,4,2                 ; @MEMOP_FREE
.subsections_via_symbols
