	.file	"extr_friend-data.c_prepare_recent_friends.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	prepare_recent_friends
	.type	prepare_recent_friends, @function
prepare_recent_friends:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	get_user@PLT
	mov	rbx, rax
	lea	eax, -1[rbp]
	cmp	eax, 999
	ja	.L5
	test	rbx, rbx
	je	.L5
	mov	edi, DWORD PTR 4[rbx]
	mov	DWORD PTR R_max[rip], ebp
	mov	DWORD PTR HN[rip], 0
	call	tree_fetch_recent@PLT
	xor	eax, eax
	call	aux_heap_sort@PLT
	mov	rax, QWORD PTR R[rip]
	mov	edx, DWORD PTR HN[rip]
	mov	QWORD PTR R_end[rip], rax
	test	edx, edx
	jle	.L3
	mov	rdi, QWORD PTR H[rip]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rcx, QWORD PTR [rdi+rdx*8]
	add	rax, 12
	add	rdx, 1
	mov	esi, DWORD PTR 8[rcx]
	mov	DWORD PTR -12[rax], esi
	mov	esi, DWORD PTR 4[rcx]
	mov	DWORD PTR -8[rax], esi
	mov	ecx, DWORD PTR [rcx]
	mov	DWORD PTR -4[rax], ecx
	cmp	DWORD PTR HN[rip], edx
	jg	.L4
	mov	QWORD PTR R_end[rip], rax
.L3:
	mov	eax, DWORD PTR [rbx]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	mov	eax, -1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	prepare_recent_friends, .-prepare_recent_friends
	.comm	R_max,4,4
	.comm	R_end,8,8
	.comm	R,8,8
	.comm	HN,4,4
	.comm	H,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_friend-data.c_prepare_recent_friends.c"
	.text
	.align	2
	.global	prepare_recent_friends
	.syntax unified
	.arm
	.fpu softvfp
	.type	prepare_recent_friends, %function
prepare_recent_friends:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, r1
	bl	get_user
	sub	r3, r7, #1
	cmp	r0, #0
	cmpne	r3, #1000
	movcs	r6, #1
	movcc	r6, #0
	bcs	.L5
	ldr	r3, .L9
	ldr	r4, .L9+4
	mov	r5, r0
	ldr	r0, [r0, #4]
	str	r7, [r3]
	str	r6, [r4]
	bl	tree_fetch_recent
	bl	aux_heap_sort
	ldr	r3, .L9+8
	ldr	r2, [r4]
	ldr	r3, [r3]
	ldr	r7, .L9+12
	cmp	r2, #0
	str	r3, [r7]
	ble	.L3
	mov	r1, r6
	ldr	r2, .L9+16
	add	r3, r3, #12
	ldr	ip, [r2]
	sub	ip, ip, #4
.L4:
	ldr	r2, [ip, #4]!
	add	r1, r1, #1
	ldr	r0, [r2, #8]
	mov	r6, r3
	str	r0, [r3, #-12]
	ldr	lr, [r2, #4]
	add	r3, r3, #12
	str	lr, [r3, #-20]
	ldr	r2, [r2]
	str	r2, [r3, #-16]
	ldr	r2, [r4]
	cmp	r2, r1
	bgt	.L4
	str	r6, [r7]
.L3:
	ldr	r0, [r5]
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	.align	2
.L9:
	.word	R_max
	.word	HN
	.word	R
	.word	R_end
	.word	H
	.size	prepare_recent_friends, .-prepare_recent_friends
	.comm	R_max,4,4
	.comm	R_end,4,4
	.comm	R,4,4
	.comm	HN,4,4
	.comm	H,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
