	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function EDIT_WM_ContextMenu
_EDIT_WM_ContextMenu:                   ## @EDIT_WM_ContextMenu
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_GetModuleHandleA
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edi
	callq	_LoadMenuA
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_GetSubMenu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%r15), %r13
	movq	8(%r15), %r14
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ORDER_UINT
	movq	_MF_BYPOSITION@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	%r15, %rdi
	callq	_EDIT_EM_CanUndo
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ES_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	je	LBB0_3
LBB0_2:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
LBB0_4:
	orl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_EnableMenuItem
	movl	(%r12), %edx
	cmpq	%r13, %r14
	je	LBB0_7
## %bb.5:
	movl	16(%r15), %eax
	movq	_ES_PASSWORD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_7
## %bb.6:
	movq	_ES_READONLY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_32
LBB0_7:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
LBB0_8:
	orl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$2, %esi
	callq	_EnableMenuItem
	movl	(%r12), %edx
	cmpq	%r13, %r14
	je	LBB0_10
## %bb.9:
	movq	_ES_PASSWORD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	je	LBB0_22
LBB0_10:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
LBB0_11:
	orl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$3, %esi
	callq	_EnableMenuItem
	movl	(%r12), %ebx
	movq	_CF_UNICODETEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_IsClipboardFormatAvailable
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	_ES_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	je	LBB0_14
LBB0_13:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
LBB0_15:
	orl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$4, %esi
	movl	%ebx, %edx
	callq	_EnableMenuItem
	movl	(%r12), %edx
	cmpq	%r13, %r14
	je	LBB0_17
## %bb.16:
	movq	_ES_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	je	LBB0_23
LBB0_17:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
LBB0_18:
	orl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$5, %esi
	callq	_EnableMenuItem
	movl	(%r12), %r12d
	testq	%r13, %r13
	jne	LBB0_24
## %bb.20:
	movq	%r15, %rdi
	callq	_get_text_length
	cmpq	%rax, %r14
	jne	LBB0_24
## %bb.21:
	movq	_MF_GRAYED@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_24:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
LBB0_25:
	orl	(%rax), %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$7, %esi
	movl	%r12d, %edx
	callq	_EnableMenuItem
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, -56(%rbp)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, -52(%rbp)
	andl	%ecx, %eax
	cmpl	$-1, %eax
	jne	LBB0_27
## %bb.26:
	movl	24(%r15), %edi
	leaq	-80(%rbp), %rsi
	callq	_GetClientRect
	movl	-80(%rbp), %eax
	movl	-76(%rbp), %ecx
	subl	%eax, %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	addl	%eax, %edx
	movl	%edx, -56(%rbp)
	movl	-72(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%eax, %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	sarl	%edx
	addl	%eax, %edx
	movl	%edx, -52(%rbp)
	movl	24(%r15), %edi
	leaq	-56(%rbp), %rsi
	callq	_ClientToScreen
LBB0_27:
	movq	_EF_FOCUSED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%r15)
	jne	LBB0_29
## %bb.28:
	movl	24(%r15), %edi
	callq	_SetFocus
LBB0_29:
	movq	_TPM_LEFTALIGN@GOTPCREL(%rip), %rax
	movq	_TPM_RIGHTBUTTON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_TPM_RETURNCMD@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_TPM_NONOTIFY@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	movl	24(%r15), %r9d
	movq	$0, (%rsp)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_TrackPopupMenu
	testq	%rax, %rax
	je	LBB0_31
## %bb.30:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_EDIT_ContextMenuCommand
LBB0_31:
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_DestroyMenu
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_23:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_32:
	movq	_MF_ENABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"user32.dll"

L_.str.1:                               ## @.str.1
	.asciz	"EDITMENU"

	.comm	_MF_BYPOSITION,4,2              ## @MF_BYPOSITION
	.comm	_ES_READONLY,4,2                ## @ES_READONLY
	.comm	_MF_ENABLED,4,2                 ## @MF_ENABLED
	.comm	_MF_GRAYED,4,2                  ## @MF_GRAYED
	.comm	_ES_PASSWORD,4,2                ## @ES_PASSWORD
	.comm	_CF_UNICODETEXT,4,2             ## @CF_UNICODETEXT
	.comm	_EF_FOCUSED,4,2                 ## @EF_FOCUSED
	.comm	_TPM_LEFTALIGN,4,2              ## @TPM_LEFTALIGN
	.comm	_TPM_RIGHTBUTTON,4,2            ## @TPM_RIGHTBUTTON
	.comm	_TPM_RETURNCMD,4,2              ## @TPM_RETURNCMD
	.comm	_TPM_NONOTIFY,4,2               ## @TPM_NONOTIFY
	.no_dead_strip	_EDIT_WM_ContextMenu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function EDIT_WM_ContextMenu
