	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calc_color_correction
_calc_color_correction:                 ## @calc_color_correction
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	leaq	16(%rbp), %r15
	movaps	16(%rbp), %xmm0
	movaps	32(%rbp), %xmm1
	movaps	48(%rbp), %xmm2
	movaps	64(%rbp), %xmm3
	movups	%xmm3, 48(%rsp)
	movups	%xmm2, 32(%rsp)
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_is_complex_fixup
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movups	(%r15), %xmm0
	movups	16(%r15), %xmm1
	movups	32(%r15), %xmm2
	movups	48(%r15), %xmm3
	movups	%xmm3, 48(%rsp)
	movups	%xmm2, 32(%rsp)
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_get_complex_fixup
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_FIXME
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	movq	_CHANNEL_SOURCE_X@GOTPCREL(%rip), %rax
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	xorl	%r8d, %r8d
	cmpq	(%rax), %rcx
	movq	_WINED3DSP_WRITEMASK_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	%r9d, %eax
	cmovel	%r8d, %eax
	movq	_CHANNEL_SOURCE_Y@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	movq	_WINED3DSP_WRITEMASK_1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %edx
	cmovel	%r8d, %edx
	orl	%eax, %edx
	movq	16(%r15), %rax
	movq	_CHANNEL_SOURCE_Z@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	_WINED3DSP_WRITEMASK_2@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %ecx
	cmovel	%r8d, %ecx
	movq	24(%r15), %rax
	movq	_CHANNEL_SOURCE_W@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rax
	movq	_WINED3DSP_WRITEMASK_3@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	cmovel	%r8d, %edi
	orl	%ecx, %edi
	orl	%edx, %edi
	andl	%r14d, %edi
	cmpq	$0, 56(%r15)
	cmovel	%r8d, %r9d
	cmpq	$0, 48(%r15)
	cmovel	%r8d, %esi
	orl	%r9d, %esi
	cmpq	$0, 40(%r15)
	cmovel	%r8d, %ebx
	cmpq	$0, 32(%r15)
	cmovel	%r8d, %eax
	orl	%ebx, %eax
	orl	%esi, %eax
	andl	%r14d, %eax
	shlq	$32, %rdi
	orq	%rdi, %rax
LBB0_3:
	xorl	%edx, %edx
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Complex fixup (%#x) not supported\n"

	.comm	_CHANNEL_SOURCE_X,8,3           ## @CHANNEL_SOURCE_X
	.comm	_WINED3DSP_WRITEMASK_0,4,2      ## @WINED3DSP_WRITEMASK_0
	.comm	_CHANNEL_SOURCE_Y,8,3           ## @CHANNEL_SOURCE_Y
	.comm	_WINED3DSP_WRITEMASK_1,4,2      ## @WINED3DSP_WRITEMASK_1
	.comm	_CHANNEL_SOURCE_Z,8,3           ## @CHANNEL_SOURCE_Z
	.comm	_WINED3DSP_WRITEMASK_2,4,2      ## @WINED3DSP_WRITEMASK_2
	.comm	_CHANNEL_SOURCE_W,8,3           ## @CHANNEL_SOURCE_W
	.comm	_WINED3DSP_WRITEMASK_3,4,2      ## @WINED3DSP_WRITEMASK_3
	.no_dead_strip	_calc_color_correction
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calc_color_correction
_calc_color_correction:                 ; @calc_color_correction
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x19, x0
	ldp	q0, q1, [x0]
	stp	q0, q1, [sp]
	ldp	q0, q1, [x0, #32]
	stp	q0, q1, [sp, #32]
	mov	x0, sp
	bl	_is_complex_fixup
	cbz	x0, LBB0_2
; %bb.1:
	ldp	q0, q1, [x19]
	stp	q0, q1, [sp]
	ldp	q0, q1, [x19, #32]
	stp	q0, q1, [sp, #32]
	mov	x0, sp
	bl	_get_complex_fixup
	mov	x1, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
	mov	x0, #0
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x8, _CHANNEL_SOURCE_X@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CHANNEL_SOURCE_X@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _WINED3DSP_WRITEMASK_0@GOTPAGE
Lloh6:
	ldr	x9, [x9, _WINED3DSP_WRITEMASK_0@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldp	x10, x11, [x19]
	cmp	x10, x8
	csel	w8, wzr, w9, eq
Lloh8:
	adrp	x10, _CHANNEL_SOURCE_Y@GOTPAGE
Lloh9:
	ldr	x10, [x10, _CHANNEL_SOURCE_Y@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
Lloh11:
	adrp	x12, _WINED3DSP_WRITEMASK_1@GOTPAGE
Lloh12:
	ldr	x12, [x12, _WINED3DSP_WRITEMASK_1@GOTPAGEOFF]
Lloh13:
	ldr	w12, [x12]
	cmp	x11, x10
	csel	w10, wzr, w12, eq
	orr	w8, w10, w8
Lloh14:
	adrp	x10, _CHANNEL_SOURCE_Z@GOTPAGE
Lloh15:
	ldr	x10, [x10, _CHANNEL_SOURCE_Z@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
Lloh17:
	adrp	x11, _WINED3DSP_WRITEMASK_2@GOTPAGE
Lloh18:
	ldr	x11, [x11, _WINED3DSP_WRITEMASK_2@GOTPAGEOFF]
Lloh19:
	ldr	w11, [x11]
	ldp	x13, x14, [x19, #16]
	cmp	x13, x10
	csel	w10, wzr, w11, eq
	orr	w8, w8, w10
Lloh20:
	adrp	x10, _CHANNEL_SOURCE_W@GOTPAGE
Lloh21:
	ldr	x10, [x10, _CHANNEL_SOURCE_W@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
Lloh23:
	adrp	x13, _WINED3DSP_WRITEMASK_3@GOTPAGE
Lloh24:
	ldr	x13, [x13, _WINED3DSP_WRITEMASK_3@GOTPAGEOFF]
Lloh25:
	ldr	w13, [x13]
	cmp	x14, x10
	csel	w10, wzr, w13, eq
	orr	w8, w8, w10
	and	w8, w8, w20
	ldp	x14, x10, [x19, #48]
	cmp	x10, #0
	csel	w9, wzr, w9, eq
	cmp	x14, #0
	csel	w10, wzr, w12, eq
	orr	w9, w10, w9
	ldp	x12, x10, [x19, #32]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
	cmp	x12, #0
	csel	w10, wzr, w13, eq
	orr	w9, w9, w10
	and	w0, w9, w20
	bfi	x0, x8, #32, #32
LBB0_3:
	mov	x1, #0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Complex fixup (%#x) not supported\n"

	.comm	_CHANNEL_SOURCE_X,8,3           ; @CHANNEL_SOURCE_X
	.comm	_WINED3DSP_WRITEMASK_0,4,2      ; @WINED3DSP_WRITEMASK_0
	.comm	_CHANNEL_SOURCE_Y,8,3           ; @CHANNEL_SOURCE_Y
	.comm	_WINED3DSP_WRITEMASK_1,4,2      ; @WINED3DSP_WRITEMASK_1
	.comm	_CHANNEL_SOURCE_Z,8,3           ; @CHANNEL_SOURCE_Z
	.comm	_WINED3DSP_WRITEMASK_2,4,2      ; @WINED3DSP_WRITEMASK_2
	.comm	_CHANNEL_SOURCE_W,8,3           ; @CHANNEL_SOURCE_W
	.comm	_WINED3DSP_WRITEMASK_3,4,2      ; @WINED3DSP_WRITEMASK_3
	.no_dead_strip	_calc_color_correction
.subsections_via_symbols
