	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_order_subst                ## -- Begin function add_order_subst
	.p2align	4, 0x90
_add_order_subst:                       ## @add_order_subst
	.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
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_curr_subst@GOTPCREL(%rip), %r14
	movl	(%r14), %r9d
	testl	%r9d, %r9d
	jle	LBB0_16
## %bb.1:
	movq	_subst_weights@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	-48(%rbp), %rdx
	cmpl	$4, %r9d
	jb	LBB0_2
## %bb.3:
	leaq	(%rcx,%r9,8), %rax
	cmpq	%rax, %rdx
	jae	LBB0_6
## %bb.4:
	leaq	(%rdx,%r9,8), %rax
	cmpq	%rax, %rcx
	jae	LBB0_6
LBB0_2:
	xorl	%esi, %esi
LBB0_12:
	movq	%rsi, %rdi
	notq	%rdi
	addq	%r9, %rdi
	movq	%r9, %rax
	andq	$3, %rax
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rbx
	movq	%rbx, (%rdx,%rsi,8)
	movq	$0, (%rcx,%rsi,8)
	incq	%rsi
	decq	%rax
	jne	LBB0_13
LBB0_14:
	cmpq	$3, %rdi
	jb	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rax
	movq	%rax, (%rdx,%rsi,8)
	movq	$0, (%rcx,%rsi,8)
	movq	8(%rcx,%rsi,8), %rax
	movq	%rax, 8(%rdx,%rsi,8)
	movq	$0, 8(%rcx,%rsi,8)
	movq	16(%rcx,%rsi,8), %rax
	movq	%rax, 16(%rdx,%rsi,8)
	movq	$0, 16(%rcx,%rsi,8)
	movq	24(%rcx,%rsi,8), %rax
	movq	%rax, 24(%rdx,%rsi,8)
	movq	$0, 24(%rcx,%rsi,8)
	addq	$4, %rsi
	cmpq	%rsi, %r9
	jne	LBB0_15
	jmp	LBB0_16
LBB0_6:
	movl	%r9d, %esi
	andl	$-4, %esi
	leaq	-4(%rsi), %rax
	movq	%rax, %r8
	shrq	$2, %r8
	incq	%r8
	testq	%rax, %rax
	je	LBB0_26
## %bb.7:
	movabsq	$9223372036854775804, %rdi      ## imm = 0x7FFFFFFFFFFFFFFC
	orq	$2, %rdi
	andq	%r8, %rdi
	xorl	%ebx, %ebx
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movups	(%rcx,%rbx,8), %xmm1
	movups	16(%rcx,%rbx,8), %xmm2
	movups	%xmm1, (%rdx,%rbx,8)
	movups	%xmm2, 16(%rdx,%rbx,8)
	movups	%xmm0, (%rcx,%rbx,8)
	movups	%xmm0, 16(%rcx,%rbx,8)
	movups	32(%rcx,%rbx,8), %xmm1
	movups	48(%rcx,%rbx,8), %xmm2
	movups	%xmm1, 32(%rdx,%rbx,8)
	movups	%xmm2, 48(%rdx,%rbx,8)
	movups	%xmm0, 32(%rcx,%rbx,8)
	movups	%xmm0, 48(%rcx,%rbx,8)
	addq	$8, %rbx
	addq	$-2, %rdi
	jne	LBB0_8
## %bb.9:
	testb	$1, %r8b
	je	LBB0_11
LBB0_10:
	movups	(%rcx,%rbx,8), %xmm0
	movups	16(%rcx,%rbx,8), %xmm1
	movups	%xmm0, (%rdx,%rbx,8)
	movups	%xmm1, 16(%rdx,%rbx,8)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx,%rbx,8)
	movups	%xmm0, 16(%rcx,%rbx,8)
LBB0_11:
	cmpq	%r9, %rsi
	jne	LBB0_12
LBB0_16:
	movq	_substs_ref@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movq	_curr_weight@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	leaq	(%rdi,%rax,4), %rsi
	leaq	-56(%rbp), %rdx
	callq	_RB_FIND
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_19
LBB0_17:
	movl	$0, (%r14)
	movl	(%r13), %edi
	callq	_add_order_pri
LBB0_18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	$1, %edi
	movl	$16, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_25
## %bb.20:
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_new_pri
	movl	%eax, (%r13)
	movq	_nextsubst@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	(%r15), %rdx
	movq	_COLLATE_SUBST_PRIORITY@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rcx,%rdx,4), %esi
	movq	_RESOLVED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	callq	_set_pri
	movq	(%rbx), %rcx
	movq	(%r15), %rax
	incl	(%rcx,%rax,4)
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jle	LBB0_38
## %bb.21:
	movq	-48(%rbp), %rcx
	movq	8(%r13), %rdx
	xorl	%esi, %esi
	cmpl	$4, %r8d
	jb	LBB0_33
## %bb.22:
	movq	%rdx, %rax
	subq	%rcx, %rax
	cmpq	$32, %rax
	jb	LBB0_33
## %bb.23:
	movl	%r8d, %esi
	andl	$-4, %esi
	leaq	-4(%rsi), %rax
	movq	%rax, %rdi
	shrq	$2, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$12, %rax
	jae	LBB0_27
