	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hci_sock_bind
_hci_sock_bind:                         ## @hci_sock_bind
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %rsi
	movq	(%rdi), %r14
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rdx
	callq	_BT_DBG
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rax
	movq	_AF_BLUETOOTH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	callq	_lock_sock
	movq	%r14, %rdi
	callq	_hci_pi
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.4:
	movq	_EALREADY@GOTPCREL(%rip), %rax
LBB0_5:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movq	8(%rbx), %rdi
	movq	_HCI_DEV_NONE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	(%rax), %rdi
	jne	LBB0_8
## %bb.7:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_8:
	callq	_hci_dev_get
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_atomic_inc
LBB0_11:
	movq	%r14, %rdi
	callq	_hci_pi
	movq	%r15, (%rax)
	movq	_BT_BOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_12:
	movq	%r14, %rdi
	callq	_release_sock
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sock %p sk %p"

	.comm	_AF_BLUETOOTH,8,3               ## @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EALREADY,4,2                   ## @EALREADY
	.comm	_HCI_DEV_NONE,8,3               ## @HCI_DEV_NONE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BT_BOUND,4,2                   ## @BT_BOUND
	.no_dead_strip	_hci_sock_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hci_sock_bind
_hci_sock_bind:                         ; @hci_sock_bind
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x1, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x19
	bl	_BT_DBG
	cbz	x20, LBB0_5
; %bb.1:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _AF_BLUETOOTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_BLUETOOTH@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_lock_sock
	mov	x0, x19
	bl	_hci_pi
	ldr	x8, [x0]
	cbz	x8, LBB0_6
; %bb.3:
Lloh5:
	adrp	x8, _EALREADY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EALREADY@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_5:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_6:
	ldr	x0, [x20, #8]
Lloh10:
	adrp	x8, _HCI_DEV_NONE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HCI_DEV_NONE@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x21, #0
	b	LBB0_10
LBB0_8:
	bl	_hci_dev_get
	cbz	x0, LBB0_13
; %bb.9:
	mov	x21, x0
	bl	_atomic_inc
LBB0_10:
	mov	x0, x19
	bl	_hci_pi
	mov	w20, #0
	str	x21, [x0]
Lloh13:
	adrp	x8, _BT_BOUND@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BT_BOUND@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_11:
	mov	x0, x19
	bl	_release_sock
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sock %p sk %p"

	.comm	_AF_BLUETOOTH,8,3               ; @AF_BLUETOOTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EALREADY,4,2                   ; @EALREADY
	.comm	_HCI_DEV_NONE,8,3               ; @HCI_DEV_NONE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BT_BOUND,4,2                   ; @BT_BOUND
	.no_dead_strip	_hci_sock_bind
.subsections_via_symbols
