	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setgamma
_setgamma:                              ## @setgamma
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$80, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	(%rdi), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.setgamma(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_gamma_def@GOTPCREL(%rip), %rax
LBB0_3:
	movq	8(%rdi), %rcx
	movl	(%rcx), %r9d
	movq	_GAMMA_DEF@GOTPCREL(%rip), %rdx
	subl	(%rdx), %r9d
	movq	(%rax), %r10
	leaq	-80(%rbp), %rdx
	subq	%r10, %rdx
	cmpq	$15, %rdx
	ja	LBB0_8
## %bb.4:
	movl	$1, %edx
	leaq	_setgamma.delta(%rip), %r8
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%r8,%rdx,4), %esi
	imull	%r9d, %esi
	leal	31(%rsi), %ecx
	testl	%esi, %esi
	cmovnsl	%esi, %ecx
	sarl	$5, %ecx
	addl	-4(%r10,%rdx,4), %ecx
	movl	(%r8,%rdx,4), %esi
	imull	%r9d, %esi
	leal	31(%rsi), %eax
	testl	%esi, %esi
	cmovnsl	%esi, %eax
	movl	%ecx, -84(%rbp,%rdx,4)
	sarl	$5, %eax
	addl	(%r10,%rdx,4), %eax
	movl	%eax, -80(%rbp,%rdx,4)
	addq	$2, %rdx
	cmpq	$69, %rdx
	jne	LBB0_5
LBB0_6:
	leaq	-80(%rbp), %rdx
	movl	$32, %esi
	movl	$68, %ecx
	callq	_reg_w
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-8(%rbp), %rax
	jne	LBB0_7
## %bb.11:
	addq	$80, %rsp
	popq	%rbp
	retq
LBB0_8:
	movd	%r9d, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	xorl	%ecx, %ecx
	leaq	_setgamma.delta(%rip), %rdx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	(%r10,%rcx,4), %xmm1
	movdqa	(%rdx,%rcx,4), %xmm2
	pmulld	%xmm0, %xmm2
	movdqa	%xmm2, %xmm3
	psrad	$31, %xmm3
	psrld	$27, %xmm3
	paddd	%xmm2, %xmm3
	psrad	$5, %xmm3
	paddd	%xmm1, %xmm3
	movdqa	%xmm3, -80(%rbp,%rcx,4)
	cmpq	$64, %rcx
	je	LBB0_6
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movdqu	16(%r10,%rcx,4), %xmm1
	movdqa	16(%rdx,%rcx,4), %xmm2
	pmulld	%xmm0, %xmm2
	movdqa	%xmm2, %xmm3
	psrad	$31, %xmm3
	psrld	$27, %xmm3
	paddd	%xmm2, %xmm3
	psrad	$5, %xmm3
	paddd	%xmm1, %xmm3
	movdqa	%xmm3, -64(%rbp,%rcx,4)
	addq	$8, %rcx
	jmp	LBB0_9
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @setgamma.delta
_setgamma.delta:
	.long	0                               ## 0x0
	.long	20                              ## 0x14
	.long	28                              ## 0x1c
	.long	28                              ## 0x1c
	.long	28                              ## 0x1c
	.long	28                              ## 0x1c
	.long	27                              ## 0x1b
	.long	26                              ## 0x1a
	.long	24                              ## 0x18
	.long	19                              ## 0x13
	.long	16                              ## 0x10
	.long	14                              ## 0xe
	.long	8                               ## 0x8
	.long	7                               ## 0x7
	.long	4                               ## 0x4
	.long	2                               ## 0x2
	.long	0                               ## 0x0

	.comm	_gamma_spec_0,8,3               ## @gamma_spec_0
	.comm	_gamma_spec_1,8,3               ## @gamma_spec_1
	.comm	_gamma_spec_2,8,3               ## @gamma_spec_2
	.comm	_gamma_spec_3,8,3               ## @gamma_spec_3
	.comm	_gamma_def,8,3                  ## @gamma_def
	.comm	_GAMMA_DEF,4,2                  ## @GAMMA_DEF
	.no_dead_strip	_setgamma
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.setgamma
l_switch.table.setgamma:
	.quad	_gamma_spec_3
	.quad	_gamma_spec_1
	.quad	_gamma_spec_1
	.quad	_gamma_spec_1
	.quad	_gamma_spec_2
	.quad	_gamma_spec_0

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setgamma
_setgamma:                              ; @setgamma
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-8]
	ldr	w8, [x0]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, l_switch.table.setgamma@PAGE
