	.file	"extr_btm_pm.c_btm_pm_reset.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	btm_pm_reset
	.type	btm_pm_reset, @function
btm_pm_reset:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rdx, QWORD PTR btm_cb[rip]
	cmp	rdx, QWORD PTR BTM_PM_SET_ONLY_ID[rip]
	mov	ecx, DWORD PTR BTM_MAX_PM_RECORDS[rip]
	mov	rdi, QWORD PTR MAX_L2CAP_LINKS[rip]
	je	.L18
	mov	rax, QWORD PTR btm_cb[rip+24]
	sal	rdx, 4
	add	rdx, rax
	mov	esi, DWORD PTR [rdx]
	test	DWORD PTR BTM_PM_REG_NOTIF[rip], esi
	jne	.L5
	xor	r8d, r8d
	test	ecx, ecx
	jle	.L14
.L4:
	mov	esi, DWORD PTR BTM_PM_REC_NOT_USED[rip]
	xor	edx, edx
	.p2align 4,,10
	.p2align 3
.L7:
	add	edx, 1
	mov	DWORD PTR [rax], esi
	add	rax, 16
	cmp	edx, ecx
	jl	.L7
.L6:
	test	r8, r8
	je	.L14
	mov	rax, QWORD PTR btm_cb[rip+8]
	cmp	rax, rdi
	jnb	.L14
	sub	rsp, 8
	.cfi_def_cfa_offset 16
	mov	rdx, QWORD PTR btm_cb[rip+16]
	mov	esi, DWORD PTR BTM_PM_STS_ERROR[rip]
	xor	ecx, ecx
	mov	edi, DWORD PTR [rdx+rax*4]
	mov	edx, DWORD PTR BTM_DEV_RESET[rip]
	call	[QWORD PTR [r8]]
	mov	rdi, QWORD PTR MAX_L2CAP_LINKS[rip]
	mov	QWORD PTR btm_cb[rip+8], rdi
	add	rsp, 8
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	mov	r8, QWORD PTR 8[rdx]
	test	ecx, ecx
	jg	.L4
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	mov	QWORD PTR btm_cb[rip+8], rdi
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	test	ecx, ecx
	jle	.L14
	mov	rax, QWORD PTR btm_cb[rip+24]
	xor	r8d, r8d
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	btm_pm_reset, .-btm_pm_reset
	.comm	btm_cb,32,32
	.comm	MAX_L2CAP_LINKS,8,8
	.comm	BTM_PM_STS_ERROR,4,4
	.comm	BTM_PM_SET_ONLY_ID,8,8
	.comm	BTM_PM_REG_NOTIF,4,4
	.comm	BTM_PM_REC_NOT_USED,4,4
	.comm	BTM_MAX_PM_RECORDS,4,4
	.comm	BTM_DEV_RESET,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_btm_pm.c_btm_pm_reset.c"
	.text
	.align	2
	.global	btm_pm_reset
	.syntax unified
	.arm
	.fpu softvfp
	.type	btm_pm_reset, %function
btm_pm_reset:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r2, .L16
	ldr	r4, .L16+4
	ldr	r1, [r2]
	ldr	r3, [r4]
	ldr	r2, .L16+8
	ldr	r5, .L16+12
	cmp	r3, r1
	ldr	lr, [r5]
	ldr	r1, [r2]
	beq	.L15
	ldr	r2, [r4, #12]
	ldr	r0, .L16+16
	ldr	ip, [r2, r3, lsl #3]
	ldr	r0, [r0]
	add	r3, r2, r3, lsl #3
	ands	ip, ip, r0
	bne	.L5
	cmp	r1, #0
	ble	.L3
.L4:
	mov	r3, #0
	ldr	r0, .L16+20
	ldr	r0, [r0]
.L7:
	str	r0, [r2, r3, lsl #3]
	add	r3, r3, #1
	cmp	r3, r1
	blt	.L7
.L6:
	cmp	ip, #0
	beq	.L3
	ldr	r3, [r4, #4]
	cmp	r3, lr
	bcs	.L3
	ldr	r0, [r4, #8]
	ldr	r2, .L16+24
	ldr	r1, .L16+28
	ldr	r0, [r0, r3, lsl #2]
	ldr	r6, [ip]
	mov	r3, #0
	ldr	r2, [r2]
	ldr	r1, [r1]
	blx	r6
	ldr	lr, [r5]
.L3:
	str	lr, [r4, #4]
	pop	{r4, r5, r6, pc}
.L5:
	cmp	r1, #0
	ldr	ip, [r3, #4]
	bgt	.L4
	b	.L6
.L15:
	cmp	r1, #0
	ble	.L3
	mov	ip, #0
	ldr	r2, [r4, #12]
	b	.L4
.L17:
	.align	2
.L16:
	.word	BTM_PM_SET_ONLY_ID
	.word	btm_cb
	.word	BTM_MAX_PM_RECORDS
	.word	MAX_L2CAP_LINKS
	.word	BTM_PM_REG_NOTIF
	.word	BTM_PM_REC_NOT_USED
	.word	BTM_DEV_RESET
	.word	BTM_PM_STS_ERROR
	.size	btm_pm_reset, .-btm_pm_reset
	.comm	btm_cb,16,4
	.comm	MAX_L2CAP_LINKS,4,4
	.comm	BTM_PM_STS_ERROR,4,4
	.comm	BTM_PM_SET_ONLY_ID,4,4
	.comm	BTM_PM_REG_NOTIF,4,4
	.comm	BTM_PM_REC_NOT_USED,4,4
	.comm	BTM_MAX_PM_RECORDS,4,4
	.comm	BTM_DEV_RESET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
