	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ref_add                        ## -- Begin function ref_add
	.p2align	4, 0x90
_ref_add:                               ## @ref_add
	.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
	movq	%rdx, %r8
	movl	%edi, %r14d
	movq	_ref_count@GOTPCREL(%rip), %rdi
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	cmpl	%r14d, %eax
	jg	LBB0_4
LBB0_3:
	leal	1(%r14), %eax
	movl	%eax, (%rdi)
LBB0_4:
	movq	_ref_chunk@GOTPCREL(%rip), %r9
	movl	(%r9), %edi
	movq	_MAX_CHUNK_REFS@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	movl	%ebx, %edx
	imull	%edi, %edx
	subl	%edx, %eax
	jle	LBB0_6
## %bb.5:
	cltd
	idivl	%ebx
                                        ## kill: def $eax killed $eax def $rax
	movq	_ref_map@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r13
	addl	%eax, %edi
	incl	%edi
	movl	%eax, %r12d
	incl	%r12d
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%r9, %rbx
	callq	_REF_MAP_SIZE
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_xrealloc
	movq	_ref_map@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movslq	(%rbx), %rcx
	movslq	(%r15), %rdx
	imulq	%rcx, %rdx
	leaq	(%rdx,%rdx,2), %rcx
	leaq	(%rax,%rcx,8), %rdi
	movq	_REF_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	imull	%r12d, %edx
	xorl	%esi, %esi
	callq	_memset
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	addl	%r12d, (%rbx)
LBB0_6:
	movq	_ref_map@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movslq	%r14d, %rdx
	shlq	$3, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movq	%r8, (%rdi,%rdx)
	movq	(%rax), %rdi
	movq	%rsi, 16(%rdi,%rdx)
	movq	(%rax), %rax
	movl	%ecx, 8(%rax,%rdx)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_ref_chunk@GOTPCREL(%rip), %rdx
	movl	$0, (%rdx)
	cmpl	%r14d, %eax
	jle	LBB0_3
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_ref_count,4,2                  ## @ref_count
	.comm	_ref_chunk,4,2                  ## @ref_chunk
	.comm	_MAX_CHUNK_REFS,4,2             ## @MAX_CHUNK_REFS
	.comm	_ref_map,8,3                    ## @ref_map
	.comm	_REF_CHUNK_SIZE,4,2             ## @REF_CHUNK_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ref_add                        ; -- Begin function ref_add
	.p2align	2
_ref_add:                               ; @ref_add
	.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	x19, x3
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x9, _ref_count@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ref_count@GOTPAGEOFF]
	ldr	w8, [x9]
Lloh2:
	adrp	x24, _ref_chunk@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ref_chunk@GOTPAGEOFF]
	cbz	w8, LBB0_6
; %bb.1:
	cmp	w8, w20
	b.gt	LBB0_3
LBB0_2:
	add	w8, w20, #1
	str	w8, [x9]
LBB0_3:
Lloh4:
	adrp	x26, _MAX_CHUNK_REFS@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MAX_CHUNK_REFS@GOTPAGEOFF]
	ldr	w9, [x24]
	ldr	w10, [x26]
	mul	w11, w10, w9
Lloh6:
	adrp	x25, _ref_map@GOTPAGE
Lloh7:
	ldr	x25, [x25, _ref_map@GOTPAGEOFF]
	subs	w8, w8, w11
	b.le	LBB0_5
; %bb.4:
	sdiv	w8, w8, w10
	add	w27, w8, #1
	ldr	x23, [x25]
	add	w0, w27, w9
	bl	_REF_MAP_SIZE
	mov	x1, x0
	mov	x0, x23
	bl	_xrealloc
	str	x0, [x25]
	ldr	w8, [x24]
	ldr	w9, [x26]
	mul	w8, w9, w8
	mov	w9, #24
	smaddl	x0, w8, w9, x0
Lloh8:
	adrp	x8, _REF_CHUNK_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REF_CHUNK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	mul	w2, w8, w27
	mov	w1, #0
	bl	_memset
	ldr	w8, [x24]
	add	w8, w8, w27
	str	w8, [x24]
LBB0_5:
	ldr	x8, [x25]
	mov	w9, #24
	smull	x10, w20, w9
	str	x22, [x8, x10]
	ldr	x8, [x25]
	smaddl	x8, w20, w9, x8
	str	x21, [x8, #16]
	ldr	x8, [x25]
	smaddl	x8, w20, w9, x8
	str	w19, [x8, #8]
	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
LBB0_6:
	str	wzr, [x24]
	cmp	w8, w20
	b.le	LBB0_2
	b	LBB0_3
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ref_count,4,2                  ; @ref_count
	.comm	_ref_chunk,4,2                  ; @ref_chunk
	.comm	_MAX_CHUNK_REFS,4,2             ; @MAX_CHUNK_REFS
	.comm	_ref_map,8,3                    ; @ref_map
	.comm	_REF_CHUNK_SIZE,4,2             ; @REF_CHUNK_SIZE
.subsections_via_symbols
