	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rfcomm_add_listener
_rfcomm_add_listener:                   ## @rfcomm_add_listener
	.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	%rdi, %r14
	leaq	-24(%rbp), %rdi
	callq	_rfcomm_l2sock_create
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	leaq	-32(%rbp), %rdi
	movq	%r14, %rsi
	callq	_bacpy
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_RFCOMM_PSM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_cpu_to_le16
	movl	%eax, -40(%rbp)
	movq	$0, -48(%rbp)
	movq	-24(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movl	$24, %edx
	callq	_kernel_bind
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movq	-24(%rbp), %rax
	movq	(%rax), %rbx
	movq	%rbx, %rdi
	callq	_lock_sock
	movq	_l2cap_mtu@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_l2cap_pi
	movl	%r14d, (%rax)
	movq	%rbx, %rdi
	callq	_release_sock
	movq	-24(%rbp), %rdi
	movl	$10, %esi
	callq	_kernel_listen
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_BT_ERR
	jmp	LBB0_10
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	movl	%ebx, %esi
	callq	_BT_ERR
LBB0_9:
	movq	-24(%rbp), %rdi
	callq	_sock_release
LBB0_10:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	-24(%rbp), %rdi
	movq	_BT_LISTEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rfcomm_session_add
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	movq	%rax, %rdi
	callq	_rfcomm_session_hold
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Create socket failed %d"

	.comm	_AF_BLUETOOTH,4,2               ## @AF_BLUETOOTH
	.comm	_RFCOMM_PSM,4,2                 ## @RFCOMM_PSM
L_.str.1:                               ## @.str.1
	.asciz	"Bind failed %d"

	.comm	_l2cap_mtu,4,2                  ## @l2cap_mtu
L_.str.2:                               ## @.str.2
	.asciz	"Listen failed %d"

	.comm	_BT_LISTEN,4,2                  ## @BT_LISTEN
	.no_dead_strip	_rfcomm_add_listener
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rfcomm_add_listener
_rfcomm_add_listener:                   ; @rfcomm_add_listener
	.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	x20, x0
	mov	x0, sp
	bl	_rfcomm_l2sock_create
	tbnz	w0, #31, LBB0_4
; %bb.1:
	add	x8, sp, #8
	add	x0, x8, #16
	mov	x1, x20
	bl	_bacpy
Lloh0:
	adrp	x8, _AF_BLUETOOTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #20]
Lloh3:
	adrp	x8, _RFCOMM_PSM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RFCOMM_PSM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_cpu_to_le16
	str	w0, [sp, #16]
	str	xzr, [sp, #8]
	ldr	x0, [sp]
	add	x1, sp, #8
	mov	w2, #24
	bl	_kernel_bind
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	x8, [sp]
	ldr	x19, [x8]
	mov	x0, x19
	bl	_lock_sock
Lloh6:
	adrp	x8, _l2cap_mtu@GOTPAGE
Lloh7:
	ldr	x8, [x8, _l2cap_mtu@GOTPAGEOFF]
Lloh8:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_l2cap_pi
	str	w20, [x0]
	mov	x0, x19
	bl	_release_sock
	ldr	x0, [sp]
	mov	w1, #10
	bl	_kernel_listen
	cbz	w0, LBB0_9
; %bb.3:
	mov	x19, x0
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
	mov	x19, x0
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_ERR
	b	LBB0_8
LBB0_5:
	mov	x19, x0
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_6:
	mov	x1, x19
	bl	_BT_ERR
LBB0_7:
	ldr	x0, [sp]
	bl	_sock_release
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
	ldr	x0, [sp]
Lloh15:
	adrp	x8, _BT_LISTEN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BT_LISTEN@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_rfcomm_session_add
	cbz	x0, LBB0_11
; %bb.10:
	bl	_rfcomm_session_hold
	mov	w19, #0
	b	LBB0_8
LBB0_11:
	mov	w19, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Create socket failed %d"

	.comm	_AF_BLUETOOTH,4,2               ; @AF_BLUETOOTH
	.comm	_RFCOMM_PSM,4,2                 ; @RFCOMM_PSM
l_.str.1:                               ; @.str.1
	.asciz	"Bind failed %d"

	.comm	_l2cap_mtu,4,2                  ; @l2cap_mtu
l_.str.2:                               ; @.str.2
	.asciz	"Listen failed %d"

	.comm	_BT_LISTEN,4,2                  ; @BT_LISTEN
	.no_dead_strip	_rfcomm_add_listener
.subsections_via_symbols