## %bb.24:
	xorl	%ebx, %ebx
	jmp	LBB0_29
LBB0_25:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	jmp	LBB0_18
LBB0_26:
	xorl	%ebx, %ebx
	testb	$1, %r8b
	jne	LBB0_10
	jmp	LBB0_11
LBB0_27:
	andq	$-4, %rdi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rcx,%rbx,8), %xmm0
	movups	16(%rcx,%rbx,8), %xmm1
	movups	%xmm0, (%rdx,%rbx,8)
	movups	%xmm1, 16(%rdx,%rbx,8)
	movups	32(%rcx,%rbx,8), %xmm0
	movups	48(%rcx,%rbx,8), %xmm1
	movups	%xmm0, 32(%rdx,%rbx,8)
	movups	%xmm1, 48(%rdx,%rbx,8)
	movups	64(%rcx,%rbx,8), %xmm0
	movups	80(%rcx,%rbx,8), %xmm1
	movups	%xmm0, 64(%rdx,%rbx,8)
	movups	%xmm1, 80(%rdx,%rbx,8)
	movups	96(%rcx,%rbx,8), %xmm0
	movups	112(%rcx,%rbx,8), %xmm1
	movups	%xmm0, 96(%rdx,%rbx,8)
	movups	%xmm1, 112(%rdx,%rbx,8)
	addq	$16, %rbx
	addq	$-4, %rdi
	jne	LBB0_28
LBB0_29:
	testq	%r9, %r9
	je	LBB0_32
## %bb.30:
	leaq	(%rdx,%rbx,8), %rdi
	addq	$16, %rdi
	leaq	(%rcx,%rbx,8), %rbx
	addq	$16, %rbx
	shlq	$5, %r9
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rbx,%rax), %xmm0
	movups	(%rbx,%rax), %xmm1
	movups	%xmm0, -16(%rdi,%rax)
	movups	%xmm1, (%rdi,%rax)
	addq	$32, %rax
	cmpq	%rax, %r9
	jne	LBB0_31
LBB0_32:
	cmpq	%r8, %rsi
	je	LBB0_37
LBB0_33:
	movq	%rsi, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rdi
	andq	$3, %rdi
	je	LBB0_35
	.p2align	4, 0x90
LBB0_34:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rbx
	movq	%rbx, (%rdx,%rsi,8)
	incq	%rsi
	decq	%rdi
	jne	LBB0_34
LBB0_35:
	cmpq	$3, %rax
	jb	LBB0_37
	.p2align	4, 0x90
LBB0_36:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rax
	movq	%rax, (%rdx,%rsi,8)
	movq	8(%rcx,%rsi,8), %rax
	movq	%rax, 8(%rdx,%rsi,8)
	movq	16(%rcx,%rsi,8), %rax
	movq	%rax, 16(%rdx,%rsi,8)
	movq	24(%rcx,%rsi,8), %rax
	movq	%rax, 24(%rdx,%rsi,8)
	addq	$4, %rsi
	cmpq	%rsi, %r8
	jne	LBB0_36
LBB0_37:
	movq	(%r15), %rax
LBB0_38:
	movq	(%r12), %rdi
	leaq	(%rdi,%rax,4), %rsi
	movq	%r13, %rdx
	callq	_RB_INSERT
	movq	_substs@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	(%r15), %rax
	leaq	(%rdi,%rax,4), %rsi
	movq	%r13, %rdx
	callq	_RB_FIND
	testq	%rax, %rax
	jne	LBB0_18
## %bb.39:
	movq	(%rbx), %rdi
	movq	(%r15), %rax
	leaq	(%rdi,%rax,4), %rsi
	movq	%r13, %rdx
	callq	_RB_INSERT
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_curr_subst,4,2                 ## @curr_subst
	.comm	_subst_weights,8,3              ## @subst_weights
	.comm	_substs_ref,8,3                 ## @substs_ref
	.comm	_curr_weight,8,3                ## @curr_weight
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory"

	.comm	_nextsubst,8,3                  ## @nextsubst
	.comm	_COLLATE_SUBST_PRIORITY,4,2     ## @COLLATE_SUBST_PRIORITY
	.comm	_RESOLVED,4,2                   ## @RESOLVED
	.comm	_substs,8,3                     ## @substs
	.comm	_INTERR,4,2                     ## @INTERR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_order_subst                ; -- Begin function add_order_subst
	.p2align	2
_add_order_subst:                       ; @add_order_subst
	.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	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh0:
	adrp	x20, _curr_subst@GOTPAGE
