	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_friends_merge_end_query        ## -- Begin function friends_merge_end_query
	.p2align	4, 0x90
_friends_merge_end_query:               ## @friends_merge_end_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	(%rcx), %eax
	cmpl	$1, %eax
	je	LBB0_11
## %bb.1:
	cmpl	$2, %eax
	jne	LBB0_21
## %bb.2:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movl	$0, %r14d
	testl	%r9d, %r9d
	jle	LBB0_22
## %bb.3:
	movl	%r9d, %r10d
	xorl	%ecx, %ecx
	movq	_resultlist@GOTPCREL(%rip), %r9
	movq	_MAX_USERLIST_NUM@GOTPCREL(%rip), %r11
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rcx
	cmpq	%r10, %rcx
	je	LBB0_22
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	%rcx, %rax
	shlq	$4, %rax
	cmpl	$4, (%r8,%rax)
	jl	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r8,%rax), %rdi
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r9), %rdx
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=2
	movslq	%eax, %r12
	movq	%rsi, %rbx
	cmpq	%r12, %rsi
	jge	LBB0_4
LBB0_9:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	1(%rbx), %rsi
	cmpl	(%r11), %r14d
	jge	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	movl	4(%rdi,%rbx,4), %eax
	movslq	%r14d, %rbx
	incl	%r14d
	movl	%eax, (%rdx,%rbx,4)
	movl	(%rdi), %eax
	jmp	LBB0_8
