	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_l2cap_ctloutput    ## -- Begin function ng_btsocket_l2cap_ctloutput
	.p2align	4, 0x90
_ng_btsocket_l2cap_ctloutput:           ## @ng_btsocket_l2cap_ctloutput
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	callq	_so2l2cap_pcb
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_ng_btsocket_l2cap_node@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.3:
	movq	(%r12), %rax
	movq	_SOL_L2CAP@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_32
## %bb.4:
	leaq	24(%r15), %r14
	movq	%r14, %rdi
	callq	_mtx_lock
	movl	8(%r12), %eax
	cmpl	$134, %eax
	je	LBB0_14
## %bb.5:
	cmpl	$135, %eax
	jne	LBB0_29
## %bb.6:
	movl	12(%r12), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_28
## %bb.7:
	leaq	LJTI0_1(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_8:
	addq	$4, %r15
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_32
LBB0_14:
	movl	28(%r15), %eax
	movq	_NG_BTSOCKET_L2CAP_CLOSED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_15
## %bb.16:
	movl	$-129, %ecx
	addl	12(%r12), %ecx
	cmpl	$4, %ecx
	ja	LBB0_28
## %bb.17:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_20:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	movl	$4, %ecx
	callq	_sooptcopyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_31
## %bb.21:
	movl	-36(%rbp), %eax
	movl	%eax, 12(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_31
LBB0_15:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_28:
	movq	_ENOPROTOOPT@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_10:
	addq	$12, %r15
	jmp	LBB0_13
LBB0_9:
	addq	$8, %r15
	jmp	LBB0_13
LBB0_11:
	addq	$16, %r15
	jmp	LBB0_13
LBB0_12:
	addq	$20, %r15
LBB0_13:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$4, %edx
	callq	_sooptcopyout
	movl	%eax, %ebx
	jmp	LBB0_31
LBB0_18:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	movl	$4, %ecx
	callq	_sooptcopyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_31
## %bb.19:
	movl	-48(%rbp), %eax
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_31
LBB0_22:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	movl	$4, %ecx
	callq	_sooptcopyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_31
## %bb.23:
	movl	-44(%rbp), %eax
	movl	%eax, 16(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_31
LBB0_24:
	movq	_NG_BTSOCKET_L2CAP_OPEN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_29
## %bb.25:
	movq	_NG_BTSOCKET_L2CAP_W4_ENC_CHANGE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_29
## %bb.26:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	movl	$4, %ecx
	callq	_sooptcopyin
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_31
## %bb.27:
	xorl	%eax, %eax
	cmpl	$0, -40(%rbp)
	setne	%al
	movl	%eax, 20(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_31
LBB0_29:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %ebx
LBB0_31:
	movq	%r14, %rdi
	callq	_mtx_unlock
LBB0_32:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_20, LBB0_20-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
.set L0_0_set_28, LBB0_28-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
.set L0_0_set_24, LBB0_24-LJTI0_0
LJTI0_0:
	.long	L0_0_set_20
	.long	L0_0_set_18
	.long	L0_0_set_28
	.long	L0_0_set_22
	.long	L0_0_set_24
.set L0_1_set_8, LBB0_8-LJTI0_1
.set L0_1_set_10, LBB0_10-LJTI0_1
.set L0_1_set_13, LBB0_13-LJTI0_1
.set L0_1_set_9, LBB0_9-LJTI0_1
.set L0_1_set_11, LBB0_11-LJTI0_1
.set L0_1_set_12, LBB0_12-LJTI0_1
LJTI0_1:
	.long	L0_1_set_8
	.long	L0_1_set_10
	.long	L0_1_set_13
	.long	L0_1_set_9
	.long	L0_1_set_11
	.long	L0_1_set_12
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ng_btsocket_l2cap_node,8,3     ## @ng_btsocket_l2cap_node
	.comm	_SOL_L2CAP,8,3                  ## @SOL_L2CAP
	.comm	_ENOPROTOOPT,4,2                ## @ENOPROTOOPT
	.comm	_NG_BTSOCKET_L2CAP_CLOSED,4,2   ## @NG_BTSOCKET_L2CAP_CLOSED
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_NG_BTSOCKET_L2CAP_OPEN,4,2     ## @NG_BTSOCKET_L2CAP_OPEN
	.comm	_NG_BTSOCKET_L2CAP_W4_ENC_CHANGE,4,2 ## @NG_BTSOCKET_L2CAP_W4_ENC_CHANGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_l2cap_ctloutput    ; -- Begin function ng_btsocket_l2cap_ctloutput
	.p2align	2
_ng_btsocket_l2cap_ctloutput:           ; @ng_btsocket_l2cap_ctloutput
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	bl	_so2l2cap_pcb
	cbz	x0, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _ng_btsocket_l2cap_node@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ng_btsocket_l2cap_node@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.2:
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _SOL_L2CAP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SOL_L2CAP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.3:
	mov	x20, x0
	add	x19, x0, #24
	mov	x0, x19
	bl	_mtx_lock
	ldr	w8, [x21, #8]
	cmp	w8, #134
	b.eq	LBB0_10
; %bb.4:
	cmp	w8, #135
	b.ne	LBB0_29
; %bb.5:
	ldr	w8, [x21, #12]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_16
; %bb.6:
Lloh6:
	adrp	x9, lJTI0_1@PAGE
Lloh7:
	add	x9, x9, lJTI0_1@PAGEOFF
	adr	x10, LBB0_7
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_7:
	add	x1, x20, #4
	b	LBB0_22
LBB0_8:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
	b	LBB0_32
LBB0_9:
	mov	w21, #0
	b	LBB0_32
LBB0_10:
	ldr	w8, [x20, #28]
Lloh11:
	adrp	x9, _NG_BTSOCKET_L2CAP_CLOSED@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NG_BTSOCKET_L2CAP_CLOSED@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.11:
	ldr	w9, [x21, #12]
	sub	w9, w9, #129
	cmp	w9, #4
	b.hi	LBB0_16
; %bb.12:
Lloh14:
	adrp	x10, lJTI0_0@PAGE
Lloh15:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_13
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_13:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #16
	mov	w3, #4
	bl	_sooptcopyin
	mov	x21, x0
	cbnz	w0, LBB0_31
; %bb.14:
	ldr	w8, [sp, #12]
	str	w8, [x20, #12]
	b	LBB0_31
LBB0_15:
Lloh16:
	adrp	x8, _EACCES@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_30
LBB0_16:
Lloh18:
	adrp	x8, _ENOPROTOOPT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOPROTOOPT@GOTPAGEOFF]
	b	LBB0_30
LBB0_17:
	add	x1, x20, #12
	b	LBB0_22
LBB0_18:
	mov	x0, x21
	mov	x1, x20
	b	LBB0_23
LBB0_19:
	add	x1, x20, #8
	b	LBB0_22
LBB0_20:
	add	x1, x20, #16
	b	LBB0_22
LBB0_21:
	add	x1, x20, #20
LBB0_22:
	mov	x0, x21
LBB0_23:
	mov	w2, #4
	bl	_sooptcopyout
	mov	x21, x0
	b	LBB0_31
LBB0_24:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #16
	mov	w3, #4
	bl	_sooptcopyin
	mov	x21, x0
	cbnz	w0, LBB0_31
; %bb.25:
	ldr	w8, [sp]
	str	w8, [x20]
	b	LBB0_31
LBB0_26:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #16
	mov	w3, #4
	bl	_sooptcopyin
	mov	x21, x0
	cbnz	w0, LBB0_31
; %bb.27:
	ldr	w8, [sp, #4]
	str	w8, [x20, #16]
	b	LBB0_31
LBB0_28:
Lloh20:
	adrp	x9, _NG_BTSOCKET_L2CAP_OPEN@GOTPAGE
Lloh21:
	ldr	x9, [x9, _NG_BTSOCKET_L2CAP_OPEN@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
Lloh23:
	adrp	x10, _NG_BTSOCKET_L2CAP_W4_ENC_CHANGE@GOTPAGE
Lloh24:
	ldr	x10, [x10, _NG_BTSOCKET_L2CAP_W4_ENC_CHANGE@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.ne	LBB0_33
LBB0_29:
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_30:
	ldr	w21, [x8]
LBB0_31:
	mov	x0, x19
	bl	_mtx_unlock
LBB0_32:
	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
	add	sp, sp, #64
	ret
LBB0_33:
	mov	x1, sp
	mov	x0, x21
	mov	w2, #16
	mov	w3, #4
	bl	_sooptcopyin
	mov	x21, x0
	cbnz	w0, LBB0_31
; %bb.34:
	ldr	w8, [sp, #8]
	cmp	w8, #0
	cset	w8, ne
	str	w8, [x20, #20]
	b	LBB0_31
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_13-LBB0_13)>>2
	.byte	(LBB0_24-LBB0_13)>>2
	.byte	(LBB0_16-LBB0_13)>>2
	.byte	(LBB0_26-LBB0_13)>>2
	.byte	(LBB0_28-LBB0_13)>>2
lJTI0_1:
	.byte	(LBB0_7-LBB0_7)>>2
	.byte	(LBB0_17-LBB0_7)>>2
	.byte	(LBB0_18-LBB0_7)>>2
	.byte	(LBB0_19-LBB0_7)>>2
	.byte	(LBB0_20-LBB0_7)>>2
	.byte	(LBB0_21-LBB0_7)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ng_btsocket_l2cap_node,8,3     ; @ng_btsocket_l2cap_node
	.comm	_SOL_L2CAP,8,3                  ; @SOL_L2CAP
	.comm	_ENOPROTOOPT,4,2                ; @ENOPROTOOPT
	.comm	_NG_BTSOCKET_L2CAP_CLOSED,4,2   ; @NG_BTSOCKET_L2CAP_CLOSED
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_NG_BTSOCKET_L2CAP_OPEN,4,2     ; @NG_BTSOCKET_L2CAP_OPEN
	.comm	_NG_BTSOCKET_L2CAP_W4_ENC_CHANGE,4,2 ; @NG_BTSOCKET_L2CAP_W4_ENC_CHANGE
.subsections_via_symbols