_EDIT_WM_ContextMenu:                   ; @EDIT_WM_ContextMenu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_GetModuleHandleA
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_LoadMenuA
	mov	x20, x0
	mov	w1, #0
	bl	_GetSubMenu
	mov	x21, x0
	ldp	x25, x24, [x19]
	mov	x0, x25
	mov	x1, x24
	bl	_ORDER_UINT
Lloh4:
	adrp	x26, _MF_BYPOSITION@GOTPAGE
Lloh5:
	ldr	x26, [x26, _MF_BYPOSITION@GOTPAGEOFF]
	ldr	w28, [x26]
	mov	x0, x19
	bl	_EDIT_EM_CanUndo
Lloh6:
	adrp	x27, _ES_READONLY@GOTPAGE
Lloh7:
	ldr	x27, [x27, _ES_READONLY@GOTPAGEOFF]
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #16]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_2:
Lloh8:
	adrp	x8, _MF_GRAYED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MF_GRAYED@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _MF_ENABLED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MF_ENABLED@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	orr	w2, w8, w28
	mov	x0, x21
	mov	w1, #0
	bl	_EnableMenuItem
	ldr	w8, [x26]
Lloh12:
	adrp	x28, _ES_PASSWORD@GOTPAGE
Lloh13:
	ldr	x28, [x28, _ES_PASSWORD@GOTPAGEOFF]
	cmp	x24, x25
	b.eq	LBB0_7
; %bb.5:
	ldr	w9, [x19, #16]
	ldr	w10, [x28]
	tst	w10, w9
	b.ne	LBB0_7
; %bb.6:
	ldr	w10, [x27]
	tst	w10, w9
	b.eq	LBB0_29
LBB0_7:
Lloh14:
	adrp	x9, _MF_GRAYED@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MF_GRAYED@GOTPAGEOFF]
LBB0_8:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x21
	mov	w1, #2
	bl	_EnableMenuItem
	ldr	w8, [x26]
	cmp	x24, x25
	b.eq	LBB0_10
; %bb.9:
	ldr	w9, [x19, #16]
	ldr	w10, [x28]
	tst	w10, w9
	b.eq	LBB0_27
LBB0_10:
Lloh16:
	adrp	x9, _MF_GRAYED@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MF_GRAYED@GOTPAGEOFF]
LBB0_11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x21
	mov	w1, #3
	bl	_EnableMenuItem
	ldr	w28, [x26]
Lloh18:
	adrp	x8, _CF_UNICODETEXT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CF_UNICODETEXT@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_IsClipboardFormatAvailable
	cbz	x0, LBB0_13