LBB0_11:
	movl	4(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_14
## %bb.12:
	movq	_resultlist@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rcx,%rbx,4)
	incq	%rbx
	movslq	4(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_13
LBB0_14:
	testl	%r9d, %r9d
	jle	LBB0_23
## %bb.15:
	movq	_resultlist@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r14
	movl	%r9d, %r9d
	xorl	%r10d, %r10d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_17 Depth=1
	incq	%r10
	cmpq	%r9, %r10
	je	LBB0_23
LBB0_17:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
	movq	%r10, %r11
	shlq	$4, %r11
	leal	(,%rax,4), %ebx
	cmpl	%ebx, (%r8,%r11)
	jne	LBB0_16
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	testl	%eax, %eax
	jle	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_17 Depth=1
	movq	8(%r8,%r11), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_17 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rbx,4), %eax
	addl	%eax, (%r14,%rbx,4)
	incq	%rbx
	movslq	4(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_20
	jmp	LBB0_16
LBB0_21:
	xorl	%edi, %edi
	callq	_assert
	jmp	LBB0_25
LBB0_22:
	movq	_resultlist@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	_compare@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%r14d, %esi
	movl	$4, %edx
	callq	_qsort
	subl	8(%r15), %r13d
	movq	(%rbx), %r9
	movl	%r14d, (%rsp)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	%r13d, %r8d
	jmp	LBB0_24
LBB0_23:
	xorl	%r8d, %r8d
	subl	8(%r15), %r8d
	movq	_resultlist@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	movl	%eax, (%rsp)
	movl	$2147483647, %ecx               ## imm = 0x7FFFFFFF
LBB0_24:
	callq	_return_one_key_list
LBB0_25:
	movl	$1, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_resultlist,8,3                 ## @resultlist
	.comm	_MAX_USERLIST_NUM,4,2           ## @MAX_USERLIST_NUM
	.comm	_compare,4,2                    ## @compare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_friends_merge_end_query        ; -- Begin function friends_merge_end_query
	.p2align	2
_friends_merge_end_query:               ; @friends_merge_end_query
	.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	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w8, [x3]
	cmp	w8, #1
	b.eq	LBB0_11
; %bb.1:
	cmp	w8, #2
	b.ne	LBB0_22
; %bb.2:
Lloh0:
	adrp	x24, _resultlist@GOTPAGE
Lloh1:
	ldr	x24, [x24, _resultlist@GOTPAGEOFF]
	cmp	w5, #1
	b.lt	LBB0_24
; %bb.3:
	mov	x8, #0
	mov	w23, #0
Lloh2:
	adrp	x9, _MAX_USERLIST_NUM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_USERLIST_NUM@GOTPAGEOFF]
	mov	w10, w5
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, #1
	cmp	x8, x10
	b.eq	LBB0_25
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	lsl	x11, x8, #4
	ldr	w11, [x4, x11]
	cmp	w11, #4
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x11, x4, x8, lsl #4
	ldr	x11, [x11, #8]
	ldr	w14, [x11]
	cmp	w14, #1
	b.lt	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x12, #0
	ldr	x13, [x24]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	x12, x12, #1
	cmp	x12, w14, sxtw
	b.ge	LBB0_4
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w15, [x9]
	cmp	w23, w15
	b.ge	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x14, x11, x12, lsl #2
	ldr	w14, [x14, #4]
	str	w14, [x13, w23, sxtw #2]
	add	w23, w23, #1
	ldr	w14, [x11]
	b	LBB0_8
LBB0_11:
	ldr	w6, [x22, #4]
	cmp	w6, #1
	b.lt	LBB0_15
; %bb.12:
	mov	x8, #0
Lloh4:
	adrp	x9, _resultlist@GOTPAGE
Lloh5:
	ldr	x9, [x9, _resultlist@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	str	wzr, [x9, x8, lsl #2]
	add	x8, x8, #1
	ldrsw	x6, [x22, #4]
	cmp	x8, x6
	b.lt	LBB0_13
; %bb.14:
                                        ; kill: def $w6 killed $w6 killed $x6 def $x6
LBB0_15:
	cmp	w5, #1
	b.lt	LBB0_23
; %bb.16:
	mov	x8, #0
Lloh7:
	adrp	x9, _resultlist@GOTPAGE
Lloh8:
	ldr	x9, [x9, _resultlist@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	mov	w10, w5
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	add	x8, x8, #1
	cmp	x8, x10
	b.eq	LBB0_23
LBB0_18:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_21 Depth 2
	lsl	x11, x8, #4
	ldr	w11, [x4, x11]
	cmp	w11, w6, lsl #2
	b.ne	LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	cmp	w6, #1
	b.lt	LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	mov	x11, #0
	add	x12, x4, x8, lsl #4
	ldr	x12, [x12, #8]
LBB0_21:                                ;   Parent Loop BB0_18 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x13, x11, #2
	ldr	w14, [x12, x13]
	ldr	w15, [x9, x13]
	add	w14, w15, w14
	str	w14, [x9, x13]
	add	x11, x11, #1
	ldrsw	x6, [x22, #4]
	cmp	x11, x6
	b.lt	LBB0_21
	b	LBB0_17
LBB0_22:
	mov	w0, #0
	bl	_assert
	b	LBB0_27
LBB0_23:
	ldr	w8, [x22, #8]
	neg	w4, w8
Lloh10:
	adrp	x8, _resultlist@GOTPAGE
Lloh11:
	ldr	x8, [x8, _resultlist@GOTPAGEOFF]
Lloh12:
	ldr	x5, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #2147483647
                                        ; kill: def $w6 killed $w6 killed $x6
	b	LBB0_26
LBB0_24:
	mov	w23, #0
LBB0_25:
	ldr	x0, [x24]
Lloh13:
	adrp	x8, _compare@GOTPAGE
Lloh14:
	ldr	x8, [x8, _compare@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x1, x23
	mov	w2, #4
	bl	_qsort
	ldr	w8, [x22, #8]
	neg	w4, w8
	ldr	x5, [x24]
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, x23
	mov	x6, x23
LBB0_26:
	bl	_return_one_key_list
LBB0_27:
	mov	w0, #1
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_resultlist,8,3                 ; @resultlist
	.comm	_MAX_USERLIST_NUM,4,2           ; @MAX_USERLIST_NUM
	.comm	_compare,4,2                    ; @compare
.subsections_via_symbols
