	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLMouseInit                   ## -- Begin function VGLMouseInit
	.p2align	4, 0x90
_VGLMouseInit:                          ## @VGLMouseInit
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_VGLModeInfo@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	addl	$-128, %ecx
	cmpl	$3, %ecx
	jb	LBB0_1
## %bb.2:
	movq	_INTERIOR@GOTPCREL(%rip), %rcx
	movq	_BORDER@GOTPCREL(%rip), %rdx
	jmp	LBB0_3
LBB0_1:
	movslq	%ecx, %rcx
	leaq	l_switch.table.VGLMouseInit(%rip), %rdx
	leaq	(%rdx,%rcx,4), %rdx
	leaq	l_switch.table.VGLMouseInit.2(%rip), %rsi
	leaq	(%rsi,%rcx,4), %rcx
LBB0_3:
	movq	8(%rax), %rax
	movq	_M_BG640x480@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	cmpq	(%rsi), %rax
	je	LBB0_5
## %bb.4:
	movl	(%rdx), %r15d
LBB0_5:
	movl	(%rcx), %ebx
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_strtoul
	movl	%eax, %r15d
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_strtoul
	movl	%eax, %ebx
LBB0_9:
	movq	_VGLMouseLargeOrMask@GOTPCREL(%rip), %rax
	movl	4(%rax), %ecx
	imull	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_12
## %bb.10:
	movq	8(%rax), %rcx
	xorl	%edx, %edx
	movq	_BORDER@GOTPCREL(%rip), %r8
	movq	_INTERIOR@GOTPCREL(%rip), %r9
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %esi
	cmpl	(%r9), %esi
	movl	$0, %edi
	cmovel	%ebx, %edi
	cmpl	(%r8), %esi
	cmovel	%r15d, %edi
	movl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rsi
	movslq	4(%rax), %rdi
	imulq	%rsi, %rdi
	cmpq	%rdi, %rdx
	jl	LBB0_11
LBB0_12:
	movq	_VGLMouseSmallOrMask@GOTPCREL(%rip), %rax
	movl	4(%rax), %ecx
	imull	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.13:
	movq	8(%rax), %rcx
	xorl	%edx, %edx
	movq	_BORDER@GOTPCREL(%rip), %r8
	movq	_INTERIOR@GOTPCREL(%rip), %r9
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %esi
	cmpl	(%r9), %esi
	movl	$0, %edi
	cmovel	%ebx, %edi
	cmpl	(%r8), %esi
	cmovel	%r15d, %edi
	movl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rsi
	movslq	4(%rax), %rdi
	imulq	%rsi, %rdi
	cmpq	%rdi, %rdx
	jl	LBB0_14
LBB0_15:
	xorl	%eax, %eax
	callq	_VGLMouseSetStdImage
	movq	_MOUSE_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_SIGUSR2@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)
	movq	_CONS_MOUSECTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-56(%rbp), %rdx
	xorl	%edi, %edi
	callq	_ioctl
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movl	(%r12), %edi
	movq	_VGLMouseAction@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movq	_MOUSE_GETINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movl	(%r15), %esi
	leaq	-56(%rbp), %rdx
	xorl	%edi, %edi
	callq	_ioctl
	movl	-48(%rbp), %eax
	movq	_VGLMouseXpos@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %ecx
	movq	_VGLMouseYpos@GOTPCREL(%rip), %rdx
	movl	%ecx, (%rdx)
	movq	_VGLMouseButtons@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	%r14d, %edi
	callq	_VGLMouseMode
