	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function WG_CheckHardwareGamma
LCPI0_0:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
LCPI0_1:
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
	.long	1024                            ## 0x400
LCPI0_2:
	.long	2048                            ## 0x800
	.long	2048                            ## 0x800
	.long	2048                            ## 0x800
	.long	2048                            ## 0x800
LCPI0_3:
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
	.long	3072                            ## 0xc00
LCPI0_4:
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_WG_CheckHardwareGamma
	.p2align	4, 0x90
_WG_CheckHardwareGamma:                 ## @WG_CheckHardwareGamma
	.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
	movq	_qfalse@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_glConfig@GOTPCREL(%rip), %r14
	movq	%rax, 8(%r14)
	movq	_qwglSetDeviceGammaRamp3DFX@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.18:
	movq	_qtrue@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	movl	%eax, %edi
	callq	_GetDC
	movl	%eax, %ebx
	movq	_s_oldHardwareGamma@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%ebx, %edi
	callq	_qwglGetDeviceGammaRamp3DFX
	movq	%rax, 8(%r14)
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	movl	%eax, %edi
	movl	%ebx, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ReleaseDC                      ## TAILCALL
LBB0_1:
	movq	(%r14), %rax
	movq	_GLDRV_STANDALONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.2:
	movq	_r_ignorehwgamma@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_3
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	movl	%eax, %edi
	callq	_GetDC
	movl	%eax, %r15d
	movq	_s_oldHardwareGamma@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movl	%eax, %edi
	callq	_GetDeviceGammaRamp
	movq	%rax, 8(%r14)
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	movl	%eax, %edi
	movl	%r15d, %esi
	callq	_ReleaseDC
	cmpq	$0, 8(%r14)
	je	LBB0_17
## %bb.4:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movl	1020(%rax), %edi
	callq	_HIBYTE
	movl	%eax, %r15d
	movq	(%r12), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_HIBYTE
	cmpl	%eax, %r15d
	jle	LBB0_7
## %bb.5:
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	1020(%rax), %edi
	callq	_HIBYTE
	movl	%eax, %r15d
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_HIBYTE
	cmpl	%eax, %r15d
	jle	LBB0_7
## %bb.6:
	movq	(%r12), %rax
	movq	16(%rax), %rax
	movl	1020(%rax), %edi
	callq	_HIBYTE
	movl	%eax, %r15d
	movq	(%r12), %rax
	movq	16(%rax), %rax
	movl	(%rax), %edi
	callq	_HIBYTE
	cmpl	%eax, %r15d
	jg	LBB0_8
LBB0_7:
	movq	(%rbx), %rax
	movq	%rax, 8(%r14)
	movq	_ri@GOTPCREL(%rip), %rax
	movq	_PRINT_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	callq	*(%rax)
LBB0_8:
	movq	(%r12), %rax
	movq	(%rax), %rax
	movl	724(%rax), %edi
	callq	_HIBYTE
	cmpl	$255, %eax
	jne	LBB0_17
## %bb.9:
	movq	_ri@GOTPCREL(%rip), %rax
	movq	_PRINT_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	*(%rax)
	movq	(%r12), %rdx
	movq	(%rdx), %rax
	movq	8(%rdx), %rcx
	movq	16(%rdx), %rdx
	movq	%rcx, %rdi
	subq	%rax, %rdi
	xorl	%esi, %esi
	cmpq	$32, %rdi
	jb	LBB0_15
## %bb.10:
	movq	%rdx, %rdi
	subq	%rax, %rdi
	cmpq	$32, %rdi
	jb	LBB0_15
## %bb.11:
	movq	%rdx, %rdi
	subq	%rcx, %rdi
	cmpq	$32, %rdi
	jb	LBB0_15
## %bb.12:
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,1,2,3]
	movl	$12, %esi
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [1024,1024,1024,1024]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [2048,2048,2048,2048]
	movdqa	LCPI0_3(%rip), %xmm3            ## xmm3 = [3072,3072,3072,3072]
	movdqa	LCPI0_4(%rip), %xmm4            ## xmm4 = [16,16,16,16]
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, %xmm5
	pslld	$8, %xmm5
	movdqa	%xmm5, %xmm6
	paddd	%xmm1, %xmm6
	movdqu	%xmm5, -48(%rax,%rsi,4)
	movdqu	%xmm6, -32(%rax,%rsi,4)
	movdqu	%xmm5, -48(%rcx,%rsi,4)
	movdqu	%xmm6, -32(%rcx,%rsi,4)
	movdqu	%xmm5, -48(%rdx,%rsi,4)
	movdqu	%xmm6, -32(%rdx,%rsi,4)
	cmpq	$252, %rsi
	je	LBB0_14
