	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ehea_register_memory_hooks
_ehea_register_memory_hooks:            ## @ehea_register_memory_hooks
	.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	_ehea_memory_hooks_registered@GOTPCREL(%rip), %rdi
	callq	_atomic_inc_return
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	jg	LBB0_12
## %bb.1:
	xorl	%eax, %eax
	callq	_ehea_create_busmap
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_11
LBB0_3:
	movq	_ehea_reboot_nb@GOTPCREL(%rip), %rdi
	callq	_register_reboot_notifier
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_11
LBB0_5:
	movq	_ehea_mem_nb@GOTPCREL(%rip), %rdi
	callq	_register_memory_notifier
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_10
LBB0_7:
	movq	_ehea_crash_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_crash_shutdown_register
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_info
	movq	_ehea_mem_nb@GOTPCREL(%rip), %rdi
	callq	_unregister_memory_notifier
LBB0_10:
	movq	_ehea_reboot_nb@GOTPCREL(%rip), %rdi
	callq	_unregister_reboot_notifier
LBB0_11:
	movq	_ehea_memory_hooks_registered@GOTPCREL(%rip), %rdi
	callq	_atomic_dec
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_8:
	xorl	%ebx, %ebx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ehea_memory_hooks_registered,4,2 ## @ehea_memory_hooks_registered
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ehea_create_busmap failed\n"

	.comm	_ehea_reboot_nb,4,2             ## @ehea_reboot_nb
L_.str.1:                               ## @.str.1
	.asciz	"register_reboot_notifier failed\n"

	.comm	_ehea_mem_nb,4,2                ## @ehea_mem_nb
L_.str.2:                               ## @.str.2
	.asciz	"register_memory_notifier failed\n"

	.comm	_ehea_crash_handler,4,2         ## @ehea_crash_handler
L_.str.3:                               ## @.str.3
	.asciz	"crash_shutdown_register failed\n"

	.no_dead_strip	_ehea_register_memory_hooks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ehea_register_memory_hooks
_ehea_register_memory_hooks:            ; @ehea_register_memory_hooks
	.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
Lloh0:
	adrp	x0, _ehea_memory_hooks_registered@GOTPAGE
Lloh1:
	ldr	x0, [x0, _ehea_memory_hooks_registered@GOTPAGEOFF]
	bl	_atomic_inc_return
	cmp	w0, #1
	b.le	LBB0_2
; %bb.1:
	mov	w19, #0
	b	LBB0_12
LBB0_2:
	bl	_ehea_create_busmap
	cbz	w0, LBB0_4
; %bb.3:
	mov	x19, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	b	LBB0_11
LBB0_4:
Lloh4:
	adrp	x0, _ehea_reboot_nb@GOTPAGE
Lloh5:
	ldr	x0, [x0, _ehea_reboot_nb@GOTPAGEOFF]
	bl	_register_reboot_notifier
	cbz	w0, LBB0_6
; %bb.5:
	mov	x19, x0
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
	b	LBB0_11
LBB0_6:
Lloh8:
	adrp	x0, _ehea_mem_nb@GOTPAGE
Lloh9:
	ldr	x0, [x0, _ehea_mem_nb@GOTPAGEOFF]
	bl	_register_memory_notifier
	cbz	w0, LBB0_8
; %bb.7:
	mov	x19, x0
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_info
	b	LBB0_10
LBB0_8:
Lloh12:
	adrp	x8, _ehea_crash_handler@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ehea_crash_handler@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_crash_shutdown_register
	mov	x19, x0
	cbz	w0, LBB0_12
; %bb.9:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
Lloh17:
	adrp	x0, _ehea_mem_nb@GOTPAGE
Lloh18:
	ldr	x0, [x0, _ehea_mem_nb@GOTPAGEOFF]
	bl	_unregister_memory_notifier
LBB0_10:
Lloh19:
	adrp	x0, _ehea_reboot_nb@GOTPAGE
Lloh20:
	ldr	x0, [x0, _ehea_reboot_nb@GOTPAGEOFF]
	bl	_unregister_reboot_notifier
LBB0_11:
Lloh21:
	adrp	x0, _ehea_memory_hooks_registered@GOTPAGE
Lloh22:
	ldr	x0, [x0, _ehea_memory_hooks_registered@GOTPAGEOFF]
	bl	_atomic_dec
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ehea_memory_hooks_registered,4,2 ; @ehea_memory_hooks_registered
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ehea_create_busmap failed\n"

	.comm	_ehea_reboot_nb,4,2             ; @ehea_reboot_nb
l_.str.1:                               ; @.str.1
	.asciz	"register_reboot_notifier failed\n"

	.comm	_ehea_mem_nb,4,2                ; @ehea_mem_nb
l_.str.2:                               ; @.str.2
	.asciz	"register_memory_notifier failed\n"

	.comm	_ehea_crash_handler,4,2         ; @ehea_crash_handler
l_.str.3:                               ; @.str.3
	.asciz	"crash_shutdown_register failed\n"

	.no_dead_strip	_ehea_register_memory_hooks
.subsections_via_symbols
