	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switchtec_ntb_peer_spad_write
_switchtec_ntb_peer_spad_write:         ## @switchtec_ntb_peer_spad_write
	.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
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movl	%esi, %ebx
	callq	_ntb_sndev
	movq	%rax, %r15
	movq	_NTB_DEF_PEER_IDX@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_1
## %bb.3:
	testl	%r12d, %r12d
	js	LBB0_1
## %bb.4:
	movq	(%r15), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	cmpl	%r12d, %eax
	jle	LBB0_1
## %bb.5:
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	%r12d, %esi
	shlq	$2, %rsi
	addq	(%rax), %rsi
	movl	%r14d, %edi
	callq	_iowrite32
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_NTB_DEF_PEER_IDX,4,2           ## @NTB_DEF_PEER_IDX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_switchtec_ntb_peer_spad_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switchtec_ntb_peer_spad_write
_switchtec_ntb_peer_spad_write:         ; @switchtec_ntb_peer_spad_write
	.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, x3
	mov	x20, x2
	mov	x22, x1
	bl	_ntb_sndev
Lloh0:
	adrp	x8, _NTB_DEF_PEER_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NTB_DEF_PEER_IDX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.1:
	tbnz	w20, #31, LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	cmp	w0, w20
	b.le	LBB0_5
; %bb.3:
	ldr	x8, [x21]
	cbz	x8, LBB0_8
; %bb.4:
	ldr	x8, [x8]
	add	x1, x8, w20, uxtw #2
	mov	x0, x19
	bl	_iowrite32
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
LBB0_8:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_NTB_DEF_PEER_IDX,4,2           ; @NTB_DEF_PEER_IDX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_switchtec_ntb_peer_spad_write
.subsections_via_symbols
