// File: /workspace/github_c_makefile_star2_O2/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 0x59c60
movl %eax, %ebp
movq %r14, %rdi
callq 0x59c60
pxor %xmm0, %xmm0
pinsrw $0x1, %eax, %xmm0
pinsrw $0x3, %ebp, %xmm0
psrad $0x10, %xmm0
cvtdq2pd %xmm0, %xmm0
mulpd 0x7a768(%rip), %xmm0    # 0xe3800
divpd 0x7a750(%rip), %xmm0    # 0xe37f0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movmskpd %xmm2, %eax
movsd 0x7a2bf(%rip), %xmm1    # 0xe3378
movsd 0x7a2bf(%rip), %xmm2    # 0xe3380
movapd %xmm1, %xmm3
testb $0x2, %al
jne 0x690cd
movapd %xmm2, %xmm3
movapd %xmm0, %xmm4
unpckhpd %xmm0, %xmm4            # xmm4 = xmm4[1],xmm0[1]
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %r8
testb $0x1, %al
jne 0x690e6
movapd %xmm2, %xmm1
movl 0x608(%rbx), %eax
movl 0x614(%rbx), %ecx
cvtsi2sd %r8d, %xmm2
movsd %xmm2, 0x48(%rsp)
cmpl %ecx, %eax
jne 0x6910e
cmpb $0x1, 0x602(%rbx)
jne 0x6932d
cmpb $0x0, 0x604(%rbx)
je 0x6911e
movl %ecx, %eax
jmp 0x6932d
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rbp
movq %r8, 0x40(%rsp)
addq %r8, %rbp
cmpl $-0x1, %eax
je 0x69233
leal 0x1(%rbp), %ecx
movl 0x5fc(%rbx), %edx
cvtsi2sd %eax, %xmm0
movsd 0x7a203(%rip), %xmm1    # 0xe3350
subsd %xmm0, %xmm1
movsd 0x7a637(%rip), %xmm0    # 0xe3790
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
leal 0x1(%rax,%rdx), %eax
leaq 0x28(%rsp), %r15
movl %ecx, (%r15)
movl %eax, 0x4(%r15)
movq %r14, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
mulsd 0x7a606(%rip), %xmm0    # 0xe3798
divsd 0x7a376(%rip), %xmm0    # 0xe3510
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x7a602(%rip), %rcx     # 0xe37b0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
leal 0x1(%rbp,%rax), %eax
movl 0x5fc(%rbx), %ecx
movslq 0x608(%rbx), %rdx
cvtsi2sd %edx, %xmm0
movsd 0x7a17b(%rip), %xmm1    # 0xe3350
subsd %xmm0, %xmm1
divsd 0x10(%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 0x18(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %r13
movq %r13, %rdi
xorl %edx, %edx
callq 0x58f90
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x595b0
movl 0x614(%rbx), %ecx
jmp 0x69247
movsd 0x7a555(%rip), %xmm0    # 0xe3790
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
orl $0xffff00, %ecx         # imm = 0xFFFF00
movslq %ecx, %rax
leaq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x58f90
movslq %ebp, %r15
leal 0x1(%r15), %ebp
leaq 0x28(%rsp), %r12
movq %r15, %r13
movq %r14, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
mulsd 0x7a509(%rip), %xmm0    # 0xe3798
divsd 0x7a279(%rip), %xmm0    # 0xe3510
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %al
leaq 0x7a505(%rip), %rcx     # 0xe37b0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rax
addq %r15, %rax
cmpq %r13, %rax
jle 0x6931c
incq %r13
cvtsi2sdl 0x614(%rbx), %xmm0
movl 0x5fc(%rbx), %eax
movsd 0x7a07a(%rip), %xmm1    # 0xe3350
subsd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
cvttsd2si %xmm1, %ecx
leal 0x1(%rax,%rcx), %eax
movl %ebp, 0x28(%rsp)
movl %eax, 0x2c(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x20(%rsp)
andl $0x0, 0x18(%rsp)
movq %r14, %rdi
movq %r12, %rsi
leaq 0x18(%rsp), %rdx
callq 0x56120
incl %ebp
jmp 0x6927a
movl 0x614(%rbx), %eax
movl %eax, 0x608(%rbx)
movq 0x40(%rsp), %r8
movl 0x610(%rbx), %esi
movl 0x61c(%rbx), %ecx
cmpl %ecx, %esi
jne 0x69358
movl 0x60c(%rbx), %edx
cmpl 0x618(%rbx), %edx
jne 0x69358
cmpb $0x1, 0x603(%rbx)
jne 0x6977b
cmpb $0x1, 0x605(%rbx)
jne 0x6936c
movl 0x618(%rbx), %edx
jmp 0x6977d
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)
movq %r8, 0x40(%rsp)
leal (%rcx,%r8), %eax
incl %eax
movl %eax, 0xc(%rsi)
movq %r14, %rdi
callq 0x56160
cmpl $-0x1, 0x610(%rbx)
je 0x69572
cmpl $-0x1, 0x60c(%rbx)
je 0x69572
pushq $0x1
popq %rbp
movsd 0x7a3c5(%rip), %xmm0    # 0xe3790
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r13d, %r13d
movq 0x40(%rsp), %rax
testl %eax, %eax
cmovgl %eax, %r13d
negl %r13d
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %r12
leal (%r13,%rbp), %eax
cmpl $0x1, %eax
je 0x694ac
movl 0x60c(%rbx), %eax
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %ecx
orl %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x20(%rsp)
movl $0x2, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x58f90
movsd 0x8(%rsp), %xmm0
addsd 0x79f17(%rip), %xmm0    # 0xe3370
movsd %xmm0, 0x8(%rsp)
movl 0x5f8(%rbx), %eax
addl %ebp, %eax
cvtsi2sdl 0x60c(%rbx), %xmm0
movsd 0x79ed9(%rip), %xmm1    # 0xe3350
subsd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
cvttsd2si %xmm1, %ecx
movl 0x5fc(%rbx), %edx
leal 0x1(%rdx,%rcx), %ecx
movl %eax, 0x18(%rsp)
movl %ecx, 0x1c(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x56120
incl %ebp
jmp 0x693fc
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
pushq $0x1
popq %rbp
leaq 0x30(%rsp), %r15
leaq 0x18(%rsp), %r12
leal (%r13,%rbp), %eax
cmpl $0x1, %eax
je 0x69572
movsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd 0x79e6b(%rip), %xmm1    # 0xe3350
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, 0x20(%rsp)
movl $0x2, 0x18(%rsp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x58f90
movl 0x5f8(%rbx), %eax
cvtsi2sdl 0x610(%rbx), %xmm0
divsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
leal 0x1(%rax,%rcx), %eax
movsd 0x8(%rsp), %xmm0
addsd 0x79e29(%rip), %xmm0    # 0xe3370
movsd %xmm0, 0x8(%rsp)
movl 0x5fc(%rbx), %ecx
addl %ebp, %ecx
movl %eax, 0x18(%rsp)
movl %ecx, 0x1c(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x56120
incl %ebp
jmp 0x694c3
movsd 0x7a216(%rip), %xmm0    # 0xe3790
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %ebp, %ebp
movq 0x40(%rsp), %rax
testl %eax, %eax
cmovgl %eax, %ebp
negl %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
pushq $0x1
popq %r15
leaq 0x18(%rsp), %r12
leaq 0x28(%rsp), %r13
leal (%r15,%rbp), %eax
cmpl $0x1, %eax
je 0x69674
movl 0x618(%rbx), %eax
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
shll $0x10, %ecx
shll $0x8, %eax
orl 0x614(%rbx), %ecx
orl %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x20(%rsp)
movl $0x2, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x58f90
movsd 0x8(%rsp), %xmm0
addsd 0x79d66(%rip), %xmm0    # 0xe3370
movsd %xmm0, 0x8(%rsp)
movl 0x5f8(%rbx), %eax
addl %r15d, %eax
cvtsi2sdl 0x618(%rbx), %xmm0
movl 0x5fc(%rbx), %ecx
movsd 0x79d21(%rip), %xmm1    # 0xe3350
subsd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
cvttsd2si %xmm1, %edx
leal 0x1(%rcx,%rdx), %ecx
movl %eax, 0x28(%rsp)
movl %ecx, 0x2c(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x20(%rsp)
andl $0x0, 0x18(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x56120
incl %r15d
jmp 0x695ac
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
pushq $0x1
popq %r15
leaq 0x18(%rsp), %r12
leaq 0x28(%rsp), %r13
leal (%r15,%rbp), %eax
cmpl $0x1, %eax
je 0x69753
movsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd 0x79ca3(%rip), %xmm1    # 0xe3350
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, 0x20(%rsp)
movl $0x2, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x58f90
movl 0x5f8(%rbx), %eax
cvtsi2sdl 0x61c(%rbx), %xmm0
divsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
leal 0x1(%rax,%rcx), %eax
movsd 0x8(%rsp), %xmm0
addsd 0x79c5f(%rip), %xmm0    # 0xe3370
movsd %xmm0, 0x8(%rsp)
movl 0x5fc(%rbx), %ecx
addl %r15d, %ecx
movl %eax, 0x28(%rsp)
movl %ecx, 0x2c(%rsp)
movl 0x38(%rsp), %eax
notl %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movq %rax, 0x20(%rsp)
andl $0x0, 0x18(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x56120
incl %r15d
jmp 0x6968c
movq %r14, %rdi
callq 0x59a80
movl 0x61c(%rbx), %ecx
movl %ecx, 0x610(%rbx)
movl 0x614(%rbx), %eax
movl 0x618(%rbx), %edx
movl %edx, 0x60c(%rbx)
jmp 0x6977d
movl %esi, %ecx
movq 0x40670(%rbx), %r14
shll $0x10, %ecx
shll $0x8, %edx
orl %eax, %edx
orl %ecx, %edx
movslq %edx, %rax
leaq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
movl $0x2, (%rsi)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x58f90
movq %r14, %rdi
movq %r15, %rsi
callq 0x59070
andl $0x0, 0x602(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq