	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_do_connect
_l2cap_do_connect:                      ## @l2cap_do_connect
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_bt_sk
	movq	%rax, %r15
	addq	$4, %r15
	movq	%r14, %rdi
	callq	_bt_sk
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_batostr
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_batostr
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_l2cap_pi
	movq	(%rax), %rcx
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	callq	_BT_DBG
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_hci_get_route
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_hci_dev_lock_bh
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	(%r14), %rbx
	movq	_SOCK_RAW@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r14, %rdi
	callq	_l2cap_pi
	cmpq	%r13, %rbx
	jne	LBB0_7
## %bb.3:
	movl	8(%rax), %eax
	cmpl	$128, %eax
	je	LBB0_6
## %bb.4:
	cmpl	$129, %eax
	jne	LBB0_17
## %bb.5:
	movq	_HCI_AT_DEDICATED_BONDING_MITM@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_1:
	movq	_EHOSTUNREACH@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_28
LBB0_7:
	movq	(%rax), %r13
	movl	$1, %edi
	callq	_cpu_to_le16
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_l2cap_pi
	movl	8(%rax), %eax
	cmpq	%rbx, %r13
	jne	LBB0_13
## %bb.8:
	cmpl	$129, %eax
	jne	LBB0_9
## %bb.10:
	movq	_HCI_AT_NO_BONDING_MITM@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	cmpl	$128, %eax
	je	LBB0_16
## %bb.14:
	cmpl	$129, %eax
	jne	LBB0_17
## %bb.15:
	movq	_HCI_AT_GENERAL_BONDING_MITM@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_17:
	movq	_HCI_AT_NO_BONDING@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_6:
	movq	_HCI_AT_DEDICATED_BONDING@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_9:
	movq	_HCI_AT_NO_BONDING@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %r13d
	movq	%r14, %rdi
	callq	_l2cap_pi
	movl	8(%rax), %eax
	movq	_BT_SECURITY_LOW@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_19
## %bb.12:
	movq	_BT_SECURITY_SDP@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_l2cap_pi
	movl	%ebx, 8(%rax)
	jmp	LBB0_19
LBB0_16:
	movq	_HCI_AT_GENERAL_BONDING@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %r13d
LBB0_19:
	movq	_ACL_LINK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r14, %rdi
	callq	_l2cap_pi
	movl	8(%rax), %ecx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%r13d, %r8d
	callq	_hci_connect
	testq	%rax, %rax
	je	LBB0_27
## %bb.20:
	movq	%rax, %r13
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_l2cap_conn_add
	testq	%rax, %rax
	je	LBB0_21
## %bb.22:
	movq	%rax, %rbx
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_bacpy
	movq	%rbx, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_l2cap_chan_add
	movq	_BT_CONNECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	movl	16(%r14), %esi
	movq	%r14, %rdi
	callq	_l2cap_sock_set_timer
	movq	(%r13), %rax
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_26
## %bb.23:
	movq	(%r14), %rax
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.25:
	movq	%r14, %rdi
	callq	_l2cap_do_start
	jmp	LBB0_26
LBB0_21:
	movq	%r13, %rdi
	callq	_hci_conn_put
	jmp	LBB0_27
LBB0_24:
	movq	%r14, %rdi
	callq	_l2cap_sock_clear_timer
	movq	(%rbx), %rax
	movq	%rax, 8(%r14)
LBB0_26:
	xorl	%r12d, %r12d
LBB0_27:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_hci_dev_unlock_bh
	movq	%rbx, %rdi
	callq	_hci_dev_put
