	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ng_btsocket_rfcomm_session_create
_ng_btsocket_rfcomm_session_create:     ## @ng_btsocket_rfcomm_session_create
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %r13
	movq	%rdx, -128(%rbp)                ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_MA_OWNED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ng_btsocket_rfcomm_sessions_mtx@GOTPCREL(%rip), %rdi
	callq	_mtx_assert
	movq	_M_NETGRAPH_BTSOCKET_RFCOMM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movq	_M_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movl	$48, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, -120(%rbp)                ## 8-byte Spill
	movq	_RFCOMM_DEFAULT_MTU@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%r14)
	movq	$0, 24(%r14)
	movq	_NG_BTSOCKET_RFCOMM_SESSION_CLOSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	leaq	44(%r14), %rdi
	movq	_ifqmaxlen@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_NG_BT_MBUFQ_INIT
	movq	_MTX_DEF@GOTPCREL(%rip), %rax
	movq	_MTX_DUPOK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_mtx_init
	movq	%r14, %rdi
	addq	$40, %rdi
	callq	_LIST_INIT
	movq	%rbx, %r12
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_SOCKBUF_LOCK
	movq	_SO_RCV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ng_btsocket_rfcomm_upcall@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_soupcall_set
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%r12, %rbx
	callq	_SOCKBUF_UNLOCK
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_SOCKBUF_LOCK
	movq	_SO_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_soupcall_set
	movq	%r12, %rdi
	callq	_SOCKBUF_UNLOCK
	movq	_SS_NBIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	movq	%rbx, 8(%r14)
	movq	%r14, %rdi
	callq	_mtx_lock
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	movq	%rcx, %rax
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	orq	%r13, %rax
	jne	LBB0_3
LBB0_12:
	movq	_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ng_btsocket_rfcomm_sessions@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_LIST_INSERT_HEAD
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movq	%r14, (%rax)
	movq	%r14, %rdi
	callq	_mtx_unlock
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_14
LBB0_3:
	movq	32(%r14), %rax
	addq	$6, %rax
	movq	%rax, -136(%rbp)
	movq	_SOPT_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -144(%rbp)
	movq	_SOL_L2CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -148(%rbp)
	movq	_SO_L2CAP_IMTU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -152(%rbp)
	leaq	-136(%rbp), %rax
	movq	%rax, -160(%rbp)
	movl	$8, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	8(%r14), %rdi
	leaq	-176(%rbp), %rsi
	movq	%rcx, %r15
	callq	_sosetopt
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.4:
	movl	$48, -104(%rbp)
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_6
## %bb.5:
	movq	%r15, %rcx
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_6:
	movq	_NG_L2CAP_PSM_RFCOMM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htole16
	movq	%r15, %rcx
LBB0_7:
	movq	%rax, -72(%rbp)
	movl	(%rcx), %eax
	movl	%eax, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	_BDADDR_BREDR@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, -96(%rbp)
	movq	8(%r14), %rdi
	leaq	-104(%rbp), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_sobind
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.8:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	je	LBB0_9
## %bb.10:
	movq	_NG_BTSOCKET_RFCOMM_SESSION_INITIATOR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%r14)
	movq	_NG_BTSOCKET_RFCOMM_SESSION_CONNECTING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movl	$48, -104(%rbp)
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)
	movq	_NG_L2CAP_PSM_RFCOMM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htole16
	movq	%rax, -72(%rbp)
	movl	(%r13), %eax
	movl	%eax, -80(%rbp)
	movq	$0, -88(%rbp)
	movq	(%r15), %rax
	movq	%rax, -96(%rbp)
	movq	8(%r14), %rdi
	leaq	-104(%rbp), %rsi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_soconnect
	jmp	LBB0_11
LBB0_9:
	movq	$0, 24(%r14)
	movq	_NG_BTSOCKET_RFCOMM_SESSION_LISTENING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	8(%r14), %rdi
	movl	$10, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_solisten
