	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnep_add_connection            ## -- Begin function bnep_add_connection
	.p2align	4, 0x90
_bnep_add_connection:                   ## @bnep_add_connection
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shlq	$2, %rbx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%rbx, %rax
	movq	%r14, %rbx
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	L_.str(%rip), %rdi
	callq	_BT_DBG
	movl	(%rbx), %edi
	callq	_bt_sk
	leaq	4(%rax), %rsi
	movq	%r12, %rdi
	callq	_baswap
	movl	(%rbx), %edi
	callq	_bt_sk
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_baswap
	movq	(%r15), %rax
	cmpb	$0, (%rax)
	leaq	L_.str.1(%rip), %rsi
	cmovneq	%rax, %rsi
	movq	_bnep_net_setup@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$56, %edi
	callq	_alloc_netdev
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	_bnep_session_sem@GOTPCREL(%rip), %rdi
	callq	_down_write
	movq	%r12, %rdi
	callq	___bnep_get_session
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	(%rax), %rax
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movq	%r13, %rdi
	callq	_netdev_priv
	movq	%r15, %rcx
	movq	%rax, %r15
	movq	40(%rax), %rdi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	movq	%rcx, %r14
	callq	_memcpy
	movq	48(%r15), %rdi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	_memcpy
	movq	8(%r13), %rdi
	movq	40(%r15), %rsi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	%r13, 32(%r15)
	movq	%rbx, 24(%r15)
	movl	8(%r14), %eax
	movl	%eax, 16(%r15)
	movq	_BT_CONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	movq	_MSG_NOSIGNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	callq	_bnep_get_device
	movq	%r13, %rdi
	movl	%eax, %esi
	callq	_SET_NETDEV_DEV
	movq	_bnep_type@GOTPCREL(%rip), %rsi
	movq	%r13, %rdi
	callq	_SET_NETDEV_DEVTYPE
	movq	%r13, %rdi
	callq	_register_netdev
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_6
LBB0_8:
	movq	_bnep_session_sem@GOTPCREL(%rip), %rdi
	callq	_up_write
	movq	%r13, %rdi
	callq	_free_netdev
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	callq	___bnep_link_session
	movq	_bnep_session@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CLONE_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_kernel_thread
	testl	%eax, %eax
	js	LBB0_7
## %bb.11:
	movq	_bnep_session_sem@GOTPCREL(%rip), %rdi
	callq	_up_write
	movq	(%r14), %rdi
	movl	(%r13), %esi
	callq	_strcpy
	xorl	%ebx, %ebx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.10:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_unregister_netdev
	movq	%r15, %rdi
	callq	___bnep_unlink_session
	jmp	LBB0_8
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

L_.str.1:                               ## @.str.1
	.asciz	"bnep%d"

	.comm	_bnep_net_setup,4,2             ## @bnep_net_setup
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_bnep_session_sem,4,2           ## @bnep_session_sem
	.comm	_BT_CONNECTED,8,3               ## @BT_CONNECTED
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_MSG_NOSIGNAL,4,2               ## @MSG_NOSIGNAL
	.comm	_bnep_type,4,2                  ## @bnep_type
	.comm	_bnep_session,4,2               ## @bnep_session
	.comm	_CLONE_KERNEL,4,2               ## @CLONE_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bnep_add_connection            ; -- Begin function bnep_add_connection
	.p2align	2
_bnep_add_connection:                   ; @bnep_add_connection
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x25, _ETH_ALEN@GOTPAGE
Lloh4:
	ldr	x25, [x25, _ETH_ALEN@GOTPAGEOFF]
	ldr	w8, [x25]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x22, x9, x12
	mov	sp, x22
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x24, x8, x12
	mov	sp, x24
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_DBG
	ldr	w0, [x21]
	bl	_bt_sk
	add	x1, x0, #4
	mov	x0, x22
	bl	_baswap
	ldr	w0, [x21]
	bl	_bt_sk
	mov	x1, x0
	mov	x0, x24
	bl	_baswap
	ldr	x8, [x19]
Lloh11:
	adrp	x9, l_.str.1@PAGE
