	.file	"extr_hci_request.c_hci_req_stop_discovery.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s state %u"
	.text
	.p2align 4
	.globl	hci_req_stop_discovery
	.type	hci_req_stop_discovery, @function
hci_req_stop_discovery:
.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
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rbp, QWORD PTR [rdi]
	lea	rdi, .LC0[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rdx, QWORD PTR 8[rbp]
	mov	esi, DWORD PTR 24[rbp]
	call	BT_DBG@PLT
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR DISCOVERY_FINDING[rip]
	je	.L2
	cmp	rax, QWORD PTR DISCOVERY_STOPPING[rip]
	jne	.L3
.L2:
	mov	edi, DWORD PTR HCI_INQUIRY[rip]
	lea	rsi, 4[rbp]
	call	test_bit@PLT
	test	rax, rax
	jne	.L21
.L4:
	mov	esi, DWORD PTR HCI_LE_SCAN[rip]
	mov	rdi, rbp
	mov	r13d, 1
	call	hci_dev_test_flag@PLT
	test	rax, rax
	jne	.L22
.L5:
	mov	rax, QWORD PTR DISCOV_TYPE_LE[rip]
	cmp	QWORD PTR 16[rbp], rax
	je	.L1
	mov	rax, QWORD PTR 8[rbp]
	cmp	rax, QWORD PTR DISCOVERY_RESOLVING[rip]
	je	.L7
	cmp	rax, QWORD PTR DISCOVERY_STOPPING[rip]
	je	.L7
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r13d
	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
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR HCI_LE_SCAN[rip]
	mov	rdi, rbp
	xor	r13d, r13d
	call	hci_dev_test_flag@PLT
	test	rax, rax
	je	.L5
	mov	rdi, r12
	mov	r13d, 1
	call	hci_req_add_le_scan_disable@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR BDADDR_ANY[rip]
	mov	edx, DWORD PTR NAME_PENDING[rip]
	mov	rdi, rbp
	call	hci_inquiry_cache_lookup_resolve@PLT
	mov	rsi, rax
	test	rax, rax
	je	.L1
	lea	r13, 4[rsp]
	mov	rdi, r13
	call	bacpy@PLT
	mov	rcx, r13
	mov	edx, 4
	mov	rdi, r12
	mov	esi, DWORD PTR HCI_OP_REMOTE_NAME_REQ_CANCEL[rip]
	mov	r13d, 1
	call	hci_req_add@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rdi, rbp
	call	cancel_delayed_work@PLT
	mov	rdi, r12
	call	hci_req_add_le_scan_disable@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L21:
	mov	esi, DWORD PTR HCI_OP_INQUIRY_CANCEL[rip]
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, r12
	call	hci_req_add@PLT
	jmp	.L4
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	hci_req_stop_discovery, .-hci_req_stop_discovery
	.comm	NAME_PENDING,4,4
	.comm	HCI_OP_REMOTE_NAME_REQ_CANCEL,4,4
	.comm	HCI_OP_INQUIRY_CANCEL,4,4
	.comm	HCI_LE_SCAN,4,4
	.comm	HCI_INQUIRY,4,4
	.comm	DISCOV_TYPE_LE,8,8
	.comm	DISCOVERY_STOPPING,8,8
	.comm	DISCOVERY_RESOLVING,8,8
	.comm	DISCOVERY_FINDING,8,8
	.comm	BDADDR_ANY,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_stop_discovery.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s state %u\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	hci_req_stop_discovery
	.syntax unified
	.arm
	.fpu softvfp
	.type	hci_req_stop_discovery, %function
hci_req_stop_discovery:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r4, [r0]
	ldr	r3, .L24
	ldr	r2, [r4, #8]
	sub	sp, sp, #8
	mov	r5, r0
	ldr	r1, [r4, #16]
	ldr	r0, .L24+4
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	BT_DBG
	ldr	r2, .L24+8
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L2
	ldr	r2, .L24+12
	ldr	r2, [r2]
	cmp	r3, r2
	bne	.L3
.L2:
	ldr	r3, .L24+16
	add	r1, r4, #4
	ldr	r0, [r3]
	bl	test_bit
	cmp	r0, #0
	bne	.L21
.L4:
	ldr	r3, .L24+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	hci_dev_test_flag
	cmp	r0, #0
	moveq	r6, #1
	bne	.L22
.L5:
	ldr	r3, .L24+24
	ldr	r2, [r4, #12]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L1
	ldr	r2, .L24+28
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L7
	ldr	r2, .L24+12
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L7
.L1:
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r6
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L3:
	ldr	r3, .L24+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	hci_dev_test_flag
	subs	r6, r0, #0
	beq	.L5
	mov	r0, r5
	bl	hci_req_add_le_scan_disable
	mov	r6, #1
	b	.L5
.L7:
	ldr	r3, .L24+32
	ldr	r2, .L24+36
	ldr	r1, [r3]
	mov	r0, r4
	ldr	r2, [r2]
	bl	hci_inquiry_cache_lookup_resolve
	subs	r1, r0, #0
	beq	.L1
	mov	r0, sp
	bl	bacpy
	ldr	r2, .L24+40
	mov	r3, sp
	ldr	r1, [r2]
	mov	r0, r5
	mov	r2, #4
	bl	hci_req_add
	mov	r6, #1
	b	.L1
.L22:
	mov	r0, r4
	bl	cancel_delayed_work
	mov	r0, r5
	bl	hci_req_add_le_scan_disable
	mov	r6, #1
	b	.L5
.L21:
	mov	r3, #0
	ldr	r1, .L24+44
	mov	r2, r3
	mov	r0, r5
	ldr	r1, [r1]
	bl	hci_req_add
	b	.L4
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC1
	.word	.LC0
	.word	DISCOVERY_FINDING
	.word	DISCOVERY_STOPPING
	.word	HCI_INQUIRY
	.word	HCI_LE_SCAN
	.word	DISCOV_TYPE_LE
	.word	DISCOVERY_RESOLVING
	.word	BDADDR_ANY
	.word	NAME_PENDING
	.word	HCI_OP_REMOTE_NAME_REQ_CANCEL
	.word	HCI_OP_INQUIRY_CANCEL
	.size	hci_req_stop_discovery, .-hci_req_stop_discovery
	.comm	NAME_PENDING,4,4
	.comm	HCI_OP_REMOTE_NAME_REQ_CANCEL,4,4
	.comm	HCI_OP_INQUIRY_CANCEL,4,4
	.comm	HCI_LE_SCAN,4,4
	.comm	HCI_INQUIRY,4,4
	.comm	DISCOV_TYPE_LE,4,4
	.comm	DISCOVERY_STOPPING,4,4
	.comm	DISCOVERY_RESOLVING,4,4
	.comm	DISCOVERY_FINDING,4,4
	.comm	BDADDR_ANY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
