	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_softcursor
_add_softcursor:                        ## @add_softcursor
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	24(%rdi), %rdi
	callq	_scr_readw
	movl	(%r14), %ecx
	testb	$16, %cl
	je	LBB0_7
## %bb.1:
	movq	_softcursor_original@GOTPCREL(%rip), %rdx
	cmpl	$-1, (%rdx)
	jne	LBB0_7
## %bb.2:
	movl	%eax, (%rdx)
	movl	%ecx, %edx
	shrl	$8, %edx
	andl	$65280, %edx                    ## imm = 0xFF00
	orl	%eax, %edx
	movl	%ecx, %ebx
	andl	$65280, %ebx                    ## imm = 0xFF00
	xorl	%edx, %ebx
	testb	$32, %cl
	je	LBB0_4
## %bb.3:
	xorl	%ebx, %eax
	movl	%ebx, %edx
	xorl	$28672, %edx                    ## imm = 0x7000
	testl	$28672, %eax                    ## imm = 0x7000
	cmovel	%edx, %ebx
LBB0_4:
	testb	$64, %cl
	je	LBB0_6
## %bb.5:
	movl	%ebx, %eax
	shrl	$4, %eax
	xorl	%ebx, %eax
	movl	%ebx, %ecx
	xorl	$1792, %ecx                     ## imm = 0x700
	testl	$1792, %eax                     ## imm = 0x700
	cmovel	%ecx, %ebx
LBB0_6:
	movq	24(%r14), %rsi
	movl	%ebx, %edi
	callq	_scr_writew
	movq	%r14, %rdi
	callq	_DO_UPDATE
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	16(%r14), %rax
	movq	(%rax), %rax
	movl	4(%r14), %ecx
	movl	8(%r14), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_softcursor_original,4,2        ## @softcursor_original
	.no_dead_strip	_add_softcursor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_softcursor
_add_softcursor:                        ; @add_softcursor
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x0, [x0, #24]
	bl	_scr_readw
	ldr	w8, [x19]
	tbz	w8, #4, LBB0_4
; %bb.1:
Lloh0:
	adrp	x9, _softcursor_original@GOTPAGE
Lloh1:
	ldr	x9, [x9, _softcursor_original@GOTPAGEOFF]
	ldr	w10, [x9]
	cmn	w10, #1
	b.ne	LBB0_4
; %bb.2:
	str	w0, [x9]
	lsr	w9, w8, #8
	and	w9, w9, #0xff00
	orr	w9, w9, w0
	and	w10, w8, #0xff00
	eor	w9, w9, w10
	eor	w10, w9, w0
	eor	w11, w9, #0x7000
	tst	w10, #0x7000
	csel	w10, w11, w9, eq
	tst	w8, #0x20
	csel	w9, w9, w10, eq
	eor	w10, w9, w9, lsr #4
	eor	w11, w9, #0x700
	tst	w10, #0x700
	csel	w10, w11, w9, eq
	tst	w8, #0x40
	csel	w20, w9, w10, eq
	ldr	x1, [x19, #24]
	mov	x0, x20
	bl	_scr_writew
	mov	x0, x19
	bl	_DO_UPDATE
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	x4, [x8]
	ldp	w3, w2, [x19, #4]
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x4
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_softcursor_original,4,2        ; @softcursor_original
	.no_dead_strip	_add_softcursor
.subsections_via_symbols