## %bb.19:                              ##   in Loop: Header=BB0_13 Depth=1
	movdqa	%xmm5, %xmm6
	paddd	%xmm2, %xmm6
	paddd	%xmm3, %xmm5
	movdqu	%xmm6, -16(%rax,%rsi,4)
	movdqu	%xmm5, (%rax,%rsi,4)
	movdqu	%xmm6, -16(%rcx,%rsi,4)
	movdqu	%xmm5, (%rcx,%rsi,4)
	movdqu	%xmm6, -16(%rdx,%rsi,4)
	movdqu	%xmm5, (%rdx,%rsi,4)
	paddd	%xmm4, %xmm0
	addq	$16, %rsi
	jmp	LBB0_13
LBB0_14:
	movl	$248, %esi
LBB0_15:
	movl	%esi, %edi
	shll	$8, %edi
	movl	%edi, (%rax,%rsi,4)
	movl	%edi, (%rcx,%rsi,4)
	movl	%edi, (%rdx,%rsi,4)
	addq	$-254, %rsi
	addl	$256, %edi                      ## imm = 0x100
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%edi, 1020(%rax,%rsi,4)
	movl	%edi, 1020(%rcx,%rsi,4)
	movl	%edi, 1020(%rdx,%rsi,4)
	leal	256(%rdi), %ebx
	movl	%ebx, 1024(%rax,%rsi,4)
	movl	%ebx, 1024(%rcx,%rsi,4)
	movl	%ebx, 1024(%rdx,%rsi,4)
	addl	$512, %edi                      ## imm = 0x200
	addq	$2, %rsi
	jne	LBB0_16
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_glConfig,16,3                  ## @glConfig
	.comm	_qwglSetDeviceGammaRamp3DFX,8,3 ## @qwglSetDeviceGammaRamp3DFX
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_s_oldHardwareGamma,8,3         ## @s_oldHardwareGamma
	.comm	_GLDRV_STANDALONE,8,3           ## @GLDRV_STANDALONE
	.comm	_r_ignorehwgamma,8,3            ## @r_ignorehwgamma
	.comm	_ri,8,3                         ## @ri
	.comm	_PRINT_WARNING,4,2              ## @PRINT_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WARNING: device has broken gamma support, generated gamma.dat\n"

L_.str.1:                               ## @.str.1
	.asciz	"WARNING: suspicious gamma tables, using linear ramp for restoration\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function WG_CheckHardwareGamma
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_WG_CheckHardwareGamma
	.p2align	2
_WG_CheckHardwareGamma:                 ; @WG_CheckHardwareGamma
	.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
Lloh0:
	adrp	x21, _qfalse@GOTPAGE
