// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/multi/menu/menubarentry.cpp
// Function: smooth::GUI::MenubarEntry::Paint(int)
S::Int S::GUI::MenubarEntry::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

#ifdef __APPLE__
	if (container->GetOrientation() == OR_FREE) return container->Paint(SP_UPDATE);
#endif

	Surface	*surface  = GetDrawSurface();
	Point	 realPos  = GetRealPosition();
	Size	 realSize = GetRealSize();
	Rect	 bmpRect  = Rect(realPos + Point(2, 2) * surface->GetSurfaceDPI() / 96.0, (GetSize() - Size(4 + (popup != NIL ? 12 : 0), 4)) * surface->GetSurfaceDPI() / 96.0);

	switch (message)
	{
		case SP_PAINT:
			surface->StartPaint(Rect(realPos, realSize));

			if (text == NIL && bitmap == NIL)
			{
				if (orientation == OR_LEFT || orientation == OR_RIGHT)
				{
					SetWidth(4);

					Point	 p1 = Point(realPos.x, realPos.y);
					Point	 p2 = Point(p1.x, p1.y + realSize.cy);

					surface->Bar(p1, p2, OR_VERT);

					p1.x += 2;
					p2.x += 2;

					surface->Bar(p1, p2, OR_VERT);
				}
				else if (orientation == OR_TOP || orientation == OR_BOTTOM)
				{
					SetHeight(4);

					Point	 p1 = Point(realPos.x, realPos.y);
					Point	 p2 = Point(p1.x + realSize.cx, p1.y);

					surface->Bar(p1, p2, OR_HORZ);

					p1.y += 2;
					p2.y += 2;

					surface->Bar(p1, p2, OR_HORZ);
				}
			}
			else if (text != NIL && bitmap == NIL)
			{
				Rect	 textRect = Rect(realPos + Point(1, Math::Ceil(Float(realSize.cy - scaledTextSize.cy) / 2) - 1) + Point(2, 0) * surface->GetSurfaceDPI() / 96.0, realSize - Size(2, 2) - Size(2, 0) * surface->GetSurfaceDPI() / 96.0);
				Font	 nFont	  = font;

				if (!IsActive()) nFont.SetColor(Setup::InactiveTextColor);

				surface->Box(textRect, GetBackgroundColor(), Rect::Filled);
				surface->SetText(text, textRect, nFont);
			}
			else if (text == NIL && bitmap != NIL)
			{
				surface->Box(bmpRect, Setup::BackgroundColor, Rect::Filled);

				if (flags & MB_COLOR)	surface->BlitFromBitmap(bitmap, Rect(Point(0, 0), bitmap.GetSize()), bmpRect);
				else			surface->BlitFromBitmap(graymap, Rect(Point(0, 0), graymap.GetSize()), bmpRect);

				if (popup != NIL)
				{
					Int	 height	   = Math::Round(3 * surface->GetSurfaceDPI() / 96.0);

					Point	 lineStart = realPos + Point(realSize.cx - height * 2 - 2 * surface->GetSurfaceDPI() / 96.0 - (IsRightToLeft() ? 0 : 1), (realSize.cy - height) / 2 + 1);
					Point	 lineEnd   = lineStart + Point(height * 2 - 1, 0);

					for (Int i = 0; i < height; i++)
					{
						surface->Line(lineStart, lineEnd, Setup::TextColor);

						lineStart += Point(1, 1);
						lineEnd	  += Point(-1, 1);
					}
				}
			}

			surface->EndPaint();

			break;
		case SP_MOUSEIN:
		case SP_MOUSEUP:
			if (focussed && popup != NIL) if (popup->GetContainer() == this) break;

			if (bitmap != NIL)
			{
				surface->StartPaint(Rect(realPos, realSize));

				surface->Box(bmpRect, Setup::BackgroundColor, Rect::Filled);
				surface->BlitFromBitmap(bitmap, Rect(Point(0, 0), bitmap.GetSize()), bmpRect);

				if (onAction.GetNOfConnectedSlots() > 0 && popup != NIL)
				{
					Point	 p1 = Point(realPos.x + realSize.cx - 11 * surface->GetSurfaceDPI() / 96.0 - 2, realPos.y + 1);
					Point	 p2 = Point(realPos.x + realSize.cx - 11 * surface->GetSurfaceDPI() / 96.0 - 2, realPos.y + realSize.cy - 2);

					surface->Bar(p1, p2, OR_VERT);
				}

				surface->EndPaint();
			}

			break;
		case SP_MOUSEOUT:
			if (focussed && popup != NIL) if (popup->GetContainer() == this) break;

			if (bitmap != NIL)
			{
				surface->StartPaint(Rect(realPos, realSize));

				surface->Box(bmpRect, Setup::BackgroundColor, Rect::Filled);

				if (flags & MB_COLOR) surface->BlitFromBitmap(bitmap, Rect(Point(0, 0), bitmap.GetSize()), bmpRect);
				else		      surface->BlitFromBitmap(graymap, Rect(Point(0, 0), graymap.GetSize()), bmpRect);

				if (onAction.GetNOfConnectedSlots() > 0 && popup != NIL)
				{
					Point	 p1 = Point(realPos.x + realSize.cx - 11 * surface->GetSurfaceDPI() / 96.0 - 2 + (IsRightToLeft() ? 1 : 0), realPos.y + 1);
					Point	 p2 = Point(realPos.x + realSize.cx - 11 * surface->GetSurfaceDPI() / 96.0 - 2 + (IsRightToLeft() ? 1 : 0), realPos.y + realSize.cy - 1);

					surface->Line(p1, p2, Setup::BackgroundColor);

					p1.x++;
					p2.x++;

					surface->Line(p1, p2, Setup::BackgroundColor);
				}

				surface->EndPaint();
			}

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebp
movq %rdi, %r15
movq (%rdi), %rax
callq *0x88(%rax)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb %al, %al
je 0x8a84d
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8a84d
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %rax, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x48(%rax)
movq %rax, %r12
movq %rax, %rbx
shrq $0x20, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x50(%rax)
movq %rax, 0x28(%rsp)
movq %r14, %rdi
callq 0x58930
cwtl
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm1
cmpltsd %xmm2, %xmm1
xorpd %xmm4, %xmm4
movsd 0x6a78f(%rip), %xmm3    # 0xf4390
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
movapd %xmm3, %xmm5
movsd 0x6a783(%rip), %xmm3    # 0xf4398
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6a8bb(%rip), %xmm0    # 0xf44f0
movapd %xmm0, %xmm1
cmpltsd %xmm4, %xmm1
movapd %xmm1, %xmm2
andpd %xmm5, %xmm2
andnpd %xmm3, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %r13
movq %r12, 0x20(%rsp)
leal (%r12,%r13), %eax
movl %eax, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
addl %ebx, %r13d
cmpq $0x0, 0x5b8(%r15)
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
movl $0xfffffff0, %r12d      # imm = 0xFFFFFFF0
cmovel %eax, %r12d
addl 0xb0(%r15), %r12d
movl 0xb4(%r15), %ebx
addl $-0x4, %ebx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm2
xorpd %xmm4, %xmm4
cmpltsd %xmm4, %xmm2
movapd %xmm2, %xmm3
movsd 0x6a6c2(%rip), %xmm5    # 0xf4390
andpd %xmm5, %xmm3
movsd 0x6a6be(%rip), %xmm6    # 0xf4398
andnpd %xmm6, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
movq 0x28(%rsp), %rbx
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
cmpltsd %xmm4, %xmm0
xorpd %xmm3, %xmm3
movapd %xmm0, %xmm2
andpd %xmm5, %xmm2
andnpd %xmm6, %xmm0
orpd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x6a7c0(%rip), %xmm4    # 0xf44f0
divsd %xmm4, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm3, %xmm1
movapd %xmm1, %xmm2
andpd %xmm5, %xmm2
andnpd %xmm6, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd %xmm4, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm3, %xmm1
movapd %xmm1, %xmm2
andpd %xmm5, %xmm2
andnpd %xmm6, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movl 0x8(%rsp), %edx
movl %edx, 0x40(%rsp)
movl %r13d, 0x44(%rsp)
addl %edx, %eax
movl %eax, 0x48(%rsp)
addl %r13d, %ecx
movl %ecx, 0x4c(%rsp)
cmpl $0x5, %ebp
ja 0x8a84b
movq %rbx, %r12
shrq $0x20, %r12
movl %ebp, %eax
leaq 0x6da9a(%rip), %rcx     # 0xf7850
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x1, 0xcd(%r15)
jne 0x89de2
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x89de2
cmpq %r15, 0x190(%rax)
je 0x8a84b
leaq 0x5c0(%r15), %rbp
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a84b
leaq 0x50(%rsp), %r13
movq 0x20(%rsp), %rcx
movl %ecx, (%r13)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r13)
addl %ebx, %ecx
movl %ecx, 0x28(%rsp)
movl %ecx, 0x8(%r13)
addl %eax, %r12d
movq %r12, 0x8(%rsp)
movl %r12d, 0xc(%r13)
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x55160
movq 0xe3166(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
movq %r14, (%r13)
movq 0xe2681(%rip), %rdx     # 0x16c4d0
leaq 0x40(%rsp), %r12
leaq 0x50(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r8
callq 0x57930
movq %rbp, %rdi
callq 0x58410
movq %r14, (%r13)
movl (%rax), %ecx
movl %ecx, 0x8(%r13)
movl 0x4(%rax), %eax
movl %eax, 0xc(%r13)
leaq 0x50(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r12, %rcx
callq 0x55ba0
movq 0x488(%r15), %rcx
movq 0x490(%r15), %rax
movq %rcx, %rdx
orq %rax, %rdx
je 0x8a5c0
testq %rcx, %rcx
je 0x8a5bc
movl 0x8(%rcx), %r14d
testq %rax, %rax
je 0x8a5c0
addl 0x8(%rax), %r14d
jmp 0x8a5c0
leaq 0x50(%rsp), %rsi
movq 0x20(%rsp), %rcx
movl %ecx, (%rsi)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%rsi)
leal (%rbx,%rcx), %r13d
movl %r13d, 0x8(%rsi)
leal (%r12,%rax), %r14d
movl %r14d, 0xc(%rsi)
movq 0x10(%rsp), %rdi
callq 0x55160
leaq 0xf0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x8a0b7
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x8a0b7
movl 0xd0(%r15), %eax
addl $-0x4, %eax
rolw $0xe, %ax
cmpw $0x2, %ax
jb 0x8a68e
movzwl %ax, %eax
cmpl $0x7, %eax
je 0x89f52
cmpl $0x3, %eax
jne 0x8a841
leaq 0xa8(%r15), %rsi
movl 0xb4(%r15), %eax
leaq 0x50(%rsp), %r13
movl $0x4, (%r13)
movl %eax, 0x4(%r13)
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rdx
callq *0x150(%rax)
movq 0x20(%rsp), %rcx
movl %ecx, (%r13)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r13)
leaq 0x30(%rsp), %r15
movl %ecx, (%r15)
movl %r14d, 0x4(%r15)
leaq 0x50(%rsp), %r12
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x2, %ecx
callq 0x58fc0
addl $0x2, (%r12)
addl $0x2, (%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
jmp 0x8a67f
cmpb $0x1, 0xcd(%r15)
jne 0x89ff5
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x89ff5
cmpq %r15, 0x190(%rax)
je 0x8a84b
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a84b
leaq 0x50(%rsp), %r13
movq 0x20(%rsp), %rcx
movl %ecx, (%r13)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r13)
addl %ecx, %ebx
movl %ebx, 0x8(%r13)
addl %eax, %r12d
movl %r12d, 0xc(%r13)
movq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x55160
movq 0xe2f5f(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
movq $0x0, (%r13)
movq 0xe2476(%rip), %rdx     # 0x16c4d0
leaq 0x40(%rsp), %rsi
leaq 0x50(%rsp), %r8
movq %r14, %rdi
callq 0x57930
testb $0x1, 0x30(%r15)
jne 0x8a554
movl %ebx, %ebp
movq %r12, %rbx
leaq 0x5c8(%r15), %r12
movq %r12, %rdi
callq 0x58410
leaq 0x50(%rsp), %rdx
movq $0x0, (%rdx)
movl (%rax), %ecx
movl %ecx, 0x8(%rdx)
movl 0x4(%rax), %eax
movl %eax, 0xc(%rdx)
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %r12
movl %ebp, %ebx
jmp 0x8a57e
movq %rbp, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
je 0x8a38b
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x8a38b
movl %r12d, %eax
subl 0x18c(%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x6a2a0(%rip), %xmm1    # 0xf4398
mulsd %xmm1, %xmm0
callq 0x56cb0
movq %rax, %r13
movq %rbx, %r14
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
xorpd %xmm3, %xmm3
movapd %xmm1, %xmm2
cmpltsd %xmm3, %xmm2
xorpd %xmm5, %xmm5
movapd %xmm2, %xmm3
movsd 0x6a24f(%rip), %xmm4    # 0xf4390
andpd %xmm4, %xmm3
movapd %xmm4, %xmm6
movsd 0x6a247(%rip), %xmm7    # 0xf4398
andnpd %xmm7, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x6a37f(%rip), %xmm2    # 0xf44f0
divsd %xmm2, %xmm1
movapd %xmm2, %xmm4
movapd %xmm1, %xmm2
cmpltsd %xmm5, %xmm2
movapd %xmm2, %xmm3
andpd %xmm6, %xmm3
andnpd %xmm7, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movq 0x20(%rsp), %rdx
leal (%rdx,%rax), %ecx
movq %rcx, 0x8(%rsp)
andpd 0x6cc80(%rip), %xmm0    # 0xf6e30
addsd %xmm7, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd %xmm4, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm7, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
addl %edx, %eax
incl %eax
movl %eax, 0x20(%rsp)
movq 0x18(%rsp), %rax
addl %r13d, %eax
leal (%rax,%rcx), %edx
movq %rdx, 0x18(%rsp)
leal (%rcx,%rax), %r13d
decl %r13d
movq %rbx, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm2
xorpd %xmm5, %xmm5
cmpltsd %xmm5, %xmm2
movapd %xmm2, %xmm3
movsd 0x6a15a(%rip), %xmm6    # 0xf4390
andpd %xmm6, %xmm3
movsd 0x6a156(%rip), %xmm4    # 0xf4398
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
andpd 0x6cbd5(%rip), %xmm0    # 0xf6e30
addsd %xmm4, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x6a27d(%rip), %xmm7    # 0xf44f0
divsd %xmm7, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm5, %xmm1
xorpd %xmm3, %xmm3
movapd %xmm1, %xmm2
andpd %xmm6, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rax
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
divsd %xmm7, %xmm0
movapd %xmm0, %xmm1
cmpltsd %xmm3, %xmm1
movapd %xmm6, %xmm2
andpd %xmm1, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
subl %eax, %r14d
subl %ecx, %r12d
movl 0x20(%rsp), %eax
movl %eax, 0x30(%rsp)
movl %r13d, 0x34(%rsp)
movq 0x8(%rsp), %rax
leal -0x1(%r14,%rax), %eax
movl %eax, 0x38(%rsp)
movq 0x18(%rsp), %rax
leal -0x3(%r12,%rax), %eax
movl %eax, 0x3c(%rsp)
leaq 0x140(%r15), %rsi
leaq 0x50(%rsp), %rdi
callq 0x55b70
movq (%r15), %rax
movq %r15, %rdi
callq *0x98(%rax)
testb %al, %al
jne 0x8a32b
movq 0xe262f(%rip), %rsi     # 0x16c950
leaq 0x50(%rsp), %rdi
callq 0x58650
movq (%r15), %rax
movq %r15, %rdi
callq *0x140(%rax)
movq 0xe2c6a(%rip), %rcx     # 0x16cfa8
movl (%rcx), %ecx
leaq 0x90(%rsp), %r8
movq $0x0, (%r8)
leaq 0x30(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rdx
callq 0x57930
leaq 0x30(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %r8d, %r8d
callq 0x57b80
leaq 0x50(%rsp), %rdi
callq 0x56720
jmp 0x8a841
movq %rbp, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x8a841
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a841
movq %rbx, %r14
movq 0xe2be8(%rip), %rax     # 0x16cfa8
movl (%rax), %ecx
leaq 0x50(%rsp), %r8
movq $0x0, (%r8)
movq 0xe20fb(%rip), %rdx     # 0x16c4d0
leaq 0x40(%rsp), %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x57930
testb $0x1, 0x30(%r15)
jne 0x8a3f5
leaq 0x5c8(%r15), %rbp
movq %rbp, %rdi
callq 0x58410
leaq 0x50(%rsp), %rdx
movq $0x0, (%rdx)
movl (%rax), %ecx
movl %ecx, 0x8(%rdx)
movl 0x4(%rax), %eax
movl %eax, 0xc(%rdx)
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x55ba0
cmpq $0x0, 0x5b8(%r15)
je 0x8a841
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
movsd 0x6a0a1(%rip), %xmm1    # 0xf44f0
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x6a459(%rip), %rcx     # 0xf48c0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %rbp
subl %ebp, %r14d
subl %ebp, %r14d
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x58930
cwtl
addl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6a051(%rip), %xmm0    # 0xf44f0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
xorb $0x1, %al
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
subl %ebp, %r12d
movl %r12d, %ecx
shrl $0x1f, %ecx
addl %r12d, %ecx
sarl %ecx
addl 0x20(%rsp), %eax
movq 0x18(%rsp), %rdx
addl %edx, %ecx
incl %ecx
shlq $0x20, %rcx
addq %rax, %rcx
movq %rcx, 0x50(%rsp)
leal (%rax,%rbp,2), %eax
decl %eax
movl 0x54(%rsp), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, 0x30(%rsp)
testl %ebp, %ebp
jle 0x8a841
movq 0xe24c8(%rip), %r15     # 0x16c9e8
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x58300
incl 0x50(%rsp)
incl 0x54(%rsp)
decl 0x30(%rsp)
incl 0x34(%rsp)
decl %ebp
jne 0x8a52a
jmp 0x8a841
movq %rbp, %rdi
callq 0x58410
leaq 0x50(%rsp), %rdx
movq $0x0, (%rdx)
movl (%rax), %ecx
movl %ecx, 0x8(%rdx)
movl 0x4(%rax), %eax
movl %eax, 0xc(%rdx)
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x55ba0
movq 0x488(%r15), %rdx
movq 0x490(%r15), %rcx
xorl %eax, %eax
movq %rdx, %rsi
orq %rcx, %rsi
je 0x8a716
testq %rdx, %rdx
je 0x8a713
movl 0x8(%rdx), %eax
testq %rcx, %rcx
je 0x8a716
addl 0x8(%rcx), %eax
jmp 0x8a716
movl 0x8(%rax), %r14d
testl %r14d, %r14d
movq 0x8(%rsp), %rbx
jle 0x8a841
cmpq $0x0, 0x5b8(%r15)
je 0x8a841
cvtsi2sdl 0x28(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x69ee5(%rip), %xmm1    # 0xf44f0
divsd %xmm1, %xmm0
movsd 0x28(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6c957(%rip), %xmm1    # 0xf6f78
cvttsd2si %xmm1, %eax
movq 0x18(%rsp), %rcx
incl %ecx
leaq 0x50(%rsp), %r15
movl %eax, (%r15)
movl %ecx, 0x4(%r15)
movq %r14, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x69e9a(%rip), %xmm0    # 0xf44f0
movsd 0x28(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6c910(%rip), %xmm1    # 0xf6f78
cvttsd2si %xmm1, %eax
addl $-0x2, %ebx
leaq 0x30(%rsp), %rdx
movl %eax, (%rdx)
movl %ebx, 0x4(%rdx)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %ecx
callq 0x58fc0
jmp 0x8a841
leaq 0xa8(%r15), %rsi
movl 0xb0(%r15), %eax
leaq 0x50(%rsp), %r14
movl %eax, (%r14)
movl $0x4, 0x4(%r14)
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rdx
callq *0x150(%rax)
movq 0x20(%rsp), %rax
movl %eax, (%r14)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r14)
leaq 0x30(%rsp), %r15
movl %r13d, (%r15)
movl %eax, 0x4(%r15)
leaq 0x50(%rsp), %r12
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x58fc0
addl $0x2, 0x4(%r12)
addl $0x2, 0x4(%r15)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x1, %ecx
jmp 0x8a684
movl 0x8(%rcx), %eax
testl %eax, %eax
jle 0x8a841
cmpq $0x0, 0x5b8(%r15)
je 0x8a841
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x69d97(%rip), %xmm1    # 0xf44f0
divsd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6c809(%rip), %xmm1    # 0xf6f78
movsd %xmm1, 0x28(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x28(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movq 0x18(%rsp), %rcx
incl %ecx
movq %r12, %rbx
leaq 0x50(%rsp), %r12
movl %eax, (%r12)
movl %ecx, 0x4(%r12)
movq %r14, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x69d25(%rip), %xmm0    # 0xf44f0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6c79b(%rip), %xmm1    # 0xf6f78
movsd %xmm1, 0x8(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
decl %ebx
leaq 0x30(%rsp), %r15
movl %eax, (%r15)
movl %ebx, 0x4(%r15)
movq 0xe1cb8(%rip), %r13     # 0x16c4d0
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x58300
incl (%r12)
incl (%r15)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x58300
movq 0x10(%rsp), %rdi
callq 0x58780
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8a863
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x56720
movq %rbx, %rdi
callq 0x57090