// File: /workspace/github_cpp_makefile_star2_O1/mattdibi[P]Programmatore-JTAG-per-Xilinx/svftoserial.cpp
// Function: DecodeInstruction(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string DecodeInstruction (string line) 
{
	// Necessario per analizzare linea componente per componente
	istringstream iss(line);
	string sub;
	iss >> sub;

	// Vengono chiamate diverse funzioni a seconda del valore di sub
	if (sub == "SDR")			return GenerateSDROutput (line);
	else if (sub == "SIR") 		return GenerateSIROutput (line);
	else if (sub == "STATE")	return GenerateSTATEOutput (line);
	else if (sub == "RUNTEST")	return GenerateRUNTESTOutput (line);
	else 
	{
		// Handler per altri casi
		return "";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x240(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x33b0
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x40(%rbp), %rsi
movq %r15, %rdi
callq 0x32e0
leaq 0x1845(%rip), %rsi      # 0x75f3
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5e21
leaq 0x19ce(%rip), %rsi      # 0x7790
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5e5d
leaq 0x19ba(%rip), %rsi      # 0x7794
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5e96
leaq 0x19a8(%rip), %rsi      # 0x779a
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5ec3
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x126e(%rip), %rdx      # 0x707f
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x51c0
jmp 0x5efe
leaq -0xb0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x5126
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x5fe2
movq -0xc0(%rbp), %rdi
jmp 0x5eee
leaq -0x90(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x5126
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x6224
movq -0xa0(%rbp), %rdi
jmp 0x5eee
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x5126
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x64d7
movq -0x80(%rbp), %rdi
jmp 0x5eee
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x5126
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x6616
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x5efe
movq (%r15), %rsi
incq %rsi
callq 0x3250
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5f13
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x40a6(%rip), %rsi      # 0x9fc0
leaq -0x240(%rbp), %rdi
callq 0x3320
leaq -0x1c8(%rbp), %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fa6
movq -0x50(%rbp), %rsi
jmp 0x5f99
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fa6
movq -0x70(%rbp), %rsi
jmp 0x5f99
jmp 0x5fa3
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fa6
movq -0x90(%rbp), %rsi
jmp 0x5f99
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fa6
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x3250
jmp 0x5fa6
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5fbb
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x3ffe(%rip), %rsi      # 0x9fc0
leaq -0x240(%rbp), %rdi
callq 0x3320
leaq -0x1c8(%rbp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x33e0