// File: /workspace/github_c_makefile_star2_O3/enzo1982[P]smooth/classes/gui/dialogs/messagebox.cpp
// Function: smooth::GUI::Dialogs::MessageDlg::InitializeWidgets(smooth::String const&, smooth::String const&, int, smooth::GUI::Bitmap const&, smooth::String const&, bool*)
S::Bool S::GUI::Dialogs::MessageDlg::InitializeWidgets(const String &iText, const String &title, Int iButtons, const Bitmap &bitmap, const String &checkBoxText, Bool *iCVar)
{
	text	   = iText;
	cVar	   = iCVar;

	buttons	   = iButtons;
	buttonCode = -1;

	msgbox		= new Window(title, Point(), Size());
	msgbox->SetRightToLeft(defaultRightToLeft);
	msgbox->SetFlags(msgbox->GetFlags() | WF_MODAL);

	titlebar	= new Titlebar(TB_CLOSEBUTTON);
	layer		= new Layer();
	icon		= new Image(bitmap, Point(14, 19), Size(32, 32));

	/* Compute message box size.
	 */
	Int	 maxSize      = 0;
	Int	 buttonWidth  = 80;
	Int	 buttonHeight = 22;

	GUI::Font		 font;
	const Array<String>	&lines = text.Explode("\n");

	foreach (const String &line, lines)
	{
		Int	 textSize = font.GetUnscaledTextSizeX(line);

		if (textSize > maxSize) maxSize = textSize;
	}

	msgbox->SetWidth(maxSize + 36);
	msgbox->SetHeight((((Int) Math::Max(2, lines.Length()) + 1) * 16) + 70 + buttonHeight);

	if (bitmap != NIL) msgbox->SetWidth(maxSize + 36 + icon->GetWidth() + 20);

	Int	 titleSize = Font(Font::Default, Font::DefaultSize, Font::Bold).GetUnscaledTextSizeX(title);

	msgbox->SetWidth(Math::Max(msgbox->GetWidth(), titleSize + 80));

	/* Add widgets.
	 */
	Add(msgbox);

	msgbox->Add(titlebar);
	msgbox->Add(layer);
	msgbox->Add(icon);

	msgbox->onPaint.Connect(&MessageDlg::MessagePaintProc, this);
	msgbox->doClose.Connect(&MessageDlg::MessageKillProc, this);

	/* Add optional checkbox.
	 */
	checkbox = NIL;

	if (cVar != NIL)
	{
		checkbox = new CheckBox(checkBoxText, Point(13, 46 + buttonHeight), Size(100, 0), cVar);
		checkbox->SetOrientation(OR_LOWERLEFT);
		checkbox->SetWidth(checkbox->GetUnscaledTextWidth() + 21);

		msgbox->SetWidth(Math::Max(msgbox->GetWidth(), checkbox->GetUnscaledTextWidth() + 54));
		msgbox->SetHeight(msgbox->GetHeight() + 22);

		if (bitmap != NIL)
		{
			checkbox->SetX(checkbox->GetX() + icon->GetWidth() + 20);

			msgbox->SetWidth(Math::Max(msgbox->GetWidth(), checkbox->GetUnscaledTextWidth() + 54 + icon->GetWidth() + 20));
		}

		layer->Add(checkbox);
	}

	/* Find button labels.
	 */
	switch (buttons)
	{
		default:
		case Message::Buttons::Ok:
			buttonLabels.Add("OK");

			break;
		case Message::Buttons::OkCancel:
			buttonLabels.Add("OK");
			buttonLabels.Add("Cancel");

			break;
		case Message::Buttons::YesNo:
			buttonLabels.Add("Yes");
			buttonLabels.Add("No");

			break;
		case Message::Buttons::YesNoCancel:
			buttonLabels.Add("Yes");
			buttonLabels.Add("No");
			buttonLabels.Add("Cancel");

			break;
		case Message::Buttons::RetryCancel:
			buttonLabels.Add("Retry");
			buttonLabels.Add("Cancel");

			break;
		case Message::Buttons::AbortRetryIgnore:
			buttonLabels.Add("Abort");
			buttonLabels.Add("Retry");
			buttonLabels.Add("Ignore");

			break;
	}

	/* Add buttons.
	 */
	msgbox->SetWidth(Math::Max(msgbox->GetWidth(), buttonLabels.Length() * (buttonWidth + 9) + 21));

	foreach (const String &buttonLabel, buttonLabels)
	{
		Button	*button = new Button(I18n::Translator::defaultTranslator->TranslateString(buttonLabel), Point((msgbox->GetWidth() - (buttonLabels.Length() * (buttonWidth + 9) - 9)) / 2 - 3 + (foreachindex * (buttonWidth + 9)), 14 + buttonHeight), Size());

		if	(foreachindex == 0) button->onAction.Connect(&MessageDlg::MessageButton0, this);
		else if	(foreachindex == 1) button->onAction.Connect(&MessageDlg::MessageButton1, this);
		else if	(foreachindex == 2) button->onAction.Connect(&MessageDlg::MessageButton2, this);

		button->SetOrientation(OR_LOWERLEFT);

		buttonWidgets.Add(button);

		layer->Add(button);
	}

	/* Position message box on screen.
	 */
	Rect	 workArea    = System::Screen::GetActiveScreenWorkArea();
	Float	 scaleFactor = Surface().GetSurfaceDPI() / 96.0;

	msgbox->SetPosition(workArea.GetPosition() + Point((workArea.GetWidth()  - Math::Round(msgbox->GetWidth()  * scaleFactor)) / 2,
							   (workArea.GetHeight() - Math::Round(msgbox->GetHeight() * scaleFactor)) / 2) + Point(nOfMessageBoxes * 25, nOfMessageBoxes * 25));

	return True;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r9, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movl %ecx, %ebx
movq %rdx, %r12
movq %rdi, %rbp
movq 0x140(%rsp), %r14
leaq 0xf0(%rdi), %r13
movq %r13, %rdi
callq 0x555f0
movq %r14, 0x6d0(%rbp)
movl %ebx, 0x5e8(%rbp)
movl $0xffffffff, 0x6c0(%rbp) # imm = 0xFFFFFFFF
movl $0x6d8, %edi            # imm = 0x6D8
callq 0x556b0
movq %rax, %r15
xorl %eax, %eax
leaq 0x70(%rsp), %rdx
movq %rax, (%rdx)
leaq 0xc8(%rsp), %rcx
movq %rax, (%rcx)
movq %r15, %rdi
movq %r12, %rsi
xorl %r8d, %r8d
callq 0x56fe0
movq %r15, 0x5f0(%rbp)
movq 0x102449(%rip), %rax    # 0x16bdc0
movzbl (%rax), %esi
movq %r15, %rdi
callq 0x57b90
movq 0x5f0(%rbp), %rax
orl $0x1, 0x30(%rax)
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x556b0
movq %rax, %r15
movq %rax, %rdi
movl $0x4, %esi
callq 0x56390
movq %rbp, 0x48(%rsp)
movq %r15, 0x5f8(%rbp)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %rbp
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
callq 0x58e20
leaq 0x70(%rsp), %rsi
movq %rbp, %rdi
callq 0x56a90
movq 0x48(%rsp), %r14
movq %rbp, 0x600(%r14)
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x59200
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x556b0
movq %rax, %r15
movabsq $0x130000000e, %rax     # imm = 0x130000000E
movq %rax, (%rbx)
movabsq $0x2000000020, %rax     # imm = 0x2000000020
leaq 0xc8(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x70(%rsp), %rdx
movq %r15, %rdi
movq 0x50(%rsp), %rsi
callq 0x55980
movq %r15, 0x608(%r14)
movq 0x102457(%rip), %r14    # 0x16be98
movswl (%r14), %edx
movq 0x101d34(%rip), %rax    # 0x16b780
movswl (%rax), %ecx
leaq 0x70(%rsp), %r9
movq $0x0, 0x8(%r9)
movl $0x0, (%r9)
movq 0x10234e(%rip), %rsi    # 0x16bdb8
leaq 0xc8(%rsp), %rdi
movl %ecx, %r8d
callq 0x57270
leaq 0xa7fa6(%rip), %rsi     # 0x111a27
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x70(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %r13, %rsi
callq 0x57f10
leaq 0x8(%rsp), %rdi
callq 0x59200
cmpl $0x0, 0x78(%rsp)
jle 0x69aea
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
leaq 0x70(%rsp), %r13
leaq 0xc8(%rsp), %r15
incl %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x64250
movq %r15, %rdi
movq %rax, %rsi
callq 0x57f50
cmpl %ebx, %eax
cmovgl %eax, %ebx
movl 0x78(%rsp), %eax
decl %eax
cmpl %eax, %ebp
jl 0x69ac2
jmp 0x69aec
xorl %ebx, %ebx
movq 0x48(%rsp), %r13
movq 0x5f0(%r13), %rdi
leal 0x24(%rbx), %eax
leaq 0xa8(%rdi), %rsi
movl 0xb4(%rdi), %ecx
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
movq 0x5f0(%r13), %rdi
movl 0x78(%rsp), %eax
cmpl $0x3, %eax
movl $0x2, %ecx
cmovgel %eax, %ecx
shll $0x4, %ecx
addl $0x6c, %ecx
leaq 0xa8(%rdi), %rsi
movl 0xb0(%rdi), %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
movq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x69ba0
movq 0x5f0(%r13), %rdi
movq 0x608(%r13), %rax
movl 0xb0(%rax), %eax
addl %ebx, %eax
addl $0x38, %eax
leaq 0xa8(%rdi), %rsi
movl 0xb4(%rdi), %ecx
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
movswl (%r14), %edx
movq 0x10189d(%rip), %rax    # 0x16b448
movswl (%rax), %ecx
movq 0x101bcb(%rip), %rax    # 0x16b780
movswl (%rax), %r8d
leaq 0x60(%rsp), %r9
movq $0x0, 0x8(%r9)
movl $0x0, (%r9)
movq 0x1021e4(%rip), %rsi    # 0x16bdb8
leaq 0x8(%rsp), %rdi
callq 0x57270
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x57f50
movl %eax, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x56720
movq 0x5f0(%r13), %rdi
movl 0xb0(%rdi), %eax
addl $0x50, %ebx
cmpl %ebx, %eax
cmovgl %eax, %ebx
leaq 0xa8(%rdi), %rsi
movl 0xb4(%rdi), %eax
movl %ebx, (%r15)
movl %eax, 0x4(%r15)
movq (%rdi), %rax
leaq 0x8(%rsp), %rdx
callq *0x150(%rax)
movq 0x5f0(%r13), %rsi
movq (%r13), %rax
movq %r13, %rdi
callq *0x30(%rax)
movq 0x5f0(%r13), %rdi
movq 0x5f8(%r13), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5f0(%r13), %rdi
movq 0x600(%r13), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x5f0(%r13), %rdi
movq 0x608(%r13), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movl $0x648, %edi            # imm = 0x648
addq 0x5f0(%r13), %rdi
movq 0x101f9f(%rip), %rsi    # 0x16bc30
xorl %edx, %edx
movq %r13, %rcx
callq 0x6b234
movl $0x688, %ebx            # imm = 0x688
addq 0x5f0(%r13), %rbx
movq %rbx, %rdi
callq 0x6b38c
movq 0x101dea(%rip), %rsi    # 0x16baa0
movq %rbx, %rdi
xorl %edx, %edx
movq %r13, %rcx
callq 0x6b3c6
movq $0x0, 0x6c8(%r13)
movq 0x6d0(%r13), %r12
testq %r12, %r12
je 0x69ea5
movl $0x5d8, %edi            # imm = 0x5D8
callq 0x556b0
movq %rax, %r15
movabsq $0x440000000d, %rax     # imm = 0x440000000D
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0x60(%rsp), %rcx
movq $0x64, (%rcx)
movq %r15, %rdi
movq 0x58(%rsp), %rsi
movq %r12, %r8
callq 0x55b10
movq %r15, 0x6c8(%r13)
movq (%r15), %rax
movq %r15, %rdi
movl $0x18, %esi
callq *0x120(%rax)
movq 0x6c8(%r13), %r15
movq (%r15), %rax
movq %r15, %rdi
callq *0xf0(%rax)
addl $0x15, %eax
leaq 0xa8(%r15), %rsi
movl 0xb4(%r15), %ecx
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
movq 0x5f0(%r13), %r15
movq 0x6c8(%r13), %rdi
movl 0xb0(%r15), %ebx
movq (%rdi), %rax
callq *0xf0(%rax)
addl $0x36, %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
leaq 0xa8(%r15), %rsi
movl 0xb4(%r15), %ecx
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%r15), %rax
movq %r15, %rdi
callq *0x150(%rax)
movq 0x5f0(%r13), %rdi
movl 0xb4(%rdi), %eax
addl $0x16, %eax
leaq 0xa8(%rdi), %rsi
movl 0xb0(%rdi), %ecx
leaq 0x8(%rsp), %rdx
movl %ecx, (%rdx)
movl %eax, 0x4(%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
movq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x69e91
movq 0x608(%r13), %rax
movq 0x6c8(%r13), %rdi
movl 0xa8(%rdi), %ecx
movl 0xb0(%rax), %eax
addl %ecx, %eax
addl $0x14, %eax
movl 0xac(%rdi), %ecx
leaq 0x8(%rsp), %rsi
movl %eax, (%rsi)
movl %ecx, 0x4(%rsi)
leaq 0xb0(%rdi), %rdx
movq (%rdi), %rax
callq *0x150(%rax)
movq 0x5f0(%r13), %r14
movq 0x6c8(%r13), %rdi
movl 0xb0(%r14), %ebx
movq (%rdi), %rax
callq *0xf0(%rax)
movq 0x608(%r13), %rcx
movl 0xb0(%rcx), %ecx
addl %ecx, %eax
addl $0x4a, %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
leaq 0xa8(%r14), %rsi
movl 0xb4(%r14), %ecx
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl %ecx, 0x4(%rdx)
movq (%r14), %rax
movq %r14, %rdi
callq *0x150(%rax)
movq 0x600(%r13), %rdi
movq 0x6c8(%r13), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movl 0x5e8(%r13), %eax
decl %eax
cmpl $0x4, %eax
ja 0x6a0ae
leaq 0x89a9a(%rip), %rcx     # 0xf3958
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc427a(%rip), %rsi     # 0x12e148
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x89943(%rip), %rsi     # 0xf3840
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
jmp 0x6a0d0
leaq 0x89b33(%rip), %rsi     # 0xf3a53
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x898f1(%rip), %rsi     # 0xf3840
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
jmp 0x6a0d0
leaq 0x89ada(%rip), %rsi     # 0xf3a4c
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x89aaf(%rip), %rsi     # 0xf3a50
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x89877(%rip), %rsi     # 0xf3840
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
jmp 0x6a0d0
leaq 0x89a60(%rip), %rsi     # 0xf3a4c
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x89a35(%rip), %rsi     # 0xf3a50
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
jmp 0x6a0d0
leaq 0x89a1b(%rip), %rsi     # 0xf3a59
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x899e6(%rip), %rsi     # 0xf3a53
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
leaq 0x899ca(%rip), %rsi     # 0xf3a5f
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x642ac
jmp 0x6a0d0
leaq 0xc4093(%rip), %rsi     # 0x12e148
leaq 0x8(%rsp), %rdi
callq 0x579f0
leaq 0x610(%r13), %rdi
leaq 0x8(%rsp), %rsi
callq 0x642ac
leaq 0x8(%rsp), %rdi
callq 0x59200
movq 0x5f0(%r13), %rdi
movl 0xb0(%rdi), %eax
imull $0x59, 0x618(%r13), %ecx
addl $0x15, %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
leaq 0xa8(%rdi), %rsi
movl 0xb4(%rdi), %eax
leaq 0x8(%rsp), %rdx
movl %ecx, (%rdx)
movl %eax, 0x4(%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
cmpl $0x0, 0x618(%r13)
jle 0x6a26b
movq 0x48(%rsp), %rax
leaq 0x610(%rax), %rcx
movq %rcx, 0x50(%rsp)
addq $0x668, %rax            # imm = 0x668
movq %rax, 0x58(%rsp)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
leaq 0x8(%rsp), %r12
leal 0x1(%r15), %ebp
movq 0x50(%rsp), %rdi
movl %ebp, %esi
callq 0x6b5b4
movq %rax, %rbx
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x556b0
movq %rax, %r13
movq 0x10126f(%rip), %rax    # 0x16b3e8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x58260
movq 0x48(%rsp), %rdx
movq 0x5f0(%rdx), %rcx
movl 0xb0(%rcx), %ecx
imull $-0x59, 0x618(%rdx), %edx
leal (%rcx,%rdx), %esi
addl %edx, %ecx
addl $0x9, %ecx
shrl $0x1f, %ecx
addl %esi, %ecx
addl $0x9, %ecx
sarl %ecx
addl %r14d, %ecx
movl %ecx, 0x8(%rsp)
movl $0x24, 0xc(%rsp)
movq $0x0, 0x60(%rsp)
movq %r13, %rdi
movq %rax, %rsi
movq %r12, %rdx
leaq 0x60(%rsp), %rcx
callq 0x573b0
movq 0x101b5f(%rip), %rsi    # 0x16bd40
cmpl $-0x1, %r15d
je 0x6a200
movq 0x101dfa(%rip), %rsi    # 0x16bfe8
testl %r15d, %r15d
je 0x6a200
movq 0x10165e(%rip), %rsi    # 0x16b858
cmpl $0x1, %r15d
jne 0x6a216
movq %r13, %rdi
addq $0x478, %rdi            # imm = 0x478
xorl %edx, %edx
movq 0x48(%rsp), %rcx
callq 0x6b234
movq (%r13), %rax
movq %r13, %rdi
movl $0x18, %esi
callq *0x120(%rax)
movq %r13, 0x8(%rsp)
movq 0x58(%rsp), %rdi
movq %r12, %rsi
callq 0x5aed8
movq 0x48(%rsp), %rax
movq 0x600(%rax), %rdi
movq (%rdi), %rax
movq %r13, %rsi
callq *0x30(%rax)
movq 0x48(%rsp), %rax
movl 0x618(%rax), %eax
decl %eax
addl $0x59, %r14d
movl %ebp, %r15d
cmpl %eax, %ebp
jl 0x6a152
callq 0x57e90
movq %rax, %r14
movq %rdx, %r15
leaq 0x60(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x57150
movq 0x48(%rsp), %r12
leaq 0x8(%rsp), %rdi
callq 0x58930
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x57b20
movswl %bx, %eax
cvtsi2sd %eax, %xmm0
movq 0x5f0(%r12), %rdi
divsd 0x893f8(%rip), %xmm0    # 0xf36b8
movq %r14, %rax
shrq $0x20, %rax
movl %r15d, %ecx
subl %r14d, %ecx
movslq %ecx, %rsi
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cvtdq2pd 0xb0(%rdi), %xmm1
andq %r14, %rcx
subq %rcx, %r15
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd %xmm1, %xmm0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movmskpd %xmm2, %r8d
movsd 0x89086(%rip), %xmm1    # 0xf3390
movsd 0x89086(%rip), %xmm2    # 0xf3398
movapd %xmm1, %xmm3
testb $0x1, %r8b
jne 0x6a320
movapd %xmm2, %xmm3
leaq 0xb0(%rdi), %rdx
sarq $0x20, %r15
addsd %xmm0, %xmm3
cvttsd2si %xmm3, %rcx
subq %rcx, %rsi
movq %rsi, %rcx
shrq $0x3f, %rcx
addq %rsi, %rcx
shrq %rcx
testb $0x2, %r8b
jne 0x6a34e
movapd %xmm2, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rsi
subq %rsi, %r15
movq %r15, %rsi
shrq $0x3f, %rsi
addq %r15, %rsi
shrq %rsi
movq 0x1012ae(%rip), %r8     # 0x16b620
movl (%r8), %r8d
leal (%r8,%r8,4), %r8d
leal (%r8,%r8,4), %r8d
addl %r8d, %ecx
addl %r14d, %ecx
addl %r8d, %eax
addl %esi, %eax
shlq $0x20, %rax
orq %rax, %rcx
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
movq (%rdi), %rax
callq *0x150(%rax)
leaq 0x70(%rsp), %rdi
callq 0x63e3c
leaq 0xc8(%rsp), %rdi
callq 0x56720
movb $0x1, %al
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6a406
jmp 0x6a406
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
jmp 0x6a406
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0x6a4e1
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
movq %rax, %rbx
movl $0x5d8, %esi            # imm = 0x5D8
movq %r15, %rdi
jmp 0x6a4d3
jmp 0x6a4de
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x57b20
jmp 0x6a4e1
jmp 0x6a4de
jmp 0x6a4de
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x56720
jmp 0x6a4e1
jmp 0x6a4de
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x59200
jmp 0x6a4eb
movq %rax, %rbx
jmp 0x6a4eb
jmp 0x6a4a4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x59200
jmp 0x6a49a
movq %rax, %rbx
movl $0x5b8, %esi            # imm = 0x5B8
movq %rbp, %rdi
jmp 0x6a4b9
movq %rax, %rbx
movl $0x5c8, %esi            # imm = 0x5C8
jmp 0x6a4b6
movq %rax, %rbx
movl $0x6d8, %esi            # imm = 0x6D8
movq %r15, %rdi
callq 0x55480
jmp 0x6a4f8
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4de
jmp 0x6a4c8
movq %rax, %rbx
movl $0x5c8, %esi            # imm = 0x5C8
movq %r13, %rdi
callq 0x55480
jmp 0x6a4e1
jmp 0x6a4de
jmp 0x6a4de
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x63e3c
leaq 0xc8(%rsp), %rdi
callq 0x56720
movq %rbx, %rdi
callq 0x57090