// File: /workspace/github_c_makefile_star2_O3/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 0x8a2c6
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8a2c6
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %rax, %r12
movq (%r15), %rax
movq %r15, %rdi
callq *0x48(%rax)
movq %rax, %r13
movq %rax, %rbx
shrq $0x20, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x50(%rax)
movq %rax, (%rsp)
movq %r12, %rdi
callq 0x58930
cwtl
cvtsi2sd %eax, %xmm0
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltsd %xmm1, %xmm2
movsd 0x69cac(%rip), %xmm5    # 0xf3390
movapd %xmm2, %xmm3
andpd %xmm5, %xmm3
movsd 0x69ca4(%rip), %xmm4    # 0xf3398
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
addsd %xmm0, %xmm2
cvttsd2si %xmm2, %rax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x69fa4(%rip), %xmm0    # 0xf36b8
movapd %xmm0, %xmm2
cmpltsd %xmm1, %xmm2
movapd %xmm2, %xmm1
andpd %xmm5, %xmm1
andnpd %xmm4, %xmm2
orpd %xmm1, %xmm2
addsd %xmm0, %xmm2
cvttsd2si %xmm2, %r14
movq %r13, 0x38(%rsp)
addl %r14d, %r13d
movq %rbx, 0x10(%rsp)
addl %ebx, %r14d
cmpq $0x0, 0x5b8(%r15)
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
movl $0xfffffff0, %ecx       # imm = 0xFFFFFFF0
cmovel %eax, %ecx
movd %ecx, %xmm0
movq 0xb0(%r15), %xmm1
movaps 0x6d251(%rip), %xmm2    # 0xf69c0
movss %xmm0, %xmm2            # xmm2 = xmm0[0],xmm2[1,2,3]
paddd %xmm1, %xmm2
movdqa %xmm2, 0x80(%rsp)
movq %r12, 0x8(%rsp)
movq %r12, %rdi
callq 0x58930
cwtl
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl %r13d, 0x28(%rsp)
movl %r14d, 0x2c(%rsp)
cvtdq2pd 0x80(%rsp), %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movapd 0x69d6b(%rip), %xmm3    # 0xf3530
movapd 0x69d73(%rip), %xmm4    # 0xf3540
movapd %xmm4, %xmm5
andpd %xmm2, %xmm5
andnpd %xmm3, %xmm2
orpd %xmm5, %xmm2
addpd %xmm0, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %xmm0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
cvttsd2si %xmm2, %rax
movq %rax, %xmm2
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
cvtdq2pd %xmm0, %xmm0
divpd 0x69d17(%rip), %xmm0    # 0xf3520
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
andpd %xmm2, %xmm4
andnpd %xmm3, %xmm2
orpd %xmm4, %xmm2
addpd %xmm0, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %xmm0
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
cvttsd2si %xmm2, %rax
movq %rax, %xmm1
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movd %r14d, %xmm1
movd %r13d, %xmm2
movq (%rsp), %r13
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
paddd %xmm0, %xmm2
movq %xmm2, 0x30(%rsp)
cmpl $0x5, %ebp
ja 0x8a2c4
movq %r13, %rbx
shrq $0x20, %rbx
movl %ebp, %eax
leaq 0x6d15d(%rip), %rcx     # 0xf69d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x1, 0xcd(%r15)
jne 0x8989f
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x8989f
cmpq %r15, 0x190(%rax)
je 0x8a2c4
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a2c4
leaq 0x40(%rsp), %r14
movq 0x38(%rsp), %rcx
movl %ecx, (%r14)
movq 0x10(%rsp), %rax
movl %eax, 0x4(%r14)
addl %r13d, %ecx
movl %ecx, (%rsp)
movl %ecx, 0x8(%r14)
addl %eax, %ebx
movl %ebx, 0xc(%r14)
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x55160
movq 0xe26b3(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
xorl %eax, %eax
movq %rax, (%r14)
movq 0xe1bcd(%rip), %rdx     # 0x16b4d0
leaq 0x28(%rsp), %r14
leaq 0x40(%rsp), %r12
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %r8
callq 0x57930
movq %rbp, %rdi
callq 0x58410
xorl %ecx, %ecx
movq %rcx, (%r12)
movq (%rax), %rax
movq %rax, 0x8(%r12)
leaq 0x40(%rsp), %rdx
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rcx
callq 0x55ba0
movq 0x488(%r15), %rcx
movq 0x490(%r15), %rax
movq %rcx, %rdx
orq %rax, %rdx
je 0x8a2ba
testq %rcx, %rcx
je 0x8a04f
movl 0x8(%rcx), %ecx
testq %rax, %rax
je 0x8a052
addl 0x8(%rax), %ecx
jmp 0x8a052
leaq 0x40(%rsp), %rsi
movq 0x38(%rsp), %r12
movl %r12d, (%rsi)
movq 0x10(%rsp), %rax
movl %eax, 0x4(%rsi)
leal (%r13,%r12), %r14d
movl %r14d, 0x8(%rsi)
leal (%rbx,%rax), %r13d
movl %r13d, 0xc(%rsi)
movq 0x8(%rsp), %rdi
callq 0x55160
leaq 0xf0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x89b52
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x89b52
movl 0xd0(%r15), %eax
addl $-0x4, %eax
rolw $0xe, %ax
cmpw $0x2, %ax
jb 0x8a10a
movzwl %ax, %eax
cmpl $0x7, %eax
je 0x89a03
cmpl $0x3, %eax
jne 0x8a2ba
leaq 0xa8(%r15), %rsi
movl 0xb4(%r15), %eax
leaq 0x40(%rsp), %r14
movl $0x4, (%r14)
movl %eax, 0x4(%r14)
movq (%r15), %rax
movq %r15, %rdi
movq %r14, %rdx
callq *0x150(%rax)
movl %r12d, (%r14)
movq 0x10(%rsp), %rax
movl %eax, 0x4(%r14)
leaq 0x18(%rsp), %r15
movl %r12d, (%r15)
movl %r13d, 0x4(%r15)
leaq 0x40(%rsp), %r12
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x2, %ecx
callq 0x58fc0
addl $0x2, (%r12)
addl $0x2, (%r15)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
jmp 0x8a103
cmpb $0x1, 0xcd(%r15)
jne 0x89a9f
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x89a9f
cmpq %r15, 0x190(%rax)
je 0x8a2c4
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a2c4
leaq 0x40(%rsp), %r14
movq 0x38(%rsp), %rcx
movl %ecx, (%r14)
movq 0x10(%rsp), %rax
movl %eax, 0x4(%r14)
leal (%rcx,%r13), %r12d
movl %r12d, 0x8(%r14)
addl %eax, %ebx
movl %ebx, 0xc(%r14)
movq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x55160
movq 0xe24b5(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
movq $0x0, (%r14)
movq 0xe19cd(%rip), %rdx     # 0x16b4d0
leaq 0x28(%rsp), %rsi
leaq 0x40(%rsp), %r8
movq %r13, %rdi
callq 0x57930
testb $0x1, 0x30(%r15)
jne 0x89fed
leaq 0x5c8(%r15), %r14
movq %r14, %rdi
callq 0x58410
leaq 0x40(%rsp), %rdx
movq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x28(%rsp), %rcx
movq %r13, %rdi
movq %r14, %rsi
jmp 0x8a013
movq %rbp, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
je 0x89e1f
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x89e1f
movl %ebx, %eax
subl 0x18c(%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x69806(%rip), %xmm1    # 0xf3398
mulsd %xmm1, %xmm0
callq 0x56cb0
movq %rax, %r14
movq 0x8(%rsp), %r13
movq %r13, %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 0x697b8(%rip), %xmm4    # 0xf3390
andpd %xmm4, %xmm3
movapd %xmm4, %xmm6
movsd 0x697b0(%rip), %xmm7    # 0xf3398
andnpd %xmm7, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x69ab0(%rip), %xmm2    # 0xf36b8
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
leal (%r12,%rax), %ecx
movq %rcx, 0x80(%rsp)
andpd 0x6986a(%rip), %xmm0    # 0xf34b0
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 %eax, %r12d
incl %r12d
movq 0x10(%rsp), %rax
addl %r14d, %eax
leal (%rax,%rcx), %edx
movq %rdx, 0x10(%rsp)
leal (%rcx,%rax), %r14d
decl %r14d
movq %r13, %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 0x696c6(%rip), %xmm6    # 0xf3390
andpd %xmm6, %xmm3
movsd 0x696c2(%rip), %xmm4    # 0xf3398
andnpd %xmm4, %xmm2
orpd %xmm3, %xmm2
addsd %xmm1, %xmm2
cvttsd2si %xmm2, %rax
andpd 0x697c1(%rip), %xmm0    # 0xf34b0
addsd %xmm4, %xmm0
cvttsd2si %xmm0, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x699b1(%rip), %xmm7    # 0xf36b8
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
movq (%rsp), %rdx
subl %eax, %edx
subl %ecx, %ebx
movl %r12d, 0x18(%rsp)
movl %r14d, 0x1c(%rsp)
movq 0x80(%rsp), %rax
addl %edx, %eax
decl %eax
movl %eax, 0x20(%rsp)
movq 0x10(%rsp), %rax
leal -0x3(%rbx,%rax), %eax
movl %eax, 0x24(%rsp)
leaq 0x140(%r15), %rsi
leaq 0x40(%rsp), %rdi
callq 0x55b70
movq (%r15), %rax
movq %r15, %rdi
callq *0x98(%rax)
testb %al, %al
jne 0x89dbf
movq 0xe1b9b(%rip), %rsi     # 0x16b950
leaq 0x40(%rsp), %rdi
callq 0x58650
movq (%r15), %rax
movq %r15, %rdi
callq *0x140(%rax)
movq 0xe21d6(%rip), %rcx     # 0x16bfa8
movl (%rcx), %ecx
leaq 0x90(%rsp), %r8
movq $0x0, (%r8)
leaq 0x18(%rsp), %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
callq 0x57930
leaq 0x18(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
xorl %r8d, %r8d
callq 0x57b80
leaq 0x40(%rsp), %rdi
callq 0x56720
jmp 0x8a2ba
movq %rbp, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x8a2ba
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x8a2ba
movq 0xe2157(%rip), %rax     # 0x16bfa8
movl (%rax), %ecx
leaq 0x40(%rsp), %r8
movq $0x0, (%r8)
movq 0xe166a(%rip), %rdx     # 0x16b4d0
leaq 0x28(%rsp), %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x57930
testb $0x1, 0x30(%r15)
jne 0x89e86
leaq 0x5c8(%r15), %rbp
movq %rbp, %rdi
callq 0x58410
leaq 0x40(%rsp), %rdx
movq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x28(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x55ba0
cmpq $0x0, 0x5b8(%r15)
je 0x8a2ba
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
divsd 0x697dc(%rip), %xmm0    # 0xf36b8
pxor %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x69900(%rip), %rcx     # 0xf37f0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %r14
movq (%rsp), %rcx
subl %r14d, %ecx
subl %r14d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x58930
cwtl
addl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6978e(%rip), %xmm0    # 0xf36b8
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
xorb $0x1, %al
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
subl %r14d, %ebx
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
sarl %ecx
addl %r12d, %eax
movq 0x10(%rsp), %rdx
addl %edx, %ecx
incl %ecx
shlq $0x20, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x40(%rsp)
leal (%rax,%r14,2), %eax
decl %eax
orq %rcx, %rax
movq %rax, 0x18(%rsp)
testl %r14d, %r14d
jle 0x8a2ba
movq 0xe1a48(%rip), %r15     # 0x16b9e8
leaq 0x40(%rsp), %r12
leaq 0x18(%rsp), %r13
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x58300
movq 0x40(%rsp), %xmm0
psubd 0x6c5e7(%rip), %xmm0    # 0xf65b0
movq %xmm0, 0x40(%rsp)
movq 0x18(%rsp), %xmm0
paddd 0x6c053(%rip), %xmm0    # 0xf6030
movq %xmm0, 0x18(%rsp)
decl %r14d
jne 0x89faa
jmp 0x8a2ba
movq %rbp, %rdi
callq 0x58410
leaq 0x40(%rsp), %rdx
movq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x28(%rsp), %rcx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x55ba0
movq 0x488(%r15), %rcx
movq 0x490(%r15), %rax
movq %rcx, %rdx
orq %rax, %rdx
je 0x8a2ba
testq %rcx, %rcx
je 0x8a191
movl 0x8(%rcx), %ecx
testq %rax, %rax
je 0x8a194
addl 0x8(%rax), %ecx
jmp 0x8a194
movl 0x8(%rax), %ecx
testl %ecx, %ecx
jle 0x8a2ba
cmpq $0x0, 0x5b8(%r15)
je 0x8a2ba
cvtsi2sdl (%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x69623(%rip), %xmm0    # 0xf36b8
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6bf72(%rip), %xmm1    # 0xf6018
cvttsd2si %xmm1, %eax
movq 0x10(%rsp), %rcx
incl %ecx
leaq 0x40(%rsp), %r14
movl %eax, (%r14)
movl %ecx, 0x4(%r14)
movq %r15, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x695dd(%rip), %xmm0    # 0xf36b8
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6bf2c(%rip), %xmm1    # 0xf6018
cvttsd2si %xmm1, %eax
addl $-0x2, %ebx
leaq 0x18(%rsp), %rdx
movl %eax, (%rdx)
movl %ebx, 0x4(%rdx)
movq %r15, %rdi
movq %r14, %rsi
movl $0x2, %ecx
jmp 0x8a187
leaq 0xa8(%r15), %rsi
movl 0xb0(%r15), %eax
leaq 0x40(%rsp), %r13
movl %eax, (%r13)
movl $0x4, 0x4(%r13)
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rdx
callq *0x150(%rax)
movl %r12d, (%r13)
movq 0x10(%rsp), %rax
movl %eax, 0x4(%r13)
leaq 0x18(%rsp), %r15
movl %r14d, (%r15)
movl %eax, 0x4(%r15)
leaq 0x40(%rsp), %r12
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x58fc0
addl $0x2, 0x4(%r12)
addl $0x2, 0x4(%r15)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl $0x1, %ecx
callq 0x58fc0
jmp 0x8a2ba
movl 0x8(%rax), %ecx
testl %ecx, %ecx
jle 0x8a2ba
cmpq $0x0, 0x5b8(%r15)
je 0x8a2ba
cvtsi2sd %r12d, %xmm0
movsd %xmm0, (%rsp)
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x694e1(%rip), %xmm0    # 0xf36b8
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6be30(%rip), %xmm1    # 0xf6018
movsd %xmm1, 0x80(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd 0x80(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movq 0x10(%rsp), %rcx
incl %ecx
leaq 0x40(%rsp), %r12
movl %eax, (%r12)
movl %ecx, 0x4(%r12)
movq %r13, %rdi
callq 0x58930
cwtl
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x69471(%rip), %xmm0    # 0xf36b8
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x6bdc0(%rip), %xmm1    # 0xf6018
movsd %xmm1, (%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
addsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
decl %ebx
leaq 0x18(%rsp), %r14
movl %eax, (%r14)
movl %ebx, 0x4(%r14)
movq 0xe123f(%rip), %r15     # 0x16b4d0
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x58300
incl (%r12)
incl (%r14)
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x58300
movq 0x8(%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 0x8a2dc
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x56720
movq %rbx, %rdi
callq 0x57090
nop