	.file	"extr_tscServer.c_tscBuildCreateTableMsg.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"%p failed to malloc for create table msg"
	.text
	.p2align 4
	.globl	tscBuildCreateTableMsg
	.type	tscBuildCreateTableMsg, @function
tscBuildCreateTableMsg:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	movsx	esi, WORD PTR [rdi]
	mov	edi, 1
	call	calloc@PLT
	movsx	edx, WORD PTR 0[rbp]
	mov	rsi, QWORD PTR 8[rbp]
	mov	rdi, rax
	mov	r13, rax
	call	memcpy@PLT
	xor	esi, esi
	mov	rdi, rbp
	call	tscGetMeterMetaInfo@PLT
	mov	rdi, rbp
	mov	rbx, rax
	call	tscEstimateCreateTableMsgLength@PLT
	mov	rdi, rbp
	mov	esi, eax
	mov	DWORD PTR 4[rsp], eax
	call	tscAllocPayload@PLT
	cmp	rax, QWORD PTR TSDB_CODE_SUCCESS[rip]
	jne	.L13
	movsx	r12, DWORD PTR tsRpcHeadSize[rip]
	add	r12, QWORD PTR 8[rbp]
	mov	edi, DWORD PTR [rbx]
	mov	esi, DWORD PTR [r12]
	call	tscGetDBInfoFromMeterId@PLT
	mov	esi, DWORD PTR [rbx]
	mov	edi, DWORD PTR 44[r12]
	call	strcpy@PLT
	xor	eax, eax
	cmp	QWORD PTR 32[rbp], 0
	movsx	edi, WORD PTR 16[rbp]
	setne	al
	mov	DWORD PTR 4[r12], eax
	call	htons@PLT
	movsx	edi, WORD PTR 18[rbp]
	mov	QWORD PTR 36[r12], rax
	call	htons@PLT
	mov	rbx, QWORD PTR 20[r12]
	mov	QWORD PTR 12[r12], 0
	mov	QWORD PTR 28[r12], rax
	mov	eax, DWORD PTR 16[rbp]
	test	eax, eax
	je	.L4
	mov	rdi, r13
	xor	r15d, r15d
	call	strlen@PLT
	movsx	edx, WORD PTR 16[rbp]
	mov	QWORD PTR 8[rsp], rax
	movsx	eax, WORD PTR 18[rbp]
	add	eax, edx
	test	eax, eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	esi, r15d
	mov	rdi, rbp
	add	r15d, 1
	add	rbx, 16
	call	tscFieldInfoGetField@PLT
	mov	edi, DWORD PTR -8[rbx]
	mov	r14, rax
	mov	eax, DWORD PTR 8[rax]
	mov	DWORD PTR -4[rbx], eax
	mov	esi, DWORD PTR 4[r14]
	call	strcpy@PLT
	movsx	edi, WORD PTR [r14]
	call	htons@PLT
	movsx	edx, WORD PTR 18[rbp]
	mov	QWORD PTR -16[rbx], rax
	movsx	eax, WORD PTR 16[rbp]
	add	eax, edx
	cmp	eax, r15d
	jg	.L5
.L6:
	movzx	r15d, WORD PTR 8[rsp]
	add	r15d, 1
	cmp	r15w, 1
	jg	.L14
.L7:
	mov	rdi, r13
	sub	rbx, r12
	call	tfree@PLT
	lea	rdi, 28[rbp]
	mov	r12d, ebx
	call	tscClearFieldInfo@PLT
	mov	eax, DWORD PTR TSDB_MSG_TYPE_CREATE_TABLE[rip]
	mov	DWORD PTR 20[rbp], ebx
	mov	DWORD PTR 24[rbp], eax
	xor	eax, eax
	call	minMsgSize@PLT
	xor	edi, edi
	add	ebx, eax
	cmp	ebx, DWORD PTR 4[rsp]
	setle	dil
	call	assert@PLT
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movsx	r8d, r15w
	mov	rdi, rbx
	mov	rsi, r13
	movsx	r15, r15w
	mov	edx, r8d
	mov	DWORD PTR 8[rsp], r8d
	call	memcpy@PLT
	mov	BYTE PTR -1[rbx+r15], 0
	mov	r8d, DWORD PTR 8[rsp]
	add	rbx, r15
	mov	edi, r8d
	call	htons@PLT
	mov	QWORD PTR 12[r12], rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, rbx
	mov	edx, 4
	mov	rsi, r13
	add	rbx, 4
	call	memcpy@PLT
	jmp	.L7