Lloh1:
	ldr	x21, [x21, _qfalse@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh2:
	adrp	x20, _glConfig@GOTPAGE
Lloh3:
	ldr	x20, [x20, _glConfig@GOTPAGEOFF]
	str	x8, [x20, #8]
Lloh4:
	adrp	x8, _qwglSetDeviceGammaRamp3DFX@GOTPAGE
Lloh5:
	ldr	x8, [x8, _qwglSetDeviceGammaRamp3DFX@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _qtrue@GOTPAGE
Lloh8:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	bl	_GetDesktopWindow
	bl	_GetDC
	mov	x19, x0
Lloh10:
	adrp	x8, _s_oldHardwareGamma@GOTPAGE
Lloh11:
	ldr	x8, [x8, _s_oldHardwareGamma@GOTPAGEOFF]
Lloh12:
	ldr	x1, [x8]
	bl	_qwglGetDeviceGammaRamp3DFX
	str	x0, [x20, #8]
	bl	_GetDesktopWindow
	mov	x1, x19
	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	_ReleaseDC
LBB0_2:
	ldr	x8, [x20]
Lloh13:
	adrp	x9, _GLDRV_STANDALONE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _GLDRV_STANDALONE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.3:
Lloh16:
	adrp	x8, _r_ignorehwgamma@GOTPAGE
Lloh17:
	ldr	x8, [x8, _r_ignorehwgamma@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w8, [x8]
	cbz	w8, LBB0_5
LBB0_4:
	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_5:
	bl	_GetDesktopWindow
	bl	_GetDC
	mov	x19, x0
Lloh19:
	adrp	x22, _s_oldHardwareGamma@GOTPAGE
Lloh20:
	ldr	x22, [x22, _s_oldHardwareGamma@GOTPAGEOFF]
	ldr	x1, [x22]
	bl	_GetDeviceGammaRamp
	str	x0, [x20, #8]
	bl	_GetDesktopWindow
	mov	x1, x19
	bl	_ReleaseDC
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_4
; %bb.6:
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	w0, [x8, #1020]
	bl	_HIBYTE
	mov	x19, x0
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_HIBYTE
Lloh21:
	adrp	x23, _ri@GOTPAGE
Lloh22:
	ldr	x23, [x23, _ri@GOTPAGEOFF]
Lloh23:
	adrp	x24, _PRINT_WARNING@GOTPAGE
Lloh24:
	ldr	x24, [x24, _PRINT_WARNING@GOTPAGEOFF]
	cmp	w19, w0
	b.le	LBB0_9
; %bb.7:
	ldr	x8, [x22]
	ldr	x8, [x8, #8]
	ldr	w0, [x8, #1020]
	bl	_HIBYTE
	mov	x19, x0
	ldr	x8, [x22]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_HIBYTE
	cmp	w19, w0
	b.le	LBB0_9
; %bb.8:
	ldr	x8, [x22]
	ldr	x8, [x8, #16]
	ldr	w0, [x8, #1020]
	bl	_HIBYTE
	mov	x19, x0
	ldr	x8, [x22]
	ldr	x8, [x8, #16]
	ldr	w0, [x8]
	bl	_HIBYTE
	cmp	w19, w0
	b.gt	LBB0_10
LBB0_9:
	ldr	x8, [x21]
	str	x8, [x20, #8]
	ldr	x8, [x23]
	ldr	w0, [x24]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	blr	x8
LBB0_10:
	ldr	x8, [x22]
	ldr	x8, [x8]
	ldr	w0, [x8, #724]
	bl	_HIBYTE
	cmp	w0, #255
	b.ne	LBB0_4
; %bb.11:
	ldr	x8, [x23]
	ldr	w0, [x24]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	blr	x8
	mov	x11, #0
	ldr	x10, [x22]
	ldp	x8, x9, [x10]
	ldr	x10, [x10, #16]
	sub	x12, x9, x8
	cmp	x12, #64
	b.lo	LBB0_16
; %bb.12:
	sub	x12, x10, x8
	cmp	x12, #64
	b.lo	LBB0_16
; %bb.13:
	sub	x12, x10, x9
	cmp	x12, #64
	b.lo	LBB0_16
; %bb.14:
	mov	x12, #0
Lloh29:
	adrp	x11, lCPI0_0@PAGE
Lloh30:
	ldr	q0, [x11, lCPI0_0@PAGEOFF]
	add	x13, x8, #32
	movi.4s	v1, #4, lsl #8
	movi.4s	v2, #8, lsl #8
	movi.4s	v3, #12, lsl #8
	movi.4s	v4, #16
	mov	w11, #240
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	shl.4s	v5, v0, #8
	add.4s	v6, v5, v1
	add	x14, x13, x12
	stp	q5, q6, [x14, #-32]
	add.4s	v7, v5, v2
	add.4s	v16, v5, v3
	stp	q7, q16, [x14]
	add	x14, x9, x12
	stp	q5, q6, [x14]
	stp	q7, q16, [x14, #32]
	add	x14, x10, x12
	stp	q5, q6, [x14]
	add.4s	v0, v0, v4
	add	x12, x12, #64
	stp	q7, q16, [x14, #32]
	cmp	x12, #960
	b.ne	LBB0_15
LBB0_16:
	lsl	w12, w11, #8
	lsl	x11, x11, #2
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	str	w12, [x8, x11]
	str	w12, [x9, x11]
	str	w12, [x10, x11]
	add	w12, w12, #256
	add	x11, x11, #4
	cmp	x11, #1020
	b.ne	LBB0_17
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdr	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_glConfig,16,3                  ; @glConfig
	.comm	_qwglSetDeviceGammaRamp3DFX,8,3 ; @qwglSetDeviceGammaRamp3DFX
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_s_oldHardwareGamma,8,3         ; @s_oldHardwareGamma
	.comm	_GLDRV_STANDALONE,8,3           ; @GLDRV_STANDALONE
	.comm	_r_ignorehwgamma,8,3            ; @r_ignorehwgamma
	.comm	_ri,8,3                         ; @ri
	.comm	_PRINT_WARNING,4,2              ; @PRINT_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WARNING: device has broken gamma support, generated gamma.dat\n"

l_.str.1:                               ; @.str.1
	.asciz	"WARNING: suspicious gamma tables, using linear ramp for restoration\n"

.subsections_via_symbols