LBB0_17:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VGLModeInfo,16,3               ## @VGLModeInfo
	.comm	_BORDER,4,2                     ## @BORDER
	.comm	_INTERIOR,4,2                   ## @INTERIOR
	.comm	_M_BG640x480,8,3                ## @M_BG640x480
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VGLMOUSEBORDERCOLOR"

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

	.comm	_VGLMouseLargeOrMask,16,3       ## @VGLMouseLargeOrMask
	.comm	_VGLMouseSmallOrMask,16,3       ## @VGLMouseSmallOrMask
	.comm	_MOUSE_MODE,4,2                 ## @MOUSE_MODE
	.comm	_SIGUSR2,4,2                    ## @SIGUSR2
	.comm	_CONS_MOUSECTL,4,2              ## @CONS_MOUSECTL
	.comm	_VGLMouseAction,4,2             ## @VGLMouseAction
	.comm	_MOUSE_GETINFO,4,2              ## @MOUSE_GETINFO
	.comm	_VGLMouseXpos,4,2               ## @VGLMouseXpos
	.comm	_VGLMouseYpos,4,2               ## @VGLMouseYpos
	.comm	_VGLMouseButtons,4,2            ## @VGLMouseButtons
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.VGLMouseInit
l_switch.table.VGLMouseInit:
	.long	63                              ## 0x3f
	.long	15                              ## 0xf
	.long	15                              ## 0xf

	.p2align	2                               ## @switch.table.VGLMouseInit.2
l_switch.table.VGLMouseInit.2:
	.long	36                              ## 0x24
	.long	4                               ## 0x4
	.long	4                               ## 0x4

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_VGLMouseInit                   ; -- Begin function VGLMouseInit
	.p2align	2
_VGLMouseInit:                          ; @VGLMouseInit
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
Lloh0:
	adrp	x8, _VGLModeInfo@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VGLModeInfo@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w9, w9, #128
	sbfiz	x10, x9, #2, #32
Lloh2:
	adrp	x11, l_switch.table.VGLMouseInit@PAGE
Lloh3:
	add	x11, x11, l_switch.table.VGLMouseInit@PAGEOFF
	add	x11, x11, x10
Lloh4:
	adrp	x12, l_switch.table.VGLMouseInit.2@PAGE
Lloh5:
	add	x12, x12, l_switch.table.VGLMouseInit.2@PAGEOFF
	add	x10, x12, x10
Lloh6:
	adrp	x22, _INTERIOR@GOTPAGE
Lloh7:
	ldr	x22, [x22, _INTERIOR@GOTPAGEOFF]
	cmp	w9, #3
	csel	x9, x10, x22, lo
Lloh8:
	adrp	x23, _BORDER@GOTPAGE
