// File: fhirschman[P]CANF-gp/source/general_functions.cc
// Function: sendToGP(std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>>&, bool, int)
void sendToGP(vector<vector<float>>& image, bool saveImage, int frameID){
		string appdx;
		if(frameID >=100){
		}
		else if(frameID <100 and frameID >=10){
			appdx = "0";
		}
		else if(frameID <10){
			appdx = "00";
		}

		if(saveImage && PROD_SERIES){
			stream.str("");
			stream << "set output \"frames/series_" << appdx  << frameID << ".png\"; \n";
			gp << stream.str();
			stream.str("");
		}
		else if(saveImage && PROD_SERIES==0){
			stream.str("");
			stream << "set output \"frames/fractal.png\"; \n";
			gp << stream.str();
			stream.str("");
		}

		gp << "plot '-'  binary" << gp.binFmt2d(image, "array") << " with image \n";
		gp.sendBinary2d(image);

		stream << "set xrange [" << 0 << ":" << N_X  << "]; \n";
		gp << stream.str();
		stream.str("");
		
		stream << "set yrange [" << 0 << ":" << N_Y  << "]; \n";
		gp << stream.str();
		stream.str("");

		gp << "replot; \n";

}

// Assembly:
subq $0x2a8, %rsp            # imm = 0x2A8
movb %sil, %al
movq %rdi, 0x2a0(%rsp)
andb $0x1, %al
movb %al, 0x29f(%rsp)
movl %edx, 0x298(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x8770
cmpl $0x64, 0x298(%rsp)
jl 0xacbb
jmp 0xad26
cmpl $0x64, 0x298(%rsp)
jge 0xad00
cmpl $0xa, 0x298(%rsp)
jl 0xad00
leaq 0x135db(%rip), %rsi     # 0x1e2b1
leaq 0x278(%rsp), %rdi
callq 0x8750
jmp 0xace5
jmp 0xad24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb5bb
cmpl $0xa, 0x298(%rsp)
jge 0xad22
leaq 0x1359f(%rip), %rsi     # 0x1e2b0
leaq 0x278(%rsp), %rdi
callq 0x8750
jmp 0xad20
jmp 0xad22
jmp 0xad24
jmp 0xad26
testb $0x1, 0x29f(%rsp)
je 0xaf70
leaq 0x1ec49(%rip), %rax     # 0x29984
testb $0x1, (%rax)
je 0xaf70
leaq 0x247(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x8970
movq 0xa8(%rsp), %rdx
leaq 0x13588(%rip), %rsi     # 0x1e2f0
leaq 0x248(%rsp), %rdi
callq 0xbd90
jmp 0xad77
leaq 0x1eed2(%rip), %rdi     # 0x29c50
leaq 0x248(%rsp), %rsi
callq 0x8250
jmp 0xad8d
leaq 0x248(%rsp), %rdi
callq 0x8330
leaq 0x247(%rsp), %rdi
callq 0x85a0
leaq 0x1eea2(%rip), %rdi     # 0x29c50
leaq 0x134fe(%rip), %rsi     # 0x1e2b3
callq 0x84e0
movq %rax, 0xa0(%rsp)
jmp 0xadc4
movq 0xa0(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x8450
movq %rax, 0x98(%rsp)
jmp 0xade3
movq 0x98(%rsp), %rdi
movl 0x298(%rsp), %esi
callq 0x8940
movq %rax, 0x90(%rsp)
jmp 0xae01
movq 0x90(%rsp), %rdi
leaq 0x134d8(%rip), %rsi     # 0x1e2e8
callq 0x84e0
jmp 0xae17
leaq 0x1ee32(%rip), %rsi     # 0x29c50
leaq 0x220(%rsp), %rdi
callq 0x8530
jmp 0xae2d
leaq 0x1ec4c(%rip), %rdi     # 0x29a80
leaq 0x220(%rsp), %rsi
callq 0x8450
jmp 0xae43
leaq 0x220(%rsp), %rdi
callq 0x8330
leaq 0x1ff(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x8970
movq 0x88(%rsp), %rdx
leaq 0x1347c(%rip), %rsi     # 0x1e2f0
leaq 0x200(%rsp), %rdi
callq 0xbd90
jmp 0xae83
leaq 0x1edc6(%rip), %rdi     # 0x29c50
leaq 0x200(%rsp), %rsi
callq 0x8250
jmp 0xae99
leaq 0x200(%rsp), %rdi
callq 0x8330
leaq 0x1ff(%rsp), %rdi
callq 0x85a0
jmp 0xb162
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xaeef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x248(%rsp), %rdi
callq 0x8330
leaq 0x247(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x220(%rsp), %rdi
callq 0x8330
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xaf5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x8330
leaq 0x1ff(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
testb $0x1, 0x29f(%rsp)
je 0xb160
leaq 0x1e9ff(%rip), %rax     # 0x29984
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xb160
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x8970
movq 0x80(%rsp), %rdx
leaq 0x13337(%rip), %rsi     # 0x1e2f0
leaq 0x1d8(%rsp), %rdi
callq 0xbd90
jmp 0xafc8
leaq 0x1ec81(%rip), %rdi     # 0x29c50
leaq 0x1d8(%rsp), %rsi
callq 0x8250
jmp 0xafde
leaq 0x1d8(%rsp), %rdi
callq 0x8330
leaq 0x1d7(%rsp), %rdi
callq 0x85a0
leaq 0x1ec51(%rip), %rdi     # 0x29c50
leaq 0x132c8(%rip), %rsi     # 0x1e2ce
callq 0x84e0
jmp 0xb00d
leaq 0x1ec3c(%rip), %rsi     # 0x29c50
leaq 0x1b0(%rsp), %rdi
callq 0x8530
jmp 0xb023
leaq 0x1ea56(%rip), %rdi     # 0x29a80
leaq 0x1b0(%rsp), %rsi
callq 0x8450
jmp 0xb039
leaq 0x1b0(%rsp), %rdi
callq 0x8330
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x8970
movq 0x78(%rsp), %rdx
leaq 0x1328c(%rip), %rsi     # 0x1e2f0
leaq 0x190(%rsp), %rdi
callq 0xbd90
jmp 0xb073
leaq 0x1ebd6(%rip), %rdi     # 0x29c50
leaq 0x190(%rsp), %rsi
callq 0x8250
jmp 0xb089
leaq 0x190(%rsp), %rdi
callq 0x8330
leaq 0x18f(%rsp), %rdi
callq 0x85a0
jmp 0xb160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb0df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x8330
leaq 0x1d7(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0x8330
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb14e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x8330
leaq 0x18f(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
jmp 0xb162
leaq 0x1e917(%rip), %rdi     # 0x29a80
leaq 0x13181(%rip), %rsi     # 0x1e2f1
callq 0x84e0
movq %rax, 0x70(%rsp)
jmp 0xb17c
movq 0x2a0(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x147(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x8970
movq 0x68(%rsp), %rdx
leaq 0x1315b(%rip), %rsi     # 0x1e302
leaq 0x148(%rsp), %rdi
callq 0xbd90
jmp 0xb1b6
movq 0x60(%rsp), %rdx
leaq 0x1e8be(%rip), %rsi     # 0x29a80
leaq 0x168(%rsp), %rdi
leaq 0x148(%rsp), %rcx
callq 0xc2b0
jmp 0xb1d9
movq 0x70(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x8450
movq %rax, 0x58(%rsp)
jmp 0xb1f2
movq 0x58(%rsp), %rdi
leaq 0x1310a(%rip), %rsi     # 0x1e308
callq 0x84e0
jmp 0xb205
leaq 0x168(%rsp), %rdi
callq 0x8330
leaq 0x148(%rsp), %rdi
callq 0x8330
leaq 0x147(%rsp), %rdi
callq 0x85a0
movq 0x2a0(%rsp), %rsi
leaq 0x1e845(%rip), %rdi     # 0x29a80
callq 0xc2f0
jmp 0xb242
leaq 0x1ea07(%rip), %rdi     # 0x29c50
leaq 0x130c6(%rip), %rsi     # 0x1e316
callq 0x84e0
movq %rax, 0x50(%rsp)
jmp 0xb25c
movq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x8940
movq %rax, 0x48(%rsp)
jmp 0xb26f
movq 0x48(%rsp), %rdi
leaq 0x13d52(%rip), %rsi     # 0x1efcd
callq 0x84e0
movq %rax, 0x40(%rsp)
jmp 0xb287
movq 0x40(%rsp), %rdi
leaq 0x1e651(%rip), %rax     # 0x298e4
movl (%rax), %esi
callq 0x8940
movq %rax, 0x38(%rsp)
jmp 0xb2a1
movq 0x38(%rsp), %rdi
leaq 0x13076(%rip), %rsi     # 0x1e323
callq 0x84e0
jmp 0xb2b4
leaq 0x1e995(%rip), %rsi     # 0x29c50
leaq 0x120(%rsp), %rdi
callq 0x8530
jmp 0xb2ca
leaq 0x1e7af(%rip), %rdi     # 0x29a80
leaq 0x120(%rsp), %rsi
callq 0x8450
jmp 0xb2e0
leaq 0x120(%rsp), %rdi
callq 0x8330
leaq 0xff(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x8970
movq 0x30(%rsp), %rdx
leaq 0x12fe5(%rip), %rsi     # 0x1e2f0
leaq 0x100(%rsp), %rdi
callq 0xbd90
jmp 0xb31a
leaq 0x1e92f(%rip), %rdi     # 0x29c50
leaq 0x100(%rsp), %rsi
callq 0x8250
jmp 0xb330
leaq 0x100(%rsp), %rdi
callq 0x8330
leaq 0xff(%rsp), %rdi
callq 0x85a0
leaq 0x1e8ff(%rip), %rdi     # 0x29c50
leaq 0x12fd0(%rip), %rsi     # 0x1e328
callq 0x84e0
movq %rax, 0x28(%rsp)
jmp 0xb364
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0x8940
movq %rax, 0x20(%rsp)
jmp 0xb377
movq 0x20(%rsp), %rdi
leaq 0x13c4a(%rip), %rsi     # 0x1efcd
callq 0x84e0
movq %rax, 0x18(%rsp)
jmp 0xb38f
movq 0x18(%rsp), %rdi
leaq 0x1e54d(%rip), %rax     # 0x298e8
movl (%rax), %esi
callq 0x8940
movq %rax, 0x10(%rsp)
jmp 0xb3a9
movq 0x10(%rsp), %rdi
leaq 0x12f6e(%rip), %rsi     # 0x1e323
callq 0x84e0
jmp 0xb3bc
leaq 0x1e88d(%rip), %rsi     # 0x29c50
leaq 0xd8(%rsp), %rdi
callq 0x8530
jmp 0xb3d2
leaq 0x1e6a7(%rip), %rdi     # 0x29a80
leaq 0xd8(%rsp), %rsi
callq 0x8450
jmp 0xb3e8
leaq 0xd8(%rsp), %rdi
callq 0x8330
leaq 0xb7(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x8970
movq 0x8(%rsp), %rdx
leaq 0x12edd(%rip), %rsi     # 0x1e2f0
leaq 0xb8(%rsp), %rdi
callq 0xbd90
jmp 0xb422
leaq 0x1e827(%rip), %rdi     # 0x29c50
leaq 0xb8(%rsp), %rsi
callq 0x8250
jmp 0xb438
leaq 0xb8(%rsp), %rdi
callq 0x8330
leaq 0xb7(%rsp), %rdi
callq 0x85a0
leaq 0x1e627(%rip), %rdi     # 0x29a80
leaq 0x12ed5(%rip), %rsi     # 0x1e335
callq 0x84e0
jmp 0xb467
leaq 0x278(%rsp), %rdi
callq 0x8330
addq $0x2a8, %rsp            # imm = 0x2A8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb4d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb4c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x8330
leaq 0x148(%rsp), %rdi
callq 0x8330
leaq 0x147(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x8330
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb545
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x8330
leaq 0xff(%rsp), %rdi
callq 0x85a0
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x8330
jmp 0xb5bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
jmp 0xb5ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x270(%rsp)
movl %eax, 0x26c(%rsp)
leaq 0xb8(%rsp), %rdi
callq 0x8330
leaq 0xb7(%rsp), %rdi
callq 0x85a0
leaq 0x278(%rsp), %rdi
callq 0x8330
movq 0x270(%rsp), %rdi
callq 0x8960
nopw %cs:(%rax,%rax)