// File: /workspace/github_cpp_makefile_star2_O3/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 0x33a0
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 0x50b0
leaq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x6814
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x6279
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x3250
leaq 0x1518(%rip), %rsi      # 0x7798
movq %rbx, %rdi
callq 0x3410
movq -0x48(%rbp), %rcx
leal -0x1(%rcx), %eax
cltq
movslq -0x2c(%rbp), %rdx
movq %rcx, %rsi
subq %rdx, %rsi
cmpq %rax, %rsi
jae 0x62de
leal -0x2(%rcx), %r14d
movq -0x50(%rbp), %rcx
movzbl (%rcx,%rax), %eax
cmpl $0x31, %eax
je 0x62ba
cmpl $0x30, %eax
jne 0x62c7
movb $0x2e, %al
jmp 0x62bc
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 0x62a4
movq -0x50(%rbp), %rcx
movzbl (%rcx,%rax), %ecx
cmpl $0x31, %ecx
je 0x62f4
movb $0x3a, %al
cmpl $0x30, %ecx
je 0x62f6
jmp 0x6301
movb $0x3b, %al
movzbl %al, %esi
movq %rbx, %rdi
callq 0x31f0
leaq 0x14a0(%rip), %rsi      # 0x77a8
movq %rbx, %rdi
callq 0x3410
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6329
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3250
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6348
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x3250
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x635d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x3c5c(%rip), %rsi      # 0x9fc0
leaq -0x230(%rbp), %rdi
callq 0x3310
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 0x63d0
movq -0x80(%rbp), %rsi
jmp 0x63c8
movq %rax, %r14
jmp 0x63d0
jmp 0x63af
jmp 0x63b4
movq %rax, %r14
jmp 0x63ef
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63d0
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x3250
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x63ef
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x3250
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x6403
movq (%r12), %rsi
incq %rsi
callq 0x3250
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x6418
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3250
movq 0x3ba1(%rip), %rsi      # 0x9fc0
leaq -0x230(%rbp), %rdi
callq 0x3310
leaq -0x1b8(%rbp), %rdi
callq 0x30a0
movq %r14, %rdi
callq 0x33d0