	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2ca_connect_req               ## -- Begin function l2ca_connect_req
	.p2align	4, 0x90
_l2ca_connect_req:                      ## @l2ca_connect_req
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.1:
	movq	%r8, %r14
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r13
	addq	$4, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_bd_addr_set
	movl	%r15d, 24(%r13)
	movq	%r14, 16(%r13)
	xorl	%eax, %eax
	callq	_l2cap_cid_alloc
	movl	%eax, 8(%r13)
	movq	_L2CAP_CFG_IR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 12(%r13)
	movq	%rbx, %rdi
	callq	_lp_is_connected
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	_PBUF_RAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_L2CAP_CONN_REQ_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PBUF_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_btpbuf_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %rbx
	movl	%r15d, %edi
	callq	_htole16
	movq	(%rbx), %rcx
	movl	%eax, (%rcx)
	movl	8(%r13), %edi
	callq	_htole16
	movq	(%rbx), %rcx
	movl	%eax, 4(%rcx)
	movq	_L2CAP_CONN_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_l2cap_signal
	movl	%eax, %ebx
	movq	_W4_L2CAP_CONNECT_RSP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r13)
	jmp	LBB0_6
LBB0_4:
	movq	_ERR_VAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_5:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_lp_connect_req
	movl	%eax, %ebx
LBB0_6:
	movq	_l2cap_active_pcbs@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	callq	_L2CAP_REG
	jmp	LBB0_9
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_ERROR
	movq	_ERR_MEM@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR_VAL,4,2                    ## @ERR_VAL
	.comm	_L2CAP_CFG_IR,4,2               ## @L2CAP_CFG_IR
	.comm	_PBUF_RAW,4,2                   ## @PBUF_RAW
	.comm	_L2CAP_CONN_REQ_SIZE,4,2        ## @L2CAP_CONN_REQ_SIZE
	.comm	_PBUF_RAM,4,2                   ## @PBUF_RAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"l2cap_connect_req: Could not allocate memory for pbuf\n"

	.comm	_ERR_MEM,4,2                    ## @ERR_MEM
	.comm	_L2CAP_CONN_REQ,4,2             ## @L2CAP_CONN_REQ
	.comm	_W4_L2CAP_CONNECT_RSP,4,2       ## @W4_L2CAP_CONNECT_RSP
	.comm	_l2cap_active_pcbs,4,2          ## @l2cap_active_pcbs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_l2ca_connect_req               ; -- Begin function l2ca_connect_req
	.p2align	2
_l2ca_connect_req:                      ; @l2ca_connect_req
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x1, LBB0_4
; %bb.1:
	mov	x24, x4
	mov	x22, x3
	mov	x21, x2
	mov	x23, x1
	mov	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_bd_addr_set
	str	w21, [x19, #24]
	str	x24, [x19, #16]
	bl	_l2cap_cid_alloc
Lloh0:
	adrp	x8, _L2CAP_CFG_IR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _L2CAP_CFG_IR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	stp	w0, w8, [x19, #8]
	mov	x0, x23
	bl	_lp_is_connected
	cbz	w0, LBB0_5
; %bb.2:
Lloh3:
	adrp	x8, _PBUF_RAW@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PBUF_RAW@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _L2CAP_CONN_REQ_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _L2CAP_CONN_REQ_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _PBUF_RAM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PBUF_RAM@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	bl	_btpbuf_alloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x22, x0
	mov	x0, x21
	bl	_htole16
	ldr	x8, [x22]
	str	w0, [x8]
	ldr	w0, [x19, #8]
	bl	_htole16
	ldr	x8, [x22]
	str	w0, [x8, #4]
Lloh12:
	adrp	x8, _L2CAP_CONN_REQ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _L2CAP_CONN_REQ@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	x3, x20
	mov	x4, x22
	bl	_l2cap_signal
	mov	x20, x0
Lloh15:
	adrp	x8, _W4_L2CAP_CONNECT_RSP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _W4_L2CAP_CONNECT_RSP@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_6
LBB0_4:
Lloh18:
	adrp	x8, _ERR_VAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ERR_VAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x0, x23
	mov	x1, x22
	bl	_lp_connect_req
	mov	x20, x0
LBB0_6:
Lloh20:
	adrp	x0, _l2cap_active_pcbs@GOTPAGE
Lloh21:
	ldr	x0, [x0, _l2cap_active_pcbs@GOTPAGEOFF]
	mov	x1, x19
	bl	_L2CAP_REG
	b	LBB0_9
LBB0_7:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERROR
Lloh24:
	adrp	x8, _ERR_MEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ERR_MEM@GOTPAGEOFF]
LBB0_8:
	ldr	w20, [x8]
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR_VAL,4,2                    ; @ERR_VAL
	.comm	_L2CAP_CFG_IR,4,2               ; @L2CAP_CFG_IR
	.comm	_PBUF_RAW,4,2                   ; @PBUF_RAW
	.comm	_L2CAP_CONN_REQ_SIZE,4,2        ; @L2CAP_CONN_REQ_SIZE
	.comm	_PBUF_RAM,4,2                   ; @PBUF_RAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"l2cap_connect_req: Could not allocate memory for pbuf\n"

	.comm	_ERR_MEM,4,2                    ; @ERR_MEM
	.comm	_L2CAP_CONN_REQ,4,2             ; @L2CAP_CONN_REQ
	.comm	_W4_L2CAP_CONNECT_RSP,4,2       ; @W4_L2CAP_CONNECT_RSP
	.comm	_l2cap_active_pcbs,4,2          ; @l2cap_active_pcbs
.subsections_via_symbols
