	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function priority_sort_query
_priority_sort_query:                   ## @priority_sort_query
	.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	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_vkprintf
	movq	_Q_order@GOTPCREL(%rip), %rax
	movq	_FLAG_ENTRY_SORT_SEARCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%edx, %edx
	andl	(%rax), %ecx
	setne	%dl
	movq	_Q_skip_mismatch_words_if_complete_case_found@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	movl	$0, -48(%rbp)
	movq	_HC@GOTPCREL(%rip), %rbx
	movl	$0, (%rbx)
	movq	_Q_words@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$0, %r13d
	testl	%r8d, %r8d
	jle	LBB0_7
## %bb.1:
	xorl	%ebx, %ebx
	movq	_QT@GOTPCREL(%rip), %r15
	movq	_IHE@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdi
	addq	%rbx, %rdi
	callq	_iheap_insert
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	addl	%r14d, %r13d
	incq	%rbx
	movq	_Q_words@GOTPCREL(%rip), %rax
	movslq	(%rax), %r8
	cmpq	%r8, %rbx
	jge	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %r14
	movq	(%r12), %rdi
	addq	%rbx, %rdi
	movq	_QW@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r14, %rdx
	xorl	%ecx, %ecx
	callq	_ihe_init
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rax
	cmpq	$0, (%rax,%rbx,8)
	je	LBB0_5
	jmp	LBB0_30
LBB0_6:
	movq	_HC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r14d
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edi
	movl	%r14d, %edx
	movl	%r13d, %ecx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_vkprintf
	movq	_MAX_MISMATCHED_WORDS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%rbx), %edx
	addl	%ecx, %edx
	movq	_Q_words@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jl	LBB0_30
## %bb.8:
	movl	%eax, %edx
	subl	%ecx, %edx
	cmpl	$2, %edx
	movl	$1, %ecx
	cmovgel	%edx, %ecx
	leal	1(%r13), %edx
	cmpl	%eax, %r13d
	cmovgel	%ecx, %edx
	cmpl	%r13d, %ecx
	cmovgl	%ecx, %edx
	leaq	L_.str.2(%rip), %rsi
	movl	$3, %edi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_vkprintf
	movq	_HC@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_30