LBB0_11:
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_12
LBB0_13:
	movq	%r14, %rdi
	callq	_mtx_unlock
	movq	%rbx, %r15
	movq	-112(%rbp), %rbx                ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_SOCKBUF_LOCK
	movq	8(%r14), %rdi
	movq	_SO_RCV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_soupcall_clear
	movq	%rbx, %rdi
	callq	_SOCKBUF_UNLOCK
	movq	%r12, %rdi
	callq	_SOCKBUF_LOCK
	movq	8(%r14), %rdi
	movq	_SO_SND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_soupcall_clear
	movq	%r12, %rdi
	callq	_SOCKBUF_UNLOCK
	movq	_SS_NBIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r15)
	movq	%r14, %rdi
	callq	_mtx_destroy
	movq	%r14, %rdi
	movl	$48, %esi
	callq	_bzero
	movq	_M_NETGRAPH_BTSOCKET_RFCOMM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_free
	movl	%r13d, %eax
LBB0_14:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ng_btsocket_rfcomm_sessions_mtx,4,2 ## @ng_btsocket_rfcomm_sessions_mtx
	.comm	_MA_OWNED,4,2                   ## @MA_OWNED
	.comm	_M_NETGRAPH_BTSOCKET_RFCOMM,4,2 ## @M_NETGRAPH_BTSOCKET_RFCOMM
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_M_ZERO,4,2                     ## @M_ZERO
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RFCOMM_DEFAULT_MTU,8,3         ## @RFCOMM_DEFAULT_MTU
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_CLOSED,4,2 ## @NG_BTSOCKET_RFCOMM_SESSION_CLOSED
	.comm	_ifqmaxlen,4,2                  ## @ifqmaxlen
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"btsocks_rfcomm_session_mtx"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
	.comm	_MTX_DUPOK,4,2                  ## @MTX_DUPOK
	.comm	_SO_RCV,4,2                     ## @SO_RCV
	.comm	_ng_btsocket_rfcomm_upcall,4,2  ## @ng_btsocket_rfcomm_upcall
	.comm	_SO_SND,4,2                     ## @SO_SND
	.comm	_SS_NBIO,4,2                    ## @SS_NBIO
	.comm	_SOPT_SET,4,2                   ## @SOPT_SET
	.comm	_SOL_L2CAP,4,2                  ## @SOL_L2CAP
	.comm	_SO_L2CAP_IMTU,4,2              ## @SO_L2CAP_IMTU
	.comm	_AF_BLUETOOTH,8,3               ## @AF_BLUETOOTH
	.comm	_NG_L2CAP_PSM_RFCOMM,4,2        ## @NG_L2CAP_PSM_RFCOMM
	.comm	_BDADDR_BREDR,8,3               ## @BDADDR_BREDR
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_LISTENING,4,2 ## @NG_BTSOCKET_RFCOMM_SESSION_LISTENING
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_INITIATOR,8,3 ## @NG_BTSOCKET_RFCOMM_SESSION_INITIATOR
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_CONNECTING,4,2 ## @NG_BTSOCKET_RFCOMM_SESSION_CONNECTING
	.comm	_ng_btsocket_rfcomm_sessions,4,2 ## @ng_btsocket_rfcomm_sessions
	.comm	_next,4,2                       ## @next
	.no_dead_strip	_ng_btsocket_rfcomm_session_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ng_btsocket_rfcomm_session_create
_ng_btsocket_rfcomm_session_create:     ; @ng_btsocket_rfcomm_session_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #192
	.cfi_def_cfa_offset 192
	stp	x28, x27, [sp, #96]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #112]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #128]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #144]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #160]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #176]            ; 16-byte Folded Spill
	add	x29, sp, #176
	.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
	mov	x22, x4
	mov	x23, x3
	mov	x26, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _MA_OWNED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MA_OWNED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _ng_btsocket_rfcomm_sessions_mtx@GOTPAGE
Lloh4:
	ldr	x0, [x0, _ng_btsocket_rfcomm_sessions_mtx@GOTPAGEOFF]
	bl	_mtx_assert
Lloh5:
	adrp	x9, _M_NETGRAPH_BTSOCKET_RFCOMM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _M_NETGRAPH_BTSOCKET_RFCOMM@GOTPAGEOFF]