Lloh4:
	add	x9, x9, l_switch.table.setgamma@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_3
LBB0_2:
Lloh5:
	adrp	x8, _gamma_def@GOTPAGE
Lloh6:
	ldr	x8, [x8, _gamma_def@GOTPAGEOFF]
LBB0_3:
	ldr	x8, [x8]
	ldr	x9, [x0, #8]
Lloh7:
	adrp	x10, _GAMMA_DEF@GOTPAGE
Lloh8:
	ldr	x10, [x10, _GAMMA_DEF@GOTPAGEOFF]
	ldr	w9, [x9]
Lloh9:
	ldr	w10, [x10]
	sub	w10, w9, w10
	add	x9, sp, #4
	sub	x11, x9, x8
	cmp	x11, #15
	b.hi	LBB0_6
; %bb.4:
	mov	x11, #0
Lloh10:
	adrp	x12, _setgamma.delta@PAGE
Lloh11:
	add	x12, x12, _setgamma.delta@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x8, x11]
	ldr	w14, [x12, x11]
	mul	w14, w10, w14
	add	w15, w14, #31
	cmp	w14, #0
	csel	w14, w15, w14, lt
	add	w13, w13, w14, asr #5
	str	w13, [x9, x11]
	add	x11, x11, #4
	cmp	x11, #272
	b.ne	LBB0_5
	b	LBB0_8
LBB0_6:
	mov	x11, #0
	dup.4s	v0, w10
Lloh12:
	adrp	x10, _setgamma.delta@PAGE
Lloh13:
	add	x10, x10, _setgamma.delta@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	q1, [x8, x11]
	ldr	q2, [x10, x11]
	mul.4s	v2, v0, v2
	cmlt.4s	v3, v2, #0
	usra.4s	v2, v3, #27
	ssra.4s	v1, v2, #5
	str	q1, [x9, x11]
	add	x11, x11, #16
	cmp	x11, #272
	b.ne	LBB0_7
LBB0_8:
	add	x2, sp, #4
	mov	w1, #32
	mov	w3, #68
	bl	_reg_w
	ldur	x8, [x29, #-8]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @setgamma.delta
_setgamma.delta:
	.long	0                               ; 0x0
	.long	20                              ; 0x14
	.long	28                              ; 0x1c
	.long	28                              ; 0x1c
	.long	28                              ; 0x1c
	.long	28                              ; 0x1c
	.long	27                              ; 0x1b
	.long	26                              ; 0x1a
	.long	24                              ; 0x18
	.long	19                              ; 0x13
	.long	16                              ; 0x10
	.long	14                              ; 0xe
	.long	8                               ; 0x8
	.long	7                               ; 0x7
	.long	4                               ; 0x4
	.long	2                               ; 0x2
	.long	0                               ; 0x0

	.comm	_gamma_spec_0,8,3               ; @gamma_spec_0
	.comm	_gamma_spec_1,8,3               ; @gamma_spec_1
	.comm	_gamma_spec_2,8,3               ; @gamma_spec_2
	.comm	_gamma_spec_3,8,3               ; @gamma_spec_3
	.comm	_gamma_def,8,3                  ; @gamma_def
	.comm	_GAMMA_DEF,4,2                  ; @GAMMA_DEF
	.no_dead_strip	_setgamma
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.setgamma
l_switch.table.setgamma:
	.quad	_gamma_spec_3
	.quad	_gamma_spec_1
	.quad	_gamma_spec_1
	.quad	_gamma_spec_1
	.quad	_gamma_spec_2
	.quad	_gamma_spec_0

.subsections_via_symbols