Lloh12:
	add	x9, x9, l_.str.1@PAGEOFF
	ldrb	w10, [x8]
	cmp	w10, #0
	csel	x1, x9, x8, eq
Lloh13:
	adrp	x8, _bnep_net_setup@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bnep_net_setup@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	w0, #56
	bl	_alloc_netdev
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
Lloh16:
	adrp	x0, _bnep_session_sem@GOTPAGE
Lloh17:
	ldr	x0, [x0, _bnep_session_sem@GOTPAGEOFF]
	bl	_down_write
	mov	x0, x22
	bl	___bnep_get_session
Lloh18:
	adrp	x26, _BT_CONNECTED@GOTPAGE
Lloh19:
	ldr	x26, [x26, _BT_CONNECTED@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x0]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
Lloh20:
	adrp	x8, _EEXIST@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x20
	bl	_netdev_priv
	mov	x23, x0
	ldr	x0, [x0, #40]
	ldr	w2, [x25]
	mov	x1, x24
	bl	_memcpy
	ldr	x0, [x23, #48]
	ldr	w2, [x25]
	mov	x1, x22
	bl	_memcpy
	ldr	x0, [x20, #8]
	ldr	x1, [x23, #40]
	ldr	w2, [x25]
	bl	_memcpy
	stp	x21, x20, [x23, #24]
	ldr	w8, [x19, #8]
	ldr	x9, [x26]
	str	x9, [x23]
Lloh23:
	adrp	x9, _MSG_NOSIGNAL@GOTPAGE
Lloh24:
	ldr	x9, [x9, _MSG_NOSIGNAL@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	stp	w9, w8, [x23, #12]
	mov	x0, x23
	bl	_bnep_get_device
	mov	x1, x0
	mov	x0, x20
	bl	_SET_NETDEV_DEV
Lloh26:
	adrp	x1, _bnep_type@GOTPAGE
Lloh27:
	ldr	x1, [x1, _bnep_type@GOTPAGEOFF]
	mov	x0, x20
	bl	_SET_NETDEV_DEVTYPE
	mov	x0, x20
	bl	_register_netdev
	mov	x21, x0
	cbz	w0, LBB0_7
LBB0_5:
Lloh28:
	adrp	x0, _bnep_session_sem@GOTPAGE
Lloh29:
	ldr	x0, [x0, _bnep_session_sem@GOTPAGEOFF]
	bl	_up_write
	mov	x0, x20
	bl	_free_netdev
	b	LBB0_9
LBB0_6:
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_9
LBB0_7:
	mov	x0, x23
	bl	___bnep_link_session
Lloh33:
	adrp	x8, _bnep_session@GOTPAGE
Lloh34:
	ldr	x8, [x8, _bnep_session@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
Lloh36:
	adrp	x8, _CLONE_KERNEL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CLONE_KERNEL@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x1, x23
	bl	_kernel_thread
	tbnz	w0, #31, LBB0_11
; %bb.8:
Lloh39:
	adrp	x0, _bnep_session_sem@GOTPAGE
Lloh40:
	ldr	x0, [x0, _bnep_session_sem@GOTPAGEOFF]
	bl	_up_write
	ldr	x0, [x19]
	ldr	w1, [x20]
	bl	_strcpy
	mov	w21, #0
LBB0_9:
	ldur	x8, [x29, #-72]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x21
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x21, x0
	mov	x0, x20
	bl	_unregister_netdev
	mov	x0, x23
	bl	___bnep_unlink_session
	b	LBB0_5
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

l_.str.1:                               ; @.str.1
	.asciz	"bnep%d"

	.comm	_bnep_net_setup,4,2             ; @bnep_net_setup
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_bnep_session_sem,4,2           ; @bnep_session_sem
	.comm	_BT_CONNECTED,8,3               ; @BT_CONNECTED
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_MSG_NOSIGNAL,4,2               ; @MSG_NOSIGNAL
	.comm	_bnep_type,4,2                  ; @bnep_type
	.comm	_bnep_session,4,2               ; @bnep_session
	.comm	_CLONE_KERNEL,4,2               ; @CLONE_KERNEL
.subsections_via_symbols
