	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function perf_spad_cmd_send
_perf_spad_cmd_send:                    ## @perf_spad_cmd_send
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ecx
	movl	%esi, %edx
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%edx, -64(%rbp)                 ## 4-byte Spill
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_MSG_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$0, %r14d
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.1:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_perf_link_is_up
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rbx
	movl	4(%r12), %r13d
	movl	8(%r15), %edi
	callq	_PERF_SPAD_CMD
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_ntb_peer_spad_read
	movq	_PERF_CMD_INVAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_MSG_UDELAY_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MSG_UDELAY_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_usleep_range
	incl	%r14d
	movq	_MSG_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %r14d
	jl	LBB0_2
	jmp	LBB0_7
LBB0_3:
	movq	_ENOLINK@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_6:
	movq	(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r15), %edi
	callq	_PERF_SPAD_LDATA
	movl	%eax, %ebx
	movl	-60(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %edi
	callq	_lower_32_bits
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_ntb_peer_spad_write
	movq	(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r15), %edi
	callq	_PERF_SPAD_HDATA
	movl	%eax, %ebx
	movl	%r13d, %edi
	callq	_upper_32_bits
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_ntb_peer_spad_write
	movq	(%r15), %rbx
	movl	4(%r12), %r13d
	movl	8(%r15), %edi
	callq	_PERF_SPAD_CMD
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	callq	_ntb_peer_spad_write
	movq	(%r15), %rbx
	movl	(%r12), %edi
	callq	_PERF_SPAD_NOTIFY
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_ntb_peer_db_set
	movq	(%r15), %rbx
	movl	(%r12), %edi
	callq	_PERF_SPAD_NOTIFY
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_MSG_TRIES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	cmpl	%ecx, %r14d
	movl	$0, %ecx
	cmovll	%ecx, %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CMD send: %d 0x%llx\n"

	.comm	_MSG_TRIES,4,2                  ## @MSG_TRIES
	.comm	_ENOLINK,4,2                    ## @ENOLINK
	.comm	_PERF_CMD_INVAL,8,3             ## @PERF_CMD_INVAL
	.comm	_MSG_UDELAY_LOW,4,2             ## @MSG_UDELAY_LOW
	.comm	_MSG_UDELAY_HIGH,4,2            ## @MSG_UDELAY_HIGH
L_.str.1:                               ## @.str.1
	.asciz	"DB ring peer %#llx\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_perf_spad_cmd_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function perf_spad_cmd_send
_perf_spad_cmd_send:                    ; @perf_spad_cmd_send
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x27, [x0, #8]
	ldr	x0, [x27]
	str	x21, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
Lloh2:
	adrp	x26, _MSG_TRIES@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MSG_TRIES@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.1:
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	mov	w25, #0
Lloh4:
	adrp	x24, _PERF_CMD_INVAL@GOTPAGE
Lloh5:
	ldr	x24, [x24, _PERF_CMD_INVAL@GOTPAGEOFF]
Lloh6:
	adrp	x28, _MSG_UDELAY_LOW@GOTPAGE
Lloh7:
	ldr	x28, [x28, _MSG_UDELAY_LOW@GOTPAGEOFF]
Lloh8:
	adrp	x20, _MSG_UDELAY_HIGH@GOTPAGE
Lloh9:
	ldr	x20, [x20, _MSG_UDELAY_HIGH@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_perf_link_is_up
	cbz	w0, LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x22, [x27]
	ldr	w23, [x19, #4]
	ldr	w0, [x27, #8]
	bl	_PERF_SPAD_CMD
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_ntb_peer_spad_read
	ldr	x8, [x24]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x28]
	ldr	w1, [x20]
	bl	_usleep_range
	add	w25, w25, #1
	ldr	w8, [x26]
	cmp	w25, w8
	b.lt	LBB0_2
	b	LBB0_8
LBB0_5:
	mov	w25, #0
	b	LBB0_8
LBB0_6:
Lloh10:
	adrp	x8, _ENOLINK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOLINK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_7:
	ldr	x22, [x27]
	ldr	w23, [x19, #4]
	ldr	w0, [x27, #8]
	bl	_PERF_SPAD_LDATA
	mov	x24, x0
	mov	x0, x21
	bl	_lower_32_bits
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_ntb_peer_spad_write
	ldr	x22, [x27]
	ldr	w23, [x19, #4]
	ldr	w0, [x27, #8]
	bl	_PERF_SPAD_HDATA
	mov	x24, x0
	mov	x0, x21
	bl	_upper_32_bits
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x24
	bl	_ntb_peer_spad_write
	ldr	x21, [x27]
	ldr	w22, [x19, #4]
	ldr	w0, [x27, #8]
	bl	_PERF_SPAD_CMD
	mov	x2, x0
	mov	x0, x21
	mov	x1, x22
	ldr	w3, [sp, #12]                   ; 4-byte Folded Reload
	bl	_ntb_peer_spad_write
	ldr	x20, [x27]
	ldr	w0, [x19]
	bl	_PERF_SPAD_NOTIFY
	mov	x1, x0
	mov	x0, x20
	bl	_ntb_peer_db_set
	ldr	x20, [x27]
	ldr	w0, [x19]
	bl	_PERF_SPAD_NOTIFY
	mov	x2, x0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_dbg
	ldr	w8, [x26]
LBB0_8:
Lloh15:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w25, w8
	csneg	w0, wzr, w9, lt
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CMD send: %d 0x%llx\n"

	.comm	_MSG_TRIES,4,2                  ; @MSG_TRIES
	.comm	_ENOLINK,4,2                    ; @ENOLINK
	.comm	_PERF_CMD_INVAL,8,3             ; @PERF_CMD_INVAL
	.comm	_MSG_UDELAY_LOW,4,2             ; @MSG_UDELAY_LOW
	.comm	_MSG_UDELAY_HIGH,4,2            ; @MSG_UDELAY_HIGH
l_.str.1:                               ; @.str.1
	.asciz	"DB ring peer %#llx\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_perf_spad_cmd_send
.subsections_via_symbols
