	.file	"extr_bta_ag_rfc.c_bta_ag_start_servers.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"bta_ag_start_servers: RFCOMM_CreateConnection returned error:%d"
	.text
	.p2align 4
	.globl	bta_ag_start_servers
	.type	bta_ag_start_servers, @function
bta_ag_start_servers:
.LFB0:
	.cfi_startproc
	endbr64
	mov	ecx, DWORD PTR BTA_HSP_SERVICE_ID[rip]
	sar	esi, cl
	mov	ecx, DWORD PTR BTA_AG_NUM_IDX[rip]
	test	ecx, ecx
	jle	.L17
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	test	esi, esi
	je	.L1
	mov	r12, rdi
	xor	ebx, ebx
	lea	r13, .LC0[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	lea	eax, 1[rbx]
	cmp	DWORD PTR BTA_AG_NUM_IDX[rip], eax
	setg	dl
	sar	ebp
	setne	al
	add	rbx, 1
	test	dl, al
	je	.L1
.L5:
	test	bpl, 1
	je	.L3
	mov	rax, QWORD PTR bta_ag_sec_id[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	ecx, DWORD PTR 8[r12]
	mov	rsi, r13
	mov	r9d, DWORD PTR BTM_SEC_PROTO_RFCOMM[rip]
	mov	r8d, DWORD PTR BT_PSM_RFCOMM[rip]
	lea	r14, 0[0+rbx*4]
	mov	edx, DWORD PTR [rax+rbx*4]
	mov	rax, QWORD PTR bta_ag_cb[rip]
	mov	edi, DWORD PTR FALSE[rip]
	mov	eax, DWORD PTR [rax+rbx*4]
	push	rax
	.cfi_def_cfa_offset 80
	call	BTM_SetSecurityLevel@PLT
	mov	rdi, r12
	mov	r15, QWORD PTR bta_ag_mgmt_cback_tbl[rip]
	call	bta_ag_scb_to_idx@PLT
	mov	rdx, QWORD PTR bta_ag_cb[rip]
	mov	r9, QWORD PTR [r12]
	cdqe
	mov	r8, QWORD PTR bd_addr_any[rip]
	mov	ecx, DWORD PTR BTA_AG_MTU[rip]
	mov	esi, DWORD PTR [rdx+rbx*4]
	mov	rdx, QWORD PTR bta_ag_uuid[rip]
	add	r9, r14
	mov	eax, DWORD PTR -4[r15+rax*4]
	mov	edi, DWORD PTR [rdx+rbx*4]
	mov	edx, DWORD PTR TRUE[rip]
	mov	DWORD PTR [rsp], eax
	call	RFCOMM_CreateConnection@PLT
	mov	esi, eax
	cmp	DWORD PTR PORT_SUCCESS[rip], esi
	pop	rax
	.cfi_def_cfa_offset 72
	pop	rdx
	.cfi_def_cfa_offset 64
	je	.L21
	lea	rdi, .LC1[rip]
	call	APPL_TRACE_DEBUG@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	mov	rax, QWORD PTR [r12]
	mov	rdi, r12
	mov	esi, DWORD PTR [rax+rbx*4]
	call	bta_ag_setup_port@PLT
	jmp	.L3
.L17:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE0:
	.size	bta_ag_start_servers, .-bta_ag_start_servers
	.comm	bta_ag_uuid,8,8
	.comm	bta_ag_sec_id,8,8
	.comm	bta_ag_mgmt_cback_tbl,8,8
	.comm	bta_ag_cb,8,8
	.comm	bd_addr_any,8,8
	.comm	TRUE,4,4
	.comm	PORT_SUCCESS,4,4
	.comm	FALSE,4,4
	.comm	BT_PSM_RFCOMM,4,4
	.comm	BTM_SEC_PROTO_RFCOMM,4,4
	.comm	BTA_HSP_SERVICE_ID,4,4
	.comm	BTA_AG_NUM_IDX,4,4
	.comm	BTA_AG_MTU,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_bta_ag_rfc.c_bta_ag_start_servers.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"bta_ag_start_servers: RFCOMM_CreateConnection retur"
	.ascii	"ned error:%d\000"
	.text
	.align	2
	.global	bta_ag_start_servers
	.syntax unified
	.arm
	.fpu softvfp
	.type	bta_ag_start_servers, %function
bta_ag_start_servers:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L16
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, [r3]
	ldr	r8, .L16+4
	asrs	r5, r1, r2
	movne	r3, #1
	moveq	r3, #0
	ldr	ip, [r8]
	sub	sp, sp, #36
	cmp	ip, #0
	movle	r3, #0
	andgt	r3, r3, #1
	cmp	r3, #0
	beq	.L1
	mov	r7, r0
	mov	r4, #0
	ldr	r9, .L16+8
	b	.L5
.L3:
	asrs	r5, r5, #1
	movne	r3, #1
	moveq	r3, #0
	ldr	r2, [r8]
	add	r4, r4, #1
	cmp	r2, r4
	movle	r3, #0
	andgt	r3, r3, #1
	cmp	r3, #0
	beq	.L1
.L5:
	tst	r5, #1
	beq	.L3
	ldr	r3, .L16+12
	ldr	r10, .L16+16
	ldr	r2, [r3]
	ldr	r3, [r9]
	ldr	r2, [r2, r4, lsl #2]
	ldr	r0, [r3, r4, lsl #2]
	ldr	r3, .L16+20
	lsl	r6, r4, #2
	ldr	r1, [r3]
	ldr	r3, .L16+24
	ldr	r3, [r3]
	str	r0, [sp, #8]
	ldr	r0, .L16+28
	str	r1, [sp, #4]
	str	r3, [sp]
	ldr	r3, [r7, #4]
	ldr	r1, .L16+32
	ldr	r0, [r0]
	bl	BTM_SetSecurityLevel
	ldr	r3, .L16+36
	ldr	fp, [r9]
	ldr	r2, [r3]
	ldr	r1, .L16+40
	ldr	r2, [r2, r4, lsl #2]
	ldr	r3, .L16+44
	ldr	lr, .L16+48
	ldr	ip, [r7]
	ldr	r3, [r3]
	ldr	r1, [r1]
	str	r2, [sp, #28]
	ldr	r2, [fp, r4, lsl #2]
	mov	r0, r7
	ldr	fp, [lr]
	add	r6, ip, r6
	ldr	r10, [r10]
	str	r2, [sp, #16]
	str	r3, [sp, #24]
	str	r1, [sp, #20]
	bl	bta_ag_scb_to_idx
	ldr	r1, [sp, #20]
	sub	r0, r0, #-1073741823
	ldr	r1, [r1, r0, lsl #2]
	ldr	r2, [sp, #28]
	ldr	r3, [sp, #24]
	mov	r0, r2
	str	r3, [sp]
	str	r1, [sp, #8]
	mov	r3, fp
	ldr	r1, [sp, #16]
	mov	r2, r10
	str	r6, [sp, #4]
	bl	RFCOMM_CreateConnection
	mov	r1, r0
	ldr	r3, .L16+52
	ldr	r0, .L16+56
	ldr	r3, [r3]
	cmp	r3, r1
	beq	.L15
	bl	APPL_TRACE_DEBUG
	b	.L3
.L1:
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r3, [r7]
	mov	r0, r7
	ldr	r1, [r3, r4, lsl #2]
	bl	bta_ag_setup_port
	b	.L3
.L17:
	.align	2
.L16:
	.word	BTA_HSP_SERVICE_ID
	.word	BTA_AG_NUM_IDX
	.word	bta_ag_cb
	.word	bta_ag_sec_id
	.word	TRUE
	.word	BTM_SEC_PROTO_RFCOMM
	.word	BT_PSM_RFCOMM
	.word	FALSE
	.word	.LC0
	.word	bta_ag_uuid
	.word	bta_ag_mgmt_cback_tbl
	.word	bd_addr_any
	.word	BTA_AG_MTU
	.word	PORT_SUCCESS
	.word	.LC1
	.size	bta_ag_start_servers, .-bta_ag_start_servers
	.comm	bta_ag_uuid,4,4
	.comm	bta_ag_sec_id,4,4
	.comm	bta_ag_mgmt_cback_tbl,4,4
	.comm	bta_ag_cb,4,4
	.comm	bd_addr_any,4,4
	.comm	TRUE,4,4
	.comm	PORT_SUCCESS,4,4
	.comm	FALSE,4,4
	.comm	BT_PSM_RFCOMM,4,4
	.comm	BTM_SEC_PROTO_RFCOMM,4,4
	.comm	BTA_HSP_SERVICE_ID,4,4
	.comm	BTA_AG_NUM_IDX,4,4
	.comm	BTA_AG_MTU,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
