	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function heap_add_entry
_heap_add_entry:                        ## @heap_add_entry
	.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	%rcx, %r15
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movl	(%rsi), %eax
	movl	4(%rsi), %ecx
	cmpl	%ecx, %eax
	jl	LBB0_7
## %bb.1:
	movq	%rdi, %r12
	leal	(%rcx,%rcx), %eax
	cmpl	$1024, %ecx                     ## imm = 0x400
	movl	$1024, %r13d                    ## imm = 0x400
	cmovgel	%eax, %r13d
	cmpl	%ecx, %r13d
	jle	LBB0_2
## %bb.3:
	leal	(,%r13,8), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %rcx
	movl	4(%rbx), %edx
	testl	%edx, %edx
	movq	%rax, %r12
	je	LBB0_6
## %bb.5:
	movq	8(%rbx), %rsi
	shll	$3, %edx
	movq	%r12, %rdi
	callq	_memcpy
LBB0_6:
	movq	8(%rbx), %rdi
	callq	_free
	movq	%r12, 8(%rbx)
	movl	%r13d, 4(%rbx)
	movl	(%rbx), %eax
LBB0_7:
	movq	%r15, (%r14)
	leal	1(%rax), %ecx
	movl	%ecx, (%rbx)
	testl	%eax, %eax
	jle	LBB0_11
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
                                        ## kill: def $eax killed $eax killed $rax def $rax
	leal	-1(%rax), %ecx
	movl	%eax, %edx
	movl	%ecx, %eax
	shrl	%eax
	movq	8(%rbx), %rsi
	movq	(%rsi,%rax,8), %rdi
	cmpq	%r15, (%rdi)
	jle	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%rdi, (%rsi,%rdx,8)
	cmpl	$1, %ecx
	ja	LBB0_8
LBB0_11:
	movq	8(%rbx), %rax
	movq	%r14, (%rax)
	jmp	LBB0_12
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_archive_set_error
	movq	_ARCHIVE_FATAL@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_9:
	movq	%r14, (%rsi,%rdx,8)
LBB0_12:
	movq	_ARCHIVE_OK@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Out of memory"

	.comm	_ARCHIVE_FATAL,4,2              ## @ARCHIVE_FATAL
	.comm	_ARCHIVE_OK,4,2                 ## @ARCHIVE_OK
	.no_dead_strip	_heap_add_entry
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function heap_add_entry
_heap_add_entry:                        ; @heap_add_entry
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x3
	mov	x19, x2
	mov	x21, x1
	ldp	w8, w9, [x1]
	cmp	w8, w9
	b.lt	LBB0_6
; %bb.1:
	mov	x22, x0
	lsl	w8, w9, #1
	mov	w10, #1024
	cmp	w9, #1024
	csel	w24, w10, w8, lt
	cmp	w24, w9
	b.le	LBB0_10
; %bb.2:
	lsl	w0, w24, #3
	bl	_malloc
	cbz	x0, LBB0_10
; %bb.3:
	mov	x23, x0
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_5
; %bb.4:
	ldr	x1, [x21, #8]
	lsl	w2, w8, #3
	mov	x0, x23
	bl	_memcpy
LBB0_5:
	ldr	x0, [x21, #8]
	bl	_free
	str	x23, [x21, #8]
	str	w24, [x21, #4]
	ldr	w8, [x21]
LBB0_6:
	str	x20, [x19]
	add	w9, w8, #1
	str	w9, [x21]
	cmp	w8, #1
	b.lt	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w8, #1
	lsr	w10, w9, #1
	ldr	x11, [x21, #8]
	ldr	x12, [x11, w10, uxtw #3]
	ldr	x13, [x12]
	mov	w8, w8
	cmp	x13, x20
	b.le	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	str	x12, [x11, x8, lsl #3]
	mov	x8, x10
	cmp	w9, #1
	b.hi	LBB0_7
LBB0_9:
	ldr	x8, [x21, #8]
	str	x19, [x8]
	b	LBB0_12
LBB0_10:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_archive_set_error
Lloh5:
	adrp	x8, _ARCHIVE_FATAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ARCHIVE_FATAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_11:
	str	x19, [x11, x8, lsl #3]
LBB0_12:
Lloh7:
	adrp	x8, _ARCHIVE_OK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ARCHIVE_OK@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Out of memory"

	.comm	_ARCHIVE_FATAL,4,2              ; @ARCHIVE_FATAL
	.comm	_ARCHIVE_OK,4,2                 ; @ARCHIVE_OK
	.no_dead_strip	_heap_add_entry
.subsections_via_symbols
