// File: /workspace/github_c_makefile_star2_O0/arkanis[P]process-map/map.c
// Function: PlotAddrRanges
Texture2D PlotAddrRanges(AddrRange ranges[], size_t rangeCount, Font rangeNameFont, size_t* hilbertCurveOrder) {
	// First figure out how many pages we need to fit into the map, from that we can calculate the size of the map square.
	uint64_t minRequiredPages = 0, oversizedGapPages = 0;
	for (size_t i = 0; i < rangeCount; i++) {
		size_t rangePageCount = (ranges[i].endAddr - ranges[i].startAddr) / pageSize;
		if (ranges[i].isGap) {
			if (rangePageCount > cappedGapPageCount) {
				minRequiredPages += cappedGapPageCount;
				oversizedGapPages += rangePageCount;
			} else {
				minRequiredPages += rangePageCount;
			}
		} else {
			minRequiredPages += rangePageCount;
		}
	}
	
	// Caclulate texture size and the order of the hilbert curve used to map the 1D address ranges onto a 2D plane.
	// sqrt(minRequiredPages) is the size of the square needed to fit minRequiredPages pixels.
	// log2(squareSize) is the order of the hilber curve (and the power-of-two exponent of the square size). It needs to be an integer so we round up with ceil().
	*hilbertCurveOrder = ceil(log2(sqrt(minRequiredPages)));
	size_t mapSideLength = pow(2, *hilbertCurveOrder);
	
	// We now know the size of the map, distribute the left over map space among the oversized gaps (proportinally to their respective relative size)
	uint64_t leftOverFreePages = mapSideLength*mapSideLength - minRequiredPages;
	uint64_t prevRangeEndPage = 0;
	for (size_t i = 0; i < rangeCount; i++) {
		size_t rangePageCount = (ranges[i].endAddr - ranges[i].startAddr) / pageSize;
		ranges[i].startPage = prevRangeEndPage;
		if (i == rangeCount - 1) {
			// Make sure the end of the last range aligns with the end of the map
			ranges[i].endPage = mapSideLength*mapSideLength;
		} else if (ranges[i].isGap && rangePageCount > cappedGapPageCount) {
			rangePageCount = cappedGapPageCount + leftOverFreePages * ((double)rangePageCount / oversizedGapPages);
			ranges[i].endPage = ranges[i].startPage + rangePageCount;
			// Round the endPage towards to the closest 16M boundary to avoid jagged edges on the map 
			ranges[i].endPage = (ranges[i].endPage + cappedGapPageCount / 2) / cappedGapPageCount * cappedGapPageCount;
		} else {
			ranges[i].endPage = ranges[i].startPage + rangePageCount;
		}
		
		prevRangeEndPage = ranges[i].endPage;
	}
	
	// Create a map image where the address ranges are mapped into the image via a hilbert curve.
	// Each range gets its own color and all pixels of that range are filled with its color.
	// The color has to be unique since we use them to draw the borders between ranges in the fragment shader and to
	// highlight all pixels of the selected range.
	// Each color (a 32 bit value) is constructed as follows: rr rr ii tt
	// rr rr: 16 bits of pseudo-random data taken from the hashed range name or the ranges start and end address.
	//        The fragment shader uses those bits to calculate a display color for the range.
	// ii:    8 bits of the range index just to make sure consecutive ranges have different colors even if they share
	//        the same name (and with that the same hash).
	// tt:    The type of the range (unused area, gap, file backed range, anonymous range). The fragment shader draws
	//        different types with different colors (e.g. gaps as light gray instead of a random color).
	// While we iterate over each pixel of a range also calculate the bounding box for later (text positioning, draw culling, etc.).
	Image mapImage = GenImageColor(mapSideLength, mapSideLength, BLANK);
	Color* mapImagePixels = mapImage.data;
	for (size_t i = 0; i < rangeCount; i++) {
		Color color;
		if (ranges[i].isGap) {
			uint32_t hash = fnv1a(&ranges[i], offsetof(AddrRange, isGap));
			color = (Color){ .r = hash, .g = hash >> 8, .b = i, .a = 1 };  // 1 = gap
		} else if (ranges[i].filePath) {
			uint32_t hash = fnv1a(ranges[i].filePath, strlen(ranges[i].filePath));
			color = (Color){ .r = hash, .g = hash >> 8, .b = i, .a = 2 };  // 2 = file backed range
		} else {
			uint32_t hash = fnv1a(&ranges[i], offsetof(AddrRange, isGap));
			color = (Color){ .r = hash, .g = hash >> 8, .b = i, .a = 3 };  // 3 = anonymous range
		}
		
		if (ranges[i].perms) {
			if (ranges[i].perms[2] == 'x') {
				color.a = 4;  // 4 = executable range
			} else if (ranges[i].perms[1] == 'w') {
				color.a = 5;  // 5 = writable range
			} else if (ranges[i].perms[0] == 'r') {
				color.a = 6;  // 6 = readable range
			}
		}
		
		int xMin = mapSideLength, xMax = 0, yMin = mapSideLength, yMax = 0;
		for (uint64_t page = ranges[i].startPage; page < ranges[i].endPage; page++) {
			int x, y;
			HilberCurveDistToPos(*hilbertCurveOrder, page, &x, &y);
			mapImagePixels[y * mapImage.width + x] = color;
			
			if (x < xMin) xMin = x;
			if (x > xMax) xMax = x;
			if (y < yMin) yMin = y;
			if (y > yMax) yMax = y;
		}
		
		ranges[i].color = color;
		ranges[i].boundingBox = (Rectangle){ .x = xMin, .y = yMin, .width = xMax - xMin + 1, .height = yMax - yMin + 1 };
	}
	
	// Create the label text for each region and calculate the labels position and font size
	for (size_t i = 0; i < rangeCount; i++) {
		char* text = NULL;
		if (ranges[i].isGap)
			text = strdup("unmapped");
		else if (ranges[i].filePath)
			text = strdup(basename(ranges[i].filePath));
		else
			text = strdup("anonymous");
		
		ranges[i].label = LabelFor(text, ranges[i].boundingBox, rangeNameFont);
	}

	Texture2D mapTexture = LoadTextureFromImage(mapImage);
	UnloadImage(mapImage);
	return mapTexture;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x128(%rbp)
movq %rdi, -0x120(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x14bdb
movq -0x8(%rbp), %rax
imulq $0xa0, -0x30(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0xa0, -0x30(%rbp), %rdx
addq %rdx, %rcx
subq (%rcx), %rax
shrq $0xc, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x30(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x14bbc
cmpq $0x1000, -0x38(%rbp)    # imm = 0x1000
jbe 0x14bae
movq -0x20(%rbp), %rax
addq $0x1000, %rax           # imm = 0x1000
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x14bba
movq -0x38(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x14bc8
movq -0x38(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x14bca
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x14b38
movq -0x20(%rbp), %xmm0
movaps 0x774b9(%rip), %xmm1    # 0x8c0a0
movaps %xmm1, -0x150(%rbp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x774b6(%rip), %xmm1    # 0x8c0b0
movaps %xmm1, -0x140(%rbp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
callq 0x6760
callq 0x6630
callq 0x60a0
movaps -0x150(%rbp), %xmm2
movaps %xmm0, %xmm1
movaps -0x140(%rbp), %xmm0
movaps %xmm1, %xmm3
cvttsd2si %xmm3, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movsd 0x774b1(%rip), %xmm3    # 0x8c0f8
movsd %xmm3, -0x130(%rbp)
subsd %xmm3, %xmm1
cvttsd2si %xmm1, %rax
andq %rdx, %rax
orq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x77478(%rip), %xmm0    # 0x8c100
callq 0x6750
movsd -0x130(%rbp), %xmm1
movaps %xmm0, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
imulq -0x40(%rbp), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x14ecd
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rcx
subq (%rcx), %rax
shrq $0xc, %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x30(%rax)
movq -0x58(%rbp), %rax
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x14d5c
movq -0x40(%rbp), %rcx
imulq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
jmp 0x14ea5
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x14e79
cmpq $0x1000, -0x60(%rbp)    # imm = 0x1000
jbe 0x14e79
movq -0x48(%rbp), %xmm0
movaps 0x77311(%rip), %xmm4    # 0x8c0a0
punpckldq %xmm4, %xmm0    # xmm0 = xmm0[0],xmm4[0],xmm0[1],xmm4[1]
movapd 0x77315(%rip), %xmm3    # 0x8c0b0
subpd %xmm3, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x60(%rbp), %xmm1
punpckldq %xmm4, %xmm1    # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
subpd %xmm3, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movq -0x28(%rbp), %xmm2
punpckldq %xmm4, %xmm2    # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm3, %xmm2
movaps %xmm2, %xmm3
unpckhpd %xmm2, %xmm2            # xmm2 = xmm2[1,1]
addsd %xmm3, %xmm2
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd 0x7731e(%rip), %xmm1    # 0x8c108
addsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x772f3(%rip), %xmm1    # 0x8c0f8
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x30(%rax), %rcx
addq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x38(%rax), %rcx
addq $0x800, %rcx            # imm = 0x800
shrq $0xc, %rcx
shlq $0xc, %rcx
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
jmp 0x14ea3
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x30(%rax), %rcx
addq -0x60(%rbp), %rcx
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x38(%rax)
jmp 0x14ea5
movq -0x8(%rbp), %rax
imulq $0xa0, -0x58(%rbp), %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x14cd8
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x40(%rbp), %rax
movl %eax, %edx
movb $0x0, -0x7c(%rbp)
movb $0x0, -0x7b(%rbp)
movb $0x0, -0x7a(%rbp)
movb $0x0, -0x79(%rbp)
movl -0x7c(%rbp), %ecx
leaq -0x78(%rbp), %rdi
callq 0x47770
movq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x1530d
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x14f96
movq -0x8(%rbp), %rdi
imulq $0xa0, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0x10, %esi
callq 0x16d00
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
movb %al, -0x9c(%rbp)
movl -0x98(%rbp), %eax
shrl $0x8, %eax
movb %al, -0x9b(%rbp)
movq -0x90(%rbp), %rax
movb %al, -0x9a(%rbp)
movb $0x1, -0x99(%rbp)
movl -0x9c(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x1509c
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x20(%rax)
je 0x1503d
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq %rax, -0x158(%rbp)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x62f0
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x16d00
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
movb %al, -0xa4(%rbp)
movl -0xa0(%rbp), %eax
shrl $0x8, %eax
movb %al, -0xa3(%rbp)
movq -0x90(%rbp), %rax
movb %al, -0xa2(%rbp)
movb $0x2, -0xa1(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x1509a
movq -0x8(%rbp), %rdi
imulq $0xa0, -0x90(%rbp), %rax
addq %rax, %rdi
movl $0x10, %esi
callq 0x16d00
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %eax
movb %al, -0xac(%rbp)
movl -0xa8(%rbp), %eax
shrl $0x8, %eax
movb %al, -0xab(%rbp)
movq -0x90(%rbp), %rax
movb %al, -0xaa(%rbp)
movb $0x3, -0xa9(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0x94(%rbp)
jmp 0x1509c
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x18(%rax)
je 0x15130
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movsbl 0x2(%rax), %eax
cmpl $0x78, %eax
jne 0x150dd
movb $0x4, -0x91(%rbp)
jmp 0x1512e
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x77, %eax
jne 0x15105
movb $0x5, -0x91(%rbp)
jmp 0x1512c
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0x1512a
movb $0x6, -0x91(%rbp)
jmp 0x1512c
jmp 0x1512e
jmp 0x15130
movq -0x40(%rbp), %rax
movl %eax, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
movq -0x40(%rbp), %rax
movl %eax, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq -0x8(%rbp), %rcx
imulq $0xa0, -0x90(%rbp), %rdx
addq %rdx, %rcx
cmpq 0x38(%rcx), %rax
jae 0x1525d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0xc8(%rbp), %rsi
leaq -0xcc(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
callq 0x16d60
movq -0x88(%rbp), %rax
movl -0xd0(%rbp), %ecx
imull -0x70(%rbp), %ecx
addl -0xcc(%rbp), %ecx
movslq %ecx, %rcx
movl -0x94(%rbp), %edx
movl %edx, (%rax,%rcx,4)
movl -0xcc(%rbp), %eax
cmpl -0xb0(%rbp), %eax
jge 0x151f6
movl -0xcc(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0xcc(%rbp), %eax
cmpl -0xb4(%rbp), %eax
jle 0x15210
movl -0xcc(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xb8(%rbp), %eax
jge 0x1522a
movl -0xd0(%rbp), %eax
movl %eax, -0xb8(%rbp)
movl -0xd0(%rbp), %eax
cmpl -0xbc(%rbp), %eax
jle 0x15244
movl -0xd0(%rbp), %eax
movl %eax, -0xbc(%rbp)
jmp 0x15246
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x15175
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
movl -0x94(%rbp), %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
imulq $0xa0, -0x90(%rbp), %rcx
addq %rcx, %rax
cvtsi2ssl -0xb0(%rbp), %xmm0
movss %xmm0, -0xe0(%rbp)
cvtsi2ssl -0xb8(%rbp), %xmm0
movss %xmm0, -0xdc(%rbp)
movl -0xb4(%rbp), %ecx
subl -0xb0(%rbp), %ecx
addl $0x1, %ecx
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0xd8(%rbp)
movl -0xbc(%rbp), %ecx
subl -0xb8(%rbp), %ecx
addl $0x1, %ecx
cvtsi2ss %ecx, %xmm0
movss %xmm0, -0xd4(%rbp)
movq -0xe0(%rbp), %rcx
movq %rcx, 0x44(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0x4c(%rax)
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x14f0b
movq $0x0, -0xe8(%rbp)
movq -0xe8(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x15464
movq $0x0, -0xf0(%rbp)
movq -0x8(%rbp), %rax
imulq $0xa0, -0xe8(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x15361
leaq 0x77014(%rip), %rdi     # 0x8c367
callq 0x64b0
movq %rax, -0xf0(%rbp)
jmp 0x153bb
movq -0x8(%rbp), %rax
imulq $0xa0, -0xe8(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x20(%rax)
je 0x153a6
movq -0x8(%rbp), %rax
imulq $0xa0, -0xe8(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdi
callq 0x60f0
movq %rax, %rdi
callq 0x64b0
movq %rax, -0xf0(%rbp)
jmp 0x153b9
leaq 0x76fc3(%rip), %rdi     # 0x8c370
callq 0x64b0
movq %rax, -0xf0(%rbp)
jmp 0x153bb
movq -0x118(%rbp), %rax
movq -0x8(%rbp), %rcx
movq -0xe8(%rbp), %rdx
leaq (%rdx,%rdx,4), %rdx
shlq $0x5, %rdx
movq %rcx, %rsi
addq %rdx, %rsi
movq %rsi, -0x160(%rbp)
movq -0xf0(%rbp), %rsi
movsd 0x44(%rcx,%rdx), %xmm0
movsd 0x4c(%rcx,%rdx), %xmm1
movups (%rax), %xmm2
movups 0x10(%rax), %xmm3
movups 0x20(%rax), %xmm4
movq %rsp, %rax
movups %xmm4, 0x20(%rax)
movups %xmm3, 0x10(%rax)
movups %xmm2, (%rax)
leaq -0x110(%rbp), %rdi
callq 0x16bb0
movq -0x160(%rbp), %rax
movq -0x110(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x108(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x100(%rbp), %rcx
movq %rcx, 0x68(%rax)
movq -0xf8(%rbp), %rcx
movq %rcx, 0x70(%rax)
movq -0xe8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xe8(%rbp)
jmp 0x15318
movq -0x128(%rbp), %rdi
leaq -0x78(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4f700
leaq -0x78(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x46670
movq -0x120(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nop