	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stm_register_protocol          ## -- Begin function stm_register_protocol
	.p2align	4, 0x90
_stm_register_protocol:                 ## @stm_register_protocol
	.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	%rdi, %r15
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_stm_pdrv_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	8(%r15), %edi
	callq	___stm_lookup_protocol
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_2:
	xorl	%r14d, %r14d
LBB0_3:
	movq	_stm_pdrv_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_9
## %bb.4:
	negl	%ebx
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_10
LBB0_5:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.6:
	movq	%rax, %r14
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_get_policy_node_type
	movl	%eax, 12(%r14)
	testl	%eax, %eax
	je	LBB0_3
LBB0_8:
	movq	%r14, %rdi
	addq	$8, %rdi
	movq	_stm_pdrv_head@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	%r15, (%r14)
	movq	_stm_pdrv_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_stm_pdrv_mutex,4,2             ## @stm_pdrv_mutex
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_stm_pdrv_head,4,2              ## @stm_pdrv_head
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stm_register_protocol          ; -- Begin function stm_register_protocol
	.p2align	2
_stm_register_protocol:                 ; @stm_register_protocol
	.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, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x0, _stm_pdrv_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _stm_pdrv_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	w0, [x20, #8]
	bl	___stm_lookup_protocol
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, #0
Lloh5:
	adrp	x8, _EEXIST@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
LBB0_2:
Lloh8:
	adrp	x0, _stm_pdrv_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _stm_pdrv_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	cbz	w21, LBB0_8
; %bb.3:
	neg	w20, w21
	mov	x0, x19
	bl	_kfree
	b	LBB0_9
LBB0_4:
Lloh10:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_2
; %bb.5:
	ldr	x0, [x20]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_get_policy_node_type
	str	w0, [x19, #12]
	cbz	w0, LBB0_2
LBB0_7:
	add	x0, x19, #8
Lloh13:
	adrp	x1, _stm_pdrv_head@GOTPAGE
Lloh14:
	ldr	x1, [x1, _stm_pdrv_head@GOTPAGEOFF]
	bl	_list_add_tail
	str	x20, [x19]
Lloh15:
	adrp	x0, _stm_pdrv_mutex@GOTPAGE
Lloh16:
	ldr	x0, [x0, _stm_pdrv_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_8:
	mov	w20, #0
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_stm_pdrv_mutex,4,2             ; @stm_pdrv_mutex
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_stm_pdrv_head,4,2              ; @stm_pdrv_head
.subsections_via_symbols
