	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function switchtec_ntb_link_status_update
_switchtec_ntb_link_status_update:      ## @switchtec_ntb_link_status_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %r14d
	movq	32(%rdi), %rax
	cmpl	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	24(%rbx), %rdi
	callq	_ioread64
LBB0_2:
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_switchtec_ntb_set_link_speed
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.4:
	movq	_LINK_MESSAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSG_CHECK_LINK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_switchtec_ntb_send_msg
	leaq	16(%rbx), %rdi
	callq	_ntb_link_event
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_info                       ## TAILCALL
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SWITCHTEC_NTB_MAGIC,4,2        ## @SWITCHTEC_NTB_MAGIC
	.comm	_LINK_MESSAGE,4,2               ## @LINK_MESSAGE
	.comm	_MSG_CHECK_LINK,4,2             ## @MSG_CHECK_LINK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ntb link %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"down"

	.no_dead_strip	_switchtec_ntb_link_status_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function switchtec_ntb_link_status_update
_switchtec_ntb_link_status_update:      ; @switchtec_ntb_link_status_update
	.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
	mov	x19, x0
	ldr	w20, [x0]
	ldr	x8, [x0, #32]
	ldr	w8, [x8]
	cbz	w8, LBB0_2
; %bb.1:
	ldr	x0, [x19, #24]
	bl	_ioread64
LBB0_2:
	str	wzr, [x19]
	mov	x0, x19
	bl	_switchtec_ntb_set_link_speed
	cbz	w20, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _LINK_MESSAGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LINK_MESSAGE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MSG_CHECK_LINK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_CHECK_LINK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_switchtec_ntb_send_msg
	add	x0, x19, #16
	bl	_ntb_link_event
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x2, l_.str.2@PAGE
Lloh9:
	add	x2, x2, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_info
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SWITCHTEC_NTB_MAGIC,4,2        ; @SWITCHTEC_NTB_MAGIC
	.comm	_LINK_MESSAGE,4,2               ; @LINK_MESSAGE
	.comm	_MSG_CHECK_LINK,4,2             ; @MSG_CHECK_LINK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ntb link %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"down"

	.no_dead_strip	_switchtec_ntb_link_status_update
.subsections_via_symbols
