// File: dlcgold[P]sparsematrix-unimib/./sparsematrix.h
// Function: sparse_matrix<int>::sparse_matrix<float>(sparse_matrix<float> const&)
sparse_matrix(const sparse_matrix<Q> &other):
    default_value(static_cast<T>(other.get_default_value())),
    dim(other.get_dim()), size_row(other.get_size_row()),
    size_column(other.get_size_column()), head(nullptr), size(0) {
    
    // mi muovo con gli iteratori nella matrice sparsa passata in ingresso
    // effettuo la add alla nuova matrice sparsa con cast del valore
    typename sparse_matrix<Q>::const_iterator i, ie;
    i = other.begin();
    ie = other.end();
    try {
      while(i != ie) {
	add(static_cast<T>(i->v), i->x, i->y);
	++i;
      }		
    }
    catch(...) {
      clear();
      throw NoCastSparseMatrixException();
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x65e0
movq -0x58(%rbp), %rax
cvttss2si %xmm0, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x6680
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x10(%rbp), %rdi
callq 0x37b0
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x37d0
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xc(%rax)
movq $0x0, 0x10(%rax)
movl $0x0, 0x18(%rax)
leaq -0x18(%rbp), %rdi
callq 0x6460
leaq -0x20(%rbp), %rdi
callq 0x6460
jmp 0x4337
movq -0x10(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x64a0
jmp 0x4346
leaq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %rsi, -0x60(%rbp)
callq 0x64d0
movq -0x60(%rbp), %rdi
callq 0x64f0
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x6500
jmp 0x436f
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x64d0
leaq -0x40(%rbp), %rdi
callq 0x64f0
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x6530
testb $0x1, %al
jne 0x439b
jmp 0x446e
leaq -0x18(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x6580
movq -0x70(%rbp), %rdi
cvttss2si (%rax), %eax
movl %eax, -0x44(%rbp)
callq 0x6580
movq -0x70(%rbp), %rdi
movl 0x4(%rax), %eax
movl %eax, -0x64(%rbp)
callq 0x6580
movq -0x58(%rbp), %rdi
movl -0x64(%rbp), %edx
movl 0x8(%rax), %ecx
leaq -0x44(%rbp), %rsi
callq 0x5750
jmp 0x43dc
leaq -0x50(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x65a0
jmp 0x43eb
leaq -0x50(%rbp), %rdi
callq 0x64f0
jmp 0x4385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x44a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x44a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2040
movq -0x58(%rbp), %rdi
callq 0x5cf0
jmp 0x4438
movl $0x8, %edi
callq 0x2050
movq %rax, %rdi
movq %rdi, -0x78(%rbp)
movq $0x0, (%rdi)
callq 0x66a0
movq -0x78(%rbp), %rdi
leaq 0x7908(%rip), %rsi      # 0xbd68
leaq 0x2279(%rip), %rdx      # 0x66e0
callq 0x2100
jmp 0x44c3
jmp 0x4485
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x20f0
jmp 0x4483
jmp 0x44a0
leaq -0x20(%rbp), %rdi
callq 0x64f0
leaq -0x18(%rbp), %rdi
callq 0x64f0
addq $0x80, %rsp
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x64f0
leaq -0x18(%rbp), %rdi
callq 0x64f0
movq -0x28(%rbp), %rdi
callq 0x2120
movq %rax, %rdi
callq 0x5e20
nopw %cs:(%rax,%rax)
nopl (%rax)