	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_security_cfm
_l2cap_security_cfm:                    ## @l2cap_security_cfm
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_19
## %bb.1:
	movl	%esi, %r15d
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_BT_DBG
	movq	%r12, %rdi
	callq	_read_lock
	movq	8(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_18
## %bb.2:
	movq	_L2CAP_CONF_CONNECT_PEND@GOTPCREL(%rip), %r14
	movq	_BT_CONNECT@GOTPCREL(%rip), %r13
	jmp	LBB0_3
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_l2cap_sock_clear_timer
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$34, %rsi
	addl	%eax, %esi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_l2cap_sock_set_timer
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_bh_unlock_sock
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movq	24(%rax), %rbx
	testq	%rbx, %rbx
	je	LBB0_18
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_bh_lock_sock
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	(%r14), %ecx
	testl	%ecx, (%rax)
	jne	LBB0_17
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rbx), %rax
	testl	%r15d, %r15d
	je	LBB0_5
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%r13), %rax
	je	LBB0_9
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_BT_CONNECT2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_BT_DISCONN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$34, %rsi
	addl	%eax, %esi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_l2cap_sock_set_timer
	movq	_L2CAP_CR_SEC_BLOCK@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_BT_CONFIG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%r13), %rax
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	8(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -64(%rbp)
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	16(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	%r12, %rdi
	callq	_l2cap_get_ident
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	%r13d, 4(%rax)
	movq	_BT_CONNECT@GOTPCREL(%rip), %r13
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	4(%rax), %esi
	movq	_L2CAP_CONN_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$40, %ecx
	leaq	-88(%rbp), %r8
	callq	_l2cap_send_cmd
	jmp	LBB0_17
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_l2cap_check_encryption
	jmp	LBB0_17
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_BT_CONNECT2@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rcx, (%rbx)
	movq	_L2CAP_CR_SUCCESS@GOTPCREL(%rip), %rax
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax), %r13d
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	12(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -64(%rbp)
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	8(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -72(%rbp)
	movl	%r13d, %edi
	callq	_cpu_to_le16
	movq	%rax, -80(%rbp)
	movq	_L2CAP_CS_NO_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movq	%rax, -88(%rbp)
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	4(%rax), %esi
	movq	_L2CAP_CONN_RSP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$40, %ecx
	leaq	-88(%rbp), %r8
	callq	_l2cap_send_cmd
	movq	_BT_CONNECT@GOTPCREL(%rip), %r13
	jmp	LBB0_17
LBB0_18:
	movq	%r12, %rdi
	callq	_read_unlock
LBB0_19:
	xorl	%eax, %eax
	addq	$56, %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	"conn %p"

	.comm	_L2CAP_CONF_CONNECT_PEND,4,2    ## @L2CAP_CONF_CONNECT_PEND
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_BT_CONFIG,8,3                  ## @BT_CONFIG
	.comm	_BT_CONNECT,8,3                 ## @BT_CONNECT
	.comm	_L2CAP_CONN_REQ,4,2             ## @L2CAP_CONN_REQ
	.comm	_HZ,4,2                         ## @HZ
	.comm	_BT_CONNECT2,8,3                ## @BT_CONNECT2
	.comm	_L2CAP_CR_SUCCESS,4,2           ## @L2CAP_CR_SUCCESS
	.comm	_BT_DISCONN,8,3                 ## @BT_DISCONN
	.comm	_L2CAP_CR_SEC_BLOCK,4,2         ## @L2CAP_CR_SEC_BLOCK
	.comm	_L2CAP_CS_NO_INFO,4,2           ## @L2CAP_CS_NO_INFO
	.comm	_L2CAP_CONN_RSP,4,2             ## @L2CAP_CONN_RSP
	.no_dead_strip	_l2cap_security_cfm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_security_cfm
_l2cap_security_cfm:                    ; @l2cap_security_cfm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x20, [x0]
	cbz	x20, LBB0_19
; %bb.1:
	mov	x19, x2
	mov	x21, x1
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_BT_DBG
	mov	x0, x20
	bl	_read_lock
	ldr	x22, [x20, #8]
	cbz	x22, LBB0_18
; %bb.2:
Lloh2:
	adrp	x24, _L2CAP_CONF_CONNECT_PEND@GOTPAGE
Lloh3:
	ldr	x24, [x24, _L2CAP_CONF_CONNECT_PEND@GOTPAGEOFF]
Lloh4:
	adrp	x27, _BT_CONNECT@GOTPAGE
Lloh5:
	ldr	x27, [x27, _BT_CONNECT@GOTPAGEOFF]
Lloh6:
	adrp	x28, _BT_CONNECT2@GOTPAGE
Lloh7:
	ldr	x28, [x28, _BT_CONNECT2@GOTPAGEOFF]
Lloh8:
	adrp	x25, _HZ@GOTPAGE
Lloh9:
	ldr	x25, [x25, _HZ@GOTPAGEOFF]
	mov	w26, #26215
	movk	w26, #26214, lsl #16
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_l2cap_sock_clear_timer
	ldrsw	x8, [x25]
	mul	x8, x8, x26
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w1, w8, w9
	mov	x0, x22
	bl	_l2cap_sock_set_timer
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_bh_unlock_sock
	mov	x0, x22
	bl	_l2cap_pi
	ldr	x22, [x0, #24]
	cbz	x22, LBB0_18
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_bh_lock_sock
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w8, [x0]
	ldr	w9, [x24]
	tst	w9, w8
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22]
	cbz	w21, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x27]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x28]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh10:
	adrp	x8, _BT_DISCONN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BT_DISCONN@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	str	x8, [x22]
	ldrsw	x8, [x25]
	mul	x8, x8, x26
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w1, w8, w9
	mov	x0, x22
	bl	_l2cap_sock_set_timer
Lloh13:
	adrp	x8, _L2CAP_CR_SEC_BLOCK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _L2CAP_CR_SEC_BLOCK@GOTPAGEOFF]
	b	LBB0_16
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh15:
	adrp	x9, _BT_CONNECTED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BT_CONNECTED@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x9]
