	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_l2cap_new_chan              ## -- Begin function ng_l2cap_new_chan
	.p2align	4, 0x90
_ng_l2cap_new_chan:                     ## @ng_l2cap_new_chan
	.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	%ecx, %r13d
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_M_NETGRAPH_L2CAP@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$80, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %rbx
	movq	_NG_L2CAP_L2CA_IDTYPE_ATT@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_4
## %bb.2:
	movq	_NG_L2CAP_ATT_CID@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movq	_NG_L2CAP_L2CA_IDTYPE_SMP@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jne	LBB0_6
## %bb.5:
	movq	_NG_L2CAP_SMP_CID@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	jmp	LBB0_7
LBB0_6:
	movq	(%r14), %rax
	movq	_NG_HCI_LINK_ACL@GOTPCREL(%rip), %rcx
	xorl	%esi, %esi
	cmpq	(%rcx), %rax
	setne	%sil
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ng_l2cap_get_cid
LBB0_7:
	movq	%rax, (%rbx)
	movl	%r13d, 16(%rbx)
	movq	_NG_L2CAP_NULL_CID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.9:
	movq	%rbx, %rdi
	movl	$80, %esi
	callq	_bzero
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_free
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	%r12d, 72(%rbx)
	movq	%r14, 64(%rbx)
	movq	_NG_L2CAP_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%rbx)
	movq	_NG_L2CAP_MTU_DEFAULT@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, 48(%rbx)
	xorl	%eax, %eax
	callq	_ng_l2cap_default_flow
	leaq	40(%rbx), %rsi
	movl	%eax, %edi
	movl	$4, %edx
	callq	_bcopy
	movq	(%r15), %rax
	movq	%rax, 32(%rbx)
	xorl	%eax, %eax
	callq	_ng_l2cap_default_flow
	movq	%rbx, %rsi
	addq	$28, %rsi
	movl	%eax, %edi
	movl	$4, %edx
	callq	_bcopy
	movq	_NG_L2CAP_FLUSH_TIMO_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_NG_L2CAP_LINK_TIMO_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_LIST_INSERT_HEAD
	movq	%r14, %rdi
	callq	_ng_l2cap_con_ref
LBB0_11:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_NETGRAPH_L2CAP,4,2           ## @M_NETGRAPH_L2CAP
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_NG_L2CAP_L2CA_IDTYPE_ATT,4,2   ## @NG_L2CAP_L2CA_IDTYPE_ATT
	.comm	_NG_L2CAP_ATT_CID,8,3           ## @NG_L2CAP_ATT_CID
	.comm	_NG_L2CAP_L2CA_IDTYPE_SMP,4,2   ## @NG_L2CAP_L2CA_IDTYPE_SMP
	.comm	_NG_L2CAP_SMP_CID,8,3           ## @NG_L2CAP_SMP_CID
	.comm	_NG_HCI_LINK_ACL,8,3            ## @NG_HCI_LINK_ACL
	.comm	_NG_L2CAP_NULL_CID,8,3          ## @NG_L2CAP_NULL_CID
	.comm	_NG_L2CAP_CLOSED,4,2            ## @NG_L2CAP_CLOSED
	.comm	_NG_L2CAP_MTU_DEFAULT,8,3       ## @NG_L2CAP_MTU_DEFAULT
	.comm	_NG_L2CAP_FLUSH_TIMO_DEFAULT,4,2 ## @NG_L2CAP_FLUSH_TIMO_DEFAULT
	.comm	_NG_L2CAP_LINK_TIMO_DEFAULT,4,2 ## @NG_L2CAP_LINK_TIMO_DEFAULT
	.comm	_next,4,2                       ## @next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_l2cap_new_chan              ; -- Begin function ng_l2cap_new_chan
	.p2align	2
_ng_l2cap_new_chan:                     ; @ng_l2cap_new_chan
	.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	x23, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x24, _M_NETGRAPH_L2CAP@GOTPAGE
Lloh1:
	ldr	x24, [x24, _M_NETGRAPH_L2CAP@GOTPAGEOFF]
Lloh2:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #80
	bl	_malloc
	mov	x19, x0
	cbz	x0, LBB0_10