; %bb.12:
	ldr	w8, [x19, #16]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_14
LBB0_13:
Lloh21:
	adrp	x8, _MF_GRAYED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MF_GRAYED@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh23:
	adrp	x8, _MF_ENABLED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MF_ENABLED@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	orr	w2, w8, w28
	mov	x0, x21
	mov	w1, #4
	bl	_EnableMenuItem
	ldr	w8, [x26]
	cmp	x24, x25
	b.eq	LBB0_17
; %bb.16:
	ldr	w9, [x19, #16]
	ldr	w10, [x27]
	tst	w10, w9
	b.eq	LBB0_28
LBB0_17:
Lloh25:
	adrp	x9, _MF_GRAYED@GOTPAGE
Lloh26:
	ldr	x9, [x9, _MF_GRAYED@GOTPAGEOFF]
LBB0_18:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x21
	mov	w1, #5
	bl	_EnableMenuItem
	ldr	w26, [x26]
Lloh27:
	adrp	x27, _MF_ENABLED@GOTPAGE
Lloh28:
	ldr	x27, [x27, _MF_ENABLED@GOTPAGEOFF]
	cbnz	x25, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_get_text_length
Lloh29:
	adrp	x8, _MF_GRAYED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MF_GRAYED@GOTPAGEOFF]
	cmp	x24, x0
	csel	x27, x8, x27, eq
LBB0_20:
	ldr	w8, [x27]
	orr	w2, w8, w26
	mov	x0, x21
	mov	w1, #7
	bl	_EnableMenuItem
	stp	w23, w22, [sp, #24]
	and	w8, w22, w23
	cmn	w8, #1
	b.ne	LBB0_22
; %bb.21:
	ldr	w0, [x19, #24]
	add	x1, sp, #8
	bl	_GetClientRect
	ldp	w8, w9, [sp, #8]
	sub	w9, w9, w8
	cmp	w9, #0
	cinc	w9, w9, lt
	add	w8, w8, w9, asr #1
	ldp	w9, w10, [sp, #16]
	sub	w10, w10, w9
	cmp	w10, #0
	cinc	w10, w10, lt
	add	w9, w9, w10, asr #1
	stp	w8, w9, [sp, #24]
	ldr	w0, [x19, #24]
	add	x1, sp, #24
	bl	_ClientToScreen
LBB0_22:
	ldr	w8, [x19, #20]
Lloh31:
	adrp	x9, _EF_FOCUSED@GOTPAGE
Lloh32:
	ldr	x9, [x9, _EF_FOCUSED@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_24
; %bb.23:
	ldr	w0, [x19, #24]
	bl	_SetFocus
LBB0_24:
Lloh34:
	adrp	x8, _TPM_LEFTALIGN@GOTPAGE
Lloh35:
	ldr	x8, [x8, _TPM_LEFTALIGN@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _TPM_RIGHTBUTTON@GOTPAGE
Lloh38:
	ldr	x9, [x9, _TPM_RIGHTBUTTON@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh40:
	adrp	x9, _TPM_RETURNCMD@GOTPAGE
Lloh41:
	ldr	x9, [x9, _TPM_RETURNCMD@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
Lloh43:
	adrp	x10, _TPM_NONOTIFY@GOTPAGE
Lloh44:
	ldr	x10, [x10, _TPM_NONOTIFY@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh45:
	ldr	w9, [x10]
	orr	w1, w8, w9
	ldp	w2, w3, [sp, #24]
	ldr	w5, [x19, #24]
	mov	x0, x21
	mov	w4, #0
	mov	x6, #0
	bl	_TrackPopupMenu
	cbz	x0, LBB0_26
; %bb.25:
	mov	x1, x0
	mov	x0, x19
	bl	_EDIT_ContextMenuCommand
LBB0_26:
	mov	x0, x20
	bl	_DestroyMenu
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_27:
Lloh46:
	adrp	x9, _MF_ENABLED@GOTPAGE
Lloh47:
	ldr	x9, [x9, _MF_ENABLED@GOTPAGEOFF]
	b	LBB0_11
LBB0_28:
Lloh48:
	adrp	x9, _MF_ENABLED@GOTPAGE
Lloh49:
	ldr	x9, [x9, _MF_ENABLED@GOTPAGEOFF]
	b	LBB0_18
LBB0_29:
Lloh50:
	adrp	x9, _MF_ENABLED@GOTPAGE
Lloh51:
	ldr	x9, [x9, _MF_ENABLED@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"user32.dll"

l_.str.1:                               ; @.str.1
	.asciz	"EDITMENU"

	.comm	_MF_BYPOSITION,4,2              ; @MF_BYPOSITION
	.comm	_ES_READONLY,4,2                ; @ES_READONLY
	.comm	_MF_ENABLED,4,2                 ; @MF_ENABLED
	.comm	_MF_GRAYED,4,2                  ; @MF_GRAYED
	.comm	_ES_PASSWORD,4,2                ; @ES_PASSWORD
	.comm	_CF_UNICODETEXT,4,2             ; @CF_UNICODETEXT
	.comm	_EF_FOCUSED,4,2                 ; @EF_FOCUSED
	.comm	_TPM_LEFTALIGN,4,2              ; @TPM_LEFTALIGN
	.comm	_TPM_RIGHTBUTTON,4,2            ; @TPM_RIGHTBUTTON
	.comm	_TPM_RETURNCMD,4,2              ; @TPM_RETURNCMD
	.comm	_TPM_NONOTIFY,4,2               ; @TPM_NONOTIFY
	.no_dead_strip	_EDIT_WM_ContextMenu
.subsections_via_symbols