.L13:
	mov	rsi, rbp
	lea	rdi, .LC0[rip]
	mov	r12d, -1
	call	tscError@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	tscBuildCreateTableMsg, .-tscBuildCreateTableMsg
	.comm	tsRpcHeadSize,4,4
	.comm	TSDB_MSG_TYPE_CREATE_TABLE,4,4
	.comm	TSDB_CODE_SUCCESS,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_tscServer.c_tscBuildCreateTableMsg.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%p failed to malloc for create table msg\000"
	.text
	.align	2
	.global	tscBuildCreateTableMsg
	.syntax unified
	.arm
	.fpu softvfp
	.type	tscBuildCreateTableMsg, %function
tscBuildCreateTableMsg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r0, #1
	ldrsh	r1, [r4]
	bl	calloc
	ldrsh	r2, [r4]
	ldr	r1, [r4, #4]
	mov	r9, r0
	bl	memcpy
	mov	r1, #0
	mov	r0, r4
	bl	tscGetMeterMetaInfo
	mov	r5, r0
	mov	r0, r4
	bl	tscEstimateCreateTableMsgLength
	mov	r10, r0
	mov	r0, r4
	mov	r1, r10
	bl	tscAllocPayload
	ldr	r3, .L14
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L12
	ldr	r3, .L14+4
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	ldr	r0, [r5]
	add	r7, r2, r3
	ldr	r1, [r2, r3]
	bl	tscGetDBInfoFromMeterId
	ldr	r1, [r5]
	ldr	r0, [r7, #24]
	bl	strcpy
	ldr	r3, [r4, #24]
	ldrsh	r0, [r4, #8]
	subs	r3, r3, #0
	movne	r3, #1
	str	r3, [r7, #4]
	bl	htons
	mov	r3, r0
	mov	fp, #0
	ldrsh	r0, [r4, #10]
	str	r3, [r7, #20]
	bl	htons
	ldr	r3, [r4, #8]
	ldr	r6, [r7, #12]
	cmp	r3, fp
	str	r0, [r7, #16]
	str	fp, [r7, #8]
	beq	.L4
	mov	r0, r9
	bl	strlen
	ldrsh	r3, [r4, #10]
	ldrsh	r1, [r4, #8]
	mov	r8, r0
	add	r3, r3, r1
	cmp	r3, fp
	addgt	r5, r6, #12
	ble	.L6
.L8:
	mov	r1, fp
	mov	r0, r4
	bl	tscFieldInfoGetField
	mov	r6, r0
	ldr	r3, [r0, #8]
	ldr	r0, [r5, #-8]
	str	r3, [r5, #-4]
	ldr	r1, [r6, #4]
	bl	strcpy
	ldrsh	r0, [r6]
	bl	htons
	ldrsh	r3, [r4, #8]
	ldrsh	r2, [r4, #10]
	add	fp, fp, #1
	add	r3, r3, r2
	cmp	r3, fp
	mov	r6, r5
	str	r0, [r5, #-12]
	add	r5, r5, #12
	bgt	.L8
.L6:
	add	r8, r8, #1
	lsl	r8, r8, #16
	asr	r8, r8, #16
	cmp	r8, #1
	bgt	.L13
.L7:
	mov	r0, r9
	bl	tfree
	add	r0, r4, #20
	bl	tscClearFieldInfo
	ldr	r3, .L14+8
	sub	r7, r6, r7
	ldr	r3, [r3]
	str	r7, [r4, #12]
	str	r3, [r4, #16]
	bl	minMsgSize
	add	r0, r0, r7
	cmp	r0, r10
	movgt	r0, #0
	movle	r0, #1
	bl	assert
.L1:
	mov	r0, r7
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	mov	r2, r8
	mov	r1, r9
	mov	r0, r6
	bl	memcpy
	mov	r3, #0
	add	r6, r6, r8
	mov	r0, r8
	strb	r3, [r6, #-1]
	bl	htons
	str	r0, [r7, #8]
	b	.L7
.L4:
	mov	r0, r6
	mov	r2, #4
	mov	r1, r9
	bl	memcpy
	add	r6, r6, #4
	b	.L7
.L12:
	mov	r1, r4
	ldr	r0, .L14+12
	bl	tscError
	mvn	r7, #0
	b	.L1
.L15:
	.align	2
.L14:
	.word	TSDB_CODE_SUCCESS
	.word	tsRpcHeadSize
	.word	TSDB_MSG_TYPE_CREATE_TABLE
	.word	.LC0
	.size	tscBuildCreateTableMsg, .-tscBuildCreateTableMsg
	.comm	tsRpcHeadSize,4,4
	.comm	TSDB_MSG_TYPE_CREATE_TABLE,4,4
	.comm	TSDB_CODE_SUCCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
