	.file	"extr_att_protocol.c_attp_build_read_by_type_value_cmd.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	attp_build_read_by_type_value_cmd
	.type	attp_build_read_by_type_value_cmd, @function
attp_build_read_by_type_value_cmd:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	r13d, DWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR L2CAP_MIN_OFFSET[rip]
	lea	edi, 8[rdi+rax]
	call	osi_malloc@PLT
	mov	r12, rax
	test	rax, rax
	jne	.L10
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L11
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	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
.L10:
	.cfi_restore_state
	movsx	rdx, DWORD PTR L2CAP_MIN_OFFSET[rip]
	mov	esi, DWORD PTR GATT_REQ_FIND_TYPE_VALUE[rip]
	lea	rdi, 8[r12+rdx*4]
	mov	QWORD PTR [rsp], rdi
	mov	DWORD PTR [r12], edx
	mov	DWORD PTR 4[r12], 5
	call	UINT8_TO_STREAM@PLT
	mov	esi, DWORD PTR 16[rbx]
	mov	rdi, QWORD PTR [rsp]
	call	UINT16_TO_STREAM@PLT
	mov	esi, DWORD PTR 12[rbx]
	mov	rdi, QWORD PTR [rsp]
	call	UINT16_TO_STREAM@PLT
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, rsp
	call	gatt_build_uuid_to_stream@PLT
	mov	edx, DWORD PTR [rbx]
	add	eax, DWORD PTR 4[r12]
	mov	ecx, ebp
	sub	ecx, eax
	mov	esi, DWORD PTR 4[rbx]
	mov	rdi, QWORD PTR [rsp]
	mov	DWORD PTR 4[r12], eax
	add	edx, eax
	cmp	edx, ebp
	cmovg	r13d, ecx
	mov	edx, r13d
	call	memcpy@PLT
	add	DWORD PTR 4[r12], r13d
	jmp	.L1
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	attp_build_read_by_type_value_cmd, .-attp_build_read_by_type_value_cmd
	.comm	L2CAP_MIN_OFFSET,4,4
	.comm	GATT_REQ_FIND_TYPE_VALUE,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_att_protocol.c_attp_build_read_by_type_value_cmd.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	attp_build_read_by_type_value_cmd
	.syntax unified
	.arm
	.fpu softvfp
	.type	attp_build_read_by_type_value_cmd, %function
attp_build_read_by_type_value_cmd:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L12
	ldr	r6, .L12+4
	sub	sp, sp, #8
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ldr	r3, [r6]
	mov	r7, r0
	add	r3, r3, #8
	add	r0, r3, r0
	mov	r5, r1
	ldr	r8, [r1]
	bl	osi_malloc
	subs	r4, r0, #0
	bne	.L10
.L1:
	ldr	r3, .L12
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	mov	r2, #5
	ldr	r3, [r6]
	str	r2, [r4, #4]
	add	r0, r4, r3, lsl #2
	ldr	r2, .L12+8
	add	r0, r0, #8
	ldr	r1, [r2]
	str	r0, [sp]
	str	r3, [r4]
	bl	UINT8_TO_STREAM
	ldr	r1, [r5, #16]
	ldr	r0, [sp]
	bl	UINT16_TO_STREAM
	ldr	r1, [r5, #12]
	ldr	r0, [sp]
	bl	UINT16_TO_STREAM
	ldr	r1, [r5, #8]
	mov	r0, sp
	bl	gatt_build_uuid_to_stream
	ldr	r2, [r4, #4]
	ldr	r3, [r5]
	add	r0, r0, r2
	add	r3, r0, r3
	cmp	r3, r7
	subgt	r8, r7, r0
	mov	r2, r8
	str	r0, [r4, #4]
	ldr	r1, [r5, #4]
	ldr	r0, [sp]
	bl	memcpy
	ldr	r3, [r4, #4]
	add	r8, r3, r8
	str	r8, [r4, #4]
	b	.L1
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	.LC0
	.word	L2CAP_MIN_OFFSET
	.word	GATT_REQ_FIND_TYPE_VALUE
	.size	attp_build_read_by_type_value_cmd, .-attp_build_read_by_type_value_cmd
	.comm	L2CAP_MIN_OFFSET,4,4
	.comm	GATT_REQ_FIND_TYPE_VALUE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
