// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/dialogs/colordlg.cpp
// Function: smooth::GUI::Dialogs::ColorSelection::ColorDlgUpdatePickers()
void S::GUI::Dialogs::ColorSelection::ColorDlgUpdatePickers()
{
	Surface	*surface    = dlgwnd->GetDrawSurface();
	Int	 hssize	    = Math::Round(205.0 * surface->GetSurfaceDPI() / 96.0);
	Int	 huexoffset = hssize + Math::Round(14.0 * surface->GetSurfaceDPI() / 96.0);

	if (((lasthue != acthue) || forcehupdate) && !preventhupdate)
	{
		/* Update hue picker.
		 */
		if (lasthue != -1)
		{
			Point	 p1(huexoffset							     + 1, yoffset + 1 + (Int) ((255.0 - lasthue) / (256.0 / hssize)));
			Point	 p2(huexoffset + Math::Round(16.0 * surface->GetSurfaceDPI() / 96.0) + 1, yoffset + 1 + (Int) ((255.0 - lasthue) / (256.0 / hssize)));

			surface->Line(p1, p2, Color(lasthue, 255, 255, Color::HSV).ConvertTo(Color::RGB));
		}

		Color	 ahrgb = Color(acthue, 255, 255, Color::HSV).ConvertTo(Color::RGB);

		for (Int x = huexoffset + 1; x < (huexoffset + Math::Round(16.0 * surface->GetSurfaceDPI() / 96.0) + 1); x++)
		{
			surface->SetPixel(Point(x, yoffset + 1 + (Int) ((255.0 - acthue) / (256.0 / hssize))), Color(255 - ahrgb.GetRed(), 255 - ahrgb.GetGreen(), 255 - ahrgb.GetBlue()));
		}

		lasthue = acthue;
	}

	if (((lastval != actval) || (lastsat != actsat) || forcevsupdate) && !preventvsupdate)
	{
		/* Update val/sat picker.
		 */
		surface->StartPaint(Rect(Point(xoffset + 1, yoffset + 1), Size(hssize, hssize)));

		if ((lastval != -1) && (lastsat != -1))
		{
			for (Int x = 0; x < hssize; x++)
			{
				Color	 rgb = Color(acthue, lastsat, (Int) (x * (256.0 / hssize)), Color::HSV).ConvertTo(Color::RGB);

				surface->SetPixel(Point(x + xoffset + 1, yoffset + 1 + (Int) ((255.0 - lastsat) / (256.0 / hssize))), rgb);
			}

			for (Int y = 0; y < hssize; y++)
			{
				Color	 rgb = Color(acthue, (Int) (255.0 - (y * (256.0 / hssize))), lastval, Color::HSV).ConvertTo(Color::RGB);

				surface->SetPixel(Point(xoffset + 1 + (Int) (lastval / (256.0 / hssize)), y + yoffset + 1), rgb);
			}
		}

		for (Int x = 0; x < hssize; x++)
		{
			Color	 rgb = Color(acthue, actsat, (Int) (x * (256.0 / hssize)), Color::HSV).ConvertTo(Color::RGB);

			surface->SetPixel(Point(x + xoffset + 1, yoffset + 1 + (Int) ((255.0 - actsat) / (256.0 / hssize))), Color(255 - Color(rgb).GetRed(), 255 - Color(rgb).GetGreen(), 255 - Color(rgb).GetBlue()));
		}

		for (Int y = 0; y < hssize; y++)
		{
			Color	 rgb = Color(acthue, (Int) (255.0 - (y * (256.0 / hssize))), actval, Color::HSV).ConvertTo(Color::RGB);

			surface->SetPixel(Point(xoffset + 1 + (Int) (actval / (256.0 / hssize)), y + yoffset + 1), Color(255 - Color(rgb).GetRed(), 255 - Color(rgb).GetGreen(), 255 - Color(rgb).GetBlue()));
		}

		surface->EndPaint();

		lastval = actval;
		lastsat = actsat;
	}

	ncarea->SetColor(Color(acthue, actsat, actval, Color::HSV).ConvertTo(Color::RGB));

	forcehupdate	= False;
	preventhupdate	= False;
	forcevsupdate	= False;
	preventvsupdate	= False;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x40648(%rdi), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, %r14
movq %rax, %rdi
callq 0x58930
movl %eax, %ebp
movq %r14, %rdi
callq 0x58930
pxor %xmm0, %xmm0
pinsrw $0x1, %eax, %xmm0
pinsrw $0x3, %ebp, %xmm0
psrad $0x10, %xmm0
cvtdq2pd %xmm0, %xmm0
mulpd 0x8b14e(%rip), %xmm0    # 0xf3820
divpd 0x8ae46(%rip), %xmm0    # 0xf3520
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movmskpd %xmm2, %eax
movsd 0x8ac9d(%rip), %xmm1    # 0xf3390
movsd 0x8ac9d(%rip), %xmm2    # 0xf3398
movapd %xmm1, %xmm3
testb $0x2, %al
jne 0x68707
movapd %xmm2, %xmm3
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %r8
testb $0x1, %al
jne 0x68720
movapd %xmm2, %xmm1
movl 0x608(%rbx), %eax
movl 0x614(%rbx), %ecx
cmpl %ecx, %eax
movq %r8, 0x28(%rsp)
jne 0x68742
cmpb $0x1, 0x602(%rbx)
jne 0x689c6
cmpb $0x0, 0x604(%rbx)
je 0x68752
movl %ecx, %eax
jmp 0x689c6
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rbp
addq %r8, %rbp
cmpl $-0x1, %eax
je 0x68871
leal 0x1(%rbp), %ecx
movl 0x5fc(%rbx), %edx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x8abe9(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
movsd 0x8b03d(%rip), %xmm2    # 0xf37d0
divsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %eax
leal 0x1(%rax,%rdx), %eax
leaq 0x20(%rsp), %r15
movl %ecx, (%r15)
movl %eax, 0x4(%r15)
movq %r14, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8b00b(%rip), %xmm0    # 0xf37d8
divsd 0x8aee3(%rip), %xmm0    # 0xf36b8
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x8b007(%rip), %rcx     # 0xf37f0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
leal 0x1(%rbp,%rax), %eax
movl 0x5fc(%rbx), %ecx
movslq 0x608(%rbx), %rdx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x8ab55(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %esi
leal 0x1(%rcx,%rsi), %ecx
leaq 0x40(%rsp), %r12
movl %eax, (%r12)
movl %ecx, 0x4(%r12)
orq $0xffff00, %rdx         # imm = 0xFFFF00
leaq 0x10(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %r13
movq %r13, %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x58300
movl 0x614(%rbx), %ecx
jmp 0x6888b
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
movsd 0x8af4f(%rip), %xmm1    # 0xf37d0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
orl $0xffff00, %ecx         # imm = 0xFFFF00
movslq %ecx, %rax
leaq 0x10(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8af11(%rip), %xmm0    # 0xf37d8
divsd 0x8ade9(%rip), %xmm0    # 0xf36b8
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x8af0d(%rip), %r12     # 0xf37f0
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
testq %rax, %rax
movsd 0x8(%rsp), %xmm2
jle 0x689b5
movslq %ebp, %r15
incl %ebp
movq %r15, %r13
movsd %xmm2, 0x8(%rsp)
incq %r13
movl 0x5fc(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x614(%rbx), %xmm0
movsd 0x8aa41(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
leal 0x1(%rax,%rcx), %eax
movl %ebp, 0x20(%rsp)
movl %eax, 0x24(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x55120
movq %r14, %rdi
callq 0x58930
movsd 0x8(%rsp), %xmm2
xorpd %xmm1, %xmm1
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8ae4d(%rip), %xmm0    # 0xf37d8
divsd 0x8ad25(%rip), %xmm0    # 0xf36b8
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
addq %r15, %rax
incl %ebp
cmpq %r13, %rax
jg 0x6890b
movl 0x614(%rbx), %eax
movl %eax, 0x608(%rbx)
movq 0x28(%rsp), %r8
movl 0x610(%rbx), %esi
movl 0x61c(%rbx), %ecx
cmpl %ecx, %esi
jne 0x689f1
movl 0x60c(%rbx), %edx
cmpl 0x618(%rbx), %edx
jne 0x689f1
cmpb $0x1, 0x603(%rbx)
jne 0x68e49
cmpb $0x1, 0x605(%rbx)
jne 0x68a05
movl 0x618(%rbx), %edx
jmp 0x68e4b
movl 0x5f8(%rbx), %eax
movl 0x5fc(%rbx), %ecx
leal 0x1(%rax), %edx
leal 0x1(%rcx), %edi
leaq 0x30(%rsp), %rsi
movl %edx, (%rsi)
movl %edi, 0x4(%rsi)
leal 0x1(%rax,%r8), %eax
movl %eax, 0x8(%rsi)
leal (%rcx,%r8), %eax
incl %eax
movl %eax, 0xc(%rsi)
movq %r14, %rdi
callq 0x55160
cmpl $-0x1, 0x610(%rbx)
je 0x68c1b
cmpl $-0x1, 0x60c(%rbx)
je 0x68c1b
movq 0x28(%rsp), %r13
testl %r13d, %r13d
jle 0x68e21
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd 0x8ad5e(%rip), %xmm1    # 0xf37d0
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
negl %r13d
xorpd %xmm1, %xmm1
movsd %xmm1, (%rsp)
movl $0x1, %ebp
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
movsd %xmm0, 0x8(%rsp)
movl 0x60c(%rbx), %eax
movsd 0x8(%rsp), %xmm0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %ecx
orl %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x18(%rsp)
movl $0x2, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
movsd (%rsp), %xmm0
addsd 0x8a8a0(%rip), %xmm0    # 0xf3388
movsd %xmm0, (%rsp)
movl 0x5f8(%rbx), %eax
addl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x60c(%rbx), %xmm0
movsd 0x8a860(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %ecx
movl 0x5fc(%rbx), %edx
leal 0x1(%rdx,%rcx), %ecx
movl %eax, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x55120
leal 0x1(%r13,%rbp), %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x68a9b
cmpl $0x0, 0x28(%rsp)
jle 0x68e21
xorpd %xmm3, %xmm3
movsd %xmm3, (%rsp)
movl $0x1, %ebp
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
movsd (%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
movsd 0x8a7e8(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl 0x610(%rbx), %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %eax
orl %ecx, %eax
cltq
movq %rax, 0x18(%rsp)
movl $0x2, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
movl 0x5f8(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x610(%rbx), %xmm0
divsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
leal 0x1(%rax,%rcx), %eax
movsd (%rsp), %xmm0
addsd 0x8a7a4(%rip), %xmm0    # 0xf3388
movsd %xmm0, (%rsp)
movl 0x5fc(%rbx), %ecx
addl %ebp, %ecx
movl %eax, 0x10(%rsp)
movl %ecx, 0x14(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x55120
leal 0x1(%r13,%rbp), %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x68b6d
movq 0x28(%rsp), %rbp
testl %ebp, %ebp
jle 0x68e21
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x8ab99(%rip), %xmm1    # 0xf37d0
divsd %xmm0, %xmm1
negl %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movl $0x1, %r15d
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r13
movsd %xmm1, 0x8(%rsp)
movl 0x618(%rbx), %eax
movapd %xmm1, %xmm0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %ecx
orl %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x18(%rsp)
movl $0x2, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
movsd (%rsp), %xmm0
addsd 0x8a6df(%rip), %xmm0    # 0xf3388
movsd %xmm0, (%rsp)
movl 0x5f8(%rbx), %eax
addl %r15d, %eax
movl 0x5fc(%rbx), %ecx
xorps %xmm0, %xmm0
cvtsi2sdl 0x618(%rbx), %xmm0
movsd 0x8a698(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %edx
leal 0x1(%rcx,%rdx), %ecx
movl %eax, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x55120
movsd 0x8(%rsp), %xmm1
leal (%r15,%rbp), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $0x1, %eax
jne 0x68c5c
cmpl $0x0, 0x28(%rsp)
jle 0x68e21
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movl $0x1, %r15d
leaq 0x10(%rsp), %r12
leaq 0x20(%rsp), %r13
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x8a606(%rip), %xmm1    # 0xf3368
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movl 0x61c(%rbx), %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %eax
orl %ecx, %eax
cltq
movq %rax, 0x18(%rsp)
movl $0x2, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
xorps %xmm0, %xmm0
cvtsi2sdl 0x61c(%rbx), %xmm0
divsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movl 0x5f8(%rbx), %ecx
leal 0x1(%rcx,%rax), %eax
movsd (%rsp), %xmm0
addsd 0x8a5c0(%rip), %xmm0    # 0xf3388
movsd %xmm0, (%rsp)
movl 0x5fc(%rbx), %ecx
addl %r15d, %ecx
movl %eax, 0x20(%rsp)
movl %ecx, 0x24(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x55120
movsd 0x8(%rsp), %xmm1
leal (%r15,%rbp), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $0x1, %eax
jne 0x68d51
movq %r14, %rdi
callq 0x58780
movl 0x61c(%rbx), %ecx
movl %ecx, 0x610(%rbx)
movl 0x614(%rbx), %eax
movl 0x618(%rbx), %edx
movl %edx, 0x60c(%rbx)
jmp 0x68e4b
movl %esi, %ecx
movq 0x40670(%rbx), %r14
shll $0x10, %ecx
shll $0x8, %edx
orl %eax, %edx
orl %ecx, %edx
movslq %edx, %rax
leaq 0x10(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
movq %r15, %rsi
callq 0x57de0
movl $0x0, 0x602(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop