// File: /workspace/github_cpp_makefile_star2_O1/mattdibi[P]Programmatore-JTAG-per-Xilinx/svftoserial.cpp
// Function: GenerateSIROutput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string GenerateSIROutput (string line)
{
		istringstream iss(line);
		string sub, str;
		int n, k;

		// Scarta nome comando
		iss >> sub;
		// Memorizza dimensione dati, utilizzabile per verifica
		iss >> n;
		// Scarta parametro
		iss >> sub;
		// Prende dati in esadecimale tra parentesi
		iss >> sub;

		// Preleva parte tra parentesi
		string hexval = sub.substr(1,2);
		// Converte stringa esadecimale in stringa binaria
		string binval = hexstrToBinstr(hexval);

		// Inserisce parte iniziale comune per tutte le SIR
		str += "!!**";
		
		// Sostituisce '.' e ',' a 0 e 1
		for (k=binval.length()-1; k>binval.length()-n; k--)
		{
			if (binval[k]=='0') 
				str += '.';
			else if(binval[k]=='1') 
				str += ',';
		}

		// Sostituisce l'ultimo bit con ':' o con ';'
		if (binval[k]=='0') 
			str += ':';
        else if (binval[k]=='1') 
			str += ';';

		// Inserisce parte finale comune per tutte le SIR
		str += "!*";
		
		return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq -0x230(%rbp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x33b0
leaq -0x60(%rbp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x10(%rbx), %r12
movq %r12, (%rbx)
movq %rax, 0x8(%rbx)
movb %al, 0x10(%rbx)
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x32e0
leaq -0x230(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3150
leaq -0x230(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x32e0
leaq -0x230(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x32e0
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x3270
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x5126
leaq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x68a9
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x6311
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3250
leaq 0x148c(%rip), %rsi      # 0x77a4
movq %rbx, %rdi
callq 0x3420
movq -0x48(%rbp), %rcx
leal -0x1(%rcx), %eax
cltq
movslq -0x2c(%rbp), %rdx
movq %rcx, %rsi
subq %rdx, %rsi
cmpq %rax, %rsi
jae 0x6376
leal -0x2(%rcx), %r14d
movq -0x50(%rbp), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x31, %eax
je 0x6352
cmpl $0x30, %eax
jne 0x635f
movb $0x2e, %al
jmp 0x6354
movb $0x2c, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x31f0
movslq %r14d, %rax
movq -0x48(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
subq %rdx, %rcx
leal -0x1(%rax), %r14d
cmpq %rax, %rcx
jb 0x633c
movq -0x50(%rbp), %rcx
movzbl (%rcx,%rax), %ecx
cmpl $0x31, %ecx
je 0x638c
movb $0x3a, %al
cmpl $0x30, %ecx
je 0x638e
jmp 0x6399
movb $0x3b, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x31f0
leaq 0x1414(%rip), %rsi      # 0x77b4
movq %rbx, %rdi
callq 0x3420
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63c1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3250
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63e0
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x3250
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x63f5
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x3bc4(%rip), %rsi      # 0x9fc0
leaq -0x230(%rbp), %rdi
callq 0x3320
leaq -0x1b8(%rbp), %rdi
callq 0x30a0
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x6468
movq -0x80(%rbp), %rsi
jmp 0x6460
movq %rax, %r14
jmp 0x6468
jmp 0x6447
jmp 0x644c
movq %rax, %r14
jmp 0x6487
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6468
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3250
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6487
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x3250
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x649b
movq (%r12), %rsi
incq %rsi
callq 0x3250
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x64b0
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x3b09(%rip), %rsi      # 0x9fc0
leaq -0x230(%rbp), %rdi
callq 0x3320
leaq -0x1b8(%rbp), %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x33e0