	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function heap_create
_heap_create:                           ## @heap_create
	.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
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	$16, %edi
	callq	_malloc
	movl	$1, %r13d
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r15
	movq	%rbx, (%rax)
	shll	$3, %ebx
	movl	%ebx, %edi
	callq	_malloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	movq	(%r15), %r8
	testq	%r8, %r8
	je	LBB0_10
## %bb.3:
	leaq	-1(%r8), %r13
	movl	%r8d, %edx
	andl	$3, %edx
	cmpq	$3, %r13
	jae	LBB0_12
## %bb.4:
	xorl	%esi, %esi
	jmp	LBB0_5
LBB0_14:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_11
LBB0_12:
	movq	%r8, %r9
	andq	$-4, %r9
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%r12,%rcx), %rdi
	movq	%rdi, (%rax,%rcx)
	movq	8(%r15), %rax
	movq	(%rax,%rcx), %rdi
	movq	%rsi, (%rdi)
	leaq	8(%r12,%rcx), %rdi
	movq	%rdi, 8(%rax,%rcx)
	movq	8(%r15), %rax
	movq	8(%rax,%rcx), %rdi
	leaq	1(%rsi), %rbx
	movq	%rbx, (%rdi)
	leaq	16(%r12,%rcx), %rdi
	movq	%rdi, 16(%rax,%rcx)
	movq	8(%r15), %rax
	movq	16(%rax,%rcx), %rdi
	leaq	2(%rsi), %rbx
	movq	%rbx, (%rdi)
	leaq	24(%r12,%rcx), %rdi
	movq	%rdi, 24(%rax,%rcx)
	movq	8(%r15), %rax
	movq	24(%rax,%rcx), %rdi
	leaq	3(%rsi), %rbx
	movq	%rbx, (%rdi)
	addq	$4, %rsi
	addq	$32, %rcx
	cmpq	%r9, %rsi
	jne	LBB0_13
LBB0_5:
	testq	%rdx, %rdx
	je	LBB0_8
## %bb.6:
	leaq	(%r12,%rsi,8), %rcx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, (%rax,%rsi,8)
	movq	8(%r15), %rax
	movq	(%rax,%rsi,8), %rdi
	movq	%rsi, (%rdi)
	incq	%rsi
	addq	$8, %rcx
	decq	%rdx
	jne	LBB0_7
LBB0_8:
	testq	%r8, %r8
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_heap_down
	addq	$-1, %r13
	jb	LBB0_9
LBB0_10:
	movq	%r15, (%r14)
	xorl	%r13d, %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_heap_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function heap_create
_heap_create:                           ; @heap_create
	.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	x19, x2
	mov	x22, x1
	mov	x21, x0
	mov	w0, #16
	bl	_malloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	str	x22, [x0]
	lsl	w0, w22, #3
	bl	_malloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_9
; %bb.2:
	ldr	x8, [x20]
	cbz	x8, LBB0_8
; %bb.3:
	mov	x9, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x10, x9, #3
	str	x21, [x0, x10]
	ldr	x0, [x20, #8]
	ldr	x10, [x0, x10]
	str	x9, [x10]
	add	x9, x9, #1
	add	x21, x21, #8
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.5:
	cbz	x8, LBB0_8
; %bb.6:
	sub	x21, x8, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_heap_down
	sub	x21, x21, #1
	cmn	x21, #1
	b.ne	LBB0_7
LBB0_8:
	mov	w0, #0
	str	x20, [x19]
	b	LBB0_11
LBB0_9:
	mov	x0, x20
	bl	_free
LBB0_10:
	mov	w0, #1
LBB0_11:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_heap_create
.subsections_via_symbols
