// File: Stygain[P]bandwidth-monitor/src/graph.cpp
// Function: Graph::Create(int, int, int, int)
void Graph::Create(int placementX, int placementY, int width, int height)
{
	this->placementX = placementX;
	this->placementY = placementY;
	this->width = width;
	this->height = height;

	this->graphTitle->Create(this->placementX + 1, this->placementY, this->width, 1);
	this->graphMaxItem->Create(this->placementX + 2, this->placementY + 1, 5, 1);

	this->win = newwin(this->height, this->width, this->placementY + 1, this->placementX);
	wborder(this->win, 0, 0, 0, 0, 0, 0, 0, 0);

	this->numCols = (this->width - 3);
	for (int i = 0; i < this->numCols; i++)
	{
		this->gDataCols.push_back(new GraphDataColumn(this->graphType, this->interfaces, this->interface));
	}

	for (size_t i = 0; i < (this->gDataCols.size() - 1); i++)
	{
		gDataCols[i]->SetNext(gDataCols[i+1]);
	}

	this->numRows = (this->height - 2);
	for (int i = 0; i < this->numRows; i++)
	{
		this->gRows.push_back(
			new GraphRow(
				1,
				(this->width - 3),
				(this->placementX + 1),
				(this->placementY + 1 + ((i * 1) + 1)),
				(this->numRows - i - 1),
				(this->numRows - 1)
			)
		);
	}

	wrefresh(this->win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0xc(%rbp), %ecx
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl -0x14(%rbp), %ecx
movl %ecx, 0x10(%rax)
movl -0x18(%rbp), %ecx
movl %ecx, 0x14(%rax)
movq 0x38(%rax), %rdi
movl 0x8(%rax), %esi
addl $0x1, %esi
movl 0xc(%rax), %edx
movl 0x10(%rax), %ecx
movl $0x1, %r8d
callq 0xe250
movq -0x58(%rbp), %rax
movq 0x40(%rax), %rdi
movl 0x8(%rax), %esi
addl $0x2, %esi
movl 0xc(%rax), %edx
addl $0x1, %edx
movl $0x5, %ecx
movl $0x1, %r8d
callq 0xe4a0
movq -0x58(%rbp), %rax
movl 0x14(%rax), %edi
movl 0x10(%rax), %esi
movl 0xc(%rax), %edx
addl $0x1, %edx
movl 0x8(%rax), %ecx
callq 0x3340
movq %rax, %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq (%rax), %rdi
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x31e0
movq -0x58(%rbp), %rax
movl 0x10(%rax), %ecx
subl $0x3, %ecx
movl %ecx, 0x1c(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x58(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x1c(%rcx), %eax
jge 0xe910
movq -0x58(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x68(%rbp)
movl $0x20, %edi
callq 0x3320
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x60(%rbp)
movl 0x30(%rax), %esi
movq 0x20(%rax), %rdx
movq 0x28(%rax), %rcx
callq 0xda40
jmp 0xe8d1
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0xf510
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe88f
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x20, %esi
callq 0x3330
jmp 0xea5f
movq $0x0, -0x40(%rbp)
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x60, %rdi
callq 0xf370
movq %rax, %rcx
movq -0x70(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xe984
movq -0x58(%rbp), %rdi
addq $0x60, %rdi
movq -0x40(%rbp), %rsi
callq 0xf540
movq -0x58(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x78(%rbp)
addq $0x60, %rdi
movq -0x40(%rbp), %rsi
addq $0x1, %rsi
callq 0xf540
movq -0x78(%rbp), %rdi
movq (%rax), %rsi
callq 0xda90
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xe918
movq -0x58(%rbp), %rax
movl 0x14(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x18(%rax)
movl $0x0, -0x44(%rbp)
movq -0x58(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x18(%rcx), %eax
jge 0xea4a
movq -0x58(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x88(%rbp)
movl $0x20, %edi
callq 0x3320
movq %rax, %rdi
movq -0x58(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x80(%rbp)
movl 0x10(%rax), %edx
addl $-0x3, %edx
movl 0x8(%rax), %ecx
movl 0xc(%rax), %esi
incl %ecx
movl -0x44(%rbp), %r9d
movl %esi, %r8d
movl %r9d, %esi
leal 0x2(%rsi,%r8), %r8d
movl 0x18(%rax), %esi
notl %r9d
addl %esi, %r9d
decl %esi
movq %rsp, %rax
movl %esi, (%rax)
movl $0x1, %esi
callq 0xe010
jmp 0xea08
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rsi
callq 0xf560
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xe998
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x20, %esi
callq 0x3330
jmp 0xea5f
movq -0x58(%rbp), %rax
movq (%rax), %rdi
callq 0x3390
addq $0xa0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x35c0
nopl (%rax,%rax)