Lloh9:
	ldr	x23, [x23, _BORDER@GOTPAGEOFF]
	csel	x10, x11, x23, lo
	ldr	w10, [x10]
	ldr	w20, [x9]
	ldr	x8, [x8, #8]
Lloh10:
	adrp	x9, _M_BG640x480@GOTPAGE
Lloh11:
	ldr	x9, [x9, _M_BG640x480@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	w21, wzr, w10, eq
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_2
; %bb.1:
	mov	x1, #0
	mov	w2, #0
	bl	_strtoul
	mov	x21, x0
LBB0_2:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_4
; %bb.3:
	mov	x1, #0
	mov	w2, #0
	bl	_strtoul
	mov	x20, x0
LBB0_4:
Lloh17:
	adrp	x8, _VGLMouseLargeOrMask@GOTPAGE
Lloh18:
	ldr	x8, [x8, _VGLMouseLargeOrMask@GOTPAGEOFF]
	ldp	w9, w10, [x8]
	mul	w9, w10, w9
	cmp	w9, #1
	b.lt	LBB0_7
; %bb.5:
	mov	x9, #0
	ldr	x10, [x8, #8]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x11, x9, #2
	ldr	w12, [x10, x11]
	ldr	w13, [x23]
	ldr	w14, [x22]
	cmp	w12, w14
	csel	w14, w20, wzr, eq
	cmp	w12, w13
	csel	w12, w21, w14, eq
	str	w12, [x10, x11]
	add	x9, x9, #1
	ldpsw	x11, x12, [x8]
	mul	x11, x12, x11
	cmp	x9, x11
	b.lt	LBB0_6
LBB0_7:
Lloh19:
	adrp	x8, _VGLMouseSmallOrMask@GOTPAGE
Lloh20:
	ldr	x8, [x8, _VGLMouseSmallOrMask@GOTPAGEOFF]
	ldp	w9, w10, [x8]
	mul	w9, w10, w9
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.8:
	mov	x9, #0
	ldr	x10, [x8, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x11, x9, #2
	ldr	w12, [x10, x11]
	ldr	w13, [x23]
	ldr	w14, [x22]
	cmp	w12, w14
	csel	w14, w20, wzr, eq
	cmp	w12, w13
	csel	w12, w21, w14, eq
	str	w12, [x10, x11]
	add	x9, x9, #1
	ldpsw	x11, x12, [x8]
	mul	x11, x12, x11
	cmp	x9, x11
	b.lt	LBB0_9
LBB0_10:
	bl	_VGLMouseSetStdImage
Lloh21:
	adrp	x8, _MOUSE_MODE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MOUSE_MODE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x22, _SIGUSR2@GOTPAGE
Lloh25:
	ldr	x22, [x22, _SIGUSR2@GOTPAGEOFF]
	ldr	w9, [x22]
	stp	w9, w8, [sp, #20]
Lloh26:
	adrp	x21, _CONS_MOUSECTL@GOTPAGE
Lloh27:
	ldr	x21, [x21, _CONS_MOUSECTL@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #8
	mov	w0, #0
	bl	_ioctl
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	w0, [x22]
Lloh28:
	adrp	x8, _VGLMouseAction@GOTPAGE
Lloh29:
	ldr	x8, [x8, _VGLMouseAction@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	bl	_signal
Lloh31:
	adrp	x8, _MOUSE_GETINFO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MOUSE_GETINFO@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	w1, [x21]
	add	x2, sp, #8
	mov	w0, #0
	bl	_ioctl
	ldr	w8, [sp, #16]
Lloh34:
	adrp	x9, _VGLMouseXpos@GOTPAGE
Lloh35:
	ldr	x9, [x9, _VGLMouseXpos@GOTPAGEOFF]
Lloh36:
	str	w8, [x9]
Lloh37:
	adrp	x8, _VGLMouseYpos@GOTPAGE
Lloh38:
	ldr	x8, [x8, _VGLMouseYpos@GOTPAGEOFF]
	ldp	w10, w9, [sp, #8]
Lloh39:
	str	w9, [x8]
Lloh40:
	adrp	x8, _VGLMouseButtons@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VGLMouseButtons@GOTPAGEOFF]
Lloh42:
	str	w10, [x8]
	mov	x0, x19
	bl	_VGLMouseMode
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_VGLModeInfo,16,3               ; @VGLModeInfo
	.comm	_BORDER,4,2                     ; @BORDER
	.comm	_INTERIOR,4,2                   ; @INTERIOR
	.comm	_M_BG640x480,8,3                ; @M_BG640x480
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VGLMOUSEBORDERCOLOR"

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

	.comm	_VGLMouseLargeOrMask,16,3       ; @VGLMouseLargeOrMask
	.comm	_VGLMouseSmallOrMask,16,3       ; @VGLMouseSmallOrMask
	.comm	_MOUSE_MODE,4,2                 ; @MOUSE_MODE
	.comm	_SIGUSR2,4,2                    ; @SIGUSR2
	.comm	_CONS_MOUSECTL,4,2              ; @CONS_MOUSECTL
	.comm	_VGLMouseAction,4,2             ; @VGLMouseAction
	.comm	_MOUSE_GETINFO,4,2              ; @MOUSE_GETINFO
	.comm	_VGLMouseXpos,4,2               ; @VGLMouseXpos
	.comm	_VGLMouseYpos,4,2               ; @VGLMouseYpos
	.comm	_VGLMouseButtons,4,2            ; @VGLMouseButtons
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.VGLMouseInit
l_switch.table.VGLMouseInit:
	.long	63                              ; 0x3f
	.long	15                              ; 0xf
	.long	15                              ; 0xf

	.p2align	2                               ; @switch.table.VGLMouseInit.2
l_switch.table.VGLMouseInit.2:
	.long	36                              ; 0x24
	.long	4                               ; 0x4
	.long	4                               ; 0x4

.subsections_via_symbols
