// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/progressbar.cpp
// Function: smooth::GUI::Progressbar::CreateGradient(smooth::GUI::Size const&)
S::Void S::GUI::Progressbar::CreateGradient(const Size &gSize)
{
	gradient.CreateBitmap(gSize - Size(2, 2));
	gradientDirection = IsRightToLeft();

	Color	 startColor = IsRightToLeft() ? Setup::GradientEndColor : Setup::GradientStartColor;
	Color	 endColor   = IsRightToLeft() ? Setup::GradientStartColor : Setup::GradientEndColor;

	Int	 rs	    = startColor.GetRed();
	Int	 gs	    = startColor.GetGreen();
	Int	 bs	    = startColor.GetBlue();
	Float	 rp	    = ((Float) (endColor.GetRed() - rs)) / ((subtype == OR_HORZ) ? (gSize.cx - 2) : (gSize.cy - 2));
	Float	 gp	    = ((Float) (endColor.GetGreen() - gs)) / ((subtype == OR_HORZ) ? (gSize.cx - 2) : (gSize.cy - 2));
	Float	 bp	    = ((Float) (endColor.GetBlue() - bs)) / ((subtype == OR_HORZ) ? (gSize.cx - 2) : (gSize.cy - 2));

	if (subtype == OR_HORZ)
	{
		for (Int x = 0; x < gSize.cx - 2; x++)
		{
			for (Int y = 0; y < gSize.cy - 2; y++) gradient.SetPixel(Point(x, y), Color((Int) (rs + rp * x), (Int) (gs + gp * x), (Int) (bs + bp * x)));
		}
	}
	else
	{
		for (Int y = 0; y < gSize.cy - 2; y++)
		{
			for (Int x = 0; x < gSize.cx - 2; x++) gradient.SetPixel(Point(x, gSize.cy - 3 - y), Color((Int) (rs + rp * y), (Int) (gs + gp * y), (Int) (bs + bp * y)));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
addq $0x5b8, %rax            # imm = 0x5B8
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x59260
movq -0xc0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5db90
movq -0xb8(%rbp), %rdi
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5c4d0
movq -0xb0(%rbp), %rdi
movq (%rdi), %rax
callq *0x160(%rax)
movq -0xb0(%rbp), %rdi
andb $0x1, %al
movb %al, 0x5c0(%rdi)
movq (%rdi), %rax
callq *0x160(%rax)
testb $0x1, %al
jne 0x9edfd
jmp 0x9ee0d
movq 0x16a114(%rip), %rax    # 0x208f18
movq %rax, -0xc8(%rbp)
jmp 0x9ee1d
movq 0x16a1a4(%rip), %rax    # 0x208fb8
movq %rax, -0xc8(%rbp)
jmp 0x9ee1d
movq -0xc8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x5c720
movq -0xb0(%rbp), %rdi
movq (%rdi), %rax
callq *0x160(%rax)
testb $0x1, %al
jne 0x9ee43
jmp 0x9ee53
movq 0x16a16e(%rip), %rax    # 0x208fb8
movq %rax, -0xd0(%rbp)
jmp 0x9ee63
movq 0x16a0be(%rip), %rax    # 0x208f18
movq %rax, -0xd0(%rbp)
jmp 0x9ee63
movq -0xd0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x5c720
leaq -0x30(%rbp), %rdi
callq 0x59f20
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5d920
movl %eax, -0x48(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5b650
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x59f20
movl %eax, %ecx
movq -0xb0(%rbp), %rax
subl -0x44(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0xd8(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0x9eed5
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl $0x2, %eax
movl %eax, -0xdc(%rbp)
jmp 0x9eee5
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
movl %eax, -0xdc(%rbp)
movsd -0xd8(%rbp), %xmm0
movl -0xdc(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movq -0xb0(%rbp), %rax
subl -0x48(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0xe8(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0x9ef3e
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl $0x2, %eax
movl %eax, -0xec(%rbp)
jmp 0x9ef4e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
movl %eax, -0xec(%rbp)
movsd -0xe8(%rbp), %xmm0
movl -0xec(%rbp), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5b650
movl %eax, %ecx
movq -0xb0(%rbp), %rax
subl -0x4c(%rbp), %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, -0xf8(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0x9efa7
movq -0x10(%rbp), %rax
movl (%rax), %eax
subl $0x2, %eax
movl %eax, -0xfc(%rbp)
jmp 0x9efb7
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
movl %eax, -0xfc(%rbp)
movq -0xb0(%rbp), %rax
movsd -0xf8(%rbp), %xmm0
movl -0xfc(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0x9f0dd
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x9f0d8
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x9f0c8
movq -0xb0(%rbp), %rax
addq $0x5b8, %rax            # imm = 0x5B8
movq %rax, -0x108(%rbp)
movl -0x6c(%rbp), %esi
movl -0x70(%rbp), %edx
leaq -0x78(%rbp), %rdi
callq 0x5c2c0
cvtsi2sdl -0x44(%rbp), %xmm1
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0x6c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
cvtsi2sdl -0x48(%rbp), %xmm1
movsd -0x60(%rbp), %xmm0
cvtsi2sdl -0x6c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl -0x4c(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
cvtsi2sdl -0x6c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
leaq -0x88(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
movq -0x108(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x5a3d0
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x9f00b
jmp 0x9f0ca
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x9eff0
jmp 0x9f205
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x9f203
movl $0x0, -0x90(%rbp)
movl -0x90(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x9f1ed
movq -0xb0(%rbp), %rax
addq $0x5b8, %rax            # imm = 0x5B8
movq %rax, -0x110(%rbp)
movl -0x90(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
subl $0x3, %edx
subl -0x8c(%rbp), %edx
leaq -0x98(%rbp), %rdi
callq 0x5c2c0
cvtsi2sdl -0x44(%rbp), %xmm1
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0x8c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %esi
cvtsi2sdl -0x48(%rbp), %xmm1
movsd -0x60(%rbp), %xmm0
cvtsi2sdl -0x8c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
cvtsi2sdl -0x4c(%rbp), %xmm1
movsd -0x68(%rbp), %xmm0
cvtsi2sdl -0x8c(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
leaq -0xa8(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
movq -0x110(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x5a3d0
movl -0x90(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x90(%rbp)
jmp 0x9f109
jmp 0x9f1ef
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x9f0e7
jmp 0x9f205
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop