	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_weight                     ## -- Begin function add_weight
	.p2align	4, 0x90
_add_weight:                            ## @add_weight
	.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	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	callq	_resolve_pri
	movl	%eax, -24(%rbp)
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movq	_COLLATE_SUBST_PRIORITY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_6
## %bb.2:
	movq	_weights@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movslq	%ebx, %rbx
	leaq	(%rdi,%rbx,4), %rsi
	leaq	-24(%rbp), %rdx
	callq	_RB_FIND
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movl	$1, %edi
	movl	$4, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	-24(%rbp), %ecx
	movl	%ecx, (%rax)
	movq	(%r14), %rdi
	leaq	(%rdi,%rbx,4), %rsi
	movq	%rax, %rdx
	callq	_RB_INSERT
	jmp	LBB0_6
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COLLATE_SUBST_PRIORITY,4,2     ## @COLLATE_SUBST_PRIORITY
	.comm	_weights,8,3                    ## @weights
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_weight                     ; -- Begin function add_weight
	.p2align	2
_add_weight:                            ; @add_weight
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	bl	_resolve_pri
	str	w0, [sp, #8]
	cbz	w0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _COLLATE_SUBST_PRIORITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COLLATE_SUBST_PRIORITY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_6
; %bb.2:
Lloh3:
	adrp	x20, _weights@GOTPAGE
Lloh4:
	ldr	x20, [x20, _weights@GOTPAGEOFF]
	ldr	x0, [x20]
	add	x1, x0, w19, sxtw #2
	add	x2, sp, #8
	bl	_RB_FIND
	cbnz	x0, LBB0_6
; %bb.3:
	mov	w0, #1
	mov	w1, #4
	bl	_calloc
	cbz	x0, LBB0_5
; %bb.4:
	mov	x2, x0
	sxtw	x8, w19
	ldr	w9, [sp, #8]
	str	w9, [x0]
	ldr	x0, [x20]
	add	x1, x0, x8, lsl #2
	bl	_RB_INSERT
	b	LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _stderr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_COLLATE_SUBST_PRIORITY,4,2     ; @COLLATE_SUBST_PRIORITY
	.comm	_weights,8,3                    ; @weights
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory"

.subsections_via_symbols
