// File: haught[P]cws_plugin/cws_plugin.cpp
// Function: main
int main(int argc, char **argv) {
	int i;
	map<string, string> valueMap;
	char fileName[1024];
	for (int i = 0; i < argc; i++) {
		cout << "arg" <<  i << ":" << argv[i] << endl;
	}
	if (argc <3) {
		cout << "error:Invalid parameter,format:" << argv[0] << "input output" << endl;	//Error to UI
		exit(0);
	}
	sprintf(fileName, "%s/run.gcode",argv[1]);
	readGcode(fileName, valueMap);


	sprintf(fileName, "%s/default.slicing", argv[1]);
	writeDefault_slicing(fileName, valueMap);

	sprintf(fileName, "%s/manifest.xml", argv[1]);
	writeManifest_xml(argv[1],fileName, valueMap);

	sprintf(fileName, "%s/1.gcode", argv[1]);
	write_1_gcode(fileName, valueMap);



	cout << "progress:0" << endl;				//progross to UI

	cout << "info:" << endl;				//progross to UI

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x8ea0
movl $0x0, -0x454(%rbp)
movl -0x454(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x88dd
movq 0x77b6(%rip), %rdi      # 0xffd8
leaq 0x3853(%rip), %rsi      # 0xc07c
callq 0x3240
movq %rax, -0x470(%rbp)
jmp 0x8837
movq -0x470(%rbp), %rdi
movl -0x454(%rbp), %esi
callq 0x3410
movq %rax, -0x478(%rbp)
jmp 0x8852
movq -0x478(%rbp), %rdi
leaq 0x34b9(%rip), %rsi      # 0xbd19
callq 0x3240
movq %rax, -0x480(%rbp)
jmp 0x886e
movq -0x480(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x454(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3240
movq %rax, -0x488(%rbp)
jmp 0x8892
movq -0x488(%rbp), %rdi
movq 0x7728(%rip), %rsi      # 0xffc8
callq 0x3280
jmp 0x88a7
jmp 0x88a9
movl -0x454(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x454(%rbp)
jmp 0x880c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x460(%rbp)
movl %eax, -0x464(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x8ec0
jmp 0x8aaa
cmpl $0x3, -0x8(%rbp)
jge 0x8953
movq 0x76ee(%rip), %rdi      # 0xffd8
leaq 0x378f(%rip), %rsi      # 0xc080
callq 0x3240
movq %rax, -0x490(%rbp)
jmp 0x88ff
movq -0x490(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x3240
movq %rax, -0x498(%rbp)
jmp 0x891b
movq -0x498(%rbp), %rdi
leaq 0x3777(%rip), %rsi      # 0xc0a0
callq 0x3240
movq %rax, -0x4a0(%rbp)
jmp 0x8937
movq -0x4a0(%rbp), %rdi
movq 0x7683(%rip), %rsi      # 0xffc8
callq 0x3280
jmp 0x894c
xorl %edi, %edi
callq 0x32e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x374b(%rip), %rsi      # 0xc0ad
xorl %eax, %eax
leaq -0x450(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x3080
movq -0x4a8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x8440
jmp 0x8989
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x3722(%rip), %rsi      # 0xc0ba
xorl %eax, %eax
leaq -0x450(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
callq 0x3080
movq -0x4b0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x63b0
jmp 0x89bf
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x36ff(%rip), %rsi      # 0xc0cd
xorl %eax, %eax
leaq -0x450(%rbp), %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x3080
movq -0x4b8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x48(%rbp), %rdx
callq 0x5be0
jmp 0x89fd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x36d1(%rip), %rsi      # 0xc0dd
xorl %eax, %eax
leaq -0x450(%rbp), %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x3080
movq -0x4c0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x37f0
jmp 0x8a33
movq 0x759e(%rip), %rdi      # 0xffd8
leaq 0x36a7(%rip), %rsi      # 0xc0e8
callq 0x3240
movq %rax, -0x4c8(%rbp)
jmp 0x8a4f
movq -0x4c8(%rbp), %rdi
movq 0x756b(%rip), %rsi      # 0xffc8
callq 0x3280
jmp 0x8a64
movq 0x756d(%rip), %rdi      # 0xffd8
leaq 0x3681(%rip), %rsi      # 0xc0f3
callq 0x3240
movq %rax, -0x4d0(%rbp)
jmp 0x8a80
movq -0x4d0(%rbp), %rdi
movq 0x753a(%rip), %rsi      # 0xffc8
callq 0x3280
jmp 0x8a95
leaq -0x48(%rbp), %rdi
callq 0x8ec0
movl -0x4(%rbp), %eax
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
movq -0x460(%rbp), %rdi
callq 0x3420
nopw %cs:(%rax,%rax)