// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %rdi, %rbx
movq 0x40648(%rdi), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, %r14
movq %rax, %rdi
callq 0x58930
cwtl
cvtsi2sd %eax, %xmm0
mulsd 0x8c064(%rip), %xmm0    # 0xf4760
divsd 0x8bdec(%rip), %xmm0    # 0xf44f0
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm1
cmpltsd %xmm2, %xmm1
movsd 0x8bc77(%rip), %xmm3    # 0xf4390
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movsd 0x8bc6f(%rip), %xmm3    # 0xf4398
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rbp
movq %r14, %rdi
callq 0x58930
movl 0x608(%rbx), %ecx
cmpl 0x614(%rbx), %ecx
jne 0x6875d
cmpb $0x1, 0x602(%rbx)
jne 0x68a19
cmpb $0x0, 0x604(%rbx)
jne 0x68a19
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8bfee(%rip), %xmm0    # 0xf4768
divsd 0x8bd6e(%rip), %xmm0    # 0xf44f0
movapd %xmm0, %xmm1
cmpltsd 0x8bff9(%rip), %xmm1    # 0xf4788
movsd 0x8bbf9(%rip), %xmm2    # 0xf4390
andpd %xmm1, %xmm2
movsd 0x8bbf5(%rip), %xmm3    # 0xf4398
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %r13
addq %rbp, %r13
cmpl $-0x1, %ecx
je 0x688c3
leal 0x1(%r13), %eax
movl 0x5fc(%rbx), %edx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x8bb8f(%rip), %xmm1    # 0xf4368
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x8bf84(%rip), %xmm2    # 0xf4770
divsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
divsd %xmm2, %xmm1
cvttsd2si %xmm1, %ecx
leal 0x1(%rcx,%rdx), %ecx
leaq 0x28(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq %r14, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8bf54(%rip), %xmm0    # 0xf4778
divsd 0x8bcc4(%rip), %xmm0    # 0xf44f0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x8bf50(%rip), %rcx     # 0xf4790
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
leal 0x1(%r13,%rax), %eax
movl 0x5fc(%rbx), %ecx
movslq 0x608(%rbx), %rdx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x8bafd(%rip), %xmm1    # 0xf4368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %esi
leal 0x1(%rcx,%rsi), %ecx
leaq 0x50(%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 0x38(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x58300
movq %rbp, 0x20(%rsp)
movslq 0x614(%rbx), %rax
orq $0xffff00, %rax         # imm = 0xFFFF00
leaq 0x10(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x38(%rsp), %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8be70(%rip), %xmm0    # 0xf4778
divsd 0x8bbe0(%rip), %xmm0    # 0xf44f0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x8be6c(%rip), %r12     # 0xf4790
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
testq %rax, %rax
jle 0x68a08
movslq %r13d, %r15
xorps %xmm0, %xmm0
cvtsi2sdl 0x20(%rsp), %xmm0
movsd 0x8be24(%rip), %xmm1    # 0xf4770
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
incl %r13d
movq %r15, %rbp
incq %rbp
movl 0x5fc(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x614(%rbx), %xmm0
movsd 0x8b9f0(%rip), %xmm1    # 0xf4368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %ecx
leal 0x1(%rax,%rcx), %eax
movl %r13d, 0x28(%rsp)
movl %eax, 0x2c(%rsp)
movl 0x40(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x55120
movq %r14, %rdi
callq 0x58930
movsd 0x8bb23(%rip), %xmm2    # 0xf44f0
xorpd %xmm1, %xmm1
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x8bd97(%rip), %xmm0    # 0xf4778
divsd %xmm2, %xmm0
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
addsd (%r12,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
addq %r15, %rax
incl %r13d
cmpq %rbp, %rax
jg 0x6895c
movl 0x614(%rbx), %eax
movl %eax, 0x608(%rbx)
movq 0x20(%rsp), %rbp
movl 0x610(%rbx), %eax
cmpl 0x61c(%rbx), %eax
jne 0x68a42
movl 0x60c(%rbx), %eax
cmpl 0x618(%rbx), %eax
jne 0x68a42
cmpb $0x1, 0x603(%rbx)
jne 0x68ea5
cmpb $0x0, 0x605(%rbx)
jne 0x68ea5
movl 0x5f8(%rbx), %eax
movl 0x5fc(%rbx), %ecx
leal 0x1(%rax), %edx
leal 0x1(%rcx), %edi
leaq 0x38(%rsp), %rsi
movl %edx, (%rsi)
movl %edi, 0x4(%rsi)
leal 0x1(%rax,%rbp), %eax
movl %eax, 0x8(%rsi)
leal (%rcx,%rbp), %eax
incl %eax
movl %eax, 0xc(%rsi)
movq %r14, %rdi
callq 0x55160
cmpl $-0x1, 0x610(%rbx)
movq %rbp, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x48(%rsp)
je 0x68c83
cmpl $-0x1, 0x60c(%rbx)
je 0x68c83
cmpl $0x0, 0x20(%rsp)
jle 0x68b98
movsd 0x8bcaf(%rip), %xmm0    # 0xf4770
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %r13
negl %r13d
xorpd %xmm1, %xmm1
movl $0x1, %ebp
leaq 0x38(%rsp), %r15
leaq 0x10(%rsp), %r12
movsd %xmm1, 0x30(%rsp)
movl 0x60c(%rbx), %eax
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %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
movl 0x5f8(%rbx), %eax
addl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x60c(%rbx), %xmm0
movsd 0x8b820(%rip), %xmm1    # 0xf4368
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
movsd 0x30(%rsp), %xmm1
addsd 0x8b804(%rip), %xmm1    # 0xf4388
leal 0x1(%r13,%rbp), %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x68ae8
cmpl $0x0, 0x20(%rsp)
jle 0x68c83
movsd 0x8bbc5(%rip), %xmm0    # 0xf4770
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x20(%rsp), %r13
negl %r13d
xorpd %xmm0, %xmm0
movl $0x1, %ebp
leaq 0x38(%rsp), %r15
leaq 0x10(%rsp), %r12
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd 0x8b77c(%rip), %xmm1    # 0xf4368
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 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
addl %ecx, %eax
incl %eax
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
movsd 0x8(%rsp), %xmm0
addsd 0x8b719(%rip), %xmm0    # 0xf4388
leal 0x1(%r13,%rbp), %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x68bd2
cmpl $0x0, 0x20(%rsp)
jle 0x68d8b
movsd 0x8bada(%rip), %xmm0    # 0xf4770
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rbp
negl %ebp
xorpd %xmm1, %xmm1
movl $0x1, %r15d
leaq 0x10(%rsp), %r12
leaq 0x28(%rsp), %r13
movsd %xmm1, 0x30(%rsp)
movl 0x618(%rbx), %eax
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %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 0x38(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
movl 0x5f8(%rbx), %eax
addl %r15d, %eax
movl 0x5fc(%rbx), %ecx
xorps %xmm0, %xmm0
cvtsi2sdl 0x618(%rbx), %xmm0
movsd 0x8b642(%rip), %xmm1    # 0xf4368
subsd %xmm0, %xmm1
divsd 0x8(%rsp), %xmm1
cvttsd2si %xmm1, %edx
leal 0x1(%rcx,%rdx), %ecx
movl %eax, 0x28(%rsp)
movl %ecx, 0x2c(%rsp)
movl 0x40(%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 0x30(%rsp), %xmm1
addsd 0x8b614(%rip), %xmm1    # 0xf4388
leal (%r15,%rbp), %eax
incl %eax
movl %r15d, %ecx
incl %ecx
movl %ecx, %r15d
cmpl $0x1, %eax
jne 0x68cbd
movq 0x20(%rsp), %r15
testl %r15d, %r15d
jle 0x68e8f
movsd 0x8b9cf(%rip), %xmm0    # 0xf4770
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
negl %r15d
xorpd %xmm0, %xmm0
movl $0x1, %ebp
leaq 0x10(%rsp), %r12
leaq 0x28(%rsp), %r13
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x30(%rsp), %xmm0
movsd 0x8b58b(%rip), %xmm1    # 0xf4368
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 0x38(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x57d10
movl 0x5f8(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sdl 0x61c(%rbx), %xmm0
divsd 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
addl %ecx, %eax
incl %eax
movl 0x5fc(%rbx), %ecx
addl %ebp, %ecx
movl %eax, 0x28(%rsp)
movl %ecx, 0x2c(%rsp)
movl 0x40(%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), %xmm0
addsd 0x8b50e(%rip), %xmm0    # 0xf4388
leal (%r15,%rbp), %eax
incl %eax
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
cmpl $0x1, %eax
jne 0x68dc3
movq %r14, %rdi
callq 0x58780
movq 0x618(%rbx), %rax
movq %rax, 0x60c(%rbx)
movq 0x40670(%rbx), %r14
movl 0x618(%rbx), %eax
movl 0x61c(%rbx), %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %eax
orl %ecx, %eax
cltq
leaq 0x10(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x57d10
movq %r14, %rdi
movq %r15, %rsi
callq 0x57de0
movl $0x0, 0x602(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq