	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function osm_port_relink_endpoint
_osm_port_relink_endpoint:              ## @osm_port_relink_endpoint
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	16(%rdi), %rdi
	callq	_osm_physp_get_port_num
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_osm_node_get_node_guid
	movq	%rax, %r14
	testq	%r12, %r12
	jne	LBB0_6
## %bb.1:
	movq	%rbx, %rdi
	callq	_osm_node_get_type
	movq	_IB_NODE_TYPE_SWITCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.4:
	cmpq	%rax, 8(%rcx)
	jne	LBB0_6
## %bb.5:
	movq	(%rcx), %rax
	movq	(%rax), %rax
	cmpq	%r14, (%rax)
	je	LBB0_19
LBB0_6:
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_osm_node_get_remote_node
	testq	%rax, %rax
	je	LBB0_21
## %bb.7:
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.8:
	movq	(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_21
## %bb.9:
	cmpq	%rax, 8(%rcx)
	je	LBB0_14
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	(%rcx), %rax
	movq	-40(%rbp), %rcx
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_21
## %bb.15:
	movq	16(%rax), %rcx
	testq	%rcx, %rcx
	je	LBB0_22
## %bb.16:
	movq	(%rcx), %rax
	cmpq	%r14, (%rax)
	je	LBB0_19
## %bb.17:
	cmpq	%r14, 24(%rax)
	jne	LBB0_21
## %bb.18:
	addq	$24, %rax
LBB0_19:
	movq	%rax, (%r15)
	movq	%r15, 8(%rax)
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_NODE_TYPE_SWITCH,8,3        ## @IB_NODE_TYPE_SWITCH
	.no_dead_strip	_osm_port_relink_endpoint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function osm_port_relink_endpoint
_osm_port_relink_endpoint:              ; @osm_port_relink_endpoint
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	x0, [x0, #16]
	ldr	x21, [x19, #8]
	bl	_osm_physp_get_port_num
	mov	x22, x0
	mov	x0, x21
	bl	_osm_node_get_node_guid
	mov	x20, x0
	cbnz	x22, LBB0_6
; %bb.1:
	mov	x0, x21
	bl	_osm_node_get_type
Lloh0:
	adrp	x8, _IB_NODE_TYPE_SWITCH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_NODE_TYPE_SWITCH@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x21]
	cbz	x8, LBB0_6
; %bb.3:
	ldr	x9, [x8]
	cbz	x9, LBB0_6
; %bb.4:
	ldr	x10, [x9, #8]
	cmp	x10, x8
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x9]
	ldr	x0, [x8]
	ldr	x8, [x0]
	cmp	x8, x20
	b.eq	LBB0_16
LBB0_6:
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x22
	bl	_osm_node_get_remote_node
	cbz	x0, LBB0_11
; %bb.7:
	ldr	x8, [x0]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	x9, [x8]
	cbz	x9, LBB0_10
; %bb.9:
	ldr	x10, [x9, #8]
	cmp	x10, x8
	b.eq	LBB0_12
LBB0_10:
	mov	x0, #0
LBB0_11:
	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
	add	sp, sp, #64
	ret
LBB0_12:
	ldr	x8, [x9]
	ldr	x9, [sp, #8]
	ldr	x0, [x8, x9, lsl #3]
	cbz	x0, LBB0_11
; %bb.13:
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_11
; %bb.14:
	ldr	x0, [x8]
	ldr	x8, [x0]
	cmp	x8, x20
	b.eq	LBB0_16
; %bb.15:
	ldr	x8, [x0, #24]!
	cmp	x8, x20
	b.ne	LBB0_10
LBB0_16:
	str	x0, [x19]
	str	x19, [x0, #8]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_NODE_TYPE_SWITCH,8,3        ; @IB_NODE_TYPE_SWITCH
	.no_dead_strip	_osm_port_relink_endpoint
.subsections_via_symbols