; %bb.1:
Lloh8:
	adrp	x8, _NG_L2CAP_L2CA_IDTYPE_ATT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NG_L2CAP_L2CA_IDTYPE_ATT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _NG_L2CAP_ATT_CID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NG_L2CAP_ATT_CID@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _NG_L2CAP_L2CA_IDTYPE_SMP@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NG_L2CAP_L2CA_IDTYPE_SMP@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, w23
	b.ne	LBB0_6
; %bb.4:
Lloh16:
	adrp	x8, _NG_L2CAP_SMP_CID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NG_L2CAP_SMP_CID@GOTPAGEOFF]
LBB0_5:
	ldr	x0, [x8]
	str	x0, [x19, #8]
	b	LBB0_7
LBB0_6:
	ldr	x8, [x20]
Lloh18:
	adrp	x9, _NG_HCI_LINK_ACL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NG_HCI_LINK_ACL@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w1, ne
	mov	x0, x21
	bl	_ng_l2cap_get_cid
LBB0_7:
	str	x0, [x19]
	str	w23, [x19, #16]
Lloh21:
	adrp	x8, _NG_L2CAP_NULL_CID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _NG_L2CAP_NULL_CID@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	w1, #80
	bl	_bzero
	ldr	w1, [x24]
	mov	x0, x19
	bl	_free
	mov	x19, #0
	b	LBB0_10
LBB0_9:
	str	w22, [x19, #72]
	str	x20, [x19, #64]
Lloh24:
	adrp	x8, _NG_L2CAP_CLOSED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _NG_L2CAP_CLOSED@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x19, #56]
Lloh27:
	adrp	x22, _NG_L2CAP_MTU_DEFAULT@GOTPAGE
Lloh28:
	ldr	x22, [x22, _NG_L2CAP_MTU_DEFAULT@GOTPAGEOFF]
	ldr	x8, [x22]
	str	x8, [x19, #48]
	bl	_ng_l2cap_default_flow
	add	x1, x19, #40
	mov	w2, #4
	bl	_bcopy
	ldr	x8, [x22]
	str	x8, [x19, #32]
	bl	_ng_l2cap_default_flow
	add	x1, x19, #28
	mov	w2, #4
	bl	_bcopy
Lloh29:
	adrp	x8, _NG_L2CAP_FLUSH_TIMO_DEFAULT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NG_L2CAP_FLUSH_TIMO_DEFAULT@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _NG_L2CAP_LINK_TIMO_DEFAULT@GOTPAGE
Lloh33:
	ldr	x9, [x9, _NG_L2CAP_LINK_TIMO_DEFAULT@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #20]
Lloh35:
	adrp	x8, _next@GOTPAGE
Lloh36:
	ldr	x8, [x8, _next@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x19
	bl	_LIST_INSERT_HEAD
	mov	x0, x20
	bl	_ng_l2cap_con_ref
LBB0_10:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_M_NETGRAPH_L2CAP,4,2           ; @M_NETGRAPH_L2CAP
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_NG_L2CAP_L2CA_IDTYPE_ATT,4,2   ; @NG_L2CAP_L2CA_IDTYPE_ATT
	.comm	_NG_L2CAP_ATT_CID,8,3           ; @NG_L2CAP_ATT_CID
	.comm	_NG_L2CAP_L2CA_IDTYPE_SMP,4,2   ; @NG_L2CAP_L2CA_IDTYPE_SMP
	.comm	_NG_L2CAP_SMP_CID,8,3           ; @NG_L2CAP_SMP_CID
	.comm	_NG_HCI_LINK_ACL,8,3            ; @NG_HCI_LINK_ACL
	.comm	_NG_L2CAP_NULL_CID,8,3          ; @NG_L2CAP_NULL_CID
	.comm	_NG_L2CAP_CLOSED,4,2            ; @NG_L2CAP_CLOSED
	.comm	_NG_L2CAP_MTU_DEFAULT,8,3       ; @NG_L2CAP_MTU_DEFAULT
	.comm	_NG_L2CAP_FLUSH_TIMO_DEFAULT,4,2 ; @NG_L2CAP_FLUSH_TIMO_DEFAULT
	.comm	_NG_L2CAP_LINK_TIMO_DEFAULT,4,2 ; @NG_L2CAP_LINK_TIMO_DEFAULT
	.comm	_next,4,2                       ; @next
.subsections_via_symbols
