	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hci_register_proto             ## -- Begin function hci_register_proto
	.p2align	4, 0x90
_hci_register_proto:                    ## @hci_register_proto
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edx
	movq	(%rdi), %rcx
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	callq	_BT_DBG
	movq	(%rbx), %rax
	movq	_HCI_MAX_PROTO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_1
## %bb.2:
	movq	_hci_task_lock@GOTPCREL(%rip), %rdi
	callq	_write_lock_bh
	movq	_hci_proto@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_3
## %bb.4:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_3:
	movq	%rbx, (%rax,%rcx,8)
	xorl	%ebx, %ebx
LBB0_5:
	movq	_hci_task_lock@GOTPCREL(%rip), %rdi
	callq	_write_unlock_bh
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%p name %s id %d"

	.comm	_HCI_MAX_PROTO,8,3              ## @HCI_MAX_PROTO
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_hci_task_lock,4,2              ## @hci_task_lock
	.comm	_hci_proto,8,3                  ## @hci_proto
	.comm	_EEXIST,4,2                     ## @EEXIST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hci_register_proto             ; -- Begin function hci_register_proto
	.p2align	2
_hci_register_proto:                    ; @hci_register_proto
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w2, [x0, #8]
	ldr	x3, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _HCI_MAX_PROTO@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HCI_MAX_PROTO@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.1:
Lloh5:
	adrp	x0, _hci_task_lock@GOTPAGE
Lloh6:
	ldr	x0, [x0, _hci_task_lock@GOTPAGEOFF]
	bl	_write_lock_bh
Lloh7:
	adrp	x8, _hci_proto@GOTPAGE
Lloh8:
	ldr	x8, [x8, _hci_proto@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	x10, [x8, x9, lsl #3]
	cbz	x10, LBB0_4
; %bb.2:
Lloh10:
	adrp	x8, _EEXIST@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_6
LBB0_4:
	mov	w20, #0
	str	x19, [x8, x9, lsl #3]
LBB0_5:
Lloh16:
	adrp	x0, _hci_task_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _hci_task_lock@GOTPAGEOFF]
	bl	_write_unlock_bh
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.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	"%p name %s id %d"

	.comm	_HCI_MAX_PROTO,8,3              ; @HCI_MAX_PROTO
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_hci_task_lock,4,2              ; @hci_task_lock
	.comm	_hci_proto,8,3                  ; @hci_proto
	.comm	_EEXIST,4,2                     ; @EEXIST
.subsections_via_symbols
