// File: /workspace/github_cpp_makefile_star2_O3/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 0x33a0
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 0x18d1(%rip), %rsi      # 0x75e7
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5d89
leaq 0x1a5a(%rip), %rsi      # 0x7784
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5dc5
leaq 0x1a46(%rip), %rsi      # 0x7788
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5dfe
leaq 0x1a34(%rip), %rsi      # 0x778e
leaq -0x40(%rbp), %rdi
callq 0x3080
testl %eax, %eax
je 0x5e2b
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x12fd(%rip), %rdx      # 0x7076
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x514e
jmp 0x5e66
leaq -0xb0(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0x50b0
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
callq 0x5f4a
movq -0xc0(%rbp), %rdi
jmp 0x5e56
leaq -0x90(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x50b0
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x618c
movq -0xa0(%rbp), %rdi
jmp 0x5e56
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x50b0
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x643f
movq -0x80(%rbp), %rdi
jmp 0x5e56
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %rdi
callq 0x50b0
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x657e
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x5e66
movq (%r15), %rsi
incq %rsi
callq 0x3250
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5e7b
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x413e(%rip), %rsi      # 0x9fc0
leaq -0x240(%rbp), %rdi
callq 0x3310
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 0x5f0e
movq -0x50(%rbp), %rsi
jmp 0x5f01
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f0e
movq -0x70(%rbp), %rsi
jmp 0x5f01
jmp 0x5f0b
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f0e
movq -0x90(%rbp), %rsi
jmp 0x5f01
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r15, %rdi
je 0x5f0e
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x3250
jmp 0x5f0e
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x5f23
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x4096(%rip), %rsi      # 0x9fc0
leaq -0x240(%rbp), %rdi
callq 0x3310
leaq -0x1c8(%rbp), %rdi
callq 0x30a0
movq %rbx, %rdi
callq 0x33d0