	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StCreateLink                   ## -- Begin function StCreateLink
	.p2align	4, 0x90
_StCreateLink:                          ## @StCreateLink
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rbx
	movq	(%rbx), %rax
	movq	_SERVER_TYPE_STANDALONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %r13
	movq	_ERR_NO_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	%r13, %rdi
	callq	_LockHubList
	movl	24(%r12), %esi
	movq	%r13, %rdi
	callq	_GetHub
	movq	%rax, %r14
	movq	%r13, %rdi
	callq	_UnlockHubList
	testq	%r14, %r14
	je	LBB0_3
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$0, (%rax)
	je	LBB0_5
LBB0_7:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	callq	_LockList
	movl	(%r14), %edi
	callq	_LIST_NUM
	testq	%rax, %rax
	jle	LBB0_11
## %bb.8:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_LIST_DATA
	movq	%rax, %r13
	movl	12(%rax), %edi
	callq	_Lock
	movq	24(%r13), %rax
	movl	(%rax), %edi
	movq	16(%r12), %rax
	movl	(%rax), %esi
	callq	_UniStrCmpi
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	12(%r13), %edi
	callq	_Unlock
	incq	%r15
	movl	(%r14), %edi
	callq	_LIST_NUM
	cmpq	%rax, %r15
	jl	LBB0_9
LBB0_11:
	movl	(%r14), %edi
	callq	_UnlockList
	movq	16(%r12), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_ALog
	movq	16(%r12), %rdx
	movl	12(%r12), %ecx
	leaq	8(%r12), %r8
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_NewLink
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, %rbx
	movl	4(%r12), %eax
	movl	%eax, 8(%rbx)
	movl	(%r12), %edi
	callq	_CloneX
	movl	%eax, 4(%rbx)
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_SetLinkOffline
	movq	%rbx, %rdi
	callq	_ReleaseLink
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_IncrementServerConfigRevision
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_1:
	movq	_ERR_LINK_CANT_CREATE_ON_FARM@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_3:
	movq	_ERR_HUB_NOT_FOUND@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_GetHubAdminOption
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_ReleaseHub
	movq	_ERR_NOT_ENOUGH_RIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_16:
	movl	16(%r13), %edi
	callq	_AddRef
	movl	12(%r13), %edi
	callq	_Unlock
	movl	(%r14), %edi
	callq	_UnlockList
	movq	%r13, %rdi
	callq	_ReleaseLink
	movq	%r14, %rdi
	callq	_ReleaseHub
	movq	_ERR_LINK_ALREADY_EXISTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_15
LBB0_12:
	movq	_ERR_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_14:
	movq	%r14, %rdi
	callq	_ReleaseHub
LBB0_15:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR_NO_ERROR,8,3               ## @ERR_NO_ERROR
	.comm	_CHECK_RIGHT,4,2                ## @CHECK_RIGHT
	.comm	_SERVER_TYPE_STANDALONE,8,3     ## @SERVER_TYPE_STANDALONE
	.comm	_ERR_LINK_CANT_CREATE_ON_FARM,8,3 ## @ERR_LINK_CANT_CREATE_ON_FARM
	.comm	_ERR_HUB_NOT_FOUND,8,3          ## @ERR_HUB_NOT_FOUND
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no_cascade"

	.comm	_ERR_NOT_ENOUGH_RIGHT,8,3       ## @ERR_NOT_ENOUGH_RIGHT
	.comm	_ERR_LINK_ALREADY_EXISTS,8,3    ## @ERR_LINK_ALREADY_EXISTS
L_.str.1:                               ## @.str.1
	.asciz	"LA_CREATE_LINK"

	.comm	_ERR_INTERNAL_ERROR,8,3         ## @ERR_INTERNAL_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StCreateLink                   ; -- Begin function StCreateLink
	.p2align	2
