	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_connect_rsp
_l2cap_connect_rsp:                     ## @l2cap_connect_rsp
	.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
	subq	$536, %rsp                      ## imm = 0x218
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, -568(%rbp)                ## 8-byte Spill
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	12(%rdx), %edi
	callq	___le16_to_cpu
	movl	%eax, %ebx
	movl	8(%r14), %edi
	callq	___le16_to_cpu
	movl	%eax, %r12d
	movl	4(%r14), %edi
	callq	___le16_to_cpu
	movl	%eax, %r13d
	movl	(%r14), %edi
	movl	%r12d, %r14d
	callq	___le16_to_cpu
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	movl	%eax, %r8d
	callq	_BT_DBG
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_l2cap_get_chan_by_scid
	jmp	LBB0_3
LBB0_2:
	movq	-568(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_l2cap_get_chan_by_ident
LBB0_3:
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	cmpl	$129, %r13d
	je	LBB0_7
## %bb.5:
	cmpl	$128, %r13d
	jne	LBB0_8
## %bb.6:
	movq	_BT_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	%r12, %rdi
	callq	_l2cap_pi
	movl	$0, 12(%rax)
	movq	%r12, %rdi
	callq	_l2cap_pi
	movl	%r14d, (%rax)
	movq	_L2CAP_CONF_REQ_SENT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_l2cap_pi
	orl	%ebx, 4(%rax)
	movq	_L2CAP_CONF_CONNECT_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	movq	%r12, %rdi
	callq	_l2cap_pi
	andl	%ebx, 4(%rax)
	movq	%r15, %rdi
	callq	_l2cap_get_ident
	movq	%r15, %r13
	movl	%eax, %r14d
	movq	_L2CAP_CONF_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-560(%rbp), %r15
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_l2cap_build_conf_req
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	movq	%r15, %r8
	callq	_l2cap_send_cmd
	movq	%r12, %rdi
	callq	_l2cap_pi
	incl	8(%rax)
	jmp	LBB0_9
LBB0_7:
	movq	_L2CAP_CONF_CONNECT_PEND@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_l2cap_pi
	orl	%ebx, 4(%rax)
	jmp	LBB0_9
LBB0_8:
	movq	_ECONNREFUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_l2cap_chan_del
LBB0_9:
	movq	%r12, %rdi
	callq	_bh_unlock_sock
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	addq	$536, %rsp                      ## imm = 0x218
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dcid 0x%4.4x scid 0x%4.4x result 0x%2.2x status 0x%2.2x"

	.comm	_BT_CONFIG,4,2                  ## @BT_CONFIG
	.comm	_L2CAP_CONF_REQ_SENT,4,2        ## @L2CAP_CONF_REQ_SENT
	.comm	_L2CAP_CONF_CONNECT_PEND,4,2    ## @L2CAP_CONF_CONNECT_PEND
	.comm	_L2CAP_CONF_REQ,4,2             ## @L2CAP_CONF_REQ
	.comm	_ECONNREFUSED,4,2               ## @ECONNREFUSED
	.no_dead_strip	_l2cap_connect_rsp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_connect_rsp
_l2cap_connect_rsp:                     ; @l2cap_connect_rsp
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #528
	mov	x24, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	w0, [x2, #12]
	bl	___le16_to_cpu
	mov	x23, x0
	ldr	w0, [x24, #8]
	bl	___le16_to_cpu
	mov	x21, x0
	ldr	w0, [x24, #4]
	bl	___le16_to_cpu
	mov	x22, x0
	ldr	w0, [x24]
	bl	___le16_to_cpu
	mov	x4, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x23
	mov	x3, x22
	bl	_BT_DBG
	cbz	w23, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	bl	_l2cap_get_chan_by_scid
	mov	x20, x0
	cbnz	x0, LBB0_3
	b	LBB0_9
LBB0_2:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_l2cap_get_chan_by_ident
	mov	x20, x0
	cbz	x0, LBB0_9
LBB0_3:
	cmp	w22, #129
	b.eq	LBB0_6
; %bb.4:
	cmp	w22, #128
	b.ne	LBB0_7
; %bb.5:
Lloh5:
	adrp	x8, _BT_CONFIG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BT_CONFIG@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x20]
	mov	x0, x20
	bl	_l2cap_pi
	str	wzr, [x0, #12]
	mov	x0, x20
	bl	_l2cap_pi
	str	w21, [x0]
Lloh8:
	adrp	x8, _L2CAP_CONF_REQ_SENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _L2CAP_CONF_REQ_SENT@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_l2cap_pi
	ldr	w8, [x0, #4]
	orr	w8, w8, w21
	str	w8, [x0, #4]
Lloh11:
	adrp	x8, _L2CAP_CONF_CONNECT_PEND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _L2CAP_CONF_CONNECT_PEND@GOTPAGEOFF]
Lloh13:
	ldr	w21, [x8]
	mov	x0, x20
	bl	_l2cap_pi
	ldr	w8, [x0, #4]
	bic	w8, w8, w21
	str	w8, [x0, #4]
	mov	x0, x19
	bl	_l2cap_get_ident
	mov	x21, x0
Lloh14:
	adrp	x8, _L2CAP_CONF_REQ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _L2CAP_CONF_REQ@GOTPAGEOFF]
Lloh16:
	ldr	w22, [x8]
	add	x1, sp, #8
	mov	x0, x20
	bl	_l2cap_build_conf_req
	mov	x3, x0
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_l2cap_send_cmd
	mov	x0, x20
	bl	_l2cap_pi
	ldr	w8, [x0, #8]
	add	w8, w8, #1
	str	w8, [x0, #8]
	b	LBB0_8
LBB0_6:
Lloh17:
	adrp	x8, _L2CAP_CONF_CONNECT_PEND@GOTPAGE
Lloh18:
	ldr	x8, [x8, _L2CAP_CONF_CONNECT_PEND@GOTPAGEOFF]
Lloh19:
	ldr	w19, [x8]
	mov	x0, x20
	bl	_l2cap_pi
	ldr	w8, [x0, #4]
	orr	w8, w8, w19
	str	w8, [x0, #4]
	b	LBB0_8
LBB0_7:
Lloh20:
	adrp	x8, _ECONNREFUSED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ECONNREFUSED@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_l2cap_chan_del
LBB0_8:
	mov	x0, x20
	bl	_bh_unlock_sock
LBB0_9:
	ldur	x8, [x29, #-72]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #0
	add	sp, sp, #528
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dcid 0x%4.4x scid 0x%4.4x result 0x%2.2x status 0x%2.2x"

	.comm	_BT_CONFIG,4,2                  ; @BT_CONFIG
	.comm	_L2CAP_CONF_REQ_SENT,4,2        ; @L2CAP_CONF_REQ_SENT
	.comm	_L2CAP_CONF_CONNECT_PEND,4,2    ; @L2CAP_CONF_CONNECT_PEND
	.comm	_L2CAP_CONF_REQ,4,2             ; @L2CAP_CONF_REQ
	.comm	_ECONNREFUSED,4,2               ; @ECONNREFUSED
	.no_dead_strip	_l2cap_connect_rsp
.subsections_via_symbols
