// File: /workspace/github_cpp_makefile_star2_O3/dlcgold[P]sparsematrix-unimib/main.cpp
// Function: test_fondamentali()
void test_fondamentali(){
  std::cout << "test matrice float 3x3 (valore default 0)\n";
  smatrixf floatNM(0, 3, 3);
  for(int i = 0; i < floatNM.get_size_row(); i++){
    for(int j = 0; j < floatNM.get_size_column(); j++){
      if(i != j){
        if(j != 0 ){
	  floatNM.add((float)(i + j + 7) / (-1 * j * 3), i, j);
	}else{
	  floatNM.add(i + (j * (-1)), i, j);
	}
      }
    }
  }
  assert(floatNM.get_size_row() == 3);
  assert(floatNM.get_size_column() == 3);
  assert(floatNM.get_size_row() == 3);
  assert(floatNM.get_size_column() == 3);
  std::cout << "\ntest stampa matrice float con accesso mediante operator()\n";
  printdef(floatNM, floatNM.get_size_row(), floatNM.get_size_column());
  
  positive pos;
  int count = evaluate(floatNM, pos);
  std::cout << "\ntest evaluate (numero positivi) matrice float \n";
  assert(count == 2);
  std::cout << count << " = " << 2 << "\n";
  std::cout << "\ntest stampa matrice float con accesso mediante iteratore\n";
  smatrixf::iterator i, ie;
  for(i = floatNM.begin(), ie = floatNM.end(); i != ie; i++){
    std::cout << i->v << std::endl;
  }
  i = floatNM.begin();
  
  std::cout << "\n\n" << (*i).v << "\n";
  std::cout << "\ntest cast da matrice float a matrice di interi\n";
  smatrixi interaNM(floatNM);
  std::cout << "\ntest stampa matrice intera con accesso mediante operator()\n";
  printdef(interaNM, interaNM.get_size_row(), interaNM.get_size_column());
  
  count = evaluate(interaNM, pos);
  std::cout << "\ntest evaluate (numero positivi) matrice intera \n";
  assert(count == 2);
  std::cout << count << " = " << 2 << "\n";
  std::cout << "\ntest stampa matrice intera con accesso mediante iteratore\n";
  smatrixi::iterator iu, ieu;
  for(iu = interaNM.begin(), ieu = interaNM.end(); iu != ieu; iu++){
    std::cout << iu->v << std::endl;
  }
  std::cout << "\ntest assegnamento\n";
  smatrixf floatNM2 = floatNM;
  printdef(floatNM2, floatNM2.get_size_row(), floatNM2.get_size_column());
  std::cout << "\ntest assegnamento con iteratore\n";

  smatrixf::iterator testBegin;
  testBegin = floatNM.begin();
  std::cout << testBegin->v << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq 0x5d39(%rip), %rdi      # 0x6fd0
leaq 0x2d66(%rip), %rsi      # 0x4004
movl $0x2a, %edx
callq 0x10d0
xorl %r13d, %r13d
leaq -0x48(%rbp), %rcx
movl %r13d, (%rcx)
movb $0x1, 0x4(%rcx)
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x8(%rcx)
movq $0x0, 0x10(%rcx)
movl %r13d, 0x18(%rcx)
movl $0x3, %ecx
movl $0x7, %ebx
movl $0x3, %eax
xorl %r15d, %r15d
testl %eax, %eax
jle 0x1365
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss %xmm0, -0x4c(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r13d, %eax
addl %r12d, %eax
je 0x1353
testl %r12d, %r12d
je 0x1337
leal (%rbx,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2ss %r14d, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x1eb8
jmp 0x1353
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x1eb8
incl %r12d
movl -0x3c(%rbp), %eax
addl $-0x3, %r14d
cmpl %eax, %r12d
jl 0x12f9
movl -0x40(%rbp), %ecx
incl %r15d
decl %r13d
incl %ebx
cmpl %ecx, %r15d
jl 0x12e2
cmpl $0x3, %ecx
jne 0x1716
cmpl $0x3, %eax
jne 0x1735
movq 0x5c41(%rip), %rdi      # 0x6fd0
leaq 0x2cf6(%rip), %rsi      # 0x408c
movl $0x3b, %edx
callq 0x10d0
leaq -0xf0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21ae
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
leaq -0xf0(%rbp), %rdi
callq 0x20cf
leaq -0xf0(%rbp), %rdi
callq 0x2268
leaq -0x48(%rbp), %rdi
callq 0x2291
movl %eax, %ebx
movq 0x5bf0(%rip), %rdi      # 0x6fd0
leaq 0x2ce1(%rip), %rsi      # 0x40c8
movl $0x30, %edx
callq 0x10d0
cmpl $0x2, %ebx
jne 0x1754
movq 0x5bcf(%rip), %rdi      # 0x6fd0
movl $0x2, %esi
callq 0x1120
movq %rax, %rbx
leaq 0x2cef(%rip), %rsi      # 0x4104
movl $0x3, %edx
movq %rax, %rdi
callq 0x10d0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1120
leaq 0x2d0e(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x5b86(%rip), %rdi      # 0x6fd0
leaq 0x2cb7(%rip), %rsi      # 0x4108
movl $0x3a, %edx
callq 0x10d0
movq -0x38(%rbp), %r15
testq %r15, %r15
je 0x14b6
movq 0x5b65(%rip), %rbx      # 0x6fd0
movq 0x8(%r15), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %rbx, %rdi
callq 0x10f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq (%r15), %r15
testq %r15, %r15
jne 0x146b
movq -0x38(%rbp), %rbx
jmp 0x14b8
xorl %ebx, %ebx
movq 0x5b11(%rip), %rdi      # 0x6fd0
leaq 0x2c7d(%rip), %rsi      # 0x4143
movl $0x2, %edx
callq 0x10d0
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq 0x5aee(%rip), %rdi      # 0x6fd0
callq 0x10f0
leaq 0x2c56(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x5ace(%rip), %rdi      # 0x6fd0
leaq 0x2c3d(%rip), %rsi      # 0x4146
movl $0x30, %edx
callq 0x10d0
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x22ea
movq 0x5aa9(%rip), %rdi      # 0x6fd0
leaq 0x2c49(%rip), %rsi      # 0x4177
movl $0x3c, %edx
callq 0x10d0
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2492
movl -0x68(%rbp), %esi
movl -0x64(%rbp), %edx
leaq -0xd0(%rbp), %rdi
callq 0x23b8
leaq -0xd0(%rbp), %rdi
callq 0x2548
leaq -0x70(%rbp), %rdi
callq 0x2571
movl %eax, %ebx
movq 0x5a58(%rip), %rdi      # 0x6fd0
leaq 0x2c35(%rip), %rsi      # 0x41b4
movl $0x31, %edx
callq 0x10d0
cmpl $0x2, %ebx
jne 0x1773
movq 0x5a37(%rip), %rdi      # 0x6fd0
movl $0x2, %esi
callq 0x1120
movq %rax, %rbx
leaq 0x2b57(%rip), %rsi      # 0x4104
movl $0x3, %edx
movq %rax, %rdi
callq 0x10d0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1120
leaq 0x2b76(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x59ee(%rip), %rdi      # 0x6fd0
leaq 0x2bfd(%rip), %rsi      # 0x41e6
movl $0x3b, %edx
callq 0x10d0
movq -0x60(%rbp), %r15
testq %r15, %r15
je 0x1643
movq 0x59cd(%rip), %rbx      # 0x6fd0
movq 0x8(%r15), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x1120
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq (%r15), %r15
testq %r15, %r15
jne 0x1603
movq 0x5986(%rip), %rdi      # 0x6fd0
leaq 0x2bd1(%rip), %rsi      # 0x4222
movl $0x13, %edx
callq 0x10d0
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21ae
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21ae
movl -0x88(%rbp), %esi
movl -0x84(%rbp), %edx
leaq -0xb0(%rbp), %rdi
callq 0x20cf
leaq -0xb0(%rbp), %rdi
callq 0x2268
movq 0x5927(%rip), %rdi      # 0x6fd0
leaq 0x2b86(%rip), %rsi      # 0x4236
movl $0x21, %edx
callq 0x10d0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
cvtss2sd (%rax), %xmm0
movq 0x5903(%rip), %rdi      # 0x6fd0
callq 0x10f0
leaq 0x2a6b(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
leaq -0x90(%rbp), %rdi
callq 0x2268
leaq -0x70(%rbp), %rdi
callq 0x2548
leaq -0x48(%rbp), %rdi
callq 0x2268
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2912(%rip), %rdi      # 0x402f
leaq 0x2927(%rip), %rsi      # 0x404b
leaq 0x2929(%rip), %rcx      # 0x4054
movl $0x34, %edx
callq 0x1070
leaq 0x2931(%rip), %rdi      # 0x406d
leaq 0x2908(%rip), %rsi      # 0x404b
leaq 0x290a(%rip), %rcx      # 0x4054
movl $0x35, %edx
callq 0x1070
leaq 0x299e(%rip), %rdi      # 0x40f9
leaq 0x28e9(%rip), %rsi      # 0x404b
leaq 0x28eb(%rip), %rcx      # 0x4054
movl $0x3e, %edx
callq 0x1070
leaq 0x297f(%rip), %rdi      # 0x40f9
leaq 0x28ca(%rip), %rsi      # 0x404b
leaq 0x28cc(%rip), %rcx      # 0x4054
movl $0x4f, %edx
callq 0x1070
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2268
jmp 0x17d0
jmp 0x17e6
jmp 0x17e6
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2548
jmp 0x17e9
jmp 0x17f8
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x2268
jmp 0x17fb
jmp 0x17cd
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x2268
jmp 0x17e9
jmp 0x17f8
jmp 0x17f8
jmp 0x17f8
jmp 0x17e6
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2548
jmp 0x17fb
jmp 0x17f8
jmp 0x17f8
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2268
movq %rbx, %rdi
callq 0x1130