	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_rfcomm_send        ## -- Begin function ng_btsocket_rfcomm_send
	.p2align	4, 0x90
_ng_btsocket_rfcomm_send:               ## @ng_btsocket_rfcomm_send
	.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
	movq	%r8, %r14
	movq	%rdx, %r12
	movl	%esi, %r13d
	callq	_so2rfcomm_pcb
	testq	%r14, %r14
	jne	LBB0_7
## %bb.1:
	testq	%r12, %r12
	je	LBB0_7
## %bb.2:
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rbx, %r15
	addq	$12, %r15
	movq	%r15, %rdi
	callq	_mtx_lock
	movq	(%rbx), %rax
	movq	_NG_BTSOCKET_RFCOMM_DLC_CONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.4:
	movq	16(%rbx), %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	callq	_sbappend
	movl	8(%rbx), %eax
	movq	_NG_BTSOCKET_RFCOMM_DLC_SENDING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%r13d, %r13d
	testl	%eax, %ecx
	jne	LBB0_6
## %bb.5:
	orl	%eax, %ecx
	movl	%ecx, 8(%rbx)
	xorl	%eax, %eax
	callq	_ng_btsocket_rfcomm_task_wakeup
	movl	%eax, %r13d
LBB0_6:
	movq	%r15, %rdi
	callq	_mtx_unlock
	xorl	%r12d, %r12d
	jmp	LBB0_10
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	callq	_mtx_unlock
	movq	_ENOTCONN@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %r13d
LBB0_10:
	movq	%r12, %rdi
	callq	_NG_FREE_M
	movq	%r14, %rdi
	callq	_NG_FREE_M
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NG_BTSOCKET_RFCOMM_DLC_CONNECTED,8,3 ## @NG_BTSOCKET_RFCOMM_DLC_CONNECTED
	.comm	_ENOTCONN,4,2                   ## @ENOTCONN
	.comm	_NG_BTSOCKET_RFCOMM_DLC_SENDING,4,2 ## @NG_BTSOCKET_RFCOMM_DLC_SENDING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ng_btsocket_rfcomm_send        ; -- Begin function ng_btsocket_rfcomm_send
	.p2align	2
_ng_btsocket_rfcomm_send:               ; @ng_btsocket_rfcomm_send
	.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	x19, x4
	mov	x20, x2
	mov	x23, x1
	bl	_so2rfcomm_pcb
	cbnz	x19, LBB0_6
; %bb.1:
	cbz	x20, LBB0_6
; %bb.2:
	mov	x22, x0
	cbz	x0, LBB0_6
; %bb.3:
	add	x21, x22, #12
	mov	x0, x21
	bl	_mtx_lock
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _NG_BTSOCKET_RFCOMM_DLC_CONNECTED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NG_BTSOCKET_RFCOMM_DLC_CONNECTED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	ldr	x0, [x22, #16]
	mov	x1, x20
	mov	x2, x23
	bl	_sbappend
	ldr	w8, [x22, #8]
Lloh3:
	adrp	x9, _NG_BTSOCKET_RFCOMM_DLC_SENDING@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NG_BTSOCKET_RFCOMM_DLC_SENDING@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
	mov	w22, #0
	b	LBB0_9
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_7:
	mov	x0, x21
	bl	_mtx_unlock
Lloh9:
	adrp	x8, _ENOTCONN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOTCONN@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	b	LBB0_10
LBB0_8:
	orr	w8, w9, w8
	str	w8, [x22, #8]
	bl	_ng_btsocket_rfcomm_task_wakeup
	mov	x22, x0
LBB0_9:
	mov	x0, x21
	bl	_mtx_unlock
	mov	x20, #0
LBB0_10:
	mov	x0, x20
	bl	_NG_FREE_M
	mov	x0, x19
	bl	_NG_FREE_M
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NG_BTSOCKET_RFCOMM_DLC_CONNECTED,8,3 ; @NG_BTSOCKET_RFCOMM_DLC_CONNECTED
	.comm	_ENOTCONN,4,2                   ; @ENOTCONN
	.comm	_NG_BTSOCKET_RFCOMM_DLC_SENDING,4,2 ; @NG_BTSOCKET_RFCOMM_DLC_SENDING
.subsections_via_symbols