Lloh1:
	ldr	x20, [x20, _curr_subst@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
Lloh2:
	adrp	x9, _subst_weights@GOTPAGE
Lloh3:
	ldr	x9, [x9, _subst_weights@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	x10, [sp, #8]
	cmp	w8, #8
	b.lo	LBB0_6
; %bb.2:
	lsl	x11, x8, #3
	add	x12, x10, x11
	add	x11, x9, x11
	cmp	x10, x11
	ccmp	x9, x12, #2, lo
	b.lo	LBB0_6
; %bb.3:
	and	x11, x8, #0xfffffff8
	add	x12, x10, #32
	add	x13, x9, #32
	movi.2d	v0, #0000000000000000
	mov	x14, x11
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q1, q2, [x13, #-32]
	ldp	q3, q4, [x13]
	stp	q1, q2, [x12, #-32]
	stp	q3, q4, [x12], #64
	stp	q0, q0, [x13, #-32]
	stp	q0, q0, [x13], #64
	subs	x14, x14, #8
	b.ne	LBB0_4
; %bb.5:
	cmp	x11, x8
	b.ne	LBB0_7
	b	LBB0_9
LBB0_6:
	mov	x11, #0
LBB0_7:
	lsl	x12, x11, #3
	add	x10, x10, x12
	add	x9, x9, x12
	sub	x8, x8, x11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x9]
	str	x11, [x10], #8
	str	xzr, [x9], #8
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
Lloh5:
	adrp	x22, _substs_ref@GOTPAGE
Lloh6:
	ldr	x22, [x22, _substs_ref@GOTPAGEOFF]
	ldr	x0, [x22]
Lloh7:
	adrp	x21, _curr_weight@GOTPAGE
Lloh8:
	ldr	x21, [x21, _curr_weight@GOTPAGEOFF]
	ldr	x8, [x21]
	add	x1, x0, x8, lsl #2
	mov	x2, sp
	bl	_RB_FIND
	mov	x19, x0
	cbz	x0, LBB0_12
LBB0_10:
	str	wzr, [x20]
	ldr	w0, [x19]
	bl	_add_order_pri
LBB0_11:
	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
LBB0_12:
	mov	w0, #1
	mov	w1, #16
	bl	_calloc
	cbz	x0, LBB0_24
; %bb.13:
	mov	x19, x0
	bl	_new_pri
	str	w0, [x19]
Lloh9:
	adrp	x23, _nextsubst@GOTPAGE
Lloh10:
	ldr	x23, [x23, _nextsubst@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	x9, [x21]
	ldr	w8, [x8, x9, lsl #2]
Lloh11:
	adrp	x9, _COLLATE_SUBST_PRIORITY@GOTPAGE
Lloh12:
	ldr	x9, [x9, _COLLATE_SUBST_PRIORITY@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh14:
	adrp	x8, _RESOLVED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RESOLVED@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	bl	_set_pri
	ldr	x8, [x23]
	ldr	x9, [x21]
	lsl	x10, x9, #2
	ldr	w11, [x8, x10]
	add	w11, w11, #1
	str	w11, [x8, x10]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.14:
	mov	x9, #0
	ldr	x10, [sp, #8]
	ldr	x11, [x19, #8]
	cmp	w8, #8
	b.lo	LBB0_19
; %bb.15:
	sub	x12, x11, x10
	cmp	x12, #64
	b.lo	LBB0_19
; %bb.16:
	and	x9, x8, #0xfffffff8
	add	x12, x11, #32
	add	x13, x10, #32
	mov	x14, x9
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x13, #-32]
	ldp	q2, q3, [x13], #64
	stp	q0, q1, [x12, #-32]
	stp	q2, q3, [x12], #64
	subs	x14, x14, #8
	b.ne	LBB0_17
; %bb.18:
	cmp	x9, x8
	b.eq	LBB0_21
LBB0_19:
	lsl	x12, x9, #3
	add	x11, x11, x12
	add	x10, x10, x12
	sub	x8, x8, x9
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x10], #8
	str	x9, [x11], #8
	subs	x8, x8, #1
	b.ne	LBB0_20
LBB0_21:
	ldr	x9, [x21]
LBB0_22:
	ldr	x0, [x22]
	add	x1, x0, x9, lsl #2
	mov	x2, x19
	bl	_RB_INSERT
Lloh17:
	adrp	x22, _substs@GOTPAGE
Lloh18:
	ldr	x22, [x22, _substs@GOTPAGEOFF]
	ldr	x0, [x22]
	ldr	x8, [x21]
	add	x1, x0, x8, lsl #2
	mov	x2, x19
	bl	_RB_FIND
	cbnz	x0, LBB0_11
; %bb.23:
	ldr	x0, [x22]
	ldr	x8, [x21]
	add	x1, x0, x8, lsl #2
	mov	x2, x19
	bl	_RB_INSERT
	b	LBB0_10
LBB0_24:
Lloh19:
	adrp	x8, _stderr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_curr_subst,4,2                 ; @curr_subst
	.comm	_subst_weights,8,3              ; @subst_weights
	.comm	_substs_ref,8,3                 ; @substs_ref
	.comm	_curr_weight,8,3                ; @curr_weight
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory"

	.comm	_nextsubst,8,3                  ; @nextsubst
	.comm	_COLLATE_SUBST_PRIORITY,4,2     ; @COLLATE_SUBST_PRIORITY
	.comm	_RESOLVED,4,2                   ; @RESOLVED
	.comm	_substs,8,3                     ; @substs
	.comm	_INTERR,4,2                     ; @INTERR
.subsections_via_symbols
