	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function perf_init_service
_perf_init_service:                     ## @perf_init_service
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	callq	_ntb_peer_mw_count
	movq	8(%rbx), %rdi
	cmpq	(%rbx), %rax
	jle	LBB0_1
## %bb.2:
	callq	_ntb_msg_count
	movq	_PERF_MSG_CNT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_3
## %bb.5:
	movq	8(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_GENMASK_ULL
	movl	%eax, %r15d
	movq	8(%rbx), %rdi
	callq	_ntb_spad_count
	movq	%rax, %r12
	movq	(%rbx), %rdi
	callq	_PERF_SPAD_CNT
	cmpq	%rax, %r12
	jl	LBB0_8
## %bb.6:
	movq	8(%rbx), %rdi
	callq	_ntb_db_valid_mask
	notl	%eax
	testl	%eax, %r15d
	jne	LBB0_8
## %bb.7:
	movq	_perf_spad_cmd_send@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_perf_spad_cmd_recv@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	8(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_3:
	movq	_perf_msg_cmd_send@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_perf_msg_cmd_recv@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_4:
	callq	_dev_dbg
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_8:
	movq	8(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_dbg
	movq	8(%rbx), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %r14d
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Not enough memory windows\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PERF_MSG_CNT,8,3               ## @PERF_MSG_CNT
	.comm	_perf_msg_cmd_send,4,2          ## @perf_msg_cmd_send
	.comm	_perf_msg_cmd_recv,4,2          ## @perf_msg_cmd_recv
L_.str.1:                               ## @.str.1
	.asciz	"Message service initialized\n"

L_.str.2:                               ## @.str.2
	.asciz	"Message service unsupported\n"

	.comm	_perf_spad_cmd_send,4,2         ## @perf_spad_cmd_send
	.comm	_perf_spad_cmd_recv,4,2         ## @perf_spad_cmd_recv
L_.str.3:                               ## @.str.3
	.asciz	"Scratchpad service initialized\n"

L_.str.4:                               ## @.str.4
	.asciz	"Scratchpad service unsupported\n"

L_.str.5:                               ## @.str.5
	.asciz	"Command services unsupported\n"

	.no_dead_strip	_perf_init_service
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function perf_init_service
_perf_init_service:                     ; @perf_init_service
	.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	x19, x0
	ldr	x0, [x0, #8]
	bl	_ntb_peer_mw_count
	mov	x8, x0
	ldp	x9, x0, [x19]
	cmp	x8, x9
	b.le	LBB0_5
; %bb.1:
	bl	_ntb_msg_count
Lloh0:
	adrp	x8, _PERF_MSG_CNT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PERF_MSG_CNT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_6
; %bb.2:
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
	ldr	x0, [x19]
	mov	w1, #0
	bl	_GENMASK_ULL
	mov	x20, x0
	ldr	x0, [x19, #8]
	bl	_ntb_spad_count
	mov	x21, x0
	ldr	x0, [x19]
	bl	_PERF_SPAD_CNT
	cmp	x21, x0
	b.lt	LBB0_8
; %bb.3:
	ldr	x0, [x19, #8]
	bl	_ntb_db_valid_mask
	bics	wzr, w20, w0
	b.ne	LBB0_8
; %bb.4:
Lloh5:
	adrp	x8, _perf_spad_cmd_send@GOTPAGE
Lloh6:
	ldr	x8, [x8, _perf_spad_cmd_send@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _perf_spad_cmd_recv@GOTPAGE
Lloh9:
	ldr	x9, [x9, _perf_spad_cmd_recv@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
	ldr	x0, [x19, #8]
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_6:
Lloh15:
	adrp	x8, _perf_msg_cmd_send@GOTPAGE
Lloh16:
	ldr	x8, [x8, _perf_msg_cmd_send@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _perf_msg_cmd_recv@GOTPAGE
Lloh19:
	ldr	x9, [x9, _perf_msg_cmd_recv@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #16]
	ldr	x0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_10
LBB0_8:
	ldr	x0, [x19, #8]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
	ldr	x0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Not enough memory windows\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PERF_MSG_CNT,8,3               ; @PERF_MSG_CNT
	.comm	_perf_msg_cmd_send,4,2          ; @perf_msg_cmd_send
	.comm	_perf_msg_cmd_recv,4,2          ; @perf_msg_cmd_recv
l_.str.1:                               ; @.str.1
	.asciz	"Message service initialized\n"

l_.str.2:                               ; @.str.2
	.asciz	"Message service unsupported\n"

	.comm	_perf_spad_cmd_send,4,2         ; @perf_spad_cmd_send
	.comm	_perf_spad_cmd_recv,4,2         ; @perf_spad_cmd_recv
l_.str.3:                               ; @.str.3
	.asciz	"Scratchpad service initialized\n"

l_.str.4:                               ; @.str.4
	.asciz	"Scratchpad service unsupported\n"

l_.str.5:                               ; @.str.5
	.asciz	"Command services unsupported\n"

	.no_dead_strip	_perf_init_service
.subsections_via_symbols
