	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_invert_screen                  ## -- Begin function invert_screen
	.p2align	4, 0x90
_invert_screen:                         ## @invert_screen
	.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
	movl	%ecx, %r15d
	movl	%edx, %ebx
	movl	%esi, %r13d
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_WARN_CONSOLE_UNLOCKED
	movl	%ebx, %r12d
	shrl	$31, %r12d
	addl	%ebx, %r12d
	sarl	%r12d
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%r15d, %edx
	callq	_screenpos
	movq	%rax, %r15
	movq	8(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	*%rax
LBB0_13:
	movq	%r14, %rdi
	callq	_DO_UPDATE
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_do_update_region               ## TAILCALL
LBB0_2:
	cmpl	$0, 4(%r14)
	je	LBB0_3
## %bb.6:
	incl	%ebx
	cmpl	$256, (%r14)                    ## imm = 0x100
	jne	LBB0_7
## %bb.10:
	cmpl	$3, %ebx
	jb	LBB0_13
## %bb.11:
	movl	%r12d, %r13d
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_scr_readw
	movl	%eax, %ecx
	andl	$4607, %ecx                     ## imm = 0x11FF
	movl	%eax, %edi
	shrl	$4, %edi
	andl	$3584, %edi                     ## imm = 0xE00
	orl	%ecx, %edi
	shll	$4, %eax
	andl	$57344, %eax                    ## imm = 0xE000
	orl	%eax, %edi
	movq	%rbx, %rsi
	callq	_scr_writew
	addq	$4, %rbx
	decl	%r13d
	jne	LBB0_12
	jmp	LBB0_13
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	incl	%ebx
	cmpl	$3, %ebx
	jb	LBB0_13
## %bb.4:
	movl	%r12d, %r13d
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_scr_readw
	xorl	$2048, %eax                     ## imm = 0x800
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_scr_writew
	addq	$4, %rbx
	decl	%r13d
	jne	LBB0_5
	jmp	LBB0_13
LBB0_7:
	cmpl	$3, %ebx
	jb	LBB0_13
## %bb.8:
	movl	%r12d, %r13d
	movq	%r15, %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_scr_readw
	movl	%eax, %ecx
	andl	$35071, %ecx                    ## imm = 0x88FF
	movl	%eax, %edi
	shrl	$4, %edi
	andl	$1792, %edi                     ## imm = 0x700
	orl	%ecx, %edi
	shll	$4, %eax
	andl	$28672, %eax                    ## imm = 0x7000
	orl	%eax, %edi
	movq	%rbx, %rsi
	callq	_scr_writew
	addq	$4, %rbx
	decl	%r13d
	jne	LBB0_9
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_invert_screen                  ; -- Begin function invert_screen
	.p2align	2
_invert_screen:                         ; @invert_screen
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x19, x0
	bl	_WARN_CONSOLE_UNLOCKED
	cmp	w22, #0
	cinc	w8, w22, lt
	asr	w20, w8, #1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x21
	bl	_screenpos
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	blr	x8
LBB0_2:
	mov	x0, x19
	bl	_DO_UPDATE
	cbz	x0, LBB0_9
; %bb.3:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	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
	b	_do_update_region
LBB0_4:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_10
; %bb.5:
	ldr	w9, [x19]
	add	w8, w22, #1
	cmp	w9, #256
	b.ne	LBB0_13
; %bb.6:
	cmp	w8, #3
	b.lo	LBB0_2
; %bb.7:
	mov	w23, #4607
	mov	x24, x20
	mov	x22, x21
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	w24, w24, #1
	mov	x0, x22
	bl	_scr_readw
	lsr	w8, w0, #9
	and	w9, w0, w23
	lsr	w10, w0, #4
	and	w10, w10, #0xe00
	orr	w0, w10, w9
	bfi	w0, w8, #13, #3
	mov	x1, x22
	bl	_scr_writew
	add	x22, x22, #4
	cbnz	w24, LBB0_8
	b	LBB0_2
LBB0_9:
	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
LBB0_10:
	add	w8, w22, #1
	cmp	w8, #3
	b.lo	LBB0_2
; %bb.11:
	mov	x23, x20
	mov	x22, x21
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	sub	w23, w23, #1
	mov	x0, x22
	bl	_scr_readw
	eor	w0, w0, #0x800
	mov	x1, x22
	bl	_scr_writew
	add	x22, x22, #4
	cbnz	w23, LBB0_12
	b	LBB0_2
LBB0_13:
	cmp	w8, #3
	b.lo	LBB0_2
; %bb.14:
	mov	w23, #35071
	mov	x24, x20
	mov	x22, x21
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	sub	w24, w24, #1
	mov	x0, x22
	bl	_scr_readw
	lsr	w8, w0, #8
	and	w9, w0, w23
	lsr	w10, w0, #4
	and	w10, w10, #0x700
	orr	w0, w10, w9
	bfi	w0, w8, #12, #3
	mov	x1, x22
	bl	_scr_writew
	add	x22, x22, #4
	cbnz	w24, LBB0_15
	b	LBB0_2
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
