	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_l2cap_peeraddr     ## -- Begin function ng_btsocket_l2cap_peeraddr
	.p2align	4, 0x90
_ng_btsocket_l2cap_peeraddr:            ## @ng_btsocket_l2cap_peeraddr
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	callq	_so2l2cap_pcb
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_ng_btsocket_l2cap_node@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.3:
	movl	12(%rbx), %eax
	movl	%eax, -20(%rbp)
	movl	8(%rbx), %edi
	callq	_htole16
	movl	%eax, -24(%rbp)
	movl	$24, -40(%rbp)
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movl	(%rbx), %ecx
	cmpl	$128, %ecx
	je	LBB0_6
## %bb.4:
	xorl	%eax, %eax
	cmpl	$129, %ecx
	jne	LBB0_8
## %bb.5:
	movq	_NG_L2CAP_ATT_CID@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movq	_NG_L2CAP_SMP_CID@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
LBB0_8:
	movl	%eax, -32(%rbp)
	movl	4(%rbx), %eax
	movl	%eax, -36(%rbp)
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdi
	callq	_sodupsockaddr
	movq	%rax, %rcx
	movq	%rax, (%r14)
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
LBB0_11:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ng_btsocket_l2cap_node,8,3     ## @ng_btsocket_l2cap_node
	.comm	_AF_BLUETOOTH,4,2               ## @AF_BLUETOOTH
	.comm	_NG_L2CAP_ATT_CID,4,2           ## @NG_L2CAP_ATT_CID
	.comm	_NG_L2CAP_SMP_CID,4,2           ## @NG_L2CAP_SMP_CID
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_l2cap_peeraddr     ; -- Begin function ng_btsocket_l2cap_peeraddr
	.p2align	2
_ng_btsocket_l2cap_peeraddr:            ; @ng_btsocket_l2cap_peeraddr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x1
	bl	_so2l2cap_pcb
	cbz	x0, LBB0_5
; %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_5
; %bb.2:
	mov	x20, x0
	ldr	w8, [x0, #12]
	str	w8, [sp, #28]
	ldr	w0, [x0, #8]
	bl	_htole16
	str	w0, [sp, #24]
Lloh3:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
	mov	w9, #24
Lloh5:
	ldr	w8, [x8]
	str	w9, [sp, #8]
	str	w8, [sp, #20]
	ldr	w8, [x20]
	cmp	w8, #128
	b.eq	LBB0_6
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _NG_L2CAP_ATT_CID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NG_L2CAP_ATT_CID@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	b	LBB0_10
LBB0_6:
Lloh11:
	adrp	x8, _NG_L2CAP_SMP_CID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _NG_L2CAP_SMP_CID@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	b	LBB0_9
LBB0_8:
	mov	w8, #0
LBB0_9:
	str	w8, [sp, #16]
	ldr	w8, [x20, #4]
	str	w8, [sp, #12]
Lloh13:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_sodupsockaddr
	str	x0, [x19]
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w0, w8, wzr, eq
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ng_btsocket_l2cap_node,8,3     ; @ng_btsocket_l2cap_node
	.comm	_AF_BLUETOOTH,4,2               ; @AF_BLUETOOTH
	.comm	_NG_L2CAP_ATT_CID,4,2           ; @NG_L2CAP_ATT_CID
	.comm	_NG_L2CAP_SMP_CID,4,2           ; @NG_L2CAP_SMP_CID
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