## %bb.9:
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%rdx, %rdi
	leaq	-48(%rbp), %rdx
	callq	_priority_sort_store_res
	movq	_H@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rdi
	movq	8(%rdi), %rax
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	(%rdi), %r12d
	movl	4(%rdi), %ebx
	andl	$1, %r12d
	movl	$1, %r15d
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_21:                                ##   in Loop: Header=BB0_10 Depth=1
	callq	_ihe_advance
	xorl	%eax, %eax
	callq	_iheap_pop
	movl	%r15d, %r14d
	negl	%r14d
	movq	_HC@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_22
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%ebx, %r12d
	movq	_H@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	8(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edx
	movl	$3, %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_vkprintf
	movq	(%rbx), %rax
	movq	8(%rax), %rax
	movq	8(%rax), %rdi
	callq	_assert
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	movq	8(%rdi), %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %rax
	je	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	testq	%rdx, %rdx
	je	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	jl	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%r13d, %r12d
	jne	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_Q_min_priority@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%r15d, %ecx
	jne	LBB0_19
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	_Q_words@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	leal	6(%r15), %esi
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=1
	leal	(%rcx,%r14), %eax
	addl	$3, %eax
	testl	%eax, %eax
	movl	$0, %ecx
	cmovlel	%ecx, %eax
	addl	%eax, %esi
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%r15d
	movl	(%rdi), %eax
	andl	$1, %eax
	addl	-64(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%r12d, %ebx
	addl	4(%rdi), %ebx
	movl	%eax, %r12d
	jmp	LBB0_21
LBB0_22:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_30
## %bb.23:
	cmpl	-44(%rbp), %r15d                ## 4-byte Folded Reload
	jl	LBB0_30
## %bb.24:
	cmpl	%r13d, %ebx
	jne	LBB0_30
## %bb.25:
	movq	_Q_min_priority@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_27
## %bb.26:
	cmpl	%r15d, %r12d
	jne	LBB0_30
LBB0_27:
	movl	%r15d, %eax
	movq	_Q_words@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	leal	6(%rax), %esi
	jne	LBB0_29
## %bb.28:
	subl	%r15d, %r12d
	addl	$3, %r12d
	xorl	%eax, %eax
	testl	%r12d, %r12d
	cmovgl	%r12d, %eax
	addl	%eax, %esi
LBB0_29:
	leaq	-48(%rbp), %rdx
	callq	_priority_sort_store_res
LBB0_30:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"priority_sort_query\n"

	.comm	_Q_order,4,2                    ## @Q_order
	.comm	_FLAG_ENTRY_SORT_SEARCH,4,2     ## @FLAG_ENTRY_SORT_SEARCH
	.comm	_Q_skip_mismatch_words_if_complete_case_found,4,2 ## @Q_skip_mismatch_words_if_complete_case_found
	.comm	_HC,4,2                         ## @HC
	.comm	_Q_words,4,2                    ## @Q_words
	.comm	_QT,8,3                         ## @QT
	.comm	_IHE,8,3                        ## @IHE
	.comm	_QW,8,3                         ## @QW
L_.str.1:                               ## @.str.1
	.asciz	"HC = %d, tags = %d, Q_words = %d\n"

	.comm	_MAX_MISMATCHED_WORDS,4,2       ## @MAX_MISMATCHED_WORDS
L_.str.2:                               ## @.str.2
	.asciz	"min_priority = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"item_id = %lld\n"

	.comm	_H,8,3                          ## @H
	.comm	_Q_min_priority,4,2             ## @Q_min_priority
	.no_dead_strip	_priority_sort_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function priority_sort_query
_priority_sort_query:                   ; @priority_sort_query
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
Lloh2:
	adrp	x8, _Q_order@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Q_order@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _FLAG_ENTRY_SORT_SEARCH@GOTPAGE
Lloh6:
	ldr	x9, [x9, _FLAG_ENTRY_SORT_SEARCH@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
Lloh8:
	adrp	x9, _Q_skip_mismatch_words_if_complete_case_found@GOTPAGE
Lloh9:
	ldr	x9, [x9, _Q_skip_mismatch_words_if_complete_case_found@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
Lloh11:
	adrp	x26, _HC@GOTPAGE
Lloh12:
	ldr	x26, [x26, _HC@GOTPAGEOFF]
	str	wzr, [sp, #28]
	str	wzr, [x26]
Lloh13:
	adrp	x21, _Q_words@GOTPAGE
Lloh14:
	ldr	x21, [x21, _Q_words@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x20, #0
	mov	w23, #0
Lloh15:
	adrp	x22, _QT@GOTPAGE
Lloh16:
	ldr	x22, [x22, _QT@GOTPAGEOFF]
Lloh17:
	adrp	x24, _IHE@GOTPAGE
Lloh18:
	ldr	x24, [x24, _IHE@GOTPAGEOFF]
Lloh19:
	adrp	x25, _QW@GOTPAGE
Lloh20:
	ldr	x25, [x25, _QW@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24]
	add	x0, x20, x8
	bl	_iheap_insert
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w23, w23, w19
	add	x20, x20, #1
	ldrsw	x9, [x21]
	cmp	x20, x9
	b.ge	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x19, [x8, x20, lsl #3]
	ldr	x8, [x24]
	add	x0, x20, x8
	ldr	x8, [x25]
	ldr	w1, [x8, x20, lsl #2]
	mov	x2, x19
	mov	w3, #0
	bl	_ihe_init
	cbnz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22]
	ldr	x8, [x8, x20, lsl #3]
	cbz	x8, LBB0_3
	b	LBB0_29
LBB0_6:
	ldr	w8, [x26]
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	b	LBB0_8
LBB0_7:
	mov	w8, #0
	mov	w23, #0
LBB0_8:
	stp	x23, x9, [sp, #8]
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	ldr	w10, [x26]
Lloh23:
	adrp	x8, _MAX_MISMATCHED_WORDS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAX_MISMATCHED_WORDS@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x8]
	ldr	w8, [x21]
	add	w10, w9, w10
	cmp	w10, w8
	b.lt	LBB0_29
; %bb.9:
	sub	w9, w8, w9
	cmp	w9, #1
	csinc	w9, w9, wzr, gt
	cmp	w23, w8
	ccmp	w9, w23, #0, lt
	csinc	w24, w9, w23, gt
	str	x24, [sp]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #3
	bl	_vkprintf
	ldr	w8, [x26]
	cbz	w8, LBB0_29
; %bb.10:
	mov	w22, #0
	mov	w28, #0
	mov	w27, #0
	mov	x19, #0
	mov	w25, #0
Lloh28:
	adrp	x26, _H@GOTPAGE
Lloh29:
	ldr	x26, [x26, _H@GOTPAGEOFF]
Lloh30:
	adrp	x20, l_.str.3@PAGE
Lloh31:
	add	x20, x20, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x2, sp, #28
	mov	x0, x19
	bl	_priority_sort_store_res
	ldr	x8, [x26]
	ldr	x0, [x8, #8]
	ldr	x8, [x0, #8]
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
	ldp	w9, w25, [x0]
	and	w27, w9, #0x1
	mov	w28, #1
	mov	x19, x8
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	bl	_ihe_advance
	bl	_iheap_pop
	neg	w22, w28
Lloh32:
	adrp	x8, _HC@GOTPAGE
Lloh33:
	ldr	x8, [x8, _HC@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	cbz	w8, LBB0_22
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	str	x8, [sp]
	mov	w0, #3
	mov	x1, x20
	bl	_vkprintf
	ldr	x8, [x26]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, #8]
	bl	_assert
	ldr	x8, [x26]
	ldr	x0, [x8, #8]
	ldr	x8, [x0, #8]
	cmp	x8, x19
	b.eq	LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	cbz	x19, LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w28, w24
	b.lt	LBB0_12
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	w25, w23
	b.ne	LBB0_12
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
Lloh35:
	adrp	x9, _Q_min_priority@GOTPAGE
Lloh36:
	ldr	x9, [x9, _Q_min_priority@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	cmp	w9, #0
	ccmp	w27, w28, #4, ne
	b.ne	LBB0_12
; %bb.19:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w8, [x21]
	subs	w8, w28, w8
	add	w1, w8, #6
	b.ne	LBB0_11
; %bb.20:                               ;   in Loop: Header=BB0_14 Depth=1
	add	w8, w27, w22
	add	w8, w8, #3
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	add	w1, w1, w8
	b	LBB0_11
LBB0_21:                                ;   in Loop: Header=BB0_14 Depth=1
	add	w28, w28, #1
	ldp	w8, w9, [x0]
	and	w8, w8, #0x1
	add	w27, w8, w27
	add	w25, w9, w25
	b	LBB0_13
LBB0_22:
	cbz	x19, LBB0_29
; %bb.23:
	cmp	w28, w24
	b.lt	LBB0_29
; %bb.24:
	cmp	w25, w23
	b.ne	LBB0_29
; %bb.25:
Lloh38:
	adrp	x8, _Q_min_priority@GOTPAGE
Lloh39:
	ldr	x8, [x8, _Q_min_priority@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	cmp	w8, #0
	ccmp	w27, w28, #4, ne
	b.ne	LBB0_29
; %bb.26:
	ldr	w8, [x21]
	subs	w8, w28, w8
	add	w1, w8, #6
	b.ne	LBB0_28
; %bb.27:
	sub	w8, w27, w28
	add	w8, w8, #3
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	add	w1, w1, w8
LBB0_28:
	add	x2, sp, #28
	mov	x0, x19
	bl	_priority_sort_store_res
LBB0_29:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"priority_sort_query\n"

	.comm	_Q_order,4,2                    ; @Q_order
	.comm	_FLAG_ENTRY_SORT_SEARCH,4,2     ; @FLAG_ENTRY_SORT_SEARCH
	.comm	_Q_skip_mismatch_words_if_complete_case_found,4,2 ; @Q_skip_mismatch_words_if_complete_case_found
	.comm	_HC,4,2                         ; @HC
	.comm	_Q_words,4,2                    ; @Q_words
	.comm	_QT,8,3                         ; @QT
	.comm	_IHE,8,3                        ; @IHE
	.comm	_QW,8,3                         ; @QW
l_.str.1:                               ; @.str.1
	.asciz	"HC = %d, tags = %d, Q_words = %d\n"

	.comm	_MAX_MISMATCHED_WORDS,4,2       ; @MAX_MISMATCHED_WORDS
l_.str.2:                               ; @.str.2
	.asciz	"min_priority = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"item_id = %lld\n"

	.comm	_H,8,3                          ; @H
	.comm	_Q_min_priority,4,2             ; @Q_min_priority
	.no_dead_strip	_priority_sort_query
.subsections_via_symbols
