	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switchtec_ntb_mw_get_align
_switchtec_ntb_mw_get_align:            ## @switchtec_ntb_mw_get_align
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %r15
	movq	%rcx, %r12
	movl	%edx, %r13d
	movl	%esi, %ebx
	callq	_ntb_sndev
	movq	_NTB_DEF_PEER_IDX@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jne	LBB0_1
## %bb.2:
	movl	(%rax), %ebx
	movq	8(%rax), %rax
	movslq	%r13d, %rdi
	shlq	$2, %rdi
	addq	(%rax), %rdi
	callq	_ioread64
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	testq	%r12, %r12
	je	LBB0_7
## %bb.4:
	movq	%rax, %rcx
	cmpl	%r13d, %ebx
	jle	LBB0_6
## %bb.5:
	movq	_SZ_4K@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_6:
	movq	%rcx, (%r12)
LBB0_7:
	testq	%r15, %r15
	je	LBB0_11
## %bb.8:
	movq	%rax, %rcx
	cmpl	%r13d, %ebx
	jle	LBB0_10
## %bb.9:
	movq	_SZ_4K@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
LBB0_10:
	movq	%rcx, (%r15)
LBB0_11:
	xorl	%ecx, %ecx
	testq	%r14, %r14
	je	LBB0_13
## %bb.12:
	movq	%rax, (%r14)
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_13:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NTB_DEF_PEER_IDX,4,2           ## @NTB_DEF_PEER_IDX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SZ_4K,8,3                      ## @SZ_4K
	.no_dead_strip	_switchtec_ntb_mw_get_align
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switchtec_ntb_mw_get_align
_switchtec_ntb_mw_get_align:            ; @switchtec_ntb_mw_get_align
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x22, x3
	mov	x21, x2
	mov	x23, 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, w23
	b.ne	LBB0_8
; %bb.1:
	ldr	w23, [x0]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	add	x0, x8, w21, sxtw #2
	bl	_ioread64
	cbz	x0, LBB0_8
; %bb.2:
Lloh3:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
	cbz	x22, LBB0_4
; %bb.3:
	ldr	x9, [x8]
	cmp	w23, w21
	csel	x9, x9, x0, gt
	str	x9, [x22]
LBB0_4:
	cbz	x20, LBB0_6
; %bb.5:
	ldr	x8, [x8]
	cmp	w23, w21
	csel	x8, x8, x0, gt
	str	x8, [x20]
LBB0_6:
	mov	w8, #0
	cbz	x19, LBB0_9
; %bb.7:
	str	x0, [x19]
	b	LBB0_9
LBB0_8:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w8, w8
LBB0_9:
	mov	x0, x8
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_NTB_DEF_PEER_IDX,4,2           ; @NTB_DEF_PEER_IDX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SZ_4K,8,3                      ; @SZ_4K
	.no_dead_strip	_switchtec_ntb_mw_get_align
.subsections_via_symbols