Lloh7:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x9]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _M_ZERO@GOTPAGE
Lloh12:
	ldr	x9, [x9, _M_ZERO@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w0, #48
	bl	_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh14:
	adrp	x8, _RFCOMM_DEFAULT_MTU@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RFCOMM_DEFAULT_MTU@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	stp	xzr, x8, [x0, #24]
Lloh17:
	adrp	x8, _NG_BTSOCKET_RFCOMM_SESSION_CLOSED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NG_BTSOCKET_RFCOMM_SESSION_CLOSED@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	add	x0, x0, #44
Lloh20:
	adrp	x8, _ifqmaxlen@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ifqmaxlen@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	bl	_NG_BT_MBUFQ_INIT
Lloh23:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _MTX_DUPOK@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MTX_DUPOK@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, #0
	bl	_mtx_init
	add	x0, x19, #40
	bl	_LIST_INIT
	add	x24, x20, #8
	mov	x0, x24
	bl	_SOCKBUF_LOCK
Lloh31:
	adrp	x8, _SO_RCV@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SO_RCV@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x27, _ng_btsocket_rfcomm_upcall@GOTPAGE
Lloh35:
	ldr	x27, [x27, _ng_btsocket_rfcomm_upcall@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	x0, x20
	mov	x3, #0
	bl	_soupcall_set
	mov	x0, x24
	bl	_SOCKBUF_UNLOCK
	add	x25, x20, #4
	mov	x0, x25
	bl	_SOCKBUF_LOCK
Lloh36:
	adrp	x8, _SO_SND@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SO_SND@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	ldr	w2, [x27]
	mov	x0, x20
	mov	x3, #0
	bl	_soupcall_set
	mov	x0, x25
	bl	_SOCKBUF_UNLOCK
Lloh39:
	adrp	x28, _SS_NBIO@GOTPAGE
Lloh40:
	ldr	x28, [x28, _SS_NBIO@GOTPAGEOFF]
	ldr	w8, [x28]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	str	x20, [x19, #8]
	mov	x0, x19
	bl	_mtx_lock
	orr	x8, x26, x23
	cbnz	x8, LBB0_4
LBB0_2:
Lloh41:
	adrp	x8, _next@GOTPAGE
Lloh42:
	ldr	x8, [x8, _next@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x8]
Lloh44:
	adrp	x0, _ng_btsocket_rfcomm_sessions@GOTPAGE
Lloh45:
	ldr	x0, [x0, _ng_btsocket_rfcomm_sessions@GOTPAGEOFF]
	mov	x1, x19
	bl	_LIST_INSERT_HEAD
	str	x19, [x21]
	mov	x0, x19
	bl	_mtx_unlock
	mov	w27, #0
	b	LBB0_14
LBB0_3:
Lloh46:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh48:
	ldr	w27, [x8]
	b	LBB0_14
LBB0_4:
	ldr	x8, [x19, #32]
	add	x8, x8, #6
	str	x8, [sp]
Lloh49:
	adrp	x8, _SOPT_SET@GOTPAGE
Lloh50:
	ldr	x8, [x8, _SOPT_SET@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	str	w8, [sp, #40]
Lloh52:
	adrp	x8, _SOL_L2CAP@GOTPAGE
Lloh53:
	ldr	x8, [x8, _SOL_L2CAP@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
Lloh55:
	adrp	x9, _SO_L2CAP_IMTU@GOTPAGE
Lloh56:
	ldr	x9, [x9, _SO_L2CAP_IMTU@GOTPAGEOFF]
Lloh57:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #32]
	mov	w8, #8
	str	w8, [sp, #8]
	mov	x8, sp
	stp	xzr, x8, [sp, #16]
	ldr	x0, [x19, #8]
	add	x1, sp, #8
	bl	_sosetopt
	mov	x27, x0
	cbnz	w0, LBB0_13
; %bb.5:
	mov	w8, #48
	str	w8, [sp, #48]
Lloh58:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh59:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh60:
	ldr	x8, [x8]
	str	x8, [sp, #88]
	cbz	x23, LBB0_7
; %bb.6:
	mov	x0, #0
	b	LBB0_8
LBB0_7:
Lloh61:
	adrp	x8, _NG_L2CAP_PSM_RFCOMM@GOTPAGE
Lloh62:
	ldr	x8, [x8, _NG_L2CAP_PSM_RFCOMM@GOTPAGEOFF]
Lloh63:
	ldr	w0, [x8]
	bl	_htole16
LBB0_8:
	str	x0, [sp, #80]
	ldr	w8, [x26]
	str	w8, [sp, #72]
Lloh64:
	adrp	x26, _BDADDR_BREDR@GOTPAGE
Lloh65:
	ldr	x26, [x26, _BDADDR_BREDR@GOTPAGEOFF]
	ldr	x8, [x26]
	stp	x8, xzr, [sp, #56]
	ldr	x0, [x19, #8]
	add	x1, sp, #48
	mov	x2, x22
	bl	_sobind
	mov	x27, x0
	cbnz	w0, LBB0_13
; %bb.9:
	cbz	x23, LBB0_11
; %bb.10:
Lloh66:
	adrp	x8, _NG_BTSOCKET_RFCOMM_SESSION_INITIATOR@GOTPAGE
Lloh67:
	ldr	x8, [x8, _NG_BTSOCKET_RFCOMM_SESSION_INITIATOR@GOTPAGEOFF]
Lloh68:
	ldr	x8, [x8]
	str	x8, [x19, #24]
Lloh69:
	adrp	x8, _NG_BTSOCKET_RFCOMM_SESSION_CONNECTING@GOTPAGE
Lloh70:
	ldr	x8, [x8, _NG_BTSOCKET_RFCOMM_SESSION_CONNECTING@GOTPAGEOFF]
Lloh71:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	mov	w8, #48
	str	w8, [sp, #48]
Lloh72:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh73:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh74:
	ldr	x8, [x8]
	str	x8, [sp, #88]
Lloh75:
	adrp	x8, _NG_L2CAP_PSM_RFCOMM@GOTPAGE
Lloh76:
	ldr	x8, [x8, _NG_L2CAP_PSM_RFCOMM@GOTPAGEOFF]
Lloh77:
	ldr	w0, [x8]
	bl	_htole16
	str	x0, [sp, #80]
	ldr	w8, [x23]
	str	w8, [sp, #72]
	ldr	x8, [x26]
	stp	x8, xzr, [sp, #56]
	ldr	x0, [x19, #8]
	add	x1, sp, #48
	mov	x2, x22
	bl	_soconnect
	b	LBB0_12
LBB0_11:
	str	xzr, [x19, #24]
Lloh78:
	adrp	x8, _NG_BTSOCKET_RFCOMM_SESSION_LISTENING@GOTPAGE
Lloh79:
	ldr	x8, [x8, _NG_BTSOCKET_RFCOMM_SESSION_LISTENING@GOTPAGEOFF]
Lloh80:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	ldr	x0, [x19, #8]
	mov	w1, #10
	mov	x2, x22
	bl	_solisten
LBB0_12:
	mov	x27, x0
	cbz	w0, LBB0_2
LBB0_13:
	mov	x0, x19
	bl	_mtx_unlock
	mov	x0, x24
	bl	_SOCKBUF_LOCK
	ldr	x0, [x19, #8]
Lloh81:
	adrp	x8, _SO_RCV@GOTPAGE
Lloh82:
	ldr	x8, [x8, _SO_RCV@GOTPAGEOFF]
Lloh83:
	ldr	w1, [x8]
	bl	_soupcall_clear
	mov	x0, x24
	bl	_SOCKBUF_UNLOCK
	mov	x0, x25
	bl	_SOCKBUF_LOCK
	ldr	x0, [x19, #8]
Lloh84:
	adrp	x8, _SO_SND@GOTPAGE
Lloh85:
	ldr	x8, [x8, _SO_SND@GOTPAGEOFF]
Lloh86:
	ldr	w1, [x8]
	bl	_soupcall_clear
	mov	x0, x25
	bl	_SOCKBUF_UNLOCK
	ldr	w8, [x28]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
	mov	x0, x19
	bl	_mtx_destroy
	mov	x0, x19
	mov	w1, #48
	bl	_bzero
Lloh87:
	adrp	x8, _M_NETGRAPH_BTSOCKET_RFCOMM@GOTPAGE
Lloh88:
	ldr	x8, [x8, _M_NETGRAPH_BTSOCKET_RFCOMM@GOTPAGEOFF]
Lloh89:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_free
LBB0_14:
	mov	x0, x27
	ldp	x29, x30, [sp, #176]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #160]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #144]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #128]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #112]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #192
	ret
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGot	Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpLdrGotLdr	Lloh87, Lloh88, Lloh89
	.loh AdrpLdrGotLdr	Lloh84, Lloh85, Lloh86
	.loh AdrpLdrGotLdr	Lloh81, Lloh82, Lloh83
	.cfi_endproc
                                        ; -- End function
	.comm	_ng_btsocket_rfcomm_sessions_mtx,4,2 ; @ng_btsocket_rfcomm_sessions_mtx
	.comm	_MA_OWNED,4,2                   ; @MA_OWNED
	.comm	_M_NETGRAPH_BTSOCKET_RFCOMM,4,2 ; @M_NETGRAPH_BTSOCKET_RFCOMM
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_M_ZERO,4,2                     ; @M_ZERO
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RFCOMM_DEFAULT_MTU,8,3         ; @RFCOMM_DEFAULT_MTU
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_CLOSED,4,2 ; @NG_BTSOCKET_RFCOMM_SESSION_CLOSED
	.comm	_ifqmaxlen,4,2                  ; @ifqmaxlen
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"btsocks_rfcomm_session_mtx"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
	.comm	_MTX_DUPOK,4,2                  ; @MTX_DUPOK
	.comm	_SO_RCV,4,2                     ; @SO_RCV
	.comm	_ng_btsocket_rfcomm_upcall,4,2  ; @ng_btsocket_rfcomm_upcall
	.comm	_SO_SND,4,2                     ; @SO_SND
	.comm	_SS_NBIO,4,2                    ; @SS_NBIO
	.comm	_SOPT_SET,4,2                   ; @SOPT_SET
	.comm	_SOL_L2CAP,4,2                  ; @SOL_L2CAP
	.comm	_SO_L2CAP_IMTU,4,2              ; @SO_L2CAP_IMTU
	.comm	_AF_BLUETOOTH,8,3               ; @AF_BLUETOOTH
	.comm	_NG_L2CAP_PSM_RFCOMM,4,2        ; @NG_L2CAP_PSM_RFCOMM
	.comm	_BDADDR_BREDR,8,3               ; @BDADDR_BREDR
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_LISTENING,4,2 ; @NG_BTSOCKET_RFCOMM_SESSION_LISTENING
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_INITIATOR,8,3 ; @NG_BTSOCKET_RFCOMM_SESSION_INITIATOR
	.comm	_NG_BTSOCKET_RFCOMM_SESSION_CONNECTING,4,2 ; @NG_BTSOCKET_RFCOMM_SESSION_CONNECTING
	.comm	_ng_btsocket_rfcomm_sessions,4,2 ; @ng_btsocket_rfcomm_sessions
	.comm	_next,4,2                       ; @next
	.no_dead_strip	_ng_btsocket_rfcomm_session_create
.subsections_via_symbols
