	.file	"extr_tsrank.c_calc_rank.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	calc_rank, @function
calc_rank:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	mov	rdi, rdx
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	call	GETQUERY@PLT
	cmp	QWORD PTR [rbx], 0
	pxor	xmm1, xmm1
	je	.L1
	mov	edx, DWORD PTR [r12]
	test	edx, edx
	je	.L1
	mov	rcx, QWORD PTR QI_OPR[rip]
	cmp	QWORD PTR [rax], rcx
	jne	.L3
	mov	rax, QWORD PTR 8[rax]
	cmp	rax, QWORD PTR OP_AND[rip]
	je	.L4
	cmp	rax, QWORD PTR OP_PHRASE[rip]
	jne	.L3
.L4:
	mov	rdx, r12
	mov	rsi, rbx
	mov	rdi, rbp
	call	calc_rank_and@PLT
	movaps	xmm1, xmm0
	pxor	xmm0, xmm0
	comiss	xmm0, xmm1
	ja	.L30
	.p2align 4,,10
	.p2align 3
.L6:
	test	DWORD PTR RANK_NORM_LOGLENGTH[rip], r13d
	je	.L8
	cmp	QWORD PTR [rbx], 0
	jg	.L31
.L8:
	test	DWORD PTR RANK_NORM_LENGTH[rip], r13d
	jne	.L32
.L9:
	mov	edx, DWORD PTR RANK_NORM_LOGUNIQ[rip]
	and	edx, r13d
	test	DWORD PTR RANK_NORM_UNIQ[rip], r13d
	je	.L10
	mov	rax, QWORD PTR [rbx]
	test	rax, rax
	jle	.L11
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, rax
	divss	xmm1, xmm0
	test	edx, edx
	je	.L11
.L12:
	add	rax, 1
	pxor	xmm0, xmm0
	movss	DWORD PTR 12[rsp], xmm1
	cvtsi2sd	xmm0, rax
	call	log@PLT
	movss	DWORD PTR 8[rsp], xmm0
	movsd	xmm0, QWORD PTR .LC2[rip]
	call	log@PLT
	movss	xmm2, DWORD PTR 8[rsp]
	movss	xmm1, DWORD PTR 12[rsp]
	divss	xmm2, xmm0
	divss	xmm1, xmm2
.L11:
	test	DWORD PTR RANK_NORM_RDIVRPLUS1[rip], r13d
	je	.L1
	movss	xmm0, DWORD PTR .LC3[rip]
	addss	xmm0, xmm1
	divss	xmm1, xmm0
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movaps	xmm0, xmm1
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rdx, r12
	mov	rsi, rbx
	mov	rdi, rbp
	call	calc_rank_or@PLT
	movaps	xmm1, xmm0
	pxor	xmm0, xmm0
	comiss	xmm0, xmm1
	jbe	.L6
.L30:
	movss	xmm1, DWORD PTR .LC0[rip]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	test	edx, edx
	je	.L11
	mov	rax, QWORD PTR [rbx]
	test	rax, rax
	jle	.L11
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	mov	rdi, rbx
	movss	DWORD PTR 12[rsp], xmm1
	call	cnt_length@PLT
	pxor	xmm0, xmm0
	add	eax, 1
	cvtsi2sd	xmm0, eax
	call	log@PLT
	movss	DWORD PTR 8[rsp], xmm0
	movsd	xmm0, QWORD PTR .LC2[rip]
	call	log@PLT
	movss	xmm2, DWORD PTR 8[rsp]
	movss	xmm1, DWORD PTR 12[rsp]
	divss	xmm2, xmm0
	divss	xmm1, xmm2
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L32:
	mov	rdi, rbx
	movss	DWORD PTR 8[rsp], xmm1
	call	cnt_length@PLT
	movss	xmm1, DWORD PTR 8[rsp]
	test	eax, eax
	jle	.L9
	pxor	xmm0, xmm0
	cvtsi2ss	xmm0, eax
	divss	xmm1, xmm0
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	calc_rank, .-calc_rank
	.comm	RANK_NORM_UNIQ,4,4
	.comm	RANK_NORM_RDIVRPLUS1,4,4
	.comm	RANK_NORM_LOGUNIQ,4,4
	.comm	RANK_NORM_LOGLENGTH,4,4
	.comm	RANK_NORM_LENGTH,4,4
	.comm	QI_OPR,8,8
	.comm	OP_PHRASE,8,8
	.comm	OP_AND,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	507307272
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.section	.rodata.cst4
	.align 4
