	.file	"extr_hci_request.c___hci_req_enable_ext_advertising.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	__hci_req_enable_ext_advertising
	.type	__hci_req_enable_ext_advertising, @function
__hci_req_enable_ext_advertising:
.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
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, esi
	sub	rsp, 208
	.cfi_def_cfa_offset 256
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 200[rsp], rax
	xor	eax, eax
	test	esi, esi
	jle	.L2
	mov	rdi, QWORD PTR [rdi]
	call	hci_find_adv_instance@PLT
	mov	r12, rax
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	test	r12, r12
	je	.L1
	mov	r14, QWORD PTR 16[rsp]
	mov	r13, rsp
	mov	edx, 24
	xor	esi, esi
	mov	rdi, r13
	call	memset@PLT
	mov	edx, 24
	xor	esi, esi
	mov	rdi, r14
	movabs	rax, 4294967297
	mov	QWORD PTR [rsp], rax
	call	memset@PLT
	mov	eax, DWORD PTR [r12]
	mov	DWORD PTR 12[r14], ebx
	test	eax, eax
	jne	.L10
.L5:
	movsx	rax, DWORD PTR 4[rsp]
	mov	esi, DWORD PTR HCI_OP_LE_SET_EXT_ADV_ENABLE[rip]
	mov	rcx, r13
	mov	rdi, rbp
	lea	edx, 3[rax+rax*2]
	sal	edx, 3
	call	hci_req_add@PLT
	xor	eax, eax
.L1:
	mov	rcx, QWORD PTR 200[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L11
	add	rsp, 208
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	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
.L10:
	.cfi_restore_state
	imul	eax, DWORD PTR MSEC_PER_SEC[rip]
	movsx	rdi, eax
	sar	eax, 31
	imul	rdi, rdi, 1717986919
	sar	rdi, 34
	sub	edi, eax
	call	cpu_to_le16@PLT
	mov	DWORD PTR 8[r14], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	mov	r12, QWORD PTR 16[rsp]
	mov	r13, rsp
	mov	edx, 24
	xor	esi, esi
	mov	rdi, r13
	call	memset@PLT
	mov	edx, 24
	xor	esi, esi
	mov	rdi, r12
	movabs	rax, 4294967297
	mov	QWORD PTR [rsp], rax
	call	memset@PLT
	mov	DWORD PTR 12[r12], ebx
	jmp	.L5
.L11:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	__hci_req_enable_ext_advertising, .-__hci_req_enable_ext_advertising
	.comm	MSEC_PER_SEC,4,4
	.comm	HCI_OP_LE_SET_EXT_ADV_ENABLE,4,4
	.comm	EINVAL,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_hci_request.c___hci_req_enable_ext_advertising.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	__hci_req_enable_ext_advertising
	.syntax unified
	.arm
	.fpu softvfp
	.type	__hci_req_enable_ext_advertising, %function
__hci_req_enable_ext_advertising:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L13
	sub	sp, sp, #172
	subs	r4, r1, #0
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #164]
	mov	r3,#0
	ble	.L2
	ldr	r0, [r0]
	bl	hci_find_adv_instance
	subs	r6, r0, #0
	beq	.L10
	mov	r1, #0
	mov	r3, #1
	ldr	r7, [sp, #20]
	mov	r2, #20
	mov	r0, r7
	str	r3, [sp, #4]
	str	r3, [sp, #8]
	str	r1, [sp, #12]
	str	r1, [sp, #16]
	str	r1, [sp, #20]
	bl	memset
	ldr	r3, [r6]
	str	r4, [r7, #12]
	cmp	r3, #0
	bne	.L11
.L5:
	ldr	r2, [sp, #8]
	ldr	r3, .L13+4
	add	r2, r2, #1
	add	r2, r2, r2, lsl #2
	ldr	r1, [r3]
	mov	r0, r5
	lsl	r2, r2, #2
	add	r3, sp, #4
	bl	hci_req_add
	mov	r0, #0
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #164]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	add	sp, sp, #172
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L11:
	ldr	r2, .L13+8
	ldr	r0, .L13+12
	ldr	r2, [r2]
	mul	r3, r2, r3
	smull	r2, r0, r3, r0
	asr	r3, r3, #31
	rsb	r0, r3, r0, asr #2
	bl	cpu_to_le16
	str	r0, [r7, #8]
	b	.L5
.L2:
	mov	r1, #0
	mov	ip, #1
	ldr	r3, [sp, #20]
	mov	r2, #20
	mov	r0, r3
	str	r1, [sp, #12]
	str	r1, [sp, #16]
	str	r1, [sp, #20]
	str	ip, [sp, #4]
	str	ip, [sp, #8]
	bl	memset
	str	r4, [r0, #12]
	b	.L5
.L10:
	ldr	r3, .L13+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	HCI_OP_LE_SET_EXT_ADV_ENABLE
	.word	MSEC_PER_SEC
	.word	1717986919
	.word	EINVAL
	.size	__hci_req_enable_ext_advertising, .-__hci_req_enable_ext_advertising
	.comm	MSEC_PER_SEC,4,4
	.comm	HCI_OP_LE_SET_EXT_ADV_ENABLE,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