_StCreateLink:                          ; @StCreateLink
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x21, [x0, #8]
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _SERVER_TYPE_STANDALONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SERVER_TYPE_STANDALONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	mov	x22, x1
	mov	x24, x0
	ldr	x23, [x21, #8]
Lloh3:
	adrp	x8, _ERR_NO_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERR_NO_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	x19, [x8]
	mov	x0, x23
	bl	_LockHubList
	ldr	w1, [x22, #24]
	mov	x0, x23
	bl	_GetHub
	mov	x20, x0
	mov	x0, x23
	bl	_UnlockHubList
	cbz	x20, LBB0_10
; %bb.2:
	ldr	w8, [x24]
	cbz	w8, LBB0_11
LBB0_3:
	ldr	w0, [x20]
	bl	_LockList
	ldr	w0, [x20]
	bl	_LIST_NUM
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x25, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	x1, x25
	bl	_LIST_DATA
	mov	x26, x0
	ldr	w0, [x0, #12]
	bl	_Lock
	ldr	x8, [x26, #24]
	ldr	w0, [x8]
	ldr	x8, [x22, #16]
	ldr	w1, [x8]
	bl	_UniStrCmpi
	cbz	x0, LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x26, #12]
	bl	_Unlock
	add	x25, x25, #1
	ldr	w0, [x20]
	bl	_LIST_NUM
	cmp	x25, x0
	b.lt	LBB0_5
LBB0_7:
	ldr	w0, [x20]
	bl	_UnlockList
	ldr	x8, [x22, #16]
	ldr	w3, [x8]
Lloh6:
	adrp	x2, l_.str.1@PAGE
Lloh7:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x24
	mov	x1, x20
	bl	_ALog
	ldr	x2, [x22, #16]
	ldr	w3, [x22, #12]
	add	x4, x22, #8
	mov	x0, x23
	mov	x1, x20
	bl	_NewLink
	cbz	x0, LBB0_14
; %bb.8:
	mov	x23, x0
	ldp	w0, w8, [x22]
	str	w8, [x23, #8]
	bl	_CloneX
	stp	wzr, w0, [x23]
	mov	x0, x23
	bl	_SetLinkOffline
	mov	x0, x23
	bl	_ReleaseLink
	mov	x0, x21
	bl	_IncrementServerConfigRevision
	b	LBB0_15
LBB0_9:
Lloh8:
	adrp	x8, _ERR_LINK_CANT_CREATE_ON_FARM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERR_LINK_CANT_CREATE_ON_FARM@GOTPAGEOFF]
Lloh10:
	ldr	x19, [x8]
	b	LBB0_16
LBB0_10:
Lloh11:
	adrp	x8, _ERR_HUB_NOT_FOUND@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERR_HUB_NOT_FOUND@GOTPAGEOFF]
Lloh13:
	ldr	x19, [x8]
	b	LBB0_16
LBB0_11:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_GetHubAdminOption
	cbz	x0, LBB0_3
; %bb.12:
	mov	x0, x20
	bl	_ReleaseHub
Lloh16:
	adrp	x8, _ERR_NOT_ENOUGH_RIGHT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ERR_NOT_ENOUGH_RIGHT@GOTPAGEOFF]
Lloh18:
	ldr	x19, [x8]
	b	LBB0_16
LBB0_13:
	ldr	w0, [x26, #16]
	bl	_AddRef
	ldr	w0, [x26, #12]
	bl	_Unlock
	ldr	w0, [x20]
	bl	_UnlockList
	mov	x0, x26
	bl	_ReleaseLink
	mov	x0, x20
	bl	_ReleaseHub
Lloh19:
	adrp	x8, _ERR_LINK_ALREADY_EXISTS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERR_LINK_ALREADY_EXISTS@GOTPAGEOFF]
Lloh21:
	ldr	x19, [x8]
	b	LBB0_16
LBB0_14:
Lloh22:
	adrp	x8, _ERR_INTERNAL_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ERR_INTERNAL_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	x19, [x8]
LBB0_15:
	mov	x0, x20
	bl	_ReleaseHub
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR_NO_ERROR,8,3               ; @ERR_NO_ERROR
	.comm	_CHECK_RIGHT,4,2                ; @CHECK_RIGHT
	.comm	_SERVER_TYPE_STANDALONE,8,3     ; @SERVER_TYPE_STANDALONE
	.comm	_ERR_LINK_CANT_CREATE_ON_FARM,8,3 ; @ERR_LINK_CANT_CREATE_ON_FARM
	.comm	_ERR_HUB_NOT_FOUND,8,3          ; @ERR_HUB_NOT_FOUND
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no_cascade"

	.comm	_ERR_NOT_ENOUGH_RIGHT,8,3       ; @ERR_NOT_ENOUGH_RIGHT
	.comm	_ERR_LINK_ALREADY_EXISTS,8,3    ; @ERR_LINK_ALREADY_EXISTS
l_.str.1:                               ; @.str.1
	.asciz	"LA_CREATE_LINK"

	.comm	_ERR_INTERNAL_ERROR,8,3         ; @ERR_INTERNAL_ERROR
.subsections_via_symbols
