// File: /workspace/github_c_makefile_star2_O1/arkanis[P]process-map/map.c
// Function: main
int main(int argc, char** argv) {
	if (argc != 2) {
		fprintf(stderr, "usage: %s pid\n", argv[0]);
		return 0;
	}
	
	FILE* cmdLineFile = fopen(TextFormat("/proc/%s/cmdline", argv[1]), "rb");
	if (cmdLineFile == NULL) {
		fprintf(stderr, "Couldn't find process %s\n", argv[1]);
		return 0;
	}
	char* cmdLine = NULL;
	fscanf(cmdLineFile, "%m[^\n]", &cmdLine);
	fclose(cmdLineFile);
	
	int screenWidth = 800, screenHeight = 600;
	SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
	InitWindow(screenWidth, screenHeight, TextFormat("Memory map of process %s: %s", argv[1], cmdLine));
	
	Font uiFont      = LoadFontEx("NotoSans-Regular.ttf", 16, NULL, 0);
	Font mapLabelSdfFont = LoadSdfFont("NotoSans-Regular.ttf");
	Shader sdfFontShader = LoadShader(NULL, "sdf-text.fs");
	
	GuiSetFont(uiFont);
	
	AddrRange* ranges = NULL;
	size_t rangeCount = 0;
	LoadAddrRanges(argv[1], &ranges, &rangeCount);
	size_t hilbertCurveOrder = 0;
	Texture2D mapTexture = PlotAddrRanges(ranges, rangeCount, mapLabelSdfFont, &hilbertCurveOrder);
	PlotRangeElfSymbols(ranges, rangeCount, hilbertCurveOrder, mapLabelSdfFont);
	
	Shader mapShader = LoadShader(NULL, "range-map2.fs");
	int selectedColorLoc = GetShaderLocation(mapShader, "selectedColor");
	Shader symbolMapShader = LoadShader(NULL, "symbol-map.fs");
	
	TaskTraces traces = LoadTaskTraces(argv[1]);
	
	Camera2D camera = (Camera2D){
		.target = (Vector2){ mapTexture.width / 2, mapTexture.height / 2 },
		.offset = (Vector2){ screenWidth / 2, screenHeight / 2 },
		.zoom = 1.0
	};
	
	bool wasWindowFocused = true, isPanning = false;
	Vector2 prevMousePos = { 0 };
	while ( !WindowShouldClose() ) {
		if ( IsWindowResized() ) {
			screenWidth = GetScreenWidth();
			screenHeight = GetScreenHeight();
		}
		
		// Reduce FPS when window isn't focused
		if ( IsWindowFocused() && !wasWindowFocused ) {
			wasWindowFocused = true;
			SetTargetFPS(0);
		} else if ( !IsWindowFocused() && wasWindowFocused ) {
			wasWindowFocused = false;
			SetTargetFPS(30);
		}
		
		// Mouse panning
		if ( IsMouseButtonPressed(MOUSE_LEFT_BUTTON) ) {
			isPanning = true;
			prevMousePos = GetMousePosition();
		} else if ( isPanning && IsMouseButtonReleased(MOUSE_LEFT_BUTTON) ) {
			isPanning = false;
		} else if ( isPanning ) {
			float dx = prevMousePos.x - GetMouseX(), dy = prevMousePos.y - GetMouseY();
			camera.target.x += dx / camera.zoom;
			camera.target.y += dy / camera.zoom;
			prevMousePos = GetMousePosition();
		}
		
		// Mousewheel zooming (world space position remains the same directly at the mouse pointer)
		const float factor = powf(0.9, -GetMouseWheelMove());  // 0.9^1 = 0.9, 0.9^-1 = 1/0.9
		Vector2 mousePosWs = GetScreenToWorld2D(GetMousePosition(), camera);
		float oldScale = camera.zoom, newScale = camera.zoom * factor;
		camera.target.x = mousePosWs.x + (camera.target.x - mousePosWs.x) * (oldScale / newScale);
		camera.target.y = mousePosWs.y + (camera.target.y - mousePosWs.y) * (oldScale / newScale);
		camera.zoom = newScale;
		
		// Handle keyboard input
		if (IsKeyPressed(KEY_R)) {
			mapShader = LoadShader(NULL, "range-map2.fs");
			symbolMapShader = LoadShader(NULL, "symbol-map.fs");
		}
		
		// Picking
		AddrRange* selectedRange = NULL;
		Color      selectedRangeColor = BLACK;
		if ( CheckCollisionPointRec(mousePosWs, (Rectangle){ .x = 0, .y = 0, .width = mapTexture.width, .height = mapTexture.height }) ) {
			uint64_t page = HilberCurvePosToDist(hilbertCurveOrder, mousePosWs.x, mousePosWs.y);
			for (size_t i = 0; i < rangeCount; i++) {
				if (page >= ranges[i].startPage && page < ranges[i].endPage) {
					selectedRange = &ranges[i];
					selectedRangeColor = selectedRange->color;
					break;
				}
			}
		}
		
		UpdateTaskTraces(&traces, ranges, rangeCount, hilbertCurveOrder);
		
		
		// Prepare view culling
		Vector2 viewTopLeft = GetScreenToWorld2D((Vector2){ 0, 0 }, camera);
		Vector2 viewBottomRight = GetScreenToWorld2D((Vector2){ screenWidth, screenHeight }, camera);
		Rectangle viewBoundingBox = (Rectangle){ .x = viewTopLeft.x, .y = viewTopLeft.y, .width = viewBottomRight.x - viewTopLeft.x, .height = viewBottomRight.y - viewTopLeft.y };
		
		BeginDrawing();
			ClearBackground(WHITE);
			
			BeginMode2D(camera);
				// Draw map legend
				int lx = -220, ly = 0;
				DrawRectangle(lx, ly, 16, 16, (Color){ 184, 224, 198, 255 });
				BeginShaderMode(sdfFontShader);
					DrawTextEx(mapLabelSdfFont, "File backed memory map",          (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14;
					DrawTextEx(mapLabelSdfFont, "(different color for each name)", (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14 + 6;
				EndShaderMode();
				DrawRectangle(lx, ly, 16, 16, (Color){ 229, 229, 229, 255 });
				BeginShaderMode(sdfFontShader);
					DrawTextEx(mapLabelSdfFont, "Anonymous memory map",            (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14 + 6;
				EndShaderMode();
				DrawRectangle(lx, ly, 16, 16, (Color){ 250, 250, 250, 255 });
				BeginShaderMode(sdfFontShader);
					DrawTextEx(mapLabelSdfFont, "Unused address space",            (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14 + 6;
					DrawTextEx(mapLabelSdfFont, "(not displayed to scale)",        (Vector2){ -200, ly }, 14, 0, BLACK); ly += (14 + 6) * 2;
				EndShaderMode();
				DrawRectangle(lx, ly, 16, 16, (Color){ 229, 229, 229, 255 });
				BeginShaderMode(sdfFontShader);
					DrawTextEx(mapLabelSdfFont, "1 MiByte to scale",               (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14 + 6;
				EndShaderMode();
				DrawRectangle(lx - (64-16), ly, 64, 64, (Color){ 229, 229, 229, 255 });
				BeginShaderMode(sdfFontShader);
					DrawTextEx(mapLabelSdfFont, "16 MiByte to scale",              (Vector2){ -200, ly }, 14, 0, BLACK); ly += 14 + 6;
				EndShaderMode();
				
				// Draw map and highlight selected range
				BeginShaderMode(mapShader);
					Vector4 selectedColor = ColorNormalize(selectedRangeColor);
					SetShaderValue(mapShader, selectedColorLoc, &selectedColor, UNIFORM_VEC4);
					DrawTexture(mapTexture, 0, 0, BLANK);
				EndShaderMode();
				
				if (selectedRange && selectedRange->label.boundingBox.width < viewBoundingBox.width * mmapLabelMaxWindowFraction) {
					BeginShaderMode(sdfFontShader);
						DrawTextEx(mapLabelSdfFont, selectedRange->label.text, (Vector2){ selectedRange->label.boundingBox.x, selectedRange->label.boundingBox.y }, selectedRange->label.fontSize, 0, BLACK);
					EndShaderMode();
				}
				
				// Draw range lables, their symbol maps and the symbol lables if necessary
				for (size_t i = 0; i < rangeCount; i++) {
					AddrRange* range = &ranges[i];
					if ( CheckCollisionRecs(range->boundingBox, viewBoundingBox) ) {
						if (range->boundingBox.width < viewBoundingBox.width * mmapLabelMaxWindowFraction) {
							BeginShaderMode(sdfFontShader);
								DrawTextEx(mapLabelSdfFont, range->label.text, (Vector2){ range->label.boundingBox.x, range->label.boundingBox.y }, range->label.fontSize, 0, (Color){ 0, 0, 0, 128 });
							EndShaderMode();
						}
						
						if (range->boundingBox.width > viewBoundingBox.width * mmapDetailsMinWindowFraction) {
							BeginShaderMode(symbolMapShader);
								DrawTexturePro(range->symbolMap, (Rectangle){ 0, 0, range->symbolMap.width, range->symbolMap.height }, range->boundingBox, (Vector2){ 0, 0 }, 0, (Color){0, 0, 0, 32});
							EndShaderMode();
							
							BeginShaderMode(sdfFontShader);
								for (size_t s = 0; s < range->symbolCount; s++) {
									Label* label = &range->symbolLabels[s];
									if ( CheckCollisionRecs(label->boundingBox, viewBoundingBox) && label->boundingBox.height * camera.zoom > 2 )
										DrawTextEx(mapLabelSdfFont, label->text, (Vector2){ label->boundingBox.x, label->boundingBox.y }, label->fontSize, 0, (Color){ 0, 0, 0, 128 });
								}
							EndShaderMode();
						}
					}
				}
				
				rlglDraw();
				glUseProgram(traces.particleShader.id);
					// Have to set the model view projection matrix manually because raylib has not matrix uniform type
					Matrix mvp = MatrixMultiply(GetMatrixModelview(), GetMatrixProjection());
					glUniformMatrix4fv(traces.particleShader.locs[LOC_MATRIX_MVP], 1, false, MatrixToFloat(mvp));
					glUniform1ui(traces.shaderCurrentTimeLocation, traces.currentTime);
					
					for (size_t t = 0; t < traces.taskCount; t++) {
						if (traces.focusedTaskIndex == -1 || (ssize_t)t == traces.focusedTaskIndex) {
							Color transparentColor = traces.tasks[t].color;
							transparentColor.a = 64;
							Vector4 color = ColorNormalize(transparentColor);
							SetShaderValue(traces.particleShader, traces.shaderColorLocation, &color, UNIFORM_VEC4);
							glBindVertexArray(traces.tasks[t].particleVAO);
								glDrawArrays(GL_POINTS, 0, particleCount);
							glBindVertexArray(0);
						}
					}
				glUseProgram(0);
			EndMode2D();
			
			DrawRectangle(0, 0, screenWidth, 20, RAYWHITE);
			if (selectedRange) {
				const char* sizeUnit = NULL;
				double size = HumanReadableByteSize(selectedRange->endAddr - selectedRange->startAddr, &sizeUnit);
				DrawTextEx(uiFont, TextFormat("Size: %.2lf %s", size, sizeUnit), (Vector2){ 5, 3 }, uiFont.baseSize, 0, BLACK);
				DrawTextEx(uiFont, TextFormat("Address 0x%016lx - 0x%016lx", selectedRange->startAddr, selectedRange->endAddr), (Vector2){ 120, 3 }, uiFont.baseSize, 0, BLACK);
				
				if ( ! selectedRange->isGap ) {
					DrawTextEx(uiFont, selectedRange->perms,    (Vector2){ 410, 3 }, uiFont.baseSize, 0, BLACK);
					DrawTextEx(uiFont, selectedRange->filePath, (Vector2){ 450, 3 }, uiFont.baseSize, 0, BLACK);
				}
			}
			
			GuiEnable();
			Rectangle tasksPanel = (Rectangle){ screenWidth - 200, 20, 200, screenHeight };
			GuiPanel(tasksPanel);
			float x = 5, y = 5;
			for (ssize_t t = 0; t < (ssize_t)traces.taskCount; t++) {
				if (traces.focusedTaskIndex == -1 || t == traces.focusedTaskIndex) {
					GuiEnable();
					DrawCircle(tasksPanel.x + x + 3, tasksPanel.y + y + 16/2, 3, traces.tasks[t].color);
				} else {
					GuiDisable();
					DrawCircle(tasksPanel.x + x + 3, tasksPanel.y + y + 16/2, 3, LIGHTGRAY);
				}
				const char* text = TextFormat("Task %d%s", traces.tasks[t].pid, traces.tasks[t].dead ? " (dead)" : "");
				if ( GuiLabelButton((Rectangle){ tasksPanel.x + x + 10, tasksPanel.y + y, 200 - 2*5, 16 }, text) ) {
					if (t == traces.focusedTaskIndex)
						traces.focusedTaskIndex = -1;
					else
						traces.focusedTaskIndex = t;
				}
				GuiLabel((Rectangle){ tasksPanel.x + x + 10, tasksPanel.y + y + 16, 200 - 2*5, 16 }, traces.tasks[t].name);
				
				y += 20 + 16;
			}
			
		EndDrawing();
	}
	
	UnloadTaskTraces(&traces);
	UnloadShader(mapShader);
	UnloadTexture(mapTexture);
	UnloadAddrRanges(&ranges, &rangeCount);
	UnloadShader(sdfFontShader);
	UnloadFont(mapLabelSdfFont);
	UnloadShader(symbolMapShader);
	UnloadFont(uiFont);
	CloseWindow();
	free(cmdLine);
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %rsi, %r12
cmpl $0x2, %edi
jne 0x124f6
movq 0x8(%r12), %rsi
addq $0x8, %r12
leaq 0x57685(%rip), %rdi     # 0x682e7
xorl %eax, %eax
callq 0x50f37
leaq 0x57665(%rip), %rsi     # 0x682d5
movq %rax, %rdi
callq 0x61d0
testq %rax, %rax
je 0x12503
movq %rax, %rbx
leaq 0x2d8(%rsp), %r14
movq $0x0, (%r14)
leaq 0x5782e(%rip), %rsi     # 0x684c8
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x60e0
movq %rbx, %rdi
callq 0x6620
movl $0x44, %edi
callq 0x2dc1a
movq (%r12), %rsi
movq (%r14), %rdx
leaq 0x5764b(%rip), %rdi     # 0x68312
xorl %eax, %eax
callq 0x50f37
movl $0x320, %edi            # imm = 0x320
movl $0x258, %esi            # imm = 0x258
movq %rax, %rdx
callq 0x29631
leaq 0x57648(%rip), %rbx     # 0x6832f
leaq 0x160(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movl $0x10, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x4d099
leaq 0x98(%rsp), %rdi
movq %rbx, %rsi
callq 0x12510
leaq 0x57629(%rip), %rsi     # 0x68344
xorl %edi, %edi
callq 0x2414d
movl %eax, 0x74(%rsp)
movq %rdx, 0xc8(%rsp)
movl (%r15), %ebx
movq 0x4(%r15), %r14
movl 0xc(%r15), %ebp
movups 0x10(%r15), %xmm0
movaps %xmm0, 0x1f0(%rsp)
movups 0x20(%r15), %xmm0
movaps %xmm0, 0x200(%rsp)
testl %ebp, %ebp
je 0x10daa
cmpb $0x0, 0x964f7(%rip)     # 0xa7255
jne 0x10d65
callq 0x6a18
movl %ebx, 0x964ed(%rip)     # 0xa7258
movq %r14, 0x964ea(%rip)     # 0xa725c
movl %ebp, 0x964ec(%rip)     # 0xa7264
movaps 0x1f0(%rsp), %xmm0
movaps 0x200(%rsp), %xmm1
movups %xmm0, 0x964d9(%rip)    # 0xa7268
movups %xmm1, 0x964e2(%rip)    # 0xa7278
cmpb $0x0, 0x964b8(%rip)     # 0xa7255
jne 0x10da4
callq 0x6a18
movl %ebx, 0x96526(%rip)     # 0xa72d0
xorl %ebx, %ebx
leaq 0x118(%rsp), %r15
movq %rbx, (%r15)
leaq 0xd0(%rsp), %r13
movq %rbx, (%r13)
movq (%r12), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x12622
leaq 0x190(%rsp), %rbp
movq %rbx, (%rbp)
movq (%r15), %r15
movq (%r13), %r13
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x198(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x1283b
movq (%rbp), %rdx
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x12e9c
leaq 0x574f0(%rip), %rsi     # 0x68350
xorl %edi, %edi
callq 0x2414d
movq %rdx, %rsi
leaq 0x574ed(%rip), %rdx     # 0x6835e
movl %eax, 0x78(%rsp)
movl %eax, %edi
movq %rsi, 0x120(%rsp)
callq 0x24793
movl %eax, 0x130(%rsp)
leaq 0x574da(%rip), %rsi     # 0x6836c
xorl %edi, %edi
callq 0x2414d
movl %eax, 0x7c(%rsp)
movq %rdx, 0x128(%rsp)
movq (%r12), %rsi
leaq 0x1f0(%rsp), %rdi
callq 0x1342c
movabsq $0x4396000043c80000, %rax # imm = 0x4396000043C80000
movq %rax, 0x58(%rsp)
movl 0x4(%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movl 0x8(%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss %xmm0, 0x60(%rsp)
movss %xmm1, 0x64(%rsp)
movabsq $0x3f80000000000000, %rax # imm = 0x3F80000000000000
movq %rax, 0x68(%rsp)
callq 0x2a15d
testb %al, %al
je 0x11002
movl 0x74(%rsp), %ebp
leaq 0x1f0(%rsp), %rdi
callq 0x13b30
movl 0x78(%rsp), %edi
movq 0x120(%rsp), %rsi
callq 0x246ed
movl 0x1a8(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0x198(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x42624
leaq 0x118(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x13bfa
movl %ebp, %edi
movq 0xc8(%rsp), %rsi
callq 0x246ed
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x50df8
movl 0x7c(%rsp), %edi
movq 0x128(%rsp), %rsi
callq 0x246ed
movups 0x160(%rsp), %xmm0
movups 0x170(%rsp), %xmm1
movups 0x180(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x50df8
callq 0x2a0f6
movq 0x2d8(%rsp), %rdi
callq 0x62e0
xorl %eax, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
movl %eax, 0x38(%rsp)
movl $0x258, 0xdc(%rsp) # imm = 0x258
movl $0x320, %r14d           # imm = 0x320
xorl %r15d, %r15d
xorps %xmm0, %xmm0
movaps %xmm0, 0x230(%rsp)
movl 0x74(%rsp), %ebp
callq 0x2a1f3
testb %al, %al
je 0x11048
callq 0x2a847
movl %eax, %r14d
callq 0x2a84e
movl %eax, 0xdc(%rsp)
callq 0x2a1e8
testb %al, %al
je 0x11058
testb $0x1, 0x38(%rsp)
je 0x11077
callq 0x2a1e8
testb %al, %al
jne 0x11084
testb $0x1, 0x38(%rsp)
je 0x11084
movl $0x1e, %edi
movl $0x0, 0x38(%rsp)
jmp 0x1107f
movb $0x1, %al
movl %eax, 0x38(%rsp)
xorl %edi, %edi
callq 0x2daf2
xorl %edi, %edi
callq 0x2e834
movb $0x1, %bl
testb %al, %al
je 0x110a3
callq 0x2867d
movaps %xmm0, 0x230(%rsp)
movl %ebx, %r15d
jmp 0x110c7
testb $0x1, %r15b
je 0x110c7
xorl %edi, %edi
callq 0x2e875
movzbl %r15b, %ecx
testb %al, %al
movl $0x0, %eax
cmovnel %eax, %ecx
je 0x12476
movl %ecx, %r15d
callq 0x286b1
movaps %xmm0, %xmm1
xorps 0x5702a(%rip), %xmm1    # 0x68100
movss 0x56f8e(%rip), %xmm0    # 0x6806c
callq 0x6040
movss %xmm0, 0x40(%rsp)
callq 0x2867d
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm1
movups %xmm1, (%rsp)
callq 0x2d742
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
movss 0x6c(%rsp), %xmm3
movss 0x40(%rsp), %xmm5
mulss %xmm3, %xmm5
movss 0x60(%rsp), %xmm1
movss 0x64(%rsp), %xmm2
subss %xmm0, %xmm1
divss %xmm5, %xmm3
mulss %xmm3, %xmm1
movaps %xmm0, 0x40(%rsp)
addss %xmm0, %xmm1
movss %xmm1, 0x60(%rsp)
subss %xmm4, %xmm2
mulss %xmm3, %xmm2
movaps %xmm4, 0x80(%rsp)
addss %xmm4, %xmm2
movss %xmm2, 0x64(%rsp)
movss %xmm5, 0x6c(%rsp)
movl $0x52, %edi
callq 0x2e531
testb %al, %al
je 0x111a6
xorl %edi, %edi
leaq 0x571d5(%rip), %rsi     # 0x68350
callq 0x2414d
movl %eax, 0x78(%rsp)
movq %rdx, 0x120(%rsp)
xorl %edi, %edi
leaq 0x571d7(%rip), %rsi     # 0x6836c
callq 0x2414d
movl %eax, 0x7c(%rsp)
movq %rdx, 0x128(%rsp)
xorps %xmm2, %xmm2
cvtsi2ssl 0x19c(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2ssl 0x1a0(%rsp), %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
xorps %xmm1, %xmm1
movaps 0x40(%rsp), %xmm0
callq 0x34d6b
movl $0xff000000, %r12d      # imm = 0xFF000000
testb %al, %al
je 0x11225
movq 0x190(%rsp), %rdi
cvttss2si 0x40(%rsp), %esi
cvttss2si 0x80(%rsp), %edx
callq 0x137e8
movq 0xd0(%rsp), %rcx
testq %rcx, %rcx
je 0x11225
movq 0x118(%rsp), %r13
cmpq 0x30(%r13), %rax
jb 0x11219
cmpq 0x38(%r13), %rax
jb 0x124ed
addq $0xa0, %r13
decq %rcx
jne 0x11209
xorl %r13d, %r13d
movq %r15, 0x2c8(%rsp)
movq 0x118(%rsp), %rsi
movq 0xd0(%rsp), %rdx
movq 0x190(%rsp), %rcx
leaq 0x1f0(%rsp), %rdi
callq 0x13867
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
xorps %xmm0, %xmm0
callq 0x2d742
movq %r14, 0x2d0(%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
movaps %xmm0, 0x40(%rsp)
xorps %xmm2, %xmm2
cvtsi2ssl 0xdc(%rsp), %xmm2
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
movaps %xmm2, 0x2e0(%rsp)
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movaps %xmm1, %xmm0
callq 0x2d742
subps 0x40(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movss %xmm0, 0x100(%rsp)
callq 0x2ace5
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2ac90
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x2b26b
movl $0xffffff24, %edi       # imm = 0xFFFFFF24
xorl %esi, %esi
movl $0x10, %edx
movl $0x10, %ecx
movl $0xffc6e0b8, %r8d       # imm = 0xFFC6E0B8
callq 0x31115
movl %ebp, %edi
movq 0xc8(%rsp), %rbx
movq %rbx, %rsi
callq 0x24729
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x57028(%rip), %rdi     # 0x6837a
movss 0x56d16(%rip), %xmm0    # 0x68070
movss 0x56d12(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56ff5(%rip), %rdi     # 0x68391
movsd 0x56dac(%rip), %xmm0    # 0x68150
movss 0x56cc8(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movl $0xffffff24, %edi       # imm = 0xFFFFFF24
movl $0x22, %esi
movl $0x10, %edx
movl $0x10, %ecx
movl $0xffe5e5e5, %r8d       # imm = 0xFFE5E5E5
callq 0x31115
movl %ebp, %edi
movq %rbx, %rsi
callq 0x24729
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56f9d(%rip), %rdi     # 0x683b1
movsd 0x56d44(%rip), %xmm0    # 0x68160
movss 0x56c50(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movl $0xffffff24, %edi       # imm = 0xFFFFFF24
movl $0x36, %esi
movl $0x10, %edx
movl $0x10, %ecx
movl $0xfffafafa, %r8d       # imm = 0xFFFAFAFA
callq 0x31115
movl %ebp, %edi
movq %rbx, %rsi
callq 0x24729
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56f3a(%rip), %rdi     # 0x683c6
movsd 0x56cdc(%rip), %xmm0    # 0x68170
movss 0x56bd8(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56f05(%rip), %rdi     # 0x683db
movsd 0x56ca2(%rip), %xmm0    # 0x68180
movss 0x56b8e(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movl $0xffffff24, %edi       # imm = 0xFFFFFF24
movl $0x72, %esi
movl $0x10, %edx
movl $0x10, %ecx
movl $0xffe5e5e5, %r8d       # imm = 0xFFE5E5E5
callq 0x31115
movl %ebp, %edi
movq %rbx, %rsi
callq 0x24729
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56ea6(%rip), %rdi     # 0x683f4
movsd 0x56c3a(%rip), %xmm0    # 0x68190
movss 0x56b16(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movl $0xfffffef4, %edi       # imm = 0xFFFFFEF4
movl $0x86, %esi
movl $0x40, %edx
movl $0x40, %ecx
movl $0xffe5e5e5, %r8d       # imm = 0xFFE5E5E5
callq 0x31115
movl %ebp, %edi
movq %rbx, %rsi
callq 0x24729
movups 0x98(%rsp), %xmm0
movups 0xa8(%rsp), %xmm1
movups 0xb8(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
leaq 0x56e40(%rip), %rdi     # 0x68406
movsd 0x56bd2(%rip), %xmm0    # 0x681a0
movss 0x56a9e(%rip), %xmm1    # 0x68074
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movl 0x78(%rsp), %ebx
movl %ebx, %edi
movq 0x120(%rsp), %r14
movq %r14, %rsi
callq 0x24729
movl %r12d, %edi
callq 0x43e56
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x308(%rsp)
movl %ebx, %edi
movq %r14, %rsi
movl 0x130(%rsp), %edx
leaq 0x308(%rsp), %rcx
movl $0x3, %r8d
callq 0x2483d
movl 0x1a8(%rsp), %eax
movl %eax, 0x10(%rsp)
movups 0x198(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x428d8
callq 0x24759
testq %r13, %r13
je 0x116c8
movss 0x100(%rsp), %xmm0
mulss 0x56a0e(%rip), %xmm0    # 0x68078
ucomiss 0x6c(%r13), %xmm0
jbe 0x116c8
movl %ebp, %edi
movq 0xc8(%rsp), %rsi
callq 0x24729
movq 0x58(%r13), %rdi
movss 0x60(%r13), %xmm1
movsd 0x64(%r13), %xmm0
movups 0x98(%rsp), %xmm2
movups 0xa8(%rsp), %xmm3
movups 0xb8(%rsp), %xmm4
movups %xmm4, 0x20(%rsp)
movups %xmm3, 0x10(%rsp)
movups %xmm2, (%rsp)
xorps %xmm2, %xmm2
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
callq 0x24759
movq %r13, 0x2c0(%rsp)
cmpq $0x0, 0xd0(%rsp)
je 0x118f7
movss 0x100(%rsp), %xmm0
movaps %xmm0, %xmm1
mulss 0x56985(%rip), %xmm1    # 0x68078
movss %xmm1, 0x3c(%rsp)
mulss 0x5697b(%rip), %xmm0    # 0x6807c
movss %xmm0, 0x100(%rsp)
xorl %ebx, %ebx
movq 0x118(%rsp), %r15
leaq (%rbx,%rbx,4), %r14
shlq $0x5, %r14
movsd 0x44(%r15,%r14), %xmm0
movsd 0x4c(%r15,%r14), %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
callq 0x34ecd
testb %al, %al
je 0x118e6
addq %r14, %r15
movss 0x3c(%rsp), %xmm0
ucomiss 0x4c(%r15), %xmm0
jbe 0x117ab
movl %ebp, %edi
movq 0xc8(%rsp), %rsi
callq 0x24729
movq 0x58(%r15), %rdi
movss 0x60(%r15), %xmm1
movsd 0x64(%r15), %xmm0
movups 0x98(%rsp), %xmm2
movups 0xa8(%rsp), %xmm3
movups 0xb8(%rsp), %xmm4
movups %xmm4, 0x20(%rsp)
movups %xmm3, 0x10(%rsp)
movups %xmm2, (%rsp)
xorps %xmm2, %xmm2
movl $0x80000000, %esi       # imm = 0x80000000
callq 0x51012
callq 0x24759
movss 0x4c(%r15), %xmm0
ucomiss 0x100(%rsp), %xmm0
jbe 0x118e6
movl 0x7c(%rsp), %edi
movq 0x128(%rsp), %rsi
callq 0x24729
xorps %xmm1, %xmm1
cvtsi2ssl 0x7c(%r15), %xmm1
xorps %xmm0, %xmm0
cvtsi2ssl 0x80(%r15), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movsd 0x44(%r15), %xmm2
movsd 0x4c(%r15), %xmm3
movl 0x88(%r15), %eax
movl %eax, 0x10(%rsp)
movups 0x78(%r15), %xmm0
movups %xmm0, (%rsp)
xorps %xmm0, %xmm0
xorps %xmm4, %xmm4
xorps %xmm5, %xmm5
movl $0x20000000, %edi       # imm = 0x20000000
callq 0x42965
callq 0x24759
movl %ebp, %edi
movq 0xc8(%rsp), %rsi
callq 0x24729
cmpq $0x0, 0x90(%r15)
je 0x118e1
movl $0x18, %r14d
xorl %r12d, %r12d
movq 0x98(%r15), %r13
movsd -0xc(%r13,%r14), %xmm0
movsd -0x4(%r13,%r14), %xmm1
movaps 0x40(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
callq 0x34ecd
testb %al, %al
je 0x118cd
movss (%r13,%r14), %xmm0
mulss 0x6c(%rsp), %xmm0
ucomiss 0x567ab(%rip), %xmm0    # 0x68030
jbe 0x118cd
movq -0x18(%r13,%r14), %rdi
movss -0x10(%r13,%r14), %xmm1
movsd -0xc(%r13,%r14), %xmm0
movups 0x98(%rsp), %xmm2
movups 0xa8(%rsp), %xmm3
movups 0xb8(%rsp), %xmm4
movups %xmm4, 0x20(%rsp)
movups %xmm3, 0x10(%rsp)
movups %xmm2, (%rsp)
xorps %xmm2, %xmm2
movl $0x80000000, %esi       # imm = 0x80000000
callq 0x51012
incq %r12
addq $0x20, %r14
cmpq 0x90(%r15), %r12
jb 0x11846
callq 0x24759
incq %rbx
cmpq 0xd0(%rsp), %rbx
jb 0x1170c
callq 0x20176
movl 0x208(%rsp), %edi
movl %edi, 0x40(%rsp)
leaq 0x97292(%rip), %rax     # 0xa8ba0
callq *(%rax)
leaq 0x280(%rsp), %rdi
callq 0x24a0c
leaq 0x240(%rsp), %rdi
callq 0x249ac
movss 0x240(%rsp), %xmm12
movss 0x244(%rsp), %xmm3
movss %xmm3, 0xec(%rsp)
movss 0x248(%rsp), %xmm10
movss 0x24c(%rsp), %xmm11
movss 0x250(%rsp), %xmm9
movss 0x254(%rsp), %xmm13
movss %xmm13, 0xf0(%rsp)
movss 0x258(%rsp), %xmm8
movss 0x25c(%rsp), %xmm7
movss %xmm7, 0x100(%rsp)
movss 0x264(%rsp), %xmm6
movss %xmm6, 0x80(%rsp)
movss 0x280(%rsp), %xmm0
movss 0x290(%rsp), %xmm2
movss 0x2a0(%rsp), %xmm1
movss 0x2b0(%rsp), %xmm5
mulss %xmm2, %xmm3
movaps %xmm0, %xmm4
mulss %xmm12, %xmm4
movss %xmm12, 0xf4(%rsp)
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm10, %xmm3
movss %xmm10, 0xf8(%rsp)
addss %xmm4, %xmm3
movaps %xmm5, %xmm4
mulss %xmm11, %xmm4
movss %xmm11, 0xfc(%rsp)
addss %xmm3, %xmm4
movss %xmm4, 0x15c(%rsp)
movaps %xmm13, %xmm3
mulss %xmm2, %xmm3
movaps %xmm0, %xmm4
mulss %xmm9, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm8, %xmm3
addss %xmm4, %xmm3
movaps %xmm5, %xmm4
mulss %xmm7, %xmm4
addss %xmm3, %xmm4
movss %xmm4, 0x158(%rsp)
movaps %xmm6, %xmm3
mulss %xmm2, %xmm3
movss 0x260(%rsp), %xmm14
movaps %xmm0, %xmm4
mulss %xmm14, %xmm4
addss %xmm3, %xmm4
movss 0x268(%rsp), %xmm15
movaps %xmm1, %xmm3
mulss %xmm15, %xmm3
addss %xmm4, %xmm3
movss 0x26c(%rsp), %xmm6
movss %xmm6, 0x3c(%rsp)
movaps %xmm5, %xmm4
mulss %xmm6, %xmm4
addss %xmm3, %xmm4
movss %xmm4, 0x154(%rsp)
movss 0x274(%rsp), %xmm3
movss %xmm3, 0xe8(%rsp)
mulss %xmm3, %xmm2
movss 0x270(%rsp), %xmm3
movss %xmm3, 0xe4(%rsp)
mulss %xmm3, %xmm0
addss %xmm2, %xmm0
movss 0x278(%rsp), %xmm7
mulss %xmm7, %xmm1
movss %xmm7, 0x134(%rsp)
addss %xmm0, %xmm1
movss 0x27c(%rsp), %xmm0
movss %xmm0, 0xe0(%rsp)
mulss %xmm0, %xmm5
addss %xmm1, %xmm5
movss %xmm5, 0x150(%rsp)
movss 0x294(%rsp), %xmm1
movss 0xec(%rsp), %xmm6
movaps %xmm6, %xmm2
mulss %xmm1, %xmm2
movss 0x284(%rsp), %xmm0
movaps %xmm0, %xmm3
mulss %xmm12, %xmm3
addss %xmm2, %xmm3
movss 0x2a4(%rsp), %xmm2
movaps %xmm2, %xmm4
mulss %xmm10, %xmm4
addss %xmm3, %xmm4
movss 0x2b4(%rsp), %xmm13
movaps %xmm13, %xmm3
mulss %xmm11, %xmm3
addss %xmm4, %xmm3
movss %xmm3, 0x14c(%rsp)
movss 0xf0(%rsp), %xmm5
movaps %xmm5, %xmm3
mulss %xmm1, %xmm3
movaps %xmm0, %xmm4
movss %xmm9, 0x138(%rsp)
mulss %xmm9, %xmm4
addss %xmm3, %xmm4
movaps %xmm2, %xmm3
movss %xmm8, 0x13c(%rsp)
mulss %xmm8, %xmm3
addss %xmm4, %xmm3
movaps %xmm13, %xmm4
mulss 0x100(%rsp), %xmm4
addss %xmm3, %xmm4
movss %xmm4, 0x148(%rsp)
movss 0x80(%rsp), %xmm3
mulss %xmm1, %xmm3
movaps %xmm0, %xmm4
mulss %xmm14, %xmm4
addss %xmm3, %xmm4
movaps %xmm2, %xmm3
mulss %xmm15, %xmm3
addss %xmm4, %xmm3
movaps %xmm13, %xmm4
mulss 0x3c(%rsp), %xmm4
addss %xmm3, %xmm4
movss %xmm4, 0x144(%rsp)
movss 0xe8(%rsp), %xmm10
mulss %xmm10, %xmm1
movss 0xe4(%rsp), %xmm11
mulss %xmm11, %xmm0
addss %xmm1, %xmm0
mulss %xmm7, %xmm2
addss %xmm0, %xmm2
movss 0xe0(%rsp), %xmm12
mulss %xmm12, %xmm13
addss %xmm2, %xmm13
movss 0x298(%rsp), %xmm7
movaps %xmm6, %xmm0
mulss %xmm7, %xmm0
movss 0x288(%rsp), %xmm6
movaps %xmm6, %xmm3
mulss 0xf4(%rsp), %xmm3
addss %xmm0, %xmm3
movss 0x2a8(%rsp), %xmm2
movaps %xmm2, %xmm4
mulss 0xf8(%rsp), %xmm4
addss %xmm3, %xmm4
movss 0x2b8(%rsp), %xmm3
movaps %xmm3, %xmm0
mulss 0xfc(%rsp), %xmm0
addss %xmm4, %xmm0
movss %xmm0, 0x140(%rsp)
movaps %xmm5, %xmm4
mulss %xmm7, %xmm4
movaps %xmm6, %xmm5
mulss %xmm9, %xmm5
addss %xmm4, %xmm5
movaps %xmm2, %xmm4
mulss %xmm8, %xmm4
addss %xmm5, %xmm4
movaps %xmm3, %xmm5
mulss 0x100(%rsp), %xmm5
addss %xmm4, %xmm5
movss 0x80(%rsp), %xmm4
mulss %xmm7, %xmm4
movaps %xmm6, %xmm1
mulss %xmm14, %xmm1
addss %xmm4, %xmm1
movaps %xmm2, %xmm0
mulss %xmm15, %xmm0
addss %xmm1, %xmm0
movaps %xmm3, %xmm4
movss 0x3c(%rsp), %xmm9
mulss %xmm9, %xmm4
addss %xmm0, %xmm4
mulss %xmm10, %xmm7
mulss %xmm11, %xmm6
addss %xmm7, %xmm6
movss 0x134(%rsp), %xmm11
mulss %xmm11, %xmm2
addss %xmm6, %xmm2
mulss %xmm12, %xmm3
addss %xmm2, %xmm3
movss 0x29c(%rsp), %xmm2
movss 0xec(%rsp), %xmm1
mulss %xmm2, %xmm1
movss 0x28c(%rsp), %xmm0
movss 0xf4(%rsp), %xmm6
mulss %xmm0, %xmm6
addss %xmm1, %xmm6
movaps %xmm6, %xmm7
movss 0x2ac(%rsp), %xmm1
movss 0xf8(%rsp), %xmm6
mulss %xmm1, %xmm6
addss %xmm7, %xmm6
movaps %xmm6, %xmm7
movss 0x2bc(%rsp), %xmm10
movss 0xfc(%rsp), %xmm6
mulss %xmm10, %xmm6
addss %xmm7, %xmm6
movss 0xf0(%rsp), %xmm7
mulss %xmm2, %xmm7
movss 0x138(%rsp), %xmm8
mulss %xmm0, %xmm8
addss %xmm7, %xmm8
movss 0x13c(%rsp), %xmm7
mulss %xmm1, %xmm7
addss %xmm8, %xmm7
movaps %xmm7, %xmm12
movss 0x100(%rsp), %xmm7
mulss %xmm10, %xmm7
addss %xmm12, %xmm7
movss 0x80(%rsp), %xmm12
mulss %xmm2, %xmm12
mulss %xmm0, %xmm14
addss %xmm12, %xmm14
mulss %xmm1, %xmm15
addss %xmm14, %xmm15
movaps %xmm9, %xmm8
mulss %xmm10, %xmm8
addss %xmm15, %xmm8
movss 0xe8(%rsp), %xmm12
mulss %xmm2, %xmm12
mulss 0xe4(%rsp), %xmm0
addss %xmm12, %xmm0
mulss %xmm11, %xmm1
addss %xmm0, %xmm1
mulss 0xe0(%rsp), %xmm10
addss %xmm1, %xmm10
movq 0x210(%rsp), %rax
movq %rax, 0x80(%rsp)
movl 0x18(%rax), %edi
xorps %xmm0, %xmm0
movaps %xmm0, 0x1b0(%rsp)
movss 0x15c(%rsp), %xmm1
movss %xmm1, 0x1b0(%rsp)
movaps %xmm0, 0x1c0(%rsp)
movaps %xmm0, 0x1d0(%rsp)
movaps %xmm0, 0x1e0(%rsp)
movss 0x158(%rsp), %xmm0
movss %xmm0, 0x1b4(%rsp)
movss 0x154(%rsp), %xmm0
movss %xmm0, 0x1b8(%rsp)
movss 0x150(%rsp), %xmm0
movss %xmm0, 0x1bc(%rsp)
movss 0x14c(%rsp), %xmm0
movss %xmm0, 0x1c0(%rsp)
movss 0x148(%rsp), %xmm0
movss %xmm0, 0x1c4(%rsp)
movss 0x144(%rsp), %xmm0
movss %xmm0, 0x1c8(%rsp)
movss %xmm13, 0x1cc(%rsp)
movss 0x140(%rsp), %xmm0
movss %xmm0, 0x1d0(%rsp)
movss %xmm5, 0x1d4(%rsp)
movss %xmm4, 0x1d8(%rsp)
movss %xmm3, 0x1dc(%rsp)
movss %xmm6, 0x1e0(%rsp)
movss %xmm7, 0x1e4(%rsp)
movss %xmm8, 0x1e8(%rsp)
movss %xmm10, 0x1ec(%rsp)
leaq 0x96de4(%rip), %rax     # 0xa8d50
movq (%rax), %rax
movl $0x1, %esi
xorl %edx, %edx
leaq 0x1b0(%rsp), %rcx
callq *%rax
movl 0x21c(%rsp), %edi
movl 0x220(%rsp), %esi
leaq 0x9a923(%rip), %rax     # 0xac8b8
callq *(%rax)
movq 0x1f8(%rsp), %rbx
testq %rbx, %rbx
je 0x12054
movq 0x1f0(%rsp), %r14
movq 0x200(%rsp), %r12
movl 0x218(%rsp), %r15d
addq $0x14, %r14
xorl %r13d, %r13d
cmpq $-0x1, %r12
setne %al
cmpq %r13, %r12
setne %cl
testb %cl, %al
jne 0x12044
movzbl -0x2(%r14), %eax
shll $0x10, %eax
movzwl -0x4(%r14), %ecx
leal (%rcx,%rax), %edi
addl $0x40000000, %edi       # imm = 0x40000000
callq 0x43e56
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x2f8(%rsp)
movl 0x40(%rsp), %edi
movq 0x80(%rsp), %rsi
movl %r15d, %edx
leaq 0x2f8(%rsp), %rcx
movl $0x3, %r8d
callq 0x2483d
movl (%r14), %edi
leaq 0x96cc6(%rip), %rbp     # 0xa8cf0
callq *(%rbp)
xorl %edi, %edi
xorl %esi, %esi
movl $0x7d0, %edx            # imm = 0x7D0
leaq 0x96d23(%rip), %rax     # 0xa8d60
callq *(%rax)
xorl %edi, %edi
callq *(%rbp)
incq %r13
addq $0x20, %r14
cmpq %r13, %rbx
jne 0x11fc7
xorl %edi, %edi
leaq 0x96b43(%rip), %rax     # 0xa8ba0
callq *(%rax)
callq 0x2ba74
xorl %edi, %edi
xorl %esi, %esi
movq 0x2d0(%rsp), %r14
movl %r14d, %edx
movl $0x14, %ecx
movl $0xfff5f5f5, %r8d       # imm = 0xFFF5F5F5
callq 0x31115
movq 0x2c0(%rsp), %r12
testq %r12, %r12
je 0x1228e
movq 0x8(%r12), %rax
subq (%r12), %rax
movq %rax, %xmm1
punpckldq 0x56106(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5610e(%rip), %xmm1    # 0x681c0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movapd %xmm0, 0x40(%rsp)
callq 0x6660
divsd 0x561af(%rip), %xmm0    # 0x68280
callq 0x6710
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x561a2(%rip), %xmm0    # 0x68288
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andq %rcx, %rdx
orq %rax, %rdx
cmpq $0x8, %rdx
movl $0x8, %eax
cmovaeq %rax, %rdx
movl %edx, %eax
leaq 0x93395(%rip), %rcx     # 0xa54a0
movq (%rcx,%rax,8), %r15
addl %edx, %edx
leal (%rdx,%rdx,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x6430
movapd 0x40(%rsp), %xmm1
divsd %xmm0, %xmm1
leaq 0x562e8(%rip), %rdi     # 0x68419
movapd %xmm1, %xmm0
movq %r15, %rsi
movb $0x1, %al
callq 0x50f37
xorps %xmm1, %xmm1
cvtsi2ssl 0x160(%rsp), %xmm1
movups 0x160(%rsp), %xmm0
movups 0x170(%rsp), %xmm2
movups 0x180(%rsp), %xmm3
movups %xmm3, 0x20(%rsp)
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
movq %rax, %rdi
movsd 0x56051(%rip), %xmm0    # 0x681d0
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
movq (%r12), %rsi
movq 0x8(%r12), %rdx
leaq 0x5628f(%rip), %rdi     # 0x68428
xorl %eax, %eax
callq 0x50f37
xorps %xmm1, %xmm1
cvtsi2ssl 0x160(%rsp), %xmm1
movups 0x160(%rsp), %xmm0
movups 0x170(%rsp), %xmm2
movups 0x180(%rsp), %xmm3
movups %xmm3, 0x20(%rsp)
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
movq %rax, %rdi
movsd 0x56000(%rip), %xmm0    # 0x681e0
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
cmpb $0x0, 0x10(%r12)
jne 0x1228e
movq 0x18(%r12), %rdi
xorps %xmm1, %xmm1
cvtsi2ssl 0x160(%rsp), %xmm1
movups 0x160(%rsp), %xmm0
movups 0x170(%rsp), %xmm2
movups 0x180(%rsp), %xmm3
movups %xmm3, 0x20(%rsp)
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
movsd 0x55fb8(%rip), %xmm0    # 0x681f0
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
movq 0x20(%r12), %rdi
xorps %xmm1, %xmm1
cvtsi2ssl 0x160(%rsp), %xmm1
movups 0x160(%rsp), %xmm0
movups 0x170(%rsp), %xmm2
movups 0x180(%rsp), %xmm3
movups %xmm3, 0x20(%rsp)
movups %xmm2, 0x10(%rsp)
movups %xmm0, (%rsp)
xorps %xmm2, %xmm2
movsd 0x55f7c(%rip), %xmm0    # 0x68200
movl $0xff000000, %esi       # imm = 0xFF000000
callq 0x51012
leal -0xc8(%r14), %ebp
movaps 0x55f74(%rip), %xmm0    # 0x68210
cvtsi2ss %ebp, %xmm0
movl $0x0, 0x94fa6(%rip)     # 0xa7250
movaps 0x55f6f(%rip), %xmm1    # 0x68220
unpcklps 0x2e0(%rsp), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
callq 0x71a0
testq %rbx, %rbx
jle 0x12453
xorps %xmm2, %xmm2
cvtsi2ss %ebp, %xmm2
movss 0x55d62(%rip), %xmm1    # 0x68038
addss %xmm1, %xmm2
movaps %xmm2, %xmm0
addss 0x55d9b(%rip), %xmm0    # 0x68080
cvttss2si %xmm0, %ebp
movq 0x1f0(%rsp), %r12
movq 0x200(%rsp), %r15
addss 0x55d17(%rip), %xmm2    # 0x68018
movaps %xmm2, 0x80(%rsp)
xorl %r13d, %r13d
movss 0x55d18(%rip), %xmm2    # 0x6802c
cmpq $-0x1, %r15
setne %al
cmpq %r15, %r13
setne %cl
movss %xmm1, 0x40(%rsp)
movaps %xmm1, %xmm0
addss %xmm2, %xmm0
addss 0x55d4e(%rip), %xmm0    # 0x68084
cvttss2si %xmm0, %esi
testb %cl, %al
jne 0x12359
movl $0x0, 0x94f08(%rip)     # 0xa7250
movl 0x10(%r12), %edx
movl %ebp, %edi
movss 0x55d29(%rip), %xmm0    # 0x68080
jmp 0x12372
movl $0x3, 0x94eed(%rip)     # 0xa7250
movl %ebp, %edi
movss 0x55d13(%rip), %xmm0    # 0x68080
movl $0xffc8c8c8, %edx       # imm = 0xFFC8C8C8
callq 0x2f6d8
cmpb $0x0, 0x1c(%r12)
movl (%r12), %esi
leaq 0x5e984(%rip), %rdx     # 0x70d0c
leaq 0x560bf(%rip), %rax     # 0x6844e
cmovneq %rax, %rdx
leaq 0x560aa(%rip), %rdi     # 0x68444
xorl %eax, %eax
callq 0x50f37
movss 0x40(%rsp), %xmm1
movss 0x55c7d(%rip), %xmm0    # 0x6802c
addss %xmm0, %xmm1
movaps %xmm1, 0x100(%rsp)
movaps %xmm1, %xmm0
movaps 0x80(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movsd 0x55e5b(%rip), %xmm1    # 0x68230
movq %rax, %rdi
callq 0x99be
cmpq %r15, %r13
movq %r13, %rcx
movq $-0x1, %rdx
cmoveq %rdx, %rcx
testb %al, %al
cmovneq %rcx, %r15
movaps 0x100(%rsp), %xmm0
addss 0x55c84(%rip), %xmm0    # 0x68088
movq 0x8(%r12), %rdi
movaps 0x80(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movsd 0x55e10(%rip), %xmm1    # 0x68230
callq 0x78a6
movss 0x55bff(%rip), %xmm2    # 0x6802c
movss 0x40(%rsp), %xmm1
addss 0x55c51(%rip), %xmm1    # 0x6808c
incq %r13
addq $0x20, %r12
cmpq %r13, %rbx
jne 0x12314
movq %r15, 0x200(%rsp)
callq 0x2ae30
callq 0x2a15d
testb %al, %al
movl 0x74(%rsp), %ebp
movq 0x2c8(%rsp), %r15
je 0x1102b
jmp 0x10f17
callq 0x2e8da
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x230(%rsp), %xmm2
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
movaps %xmm2, 0x230(%rsp)
callq 0x2e8f7
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movaps 0x230(%rsp), %xmm1
subss %xmm0, %xmm1
movss 0x6c(%rsp), %xmm0
movaps 0x40(%rsp), %xmm2
divss %xmm0, %xmm2
addss 0x60(%rsp), %xmm2
movss %xmm2, 0x60(%rsp)
divss %xmm0, %xmm1
addss 0x64(%rsp), %xmm1
movss %xmm1, 0x64(%rsp)
movl %r15d, %ebx
jmp 0x11091
movl 0x40(%r13), %r12d
jmp 0x11228
movq %r12, %rdi
callq 0x6840
jmp 0x10fee
movq %r12, %rdi
callq 0x685e
jmp 0x10fee