Lloh18:
	adrp	x9, _BT_CONFIG@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BT_CONFIG@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x10
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, x19
	bl	_l2cap_check_encryption
	b	LBB0_4
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x27]
	cmp	x8, x10
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w0, [x0, #8]
	bl	_cpu_to_le16
	str	x0, [sp, #32]
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w8, [x0, #16]
	str	w8, [sp, #40]
	mov	x0, x20
	bl	_l2cap_get_ident
	mov	x23, x0
	mov	x0, x22
	bl	_l2cap_pi
	str	w23, [x0, #4]
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w1, [x0, #4]
Lloh21:
	adrp	x8, _L2CAP_CONN_REQ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _L2CAP_CONN_REQ@GOTPAGEOFF]
	b	LBB0_17
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x10, [x28]
	cmp	x8, x10
	b.ne	LBB0_4
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
	str	x9, [x22]
Lloh23:
	adrp	x8, _L2CAP_CR_SUCCESS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _L2CAP_CR_SUCCESS@GOTPAGEOFF]
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w23, [x8]
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w0, [x0, #12]
	bl	_cpu_to_le16
	str	x0, [sp, #32]
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w0, [x0, #8]
	bl	_cpu_to_le16
	str	x0, [sp, #24]
	mov	x0, x23
	bl	_cpu_to_le16
	str	x0, [sp, #16]
Lloh25:
	adrp	x8, _L2CAP_CS_NO_INFO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _L2CAP_CS_NO_INFO@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	x0, [sp, #8]
	mov	x0, x22
	bl	_l2cap_pi
	ldr	w1, [x0, #4]
Lloh28:
	adrp	x8, _L2CAP_CONN_RSP@GOTPAGE
Lloh29:
	ldr	x8, [x8, _L2CAP_CONN_RSP@GOTPAGEOFF]
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w2, [x8]
	add	x4, sp, #8
	mov	x0, x20
	mov	w3, #40
	bl	_l2cap_send_cmd
	b	LBB0_4
LBB0_18:
	mov	x0, x20
	bl	_read_unlock
LBB0_19:
	mov	w0, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"conn %p"

	.comm	_L2CAP_CONF_CONNECT_PEND,4,2    ; @L2CAP_CONF_CONNECT_PEND
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_BT_CONFIG,8,3                  ; @BT_CONFIG
	.comm	_BT_CONNECT,8,3                 ; @BT_CONNECT
	.comm	_L2CAP_CONN_REQ,4,2             ; @L2CAP_CONN_REQ
	.comm	_HZ,4,2                         ; @HZ
	.comm	_BT_CONNECT2,8,3                ; @BT_CONNECT2
	.comm	_L2CAP_CR_SUCCESS,4,2           ; @L2CAP_CR_SUCCESS
	.comm	_BT_DISCONN,8,3                 ; @BT_DISCONN
	.comm	_L2CAP_CR_SEC_BLOCK,4,2         ; @L2CAP_CR_SEC_BLOCK
	.comm	_L2CAP_CS_NO_INFO,4,2           ; @L2CAP_CS_NO_INFO
	.comm	_L2CAP_CONN_RSP,4,2             ; @L2CAP_CONN_RSP
	.no_dead_strip	_l2cap_security_cfm
.subsections_via_symbols