.LC3:
	.long	1065353216
	.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_tsrank.c_calc_rank.c"
	.text
	.global	__aeabi_fcmplt
	.global	__aeabi_i2d
	.global	__aeabi_fdiv
	.global	__aeabi_i2f
	.global	__aeabi_fadd
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	calc_rank, %function
calc_rank:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r1
	mov	r7, r0
	mov	r0, r2
	mov	r6, r3
	mov	r4, r2
	bl	GETQUERY
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L14
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L32
	ldr	r2, [r0]
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L3
	ldr	r2, .L32+4
	ldr	r3, [r0, #4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L4
	ldr	r2, .L32+8
	ldr	r2, [r2]
	cmp	r3, r2
	bne	.L3
.L4:
	mov	r2, r4
	mov	r0, r7
	mov	r1, r5
	bl	calc_rank_and
	mov	r4, r0
	b	.L5
.L14:
	mov	r4, #0
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	mov	r2, r4
	mov	r0, r7
	mov	r1, r5
	bl	calc_rank_or
	mov	r4, r0
.L5:
	mov	r0, r4
	mov	r1, #0
	bl	__aeabi_fcmplt
	ldr	r3, .L32+12
	cmp	r0, #0
	ldr	r3, [r3]
	ldrne	r4, .L32+16
	tst	r6, r3
	beq	.L8
	ldr	r3, [r5]
	cmp	r3, #0
	bgt	.L30
.L8:
	ldr	r3, .L32+20
	ldr	r3, [r3]
	tst	r6, r3
	bne	.L31
.L9:
	ldr	r2, .L32+24
	ldr	r3, .L32+28
	ldr	r2, [r2]
	ldr	r3, [r3]
	tst	r6, r2
	and	r7, r6, r3
	beq	.L10
	ldr	r5, [r5]
	cmp	r5, #0
	ble	.L11
	mov	r0, r5
	bl	__aeabi_i2f
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_fdiv
	cmp	r7, #0
	mov	r4, r0
	beq	.L11
.L12:
	add	r0, r5, #1
	bl	__aeabi_i2d
	bl	log
	mov	r1, #1073741824
	mov	r5, r0
	mov	r0, #0
	bl	log
	mov	r1, r0
	mov	r0, r5
	bl	__aeabi_fdiv
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_fdiv
	mov	r4, r0
.L11:
	ldr	r3, .L32+32
	ldr	r3, [r3]
	tst	r6, r3
	beq	.L1
	mov	r1, #1065353216
	mov	r0, r4
	bl	__aeabi_fadd
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_fdiv
	mov	r4, r0
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	cmp	r7, #0
	beq	.L11
	ldr	r5, [r5]
	cmp	r5, #0
	ble	.L11
	b	.L12
.L30:
	mov	r0, r5
	bl	cnt_length
	add	r0, r0, #1
	bl	__aeabi_i2d
	bl	log
	mov	r1, #1073741824
	mov	r7, r0
	mov	r0, #0
	bl	log
	mov	r1, r0
	mov	r0, r7
	bl	__aeabi_fdiv
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_fdiv
	mov	r4, r0
	b	.L8
.L31:
	mov	r0, r5
	bl	cnt_length
	cmp	r0, #0
	ble	.L9
	bl	__aeabi_i2f
	mov	r1, r0
	mov	r0, r4
	bl	__aeabi_fdiv
	mov	r4, r0
	b	.L9
.L33:
	.align	2
.L32:
	.word	QI_OPR
	.word	OP_AND
	.word	OP_PHRASE
	.word	RANK_NORM_LOGLENGTH
	.word	507307272
	.word	RANK_NORM_LENGTH
	.word	RANK_NORM_UNIQ
	.word	RANK_NORM_LOGUNIQ
	.word	RANK_NORM_RDIVRPLUS1
	.size	calc_rank, .-calc_rank
	.comm	RANK_NORM_UNIQ,4,4
	.comm	RANK_NORM_RDIVRPLUS1,4,4
	.comm	RANK_NORM_LOGUNIQ,4,4
	.comm	RANK_NORM_LOGLENGTH,4,4
	.comm	RANK_NORM_LENGTH,4,4
	.comm	QI_OPR,4,4
	.comm	OP_PHRASE,4,4
	.comm	OP_AND,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
