	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EDIT_GetCompositionStr
_EDIT_GetCompositionStr:                ## @EDIT_GetCompositionStr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r12d
	movl	%edi, %r13d
	movq	_GCS_COMPSTR@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ImmGetCompositionStringW
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_heap_alloc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	movl	(%r14), %esi
	movl	%r13d, %edi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_ImmGetCompositionStringW
LBB0_4:
	movq	_GCS_COMPATTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	testl	%r12d, %esi
	je	LBB0_10
## %bb.5:
	movl	%r13d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ImmGetCompositionStringW
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movl	%eax, %r12d
	leal	2(%r12), %edi
	callq	_heap_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%rax, %r14
	leal	1(%r12), %ecx
	movq	_GCS_COMPATTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	movq	%r14, %rdx
	callq	_ImmGetCompositionStringW
	movslq	%r12d, %rax
	movq	$0, 8(%r14,%rax,8)
LBB0_10:
	movq	%r14, %r12
	movq	(%r15), %rcx
	movq	8(%r15), %rax
	cmpq	%rax, %rcx
	jge	LBB0_12
## %bb.11:
	movq	%rcx, 8(%r15)
	movq	%rcx, %rax
LBB0_12:
	movq	%rax, 16(%r15)
	movq	24(%r15), %rcx
	xorl	%edx, %edx
	testq	%rcx, %rcx
	cmovgq	%rcx, %rdx
	addq	%rax, %rdx
	movq	%rdx, (%r15)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	shrl	$2, %ebx
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, %rdi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	movl	%ebx, %ecx
	movl	%r8d, %r9d
	callq	_EDIT_EM_ReplaceSel
	movq	8(%r15), %rax
	movq	%rax, %rcx
	subq	(%r15), %rcx
	movq	%rcx, %rdx
	negq	%rdx
	cmovsq	%rcx, %rdx
	movq	%rdx, 24(%r15)
	movq	%rax, 16(%r15)
	addq	%rax, %rdx
	movq	%rdx, (%r15)
	movq	%r12, %rdi
	callq	_heap_free
	movq	%r14, %rdi
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_heap_free                      ## TAILCALL
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_GCS_COMPSTR,4,2                ## @GCS_COMPSTR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to allocate IME CompositionString\n"

	.comm	_GCS_COMPATTR,4,2               ## @GCS_COMPATTR
L_.str.1:                               ## @.str.1
	.asciz	"Unable to allocate IME Attribute String\n"

	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_EDIT_GetCompositionStr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EDIT_GetCompositionStr
_EDIT_GetCompositionStr:                ; @EDIT_GetCompositionStr
	.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
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _GCS_COMPSTR@GOTPAGE
Lloh1:
	ldr	x24, [x24, _GCS_COMPSTR@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x2, #0
	mov	w3, #0
	bl	_ImmGetCompositionStringW
	tbnz	w0, #31, LBB0_8
; %bb.1:
	mov	x21, x0
	bl	_heap_alloc
	cbz	x0, LBB0_9
; %bb.2:
	mov	x20, x0
	cbz	w21, LBB0_4
; %bb.3:
	ldr	w1, [x24]
	mov	x0, x22
	mov	x2, x20
	mov	x3, x21
	bl	_ImmGetCompositionStringW
LBB0_4:
Lloh2:
	adrp	x25, _GCS_COMPATTR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _GCS_COMPATTR@GOTPAGEOFF]
	ldr	w1, [x25]
	tst	w1, w23
	b.eq	LBB0_10
; %bb.5:
	mov	x0, x22
	mov	x2, #0
	mov	w3, #0
	bl	_ImmGetCompositionStringW
	cbz	w0, LBB0_10
; %bb.6:
	mov	x24, x0
	add	w0, w0, #2
	bl	_heap_alloc
	cbz	x0, LBB0_15
; %bb.7:
	mov	x23, x0
	add	w24, w24, #1
	ldr	w1, [x25]
	mov	x0, x22
	mov	x2, x23
	mov	x3, x24
	bl	_ImmGetCompositionStringW
	str	xzr, [x23, w24, sxtw #3]
	b	LBB0_11
LBB0_8:
	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
LBB0_9:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	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
	b	_ERR
LBB0_10:
	mov	x23, #0
LBB0_11:
	ldp	x9, x8, [x19]
	cmp	x9, x8
	b.ge	LBB0_13
; %bb.12:
	str	x9, [x19, #8]
	mov	x8, x9
LBB0_13:
	str	x8, [x19, #16]
	ldr	x9, [x19, #24]
	cmp	x9, #0
	csel	x9, x9, xzr, gt
	add	x8, x9, x8
Lloh6:
	adrp	x9, _FALSE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FALSE@GOTPAGEOFF]
	str	x8, [x19]
Lloh8:
	ldr	w1, [x9]
	lsr	w3, w21, #2
Lloh9:
	adrp	x8, _TRUE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x2, x20
	mov	x5, x4
	bl	_EDIT_EM_ReplaceSel
	ldp	x9, x8, [x19]
	subs	x9, x8, x9
	cneg	x9, x9, mi
	stp	x8, x9, [x19, #16]
	add	x8, x9, x8
	str	x8, [x19]
	mov	x0, x23
	bl	_heap_free
LBB0_14:
	mov	x0, x20
	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
	b	_heap_free
LBB0_15:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_GCS_COMPSTR,4,2                ; @GCS_COMPSTR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to allocate IME CompositionString\n"

	.comm	_GCS_COMPATTR,4,2               ; @GCS_COMPATTR
l_.str.1:                               ; @.str.1
	.asciz	"Unable to allocate IME Attribute String\n"

	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_EDIT_GetCompositionStr
.subsections_via_symbols
