	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_complement_pos                 ## -- Begin function complement_pos
	.p2align	4, 0x90
_complement_pos:                        ## @complement_pos
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_WARN_CONSOLE_UNLOCKED
	movl	_complement_pos.old_offset(%rip), %esi
	testl	%esi, %esi
	js	LBB0_4
## %bb.1:
	cmpl	(%r14), %esi
	jge	LBB0_4
## %bb.2:
	movzwl	_complement_pos.old(%rip), %r15d
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_screenpos
	movl	%r15d, %edi
	movq	%rax, %rsi
	callq	_scr_writew
	movq	%r14, %rdi
	callq	_DO_UPDATE
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	16(%r14), %rax
	movzwl	_complement_pos.old(%rip), %esi
	movzwl	_complement_pos.oldy(%rip), %edx
	movzwl	_complement_pos.oldx(%rip), %ecx
	movq	%r14, %rdi
	callq	*(%rax)
LBB0_4:
	movl	%ebx, _complement_pos.old_offset(%rip)
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.5:
	cmpl	%ebx, (%r14)
	jle	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_screenpos
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_scr_readw
	movw	%ax, _complement_pos.old(%rip)
	xorw	4(%r14), %ax
	movzwl	%ax, %r15d
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_scr_writew
	movq	%r14, %rdi
	callq	_DO_UPDATE
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	shrl	%ebx
	movl	%ebx, %eax
	xorl	%edx, %edx
	idivl	8(%r14)
	movw	%dx, _complement_pos.oldx(%rip)
	movw	%ax, _complement_pos.oldy(%rip)
	movq	16(%r14), %rcx
	movq	(%rcx), %r8
	movzwl	%ax, %eax
	movzwl	%dx, %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%r8                            ## TAILCALL
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @complement_pos.old_offset
_complement_pos.old_offset:
	.long	4294967295                      ## 0xffffffff

.zerofill __DATA,__bss,_complement_pos.old,2,1 ## @complement_pos.old
.zerofill __DATA,__bss,_complement_pos.oldx,2,1 ## @complement_pos.oldx
.zerofill __DATA,__bss,_complement_pos.oldy,2,1 ## @complement_pos.oldy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_complement_pos                 ; -- Begin function complement_pos
	.p2align	2
_complement_pos:                        ; @complement_pos
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_WARN_CONSOLE_UNLOCKED
	adrp	x22, _complement_pos.old_offset@PAGE
	ldr	w1, [x22, _complement_pos.old_offset@PAGEOFF]
	tbnz	w1, #31, LBB0_4
; %bb.1:
	ldr	w8, [x19]
	cmp	w1, w8
	b.ge	LBB0_4
; %bb.2:
	adrp	x23, _complement_pos.old@PAGE
	ldrh	w21, [x23, _complement_pos.old@PAGEOFF]
	mov	x0, x19
	mov	w2, #1
	bl	_screenpos
	mov	x1, x0
	mov	x0, x21
	bl	_scr_writew
	mov	x0, x19
	bl	_DO_UPDATE
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	ldrh	w1, [x23, _complement_pos.old@PAGEOFF]
Lloh0:
	adrp	x9, _complement_pos.oldy@PAGE
	ldrh	w2, [x9, _complement_pos.oldy@PAGEOFF]
Lloh1:
	adrp	x9, _complement_pos.oldx@PAGE
	ldrh	w3, [x9, _complement_pos.oldx@PAGEOFF]
	mov	x0, x19
	blr	x8
LBB0_4:
	str	w20, [x22, _complement_pos.old_offset@PAGEOFF]
	tbnz	w20, #31, LBB0_8
; %bb.5:
	ldr	w8, [x19]
	cmp	w8, w20
	b.le	LBB0_8
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	mov	w2, #1
	bl	_screenpos
	mov	x22, x0
	bl	_scr_readw
	adrp	x8, _complement_pos.old@PAGE
	strh	w0, [x8, _complement_pos.old@PAGEOFF]
	ldrh	w8, [x19, #4]
	eor	w8, w8, w0
	and	w21, w8, #0xffff
	mov	x0, x21
	mov	x1, x22
	bl	_scr_writew
	mov	x0, x19
	bl	_DO_UPDATE
	cbz	x0, LBB0_8
; %bb.7:
	lsr	w8, w20, #1
	ldr	w9, [x19, #8]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
Lloh2:
	adrp	x9, _complement_pos.oldx@PAGE
	strh	w8, [x9, _complement_pos.oldx@PAGEOFF]
Lloh3:
	adrp	x9, _complement_pos.oldy@PAGE
	strh	w10, [x9, _complement_pos.oldy@PAGEOFF]
	ldr	x9, [x19, #16]
	ldr	x4, [x9]
	and	w2, w10, #0xffff
	and	w3, w8, #0xffff
	mov	x0, x19
	mov	x1, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	br	x4
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdrp	Lloh0, Lloh1
	.loh AdrpAdrp	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @complement_pos.old_offset
_complement_pos.old_offset:
	.long	4294967295                      ; 0xffffffff

.zerofill __DATA,__bss,_complement_pos.old,2,1 ; @complement_pos.old
.zerofill __DATA,__bss,_complement_pos.oldx,2,1 ; @complement_pos.oldx
.zerofill __DATA,__bss,_complement_pos.oldy,2,1 ; @complement_pos.oldy
.subsections_via_symbols
