	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SYSLINK_SetItem
_SYSLINK_SetItem:                       ## @SYSLINK_SetItem
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_FALSE@GOTPCREL(%rip), %r14
	movl	(%rsi), %eax
	movq	_LIF_ITEMINDEX@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_LIF_FLAGSMASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.4:
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movl	(%r14), %r13d
	movl	20(%rsi), %esi
	callq	_SYSLINK_GetLinkItemByIndex
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movl	(%rbx), %eax
	movq	_LIF_ITEMID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	%r13d, -52(%rbp)                ## 4-byte Spill
	je	LBB0_7
## %bb.8:
	movl	16(%rbx), %edi
	callq	_lstrlenW
	movq	_MAX_LINKID_TEXT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	decq	%rsi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r13d
	leal	4(,%r13,4), %edi
	callq	_Alloc
	testq	%rax, %rax
	je	LBB0_23
## %bb.9:
	incl	%r13d
	movl	16(%rbx), %esi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	movl	%r13d, %edx
	callq	_lstrcpynW
	movl	(%rbx), %eax
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str(%rip), %rdi
LBB0_3:
	xorl	%eax, %eax
	callq	_ERR
LBB0_22:
	movl	(%r14), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	20(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	jmp	LBB0_22
LBB0_7:
	xorl	%ecx, %ecx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
LBB0_10:
	movq	_LIF_URL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.12:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	12(%rbx), %edi
	callq	_lstrlenW
	movq	_L_MAX_URL_LENGTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	decq	%rsi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r12d
	leal	4(,%r12,4), %edi
	callq	_Alloc
	testq	%rax, %rax
	je	LBB0_24
## %bb.13:
	movq	%rax, %r13
	incl	%r12d
	movl	12(%rbx), %esi
	movq	%rax, %rdi
	movl	%r12d, %edx
	callq	_lstrcpynW
	movl	(%rbx), %eax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_11:
	xorl	%r13d, %r13d
LBB0_14:
	movq	_LIF_ITEMID@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.15:
	movq	(%r15), %rdi
	callq	_Free
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	movl	(%rbx), %eax
LBB0_16:
	movq	_LIF_URL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.17:
	movq	8(%r15), %rdi
	callq	_Free
	movq	%r13, 8(%r15)
	movl	(%rbx), %eax
LBB0_18:
	movq	_LIF_STATE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_20
## %bb.19:
	movl	16(%r15), %eax
	movq	_LIS_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	4(%rbx), %ecx
	movl	8(%rbx), %edx
	xorl	%eax, %edx
	andl	%ecx, %edx
	xorl	%eax, %edx
	movl	%edx, 16(%r15)
	xorl	%r13d, %r13d
	cmpl	%edx, %eax
	setne	%r13b
	movq	_LIS_FOCUSED@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	andl	(%rax), %edx
	movq	%r15, %rsi
	cmoveq	%rcx, %rsi
	movq	%r12, %rdi
	callq	_SYSLINK_SetFocusLink
LBB0_20:
	movq	_TRUE@GOTPCREL(%rip), %r14
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.21:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_SYSLINK_RepaintLink
	jmp	LBB0_22
LBB0_23:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_24:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_Free
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_3
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_LIF_ITEMINDEX,4,2              ## @LIF_ITEMINDEX
	.comm	_LIF_FLAGSMASK,4,2              ## @LIF_FLAGSMASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid Flags!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Link %d couldn't be found\n"

	.comm	_LIF_ITEMID,4,2                 ## @LIF_ITEMID
	.comm	_MAX_LINKID_TEXT,8,3            ## @MAX_LINKID_TEXT
L_.str.2:                               ## @.str.2
	.asciz	"Unable to allocate memory for link id\n"

	.comm	_LIF_URL,4,2                    ## @LIF_URL
	.comm	_L_MAX_URL_LENGTH,8,3           ## @L_MAX_URL_LENGTH
L_.str.3:                               ## @.str.3
	.asciz	"Unable to allocate memory for link url\n"

	.comm	_LIF_STATE,4,2                  ## @LIF_STATE
	.comm	_LIS_MASK,4,2                   ## @LIS_MASK
	.comm	_LIS_FOCUSED,4,2                ## @LIS_FOCUSED
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_SYSLINK_SetItem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SYSLINK_SetItem
_SYSLINK_SetItem:                       ; @SYSLINK_SetItem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _LIF_ITEMINDEX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LIF_ITEMINDEX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.1:
Lloh3:
	adrp	x9, _LIF_FLAGSMASK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LIF_FLAGSMASK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.2:
	mov	x21, x1
	mov	x19, x0
Lloh6:
	adrp	x8, _FALSE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh8:
	ldr	w25, [x8]
	ldr	w1, [x1, #20]
	bl	_SYSLINK_GetLinkItemByIndex
	cbz	x0, LBB0_9
; %bb.3:
	mov	x20, x0
	ldr	w8, [x21]
Lloh9:
	adrp	x26, _LIF_ITEMID@GOTPAGE
Lloh10:
	ldr	x26, [x26, _LIF_ITEMID@GOTPAGEOFF]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.4:
	ldr	w0, [x21, #16]
	bl	_lstrlenW
Lloh11:
	adrp	x8, _MAX_LINKID_TEXT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX_LINKID_TEXT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	sub	x1, x8, #1
	bl	_min
	add	w23, w0, #1
	lsl	w0, w23, #2
	bl	_Alloc
	cbz	x0, LBB0_24
; %bb.5:
	mov	x22, x0
	ldr	w1, [x21, #16]
	mov	x2, x23
	bl	_lstrcpynW
	ldr	w8, [x21]
	b	LBB0_11
LBB0_6:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_ERR
Lloh16:
	adrp	x8, _FALSE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	ldr	w8, [x21, #20]
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_10:
	mov	x22, #0
LBB0_11:
Lloh20:
	adrp	x27, _LIF_URL@GOTPAGE
Lloh21:
	ldr	x27, [x27, _LIF_URL@GOTPAGEOFF]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.12:
	ldr	w0, [x21, #12]
	bl	_lstrlenW
Lloh22:
	adrp	x8, _L_MAX_URL_LENGTH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _L_MAX_URL_LENGTH@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	sub	x1, x8, #1
	bl	_min
	add	w24, w0, #1
	lsl	w0, w24, #2
	bl	_Alloc
	cbz	x0, LBB0_25
; %bb.13:
	mov	x23, x0
	ldr	w1, [x21, #12]
	mov	x2, x24
	bl	_lstrcpynW
	ldr	w8, [x21]
	b	LBB0_15
LBB0_14:
	mov	x23, #0
LBB0_15:
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_17
; %bb.16:
	ldr	x0, [x20]
	bl	_Free
	str	x22, [x20]
	ldr	w8, [x21]
LBB0_17:
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
	ldr	x0, [x20, #8]
	bl	_Free
	str	x23, [x20, #8]
	ldr	w8, [x21]
LBB0_19:
Lloh25:
	adrp	x9, _LIF_STATE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _LIF_STATE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_21
; %bb.20:
	ldr	w8, [x20, #16]
Lloh28:
	adrp	x9, _LIS_MASK@GOTPAGE
Lloh29:
	ldr	x9, [x9, _LIS_MASK@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	ldp	w10, w11, [x21, #4]
	and	w9, w9, w10
	bic	w10, w8, w9
	and	w9, w9, w11
	orr	w9, w9, w10
	str	w9, [x20, #16]
	cmp	w8, w9
	cset	w25, ne
Lloh31:
	adrp	x8, _LIS_FOCUSED@GOTPAGE
Lloh32:
	ldr	x8, [x8, _LIS_FOCUSED@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	tst	w9, w8
	csel	x1, xzr, x20, eq
	mov	x0, x19
	bl	_SYSLINK_SetFocusLink
LBB0_21:
	cbz	w25, LBB0_23
; %bb.22:
	mov	x0, x19
	mov	x1, x20
	bl	_SYSLINK_RepaintLink
LBB0_23:
Lloh34:
	adrp	x8, _TRUE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_8
LBB0_24:
Lloh36:
	adrp	x0, l_.str.2@PAGE
Lloh37:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_25:
	mov	x0, x22
	bl	_Free
Lloh38:
	adrp	x0, l_.str.3@PAGE
Lloh39:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_LIF_ITEMINDEX,4,2              ; @LIF_ITEMINDEX
	.comm	_LIF_FLAGSMASK,4,2              ; @LIF_FLAGSMASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid Flags!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Link %d couldn't be found\n"

	.comm	_LIF_ITEMID,4,2                 ; @LIF_ITEMID
	.comm	_MAX_LINKID_TEXT,8,3            ; @MAX_LINKID_TEXT
l_.str.2:                               ; @.str.2
	.asciz	"Unable to allocate memory for link id\n"

	.comm	_LIF_URL,4,2                    ; @LIF_URL
	.comm	_L_MAX_URL_LENGTH,8,3           ; @L_MAX_URL_LENGTH
l_.str.3:                               ; @.str.3
	.asciz	"Unable to allocate memory for link url\n"

	.comm	_LIF_STATE,4,2                  ; @LIF_STATE
	.comm	_LIS_MASK,4,2                   ; @LIS_MASK
	.comm	_LIS_FOCUSED,4,2                ; @LIS_FOCUSED
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_SYSLINK_SetItem
.subsections_via_symbols