LBB0_28:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s -> %s psm 0x%2.2x"

	.comm	_EHOSTUNREACH,4,2               ## @EHOSTUNREACH
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_SOCK_RAW,8,3                   ## @SOCK_RAW
	.comm	_HCI_AT_DEDICATED_BONDING_MITM,4,2 ## @HCI_AT_DEDICATED_BONDING_MITM
	.comm	_HCI_AT_DEDICATED_BONDING,4,2   ## @HCI_AT_DEDICATED_BONDING
	.comm	_HCI_AT_NO_BONDING,4,2          ## @HCI_AT_NO_BONDING
	.comm	_HCI_AT_NO_BONDING_MITM,4,2     ## @HCI_AT_NO_BONDING_MITM
	.comm	_BT_SECURITY_LOW,4,2            ## @BT_SECURITY_LOW
	.comm	_BT_SECURITY_SDP,4,2            ## @BT_SECURITY_SDP
	.comm	_HCI_AT_GENERAL_BONDING_MITM,4,2 ## @HCI_AT_GENERAL_BONDING_MITM
	.comm	_HCI_AT_GENERAL_BONDING,4,2     ## @HCI_AT_GENERAL_BONDING
	.comm	_ACL_LINK,4,2                   ## @ACL_LINK
	.comm	_BT_CONNECT,8,3                 ## @BT_CONNECT
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_SOCK_SEQPACKET,8,3             ## @SOCK_SEQPACKET
	.no_dead_strip	_l2cap_do_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_do_connect
_l2cap_do_connect:                      ; @l2cap_do_connect
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [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 w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_bt_sk
	add	x21, x0, #4
	mov	x0, x19
	bl	_bt_sk
	mov	x23, x0
	mov	x0, x21
	bl	_batostr
	mov	x20, x0
	mov	x0, x23
	bl	_batostr
	mov	x22, x0
	mov	x0, x19
	bl	_l2cap_pi
	ldr	x3, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	bl	_BT_DBG
	mov	x0, x23
	mov	x1, x21
	bl	_hci_get_route
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	_hci_dev_lock_bh
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x24, [x19]
Lloh5:
	adrp	x8, _SOCK_RAW@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SOCK_RAW@GOTPAGEOFF]
Lloh7:
	ldr	x25, [x8]
	mov	x0, x19
	bl	_l2cap_pi
	cmp	x24, x25
	b.ne	LBB0_6
; %bb.2:
	ldr	w8, [x0, #8]
	cmp	w8, #128
	b.eq	LBB0_13
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_12
; %bb.4:
Lloh8:
	adrp	x8, _HCI_AT_DEDICATED_BONDING_MITM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HCI_AT_DEDICATED_BONDING_MITM@GOTPAGEOFF]
	b	LBB0_15
LBB0_5:
Lloh10:
	adrp	x8, _EHOSTUNREACH@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EHOSTUNREACH@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_25
LBB0_6:
	ldr	x25, [x0]
	mov	w0, #1
	bl	_cpu_to_le16
	mov	x24, x0
	mov	x0, x19
	bl	_l2cap_pi
	ldr	w8, [x0, #8]
	cmp	x25, x24
	b.ne	LBB0_9
; %bb.7:
Lloh13:
	adrp	x9, _HCI_AT_NO_BONDING_MITM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _HCI_AT_NO_BONDING_MITM@GOTPAGEOFF]
Lloh15:
	adrp	x10, _HCI_AT_NO_BONDING@GOTPAGE
Lloh16:
	ldr	x10, [x10, _HCI_AT_NO_BONDING@GOTPAGEOFF]
	cmp	w8, #129
	csel	x8, x9, x10, eq
	ldr	w24, [x8]
	mov	x0, x19
	bl	_l2cap_pi
	ldr	w8, [x0, #8]
Lloh17:
	adrp	x9, _BT_SECURITY_LOW@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BT_SECURITY_LOW@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_16
; %bb.8:
Lloh20:
	adrp	x8, _BT_SECURITY_SDP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BT_SECURITY_SDP@GOTPAGEOFF]
Lloh22:
	ldr	w25, [x8]
	mov	x0, x19
	bl	_l2cap_pi
	str	w25, [x0, #8]
	b	LBB0_16
LBB0_9:
	cmp	w8, #128
	b.eq	LBB0_14
; %bb.10:
	cmp	w8, #129
	b.ne	LBB0_12
; %bb.11:
Lloh23:
	adrp	x8, _HCI_AT_GENERAL_BONDING_MITM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HCI_AT_GENERAL_BONDING_MITM@GOTPAGEOFF]
	b	LBB0_15
