	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetSelectionText               ## -- Begin function GetSelectionText
	.p2align	4, 0x90
_GetSelectionText:                      ## @GetSelectionText
	.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	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	xorl	%r13d, %r13d
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.1:
	movq	%rsi, %r15
	movl	%edi, %ebx
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movq	_EM_GETSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	leaq	-48(%rbp), %rcx
                                        ## kill: def $edx killed $edx killed $rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_SendMessage
	movq	-56(%rbp), %rax
	cmpq	-48(%rbp), %rax
	je	LBB0_9
## %bb.2:
	movl	%ebx, %edi
	callq	_GetWindowTextLength
	movq	%rax, %r14
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	leaq	4(,%r14,4), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:
	movq	%rax, %r12
	incq	%r14
	movl	%ebx, %edi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_GetWindowText
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	-56(%rbp), %rax
	movq	%r12, %rdx
	addq	%rax, %rdx
	movq	-48(%rbp), %rcx
	subq	%rax, %rcx
	movq	%r15, %rdi
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	_StringCchCopyN
	movl	%eax, %ebx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_HeapFree
	cmpl	$129, %ebx
	je	LBB0_8
## %bb.6:
	cmpl	$128, %ebx
	jne	LBB0_9
## %bb.7:
	movl	-48(%rbp), %r13d
	subl	-56(%rbp), %r13d
	jmp	LBB0_9
LBB0_4:
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_HeapFree
	jmp	LBB0_9
LBB0_8:
	decl	%r14d
	movl	%r14d, %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EM_GETSEL,4,2                  ## @EM_GETSEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetSelectionText               ; -- Begin function GetSelectionText
	.p2align	2
_GetSelectionText:                      ; @GetSelectionText
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	stp	xzr, xzr, [sp]
	cbz	x1, LBB0_2
; %bb.1:
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _EM_GETSEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EM_GETSEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x3, sp
	bl	_SendMessage
	ldp	x9, x8, [sp]
	cmp	x8, x9
	b.ne	LBB0_4
LBB0_2:
	mov	w0, #0
LBB0_3:
	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
	add	sp, sp, #80
	ret
LBB0_4:
	mov	x0, x21
	bl	_GetWindowTextLength
	add	x23, x0, #1
	bl	_GetProcessHeap
	lsl	x2, x23, #2
	mov	w1, #0
	bl	_HeapAlloc
	cbz	x0, LBB0_3
; %bb.5:
	mov	x22, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	bl	_GetWindowText
	cbz	x0, LBB0_9
; %bb.6:
	ldp	x9, x8, [sp]
	add	x2, x8, x22
	sub	x3, x9, x8
	mov	x0, x20
	mov	x1, x19
	bl	_StringCchCopyN
	mov	x20, x0
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x22
	bl	_HeapFree
	cmp	w20, #129
	b.eq	LBB0_10
; %bb.7:
	mov	w0, #0
	cmp	w20, #128
	b.ne	LBB0_3
; %bb.8:
	ldr	w8, [sp]
	ldr	w9, [sp, #8]
	sub	w0, w8, w9
	b	LBB0_3
LBB0_9:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x22
	bl	_HeapFree
	mov	w0, #0
	b	LBB0_3
LBB0_10:
	sub	w0, w19, #1
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EM_GETSEL,4,2                  ; @EM_GETSEL
.subsections_via_symbols
