	.file	"extr_tscServer.c_tscKillMetricQuery.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%p metric query is cancelled"
	.text
	.p2align 4
	.globl	tscKillMetricQuery
	.type	tscKillMetricQuery, @function
tscKillMetricQuery:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	add	rdi, 8
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	tscIsTwoStageMergeMetricQuery@PLT
	test	eax, eax
	je	.L1
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	jle	.L3
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR 24[rbp]
	mov	rax, QWORD PTR [rax+rbx*8]
	test	rax, rax
	je	.L4
	mov	rdi, QWORD PTR 16[rax]
	test	rdi, rdi
	je	.L4
	mov	edx, DWORD PTR TSDB_CODE_QUERY_CANCELLED[rip]
	mov	DWORD PTR 32[rax], edx
	call	taosStopRpcConn@PLT
.L4:
	add	rbx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jg	.L5
.L3:
	mov	DWORD PTR 0[rbp], 0
	xor	eax, eax
	call	taosGetTimestampMs@PLT
	mov	rbx, rax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	cmp	rax, QWORD PTR TSDB_SQL_RETRIEVE_EMPTY_RESULT[rip]
	je	.L7
	mov	edi, 100
	call	taosMsleep@PLT
	xor	eax, eax
	call	taosGetTimestampMs@PLT
	sub	rax, rbx
	cmp	rax, 10000
	jg	.L7
.L6:
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR TSDB_SQL_RETRIEVE_METRIC[rip]
	jne	.L19
.L7:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rsi, rbp
	lea	rdi, .LC0[rip]
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	tscTrace@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	.cfi_restore_state
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	tscKillMetricQuery, .-tscKillMetricQuery
	.comm	TSDB_SQL_RETRIEVE_METRIC,8,8
	.comm	TSDB_SQL_RETRIEVE_EMPTY_RESULT,8,8
	.comm	TSDB_CODE_QUERY_CANCELLED,4,4
	.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_tscServer.c_tscKillMetricQuery.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%p metric query is cancelled\000"
	.text
	.align	2
	.global	tscKillMetricQuery
	.syntax unified
	.arm
	.fpu softvfp
	.type	tscKillMetricQuery, %function
tscKillMetricQuery:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	add	r0, r0, #4
	bl	tscIsTwoStageMergeMetricQuery
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	ldr	r2, [r5]
	cmp	r2, #0
	ble	.L3
	mov	r4, #0
	ldr	r6, .L20
.L5:
	ldr	r3, [r5, #12]
	ldr	r3, [r3, r4, lsl #2]
	add	r4, r4, #1
	cmp	r3, #0
	beq	.L4
	ldr	r0, [r3, #8]
	cmp	r0, #0
	beq	.L4
	ldr	r2, [r6]
	str	r2, [r3, #16]
	bl	taosStopRpcConn
	ldr	r2, [r5]
.L4:
	cmp	r2, r4
	bgt	.L5
.L3:
	mov	r3, #0
	str	r3, [r5]
	bl	taosGetTimestampMs
	ldr	r7, .L20+4
	mov	r4, r0
	ldr	r8, .L20+8
	ldr	r6, .L20+12
	b	.L6
.L19:
	ldr	r2, [r8]
	cmp	r3, r2
	beq	.L7
	mov	r0, #100
	bl	taosMsleep
	bl	taosGetTimestampMs
	sub	r3, r0, r4
	cmp	r3, r6
	bgt	.L7
.L6:
	ldr	r3, [r5, #4]
	ldr	r2, [r7]
	cmp	r3, r2
	bne	.L19
.L7:
	mov	r1, r5
	pop	{r4, r5, r6, r7, r8, lr}
	ldr	r0, .L20+16
	b	tscTrace
.L21:
	.align	2
.L20:
	.word	TSDB_CODE_QUERY_CANCELLED
	.word	TSDB_SQL_RETRIEVE_METRIC
	.word	TSDB_SQL_RETRIEVE_EMPTY_RESULT
	.word	10000
	.word	.LC0
	.size	tscKillMetricQuery, .-tscKillMetricQuery
	.comm	TSDB_SQL_RETRIEVE_METRIC,4,4
	.comm	TSDB_SQL_RETRIEVE_EMPTY_RESULT,4,4
	.comm	TSDB_CODE_QUERY_CANCELLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