LBB0_12:
Lloh25:
	adrp	x8, _HCI_AT_NO_BONDING@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HCI_AT_NO_BONDING@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:
Lloh27:
	adrp	x8, _HCI_AT_DEDICATED_BONDING@GOTPAGE
Lloh28:
	ldr	x8, [x8, _HCI_AT_DEDICATED_BONDING@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh29:
	adrp	x8, _HCI_AT_GENERAL_BONDING@GOTPAGE
Lloh30:
	ldr	x8, [x8, _HCI_AT_GENERAL_BONDING@GOTPAGEOFF]
LBB0_15:
	ldr	w24, [x8]
LBB0_16:
Lloh31:
	adrp	x8, _ACL_LINK@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ACL_LINK@GOTPAGEOFF]
Lloh33:
	ldr	w25, [x8]
	mov	x0, x19
	bl	_l2cap_pi
	ldr	w3, [x0, #8]
	mov	x0, x20
	mov	x1, x25
	mov	x2, x23
	mov	x4, x24
	bl	_hci_connect
	cbz	x0, LBB0_24
; %bb.17:
	mov	x23, x0
	mov	w1, #0
	bl	_l2cap_conn_add
	cbz	x0, LBB0_22
; %bb.18:
	mov	x24, x0
	ldr	w1, [x0]
	mov	x0, x21
	bl	_bacpy
	mov	x0, x24
	mov	x1, x19
	mov	x2, #0
	bl	_l2cap_chan_add
Lloh34:
	adrp	x8, _BT_CONNECT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _BT_CONNECT@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_l2cap_sock_set_timer
	ldr	x8, [x23]
Lloh37:
	adrp	x21, _BT_CONNECTED@GOTPAGE
Lloh38:
	ldr	x21, [x21, _BT_CONNECTED@GOTPAGEOFF]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.19:
	ldr	x8, [x19]
Lloh39:
	adrp	x9, _SOCK_SEQPACKET@GOTPAGE
Lloh40:
	ldr	x9, [x9, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.20:
	mov	x0, x19
	bl	_l2cap_do_start
LBB0_21:
	mov	w22, #0
	b	LBB0_24
LBB0_22:
	mov	x0, x23
	bl	_hci_conn_put
	b	LBB0_24
LBB0_23:
	mov	x0, x19
	bl	_l2cap_sock_clear_timer
	mov	w22, #0
	ldr	x8, [x21]
	str	x8, [x19, #8]
LBB0_24:
	mov	x0, x20
	bl	_hci_dev_unlock_bh
	mov	x0, x20
	bl	_hci_dev_put
LBB0_25:
	mov	x0, x22
	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	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s -> %s psm 0x%2.2x"

	.comm	_EHOSTUNREACH,4,2               ; @EHOSTUNREACH
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_SOCK_RAW,8,3                   ; @SOCK_RAW
	.comm	_HCI_AT_DEDICATED_BONDING_MITM,4,2 ; @HCI_AT_DEDICATED_BONDING_MITM
	.comm	_HCI_AT_DEDICATED_BONDING,4,2   ; @HCI_AT_DEDICATED_BONDING
	.comm	_HCI_AT_NO_BONDING,4,2          ; @HCI_AT_NO_BONDING
	.comm	_HCI_AT_NO_BONDING_MITM,4,2     ; @HCI_AT_NO_BONDING_MITM
	.comm	_BT_SECURITY_LOW,4,2            ; @BT_SECURITY_LOW
	.comm	_BT_SECURITY_SDP,4,2            ; @BT_SECURITY_SDP
	.comm	_HCI_AT_GENERAL_BONDING_MITM,4,2 ; @HCI_AT_GENERAL_BONDING_MITM
	.comm	_HCI_AT_GENERAL_BONDING,4,2     ; @HCI_AT_GENERAL_BONDING
	.comm	_ACL_LINK,4,2                   ; @ACL_LINK
	.comm	_BT_CONNECT,8,3                 ; @BT_CONNECT
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_SOCK_SEQPACKET,8,3             ; @SOCK_SEQPACKET
	.no_dead_strip	_l2cap_do_connect
.subsections_via_symbols
