// File: /workspace/github_c_makefile_star2_O2/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 $0xa8, %rsp
movl %esi, %ebx
movq %rdi, %r15
movq (%rdi), %rax
callq *0x88(%rax)
testb %al, %al
je 0x86fa6
movq (%r15), %rax
movq %r15, %rdi
callq *0x90(%rax)
xorl %ecx, %ecx
testb %al, %al
je 0x8754e
movq (%r15), %rax
movq %r15, %rdi
callq *0x40(%rax)
movq %rax, %r13
movq (%r15), %rax
movq %r15, %rdi
callq *0x48(%rax)
movl %ebx, 0x20(%rsp)
movq %rax, %rbp
movq %rax, %r14
shrq $0x20, %r14
movq (%r15), %rax
movq %r15, %rdi
callq *0x50(%rax)
movq %rax, 0x10(%rsp)
movabsq $0x200000002, %rax      # imm = 0x200000002
leaq 0x28(%rsp), %r12
movq %rax, (%r12)
movq %r13, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
movq %r12, %rdi
callq 0x570c0
leaq 0x50(%rsp), %rdi
movq %rax, (%rdi)
movsd 0x5c7c4(%rip), %xmm0    # 0xe3510
callq 0x59600
movq %rax, %r12
movq %rax, %rbx
shrq $0x20, %rbx
movq %rbp, 0x38(%rsp)
addl %ebp, %r12d
movl 0x20(%rsp), %ebp
movq %r14, 0x18(%rsp)
addl %r14d, %ebx
cmpq $0x0, 0x5b8(%r15)
pushq $-0x4
popq %rax
pushq $-0x10
popq %rcx
cmovel %eax, %ecx
addl 0xb0(%r15), %ecx
movl 0xb4(%r15), %eax
addl $-0x4, %eax
shlq $0x20, %rax
orq %rax, %rcx
leaq 0x98(%rsp), %r14
movq %rcx, (%r14)
movq %r13, 0x8(%rsp)
movq %r13, %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
callq 0x57480
leaq 0x90(%rsp), %rdi
movq %rax, (%rdi)
movsd 0x5c740(%rip), %xmm0    # 0xe3510
callq 0x59050
movl %r12d, 0x40(%rsp)
addl %eax, %r12d
shrq $0x20, %rax
movl %ebx, 0x44(%rsp)
movl %r12d, 0x48(%rsp)
addl %ebx, %eax
movq 0x10(%rsp), %rbx
movl %eax, 0x4c(%rsp)
cmpl $0x5, %ebp
ja 0x8754c
movq %rbx, %r12
shrq $0x20, %r12
movl %ebp, %eax
leaq 0x5fad2(%rip), %rcx     # 0xe68e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpb $0x1, 0xcd(%r15)
jne 0x86e3a
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x86e3a
cmpq %r15, 0x190(%rax)
je 0x8754c
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x574f0
testb %al, %al
je 0x8754c
leaq 0x50(%rsp), %r13
movq 0x38(%rsp), %rcx
movl %ecx, (%r13)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r13)
addl %ebx, %ecx
movl %ecx, 0x10(%rsp)
movl %ecx, 0x8(%r13)
addl %eax, %r12d
movl %r12d, 0xc(%r13)
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x56160
movq 0xdb116(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
andq $0x0, (%r13)
movq 0xda630(%rip), %rdx     # 0x1614d0
leaq 0x40(%rsp), %rbx
leaq 0x50(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %r8
callq 0x58b80
movq %rbp, %rdi
callq 0x596e0
andq $0x0, (%r13)
movq (%rax), %rax
movq %rax, 0x8(%r13)
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rcx
callq 0x56c20
leaq 0x478(%r15), %rdi
callq 0x878c6
testl %eax, %eax
jle 0x87544
cmpq $0x0, 0x5b8(%r15)
je 0x87544
cvtsi2sdl 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0x59c60
cwtl
imull $0xb, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0x5c5eb(%rip), %xmm1    # 0xe3510
divsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x5f085(%rip), %xmm1    # 0xe5fc0
cvttsd2si %xmm1, %eax
movq 0x18(%rsp), %rcx
incl %ecx
leaq 0x50(%rsp), %r14
movl %eax, (%r14)
movl %ecx, 0x4(%r14)
movq 0x8(%rsp), %rdi
callq 0x59c60
cwtl
imull $0xb, %eax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x5c5a4(%rip), %xmm0    # 0xe3510
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x5f042(%rip), %xmm1    # 0xe5fc0
cvttsd2si %xmm1, %eax
addl $-0x2, %r12d
leaq 0x28(%rsp), %rdx
movl %eax, (%rdx)
movl %r12d, 0x4(%rdx)
pushq $0x2
popq %rcx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %r14
jmp 0x8753f
pushq $-0x1
popq %rcx
jmp 0x8754e
leaq 0x50(%rsp), %rsi
movq 0x38(%rsp), %r13
movl %r13d, (%rsi)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%rsi)
leal (%rbx,%r13), %ebp
movl %ebp, 0x8(%rsi)
leal (%r12,%rax), %ebx
movl %ebx, 0xc(%rsi)
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x56160
leaq 0xf0(%r15), %rdi
movq %rdi, 0x20(%rsp)
xorl %esi, %esi
callq 0x56280
testb %al, %al
je 0x8715d
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x590c0
testb %al, %al
je 0x8715d
movl 0xd0(%r15), %eax
addl $-0x4, %eax
rolw $0xe, %ax
cmpw $0x2, %ax
jb 0x874e6
movzwl %ax, %eax
cmpl $0x7, %eax
je 0x87038
cmpl $0x3, %eax
jne 0x87544
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x5a1f0
leaq 0x50(%rsp), %r14
movl %r13d, (%r14)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r14)
leaq 0x28(%rsp), %r15
movl %r13d, (%r15)
movl %ebx, 0x4(%r15)
pushq $0x2
popq %rbp
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x5a330
addl $0x2, (%r14)
addl $0x2, (%r15)
jmp 0x8752d
cmpb $0x1, 0xcd(%r15)
jne 0x870a5
movq 0x5b8(%r15), %rax
testq %rax, %rax
je 0x870a5
cmpq %r15, 0x190(%rax)
je 0x8754c
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x574f0
testb %al, %al
je 0x8754c
leaq 0x50(%rsp), %r14
movq 0x38(%rsp), %rcx
movl %ecx, (%r14)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r14)
leal (%rbx,%rcx), %r13d
movl %r13d, 0x8(%r14)
addl %eax, %r12d
movl %r12d, 0xc(%r14)
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x56160
movq 0xdaeae(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
andq $0x0, (%r14)
movq %rbx, %r14
movq 0xda3c6(%rip), %rdx     # 0x1614d0
leaq 0x40(%rsp), %rsi
leaq 0x50(%rsp), %r8
movq %rbx, %rdi
callq 0x58b80
testb $0x1, 0x30(%r15)
jne 0x87395
leaq 0x5c8(%r15), %r14
movq %r14, %rdi
callq 0x596e0
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x40(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %r14
jmp 0x873b8
movq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x57d40
testb %al, %al
je 0x87303
leaq 0x5c0(%r15), %rdi
xorl %esi, %esi
callq 0x590c0
testb %al, %al
je 0x87303
movl %r12d, %eax
subl 0x18c(%r15), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x5c1e0(%rip), %xmm0    # 0xe3380
callq 0x57e30
movq %rax, %rbp
pushq $0x2
popq %rax
leaq 0x90(%rsp), %r14
movq %rax, (%r14)
movq 0x8(%rsp), %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
callq 0x570c0
leaq 0x50(%rsp), %rdi
movq %rax, (%rdi)
movsd 0x5c333(%rip), %xmm0    # 0xe3510
callq 0x59600
movl %r13d, %ebx
addl %eax, %ebx
leal (%rax,%r13), %ecx
incl %ecx
movl %ecx, 0x38(%rsp)
shrq $0x20, %rax
movq 0x18(%rsp), %rdx
addl %ebp, %edx
movl %edx, %ecx
addl %eax, %ecx
leal (%rax,%rdx), %r13d
decl %r13d
leal -0x1(%r12,%rcx), %ebp
leaq 0xa0(%rsp), %r14
pushq $0x2
popq %rax
movq %rax, (%r14)
movq 0x8(%rsp), %rdi
callq 0x59c60
cwtl
cvtsi2sd %eax, %xmm0
movq %r14, %rdi
movq 0x8(%rsp), %r14
callq 0x57480
leaq 0x98(%rsp), %rdi
movq %rax, (%rdi)
movsd 0x5c2c7(%rip), %xmm0    # 0xe3510
callq 0x59050
movq 0x10(%rsp), %rcx
subl %eax, %ecx
shrq $0x20, %rax
movl 0x38(%rsp), %edx
movl %edx, 0x28(%rsp)
movl %r13d, 0x2c(%rsp)
addl %ebx, %ecx
decl %ecx
movl %ecx, 0x30(%rsp)
subl %eax, %ebp
addl $-0x2, %ebp
movl %ebp, 0x34(%rsp)
leaq 0x140(%r15), %rsi
leaq 0x50(%rsp), %rdi
callq 0x56bf0
movq (%r15), %rax
movq %r15, %rdi
callq *0x98(%rax)
testb %al, %al
jne 0x872a9
movq 0xda6b1(%rip), %rsi     # 0x161950
leaq 0x50(%rsp), %rdi
callq 0x59940
movq (%r15), %rax
movq %r15, %rdi
callq *0x140(%rax)
movq 0xdacec(%rip), %rcx     # 0x161fa8
movl (%rcx), %ecx
leaq 0x90(%rsp), %r8
andq $0x0, (%r8)
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
movq %rax, %rdx
callq 0x58b80
movq 0x20(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x58df0
leaq 0x50(%rsp), %rdi
callq 0x57860
jmp 0x87544
movq %rbx, %rdi
xorl %esi, %esi
callq 0x56280
testb %al, %al
je 0x87544
leaq 0x5c0(%r15), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x574f0
testb %al, %al
je 0x87544
movq 0xdac73(%rip), %rax     # 0x161fa8
movl (%rax), %ecx
leaq 0x50(%rsp), %r8
andq $0x0, (%r8)
movq 0xda189(%rip), %rdx     # 0x1614d0
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x58b80
testb $0x1, 0x30(%r15)
jne 0x87562
leaq 0x5c8(%r15), %r14
movq %r14, %rdi
callq 0x596e0
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x40(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %r14
jmp 0x87585
movq %rbp, %rdi
callq 0x596e0
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x56c20
leaq 0x478(%r15), %rdi
callq 0x878c6
testl %eax, %eax
jle 0x87544
cmpq $0x0, 0x5b8(%r15)
je 0x87544
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r14, %rdi
callq 0x59c60
cwtl
imull $0xb, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0x5c10e(%rip), %xmm1    # 0xe3510
divsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x5eba8(%rip), %xmm1    # 0xe5fc0
movsd %xmm1, 0x20(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
addsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %eax
movq 0x18(%rsp), %rcx
incl %ecx
leaq 0x50(%rsp), %r13
movl %eax, (%r13)
movl %ecx, 0x4(%r13)
movq %r14, %rdi
callq 0x59c60
cwtl
imull $0xb, %eax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x5c0a9(%rip), %xmm0    # 0xe3510
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
addsd 0x5eb47(%rip), %xmm1    # 0xe5fc0
movsd %xmm1, 0x10(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
addsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
decl %r12d
leaq 0x28(%rsp), %r14
movl %eax, (%r14)
movl %r12d, 0x4(%r14)
movq 0xda01e(%rip), %r15     # 0x1614d0
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x595b0
incl (%r13)
incl (%r14)
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rdx
movq 0x8(%rsp), %r14
movq %r15, %rcx
callq 0x595b0
jmp 0x87544
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x58980
leaq 0x50(%rsp), %r14
movl %r13d, (%r14)
movq 0x18(%rsp), %rax
movl %eax, 0x4(%r14)
leaq 0x28(%rsp), %r15
movl %ebp, (%r15)
movl %eax, 0x4(%r15)
pushq $0x1
popq %rbp
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x5a330
addl $0x2, 0x4(%r14)
addl $0x2, 0x4(%r15)
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq 0x8(%rsp), %r14
movq %r15, %rdx
movl %ebp, %ecx
callq 0x5a330
movq %r14, %rdi
callq 0x59a80
xorl %ecx, %ecx
movl %ecx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbp, %rdi
callq 0x596e0
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
movq (%rax), %rax
movq %rax, 0x8(%rdx)
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x56c20
cmpq $0x0, 0x5b8(%r15)
je 0x87544
movq %r14, %rdi
callq 0x59c60
cwtl
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm0
movsd 0x5bf64(%rip), %xmm1    # 0xe3510
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %al
leaq 0x5c1ec(%rip), %rcx     # 0xe37b0
addsd (%rcx,%rax,8), %xmm0
cvttsd2si %xmm0, %r14
movq 0x10(%rsp), %rcx
subl %r14d, %ecx
subl %r14d, %ecx
cvtsi2sd %ecx, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x8(%rsp), %rdi
callq 0x59c60
cwtl
addl %eax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x5bf14(%rip), %xmm0    # 0xe3510
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq (%r15), %rax
movq %r15, %rdi
callq *0x160(%rax)
xorb $0x1, %al
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd 0x10(%rsp), %xmm1
subsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
subl %r14d, %r12d
pushq $0x2
popq %rsi
movl %r12d, %eax
cltd
idivl %esi
addl %r13d, %ecx
movq 0x18(%rsp), %rdx
addl %edx, %eax
incl %eax
shlq $0x20, %rax
leaq (%rcx,%rax), %rdx
leaq 0x50(%rsp), %r15
movq %rdx, (%r15)
leal (%rcx,%r14,2), %ecx
decl %ecx
orq %rax, %rcx
leaq 0x28(%rsp), %r12
xorl %ebx, %ebx
testl %r14d, %r14d
cmovgl %r14d, %ebx
movq 0x8(%rsp), %r14
movq %rcx, (%r12)
movq 0xda36a(%rip), %r13     # 0x1619e8
subl $0x1, %ebx
jb 0x87544
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x595b0
movq 0x50(%rsp), %xmm0
psubd 0x5ee4a(%rip), %xmm0    # 0xe64f0
movq %xmm0, 0x50(%rsp)
movq 0x28(%rsp), %xmm0
paddd 0x5e916(%rip), %xmm0    # 0xe5fd0
movq %xmm0, 0x28(%rsp)
jmp 0x8767e
jmp 0x876c4
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x57860
movq %rbx, %rdi
callq 0x58260
nop