	.file	"extr_protocomm_nimble.c_populate_gatt_db.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Error allocating memory for GATT services"
	.align 8
.LC1:
	.string	"Error allocating memory for GATT service UUID"
	.align 8
.LC2:
	.string	"Error adding primary service !!!"
	.align 8
.LC3:
	.string	"Error adding GATT characteristic !!!"
	.align 8
.LC4:
	.string	"Error adding GATT Discriptor !!"
	.text
	.p2align 4
	.type	populate_gatt_db, @function
populate_gatt_db:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rsi
	mov	esi, 16
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rdi
	mov	edi, 2
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	calloc@PLT
	mov	QWORD PTR [r12], rax
	test	rax, rax
	je	.L16
	mov	esi, 16
	mov	edi, 1
	call	calloc@PLT
	mov	rdx, QWORD PTR [r12]
	mov	QWORD PTR 8[rdx], rax
	test	rax, rax
	je	.L17
	mov	eax, DWORD PTR BLE_UUID_TYPE_128[rip]
	mov	rsi, QWORD PTR 8[r13]
	pxor	xmm0, xmm0
	xor	edi, edi
	mov	edx, DWORD PTR BLE_UUID128_VAL_LENGTH[rip]
	movaps	XMMWORD PTR [rsp], xmm0
	mov	DWORD PTR 8[rsp], eax
	call	memcpy@PLT
	mov	rax, QWORD PTR [r12]
	mov	rsi, rsp
	mov	edx, 16
	mov	rdi, QWORD PTR 8[rax]
	call	memcpy@PLT
	mov	esi, DWORD PTR 0[r13]
	mov	rdi, QWORD PTR [r12]
	call	ble_gatt_add_primary_svcs@PLT
	mov	r14d, eax
	test	eax, eax
	jne	.L5
	mov	eax, DWORD PTR 0[r13]
	xor	ebx, ebx
	test	eax, eax
	jg	.L6
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR [r12]
	mov	edx, DWORD PTR BLE_GATT_UUID_CHAR_DSC[rip]
	mov	esi, ebx
	mov	rdi, QWORD PTR [rax]
	call	ble_gatt_add_char_dsc@PLT
	mov	ebp, eax
	test	eax, eax
	jne	.L18
	add	ebx, 1
	cmp	DWORD PTR 0[r13], ebx
	jle	.L1
.L6:
	mov	rax, QWORD PTR [r12]
	mov	esi, ebx
	mov	rdi, QWORD PTR [rax]
	call	ble_gatt_add_characteristics@PLT
	mov	ebp, eax
	test	eax, eax
	je	.L8
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC3[rip]
	mov	r14d, ebp
	call	ESP_LOGE@PLT
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L19
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r14d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC0[rip]
	call	ESP_LOGE@PLT
	mov	r14d, DWORD PTR ESP_ERR_NO_MEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC4[rip]
	mov	r14d, ebp
	call	ESP_LOGE@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC1[rip]
	call	ESP_LOGE@PLT
	mov	r14d, DWORD PTR ESP_ERR_NO_MEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, DWORD PTR TAG[rip]
	lea	rsi, .LC2[rip]
	call	ESP_LOGE@PLT
	jmp	.L1
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	populate_gatt_db, .-populate_gatt_db
	.comm	TAG,4,4
	.comm	ESP_ERR_NO_MEM,4,4
	.comm	BLE_UUID_TYPE_128,4,4
	.comm	BLE_UUID128_VAL_LENGTH,4,4
	.comm	BLE_GATT_UUID_CHAR_DSC,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_protocomm_nimble.c_populate_gatt_db.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Error allocating memory for GATT services\000"
	.align	2
.LC1:
	.ascii	"Error allocating memory for GATT service UUID\000"
	.align	2
.LC2:
	.ascii	"Error adding primary service !!!\000"
	.align	2
.LC3:
	.ascii	"Error adding GATT characteristic !!!\000"
	.align	2
.LC4:
	.ascii	"Error adding GATT Discriptor !!\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	populate_gatt_db, %function
populate_gatt_db:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r5, r0
	mov	r6, r1
	mov	r0, #2
	mov	r1, #8
	sub	sp, sp, #20
	bl	calloc
	cmp	r0, #0
	str	r0, [r5]
	beq	.L14
	mov	r7, r0
	mov	r1, #12
	mov	r0, #1
	bl	calloc
	cmp	r0, #0
	mov	r4, r0
	str	r0, [r7, #4]
	beq	.L15
	mov	r0, #0
	ldr	r2, .L17
	ldr	r3, .L17+4
	ldr	r9, [r2]
	ldr	r1, [r6, #4]
	ldr	r2, [r3]
	add	r8, sp, #4
	str	r0, [sp, #4]
	str	r0, [sp, #12]
	bl	memcpy
	str	r9, [sp, #8]
	ldm	r8, {r0, r1, r2}
	stm	r4, {r0, r1, r2}
	mov	r0, r7
	ldr	r1, [r6]
	bl	ble_gatt_add_primary_svcs
	subs	r8, r0, #0
	bne	.L5
	ldr	r3, [r6]
	cmp	r3, #0
	movgt	r4, r8
	ldrgt	r7, .L17+8
	bgt	.L6
	b	.L1
.L8:
	ldr	r3, [r5]
	mov	r1, r4
	ldr	r0, [r3]
	ldr	r2, [r7]
	bl	ble_gatt_add_char_dsc
	subs	r3, r0, #0
	add	r4, r4, #1
	bne	.L16
	ldr	r3, [r6]
	cmp	r3, r4
	ble	.L1
.L6:
	ldr	r3, [r5]
	mov	r1, r4
	ldr	r0, [r3]
	bl	ble_gatt_add_characteristics
	subs	r3, r0, #0
	beq	.L8
	ldr	r2, .L17+12
	ldr	r1, .L17+16
	ldr	r0, [r2]
	mov	r8, r3
	bl	ESP_LOGE
.L1:
	mov	r0, r8
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L16:
	mov	r8, r3
	ldr	r2, .L17+12
	ldr	r1, .L17+20
	ldr	r0, [r2]
	bl	ESP_LOGE
	mov	r0, r8
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L5:
	ldr	r3, .L17+12
	ldr	r1, .L17+24
	ldr	r0, [r3]
	bl	ESP_LOGE
	mov	r0, r8
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L14:
	ldr	r3, .L17+12
	ldr	r1, .L17+28
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L17+32
	ldr	r8, [r3]
	b	.L1
.L15:
	ldr	r3, .L17+12
	ldr	r1, .L17+36
	ldr	r0, [r3]
	bl	ESP_LOGE
	ldr	r3, .L17+32
	ldr	r8, [r3]
	b	.L1
.L18:
	.align	2
.L17:
	.word	BLE_UUID_TYPE_128
	.word	BLE_UUID128_VAL_LENGTH
	.word	BLE_GATT_UUID_CHAR_DSC
	.word	TAG
	.word	.LC3
	.word	.LC4
	.word	.LC2
	.word	.LC0
	.word	ESP_ERR_NO_MEM
	.word	.LC1
	.size	populate_gatt_db, .-populate_gatt_db
	.comm	TAG,4,4
	.comm	ESP_ERR_NO_MEM,4,4
	.comm	BLE_UUID_TYPE_128,4,4
	.comm	BLE_UUID128_VAL_LENGTH,4,4
	.comm	BLE_GATT_UUID_CHAR_DSC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
