	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function l2cap_sock_listen
_l2cap_sock_listen:                     ## @l2cap_sock_listen
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	8(%rdi), %r15
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_BT_DBG
	movq	%r15, %rdi
	callq	_lock_sock
	movq	(%r15), %rax
	movq	_BT_BOUND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	_SOCK_SEQPACKET@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.4:
	movq	%r15, %rdi
	callq	_l2cap_pi
	movl	(%rax), %eax
	leal	-128(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_5
## %bb.10:
	movq	_enable_ertm@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_11
LBB0_6:
	movq	%r15, %rdi
	callq	_l2cap_pi
	xorl	%r12d, %r12d
	cmpq	$0, 16(%rax)
	jne	LBB0_14
## %bb.7:
	movq	%r15, %rdi
	callq	_bt_sk
	movq	%rax, %r13
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	negl	%r12d
	movq	_l2cap_sk_list@GOTPCREL(%rip), %rdi
	callq	_write_lock_bh
	movl	$4097, %ebx                     ## imm = 0x1001
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_cpu_to_le16
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	___l2cap_get_sock_by_addr
	testl	%eax, %eax
	je	LBB0_9
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	leal	2(%rbx), %eax
	cmpl	$4350, %ebx                     ## imm = 0x10FE
	movl	%eax, %ebx
	jb	LBB0_8
## %bb.13:
	movq	_l2cap_sk_list@GOTPCREL(%rip), %rdi
	callq	_write_unlock_bh
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jg	LBB0_15
	jmp	LBB0_14
LBB0_2:
	movq	_EBADFD@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_15:
	movq	%r15, %rdi
	callq	_release_sock
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	$130, %eax
	je	LBB0_6
LBB0_11:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_9:
	movl	%ebx, %edi
	callq	_cpu_to_le16
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_l2cap_pi
	movq	%r12, 16(%rax)
	movl	%ebx, %edi
	callq	_cpu_to_le16
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_l2cap_pi
	movq	%rbx, 8(%rax)
	movq	_l2cap_sk_list@GOTPCREL(%rip), %rdi
	callq	_write_unlock_bh
	xorl	%r12d, %r12d
LBB0_14:
	movl	%r14d, 8(%r15)
	movq	$0, 16(%r15)
	movq	_BT_LISTEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sk %p backlog %d"

	.comm	_BT_BOUND,8,3                   ## @BT_BOUND
	.comm	_SOCK_SEQPACKET,8,3             ## @SOCK_SEQPACKET
	.comm	_EBADFD,4,2                     ## @EBADFD
	.comm	_enable_ertm,4,2                ## @enable_ertm
	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_l2cap_sk_list,4,2              ## @l2cap_sk_list
	.comm	_BT_LISTEN,8,3                  ## @BT_LISTEN
	.no_dead_strip	_l2cap_sock_listen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function l2cap_sock_listen
_l2cap_sock_listen:                     ; @l2cap_sock_listen
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x20
	bl	_BT_DBG
	mov	x0, x19
	bl	_lock_sock
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _BT_BOUND@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BT_BOUND@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	ldr	x8, [x21]
Lloh5:
	adrp	x9, _SOCK_SEQPACKET@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SOCK_SEQPACKET@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.2:
	mov	x0, x19
	bl	_l2cap_pi
	ldr	w8, [x0]
	sub	w9, w8, #128
	cmp	w9, #2
	b.hs	LBB0_12
; %bb.3:
Lloh8:
	adrp	x8, _enable_ertm@GOTPAGE
Lloh9:
	ldr	x8, [x8, _enable_ertm@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cbz	w8, LBB0_13
LBB0_4:
	mov	x0, x19
	bl	_l2cap_pi
	ldr	x8, [x0, #16]
	cbnz	x8, LBB0_15
; %bb.5:
	mov	x0, x19
	bl	_bt_sk
	mov	x22, x0
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w24, [x8]
	neg	w21, w24
Lloh14:
	adrp	x0, _l2cap_sk_list@GOTPAGE
Lloh15:
	ldr	x0, [x0, _l2cap_sk_list@GOTPAGEOFF]
	bl	_write_lock_bh
	mov	w23, #4097
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_cpu_to_le16
	mov	x1, x22
	bl	___l2cap_get_sock_by_addr
	cbz	w0, LBB0_14
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	lsr	w8, w23, #1
	add	w23, w23, #2
	cmp	w8, #2175
	b.lo	LBB0_6
; %bb.8:
Lloh16:
	adrp	x0, _l2cap_sk_list@GOTPAGE
Lloh17:
	ldr	x0, [x0, _l2cap_sk_list@GOTPAGEOFF]
	bl	_write_unlock_bh
	cmp	w24, #0
	b.gt	LBB0_11
	b	LBB0_16
LBB0_9:
Lloh18:
	adrp	x8, _EBADFD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBADFD@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	mov	x0, x19
	bl	_release_sock
	mov	x0, x21
	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
LBB0_12:
	cmp	w8, #130
	b.eq	LBB0_4
LBB0_13:
Lloh20:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
	b	LBB0_10
LBB0_14:
	mov	x0, x23
	bl	_cpu_to_le16
	mov	x21, x0
	mov	x0, x19
	bl	_l2cap_pi
	str	x21, [x0, #16]
	mov	x0, x23
	bl	_cpu_to_le16
	mov	x21, x0
	mov	x0, x19
	bl	_l2cap_pi
	str	x21, [x0, #8]
Lloh22:
	adrp	x0, _l2cap_sk_list@GOTPAGE
Lloh23:
	ldr	x0, [x0, _l2cap_sk_list@GOTPAGEOFF]
	bl	_write_unlock_bh
LBB0_15:
	mov	w21, #0
LBB0_16:
	str	w20, [x19, #8]
	str	xzr, [x19, #16]
Lloh24:
	adrp	x8, _BT_LISTEN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BT_LISTEN@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	str	x8, [x19]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sk %p backlog %d"

	.comm	_BT_BOUND,8,3                   ; @BT_BOUND
	.comm	_SOCK_SEQPACKET,8,3             ; @SOCK_SEQPACKET
	.comm	_EBADFD,4,2                     ; @EBADFD
	.comm	_enable_ertm,4,2                ; @enable_ertm
	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_l2cap_sk_list,4,2              ; @l2cap_sk_list
	.comm	_BT_LISTEN,8,3                  ; @BT_LISTEN
	.no_dead_strip	_l2cap_sock_listen
.subsections_via_symbols
