// File: /workspace/github_cpp_makefile_star2_O2/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 0x4d59(%rip), %rdi      # 0x5fd0
leaq 0x1d86(%rip), %rsi      # 0x3004
callq 0x10b0
leaq -0x38(%rbp), %rcx
andl $0x0, -0x10(%rcx)
movb $0x1, -0xc(%rcx)
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, -0x8(%rcx)
andq $0x0, (%rcx)
andl $0x0, 0x8(%rcx)
xorl %ebx, %ebx
pushq $0x3
popq %rax
pushq $0x7
popq %r13
leaq -0x70(%rbp), %r15
movl %eax, %ecx
cmpl %ecx, %ebx
jge 0x132f
cvtsi2ss %ebx, %xmm0
movss %xmm0, -0x4c(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpl %eax, %r12d
jge 0x1325
cmpl %r12d, %ebx
je 0x1319
testl %r12d, %r12d
je 0x12ff
leal (%r12,%r13), %eax
cvtsi2ss %eax, %xmm0
cvtsi2ss %r14d, %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movl %ebx, %edx
movl %r12d, %ecx
callq 0x1c7c
jmp 0x1319
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
movq %r15, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x1c7c
incl %r12d
movl -0x3c(%rbp), %eax
addl $-0x3, %r14d
jmp 0x12c7
incl %ebx
movl -0x40(%rbp), %ecx
incl %r13d
jmp 0x12b4
cmpl $0x3, %ecx
jne 0x1619
cmpl $0x3, %eax
leaq -0x38(%rbp), %r14
jne 0x1632
movq 0x4c84(%rip), %rdi      # 0x5fd0
leaq 0x1d39(%rip), %rsi      # 0x308c
callq 0x10b0
leaq -0xf0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1f18
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
leaq -0xf0(%rbp), %rdi
callq 0x1e63
leaq -0xf0(%rbp), %rdi
callq 0x1fbe
leaq -0x48(%rbp), %rdi
callq 0x1fd1
movl %eax, %ebx
movq 0x4c38(%rip), %rdi      # 0x5fd0
leaq 0x1d29(%rip), %rsi      # 0x30c8
callq 0x10b0
cmpl $0x2, %ebx
jne 0x164b
movq 0x4c1c(%rip), %rdi      # 0x5fd0
pushq $0x2
popq %rsi
callq 0x1100
leaq 0x1d41(%rip), %rsi      # 0x3104
movq %rax, %rdi
callq 0x10b0
pushq $0x2
popq %rsi
movq %rax, %rdi
callq 0x1100
leaq 0x1d67(%rip), %rsi      # 0x3144
movq %rax, %rdi
callq 0x10b0
movq 0x4be4(%rip), %rdi      # 0x5fd0
leaq 0x1d15(%rip), %rsi      # 0x3108
callq 0x10b0
movq 0x4bd1(%rip), %rbx      # 0x5fd0
movq (%r14), %r14
testq %r14, %r14
je 0x1421
movq 0x8(%r14), %rax
movss (%rax), %xmm0
movq %rbx, %rdi
callq 0x1080
movq %rax, %rdi
callq 0x1050
jmp 0x13ff
movq -0x38(%rbp), %rbx
movq 0x4ba4(%rip), %rdi      # 0x5fd0
leaq 0x1d10(%rip), %rsi      # 0x3143
callq 0x10b0
movq 0x8(%rbx), %rcx
movss (%rcx), %xmm0
movq %rax, %rdi
callq 0x1080
leaq 0x1cf5(%rip), %rsi      # 0x3144
movq %rax, %rdi
callq 0x10b0
movq 0x4b72(%rip), %rdi      # 0x5fd0
leaq 0x1ce1(%rip), %rsi      # 0x3146
callq 0x10b0
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x201c
movq 0x4b52(%rip), %rdi      # 0x5fd0
leaq 0x1cf2(%rip), %rsi      # 0x3177
callq 0x10b0
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2188
movl -0x68(%rbp), %esi
movl -0x64(%rbp), %edx
leaq -0xd0(%rbp), %rdi
callq 0x20d6
leaq -0xd0(%rbp), %rdi
callq 0x222a
leaq -0x70(%rbp), %rdi
callq 0x223d
movl %eax, %ebx
movq 0x4b06(%rip), %rdi      # 0x5fd0
leaq 0x1ce3(%rip), %rsi      # 0x31b4
callq 0x10b0
cmpl $0x2, %ebx
jne 0x1664
movq 0x4aea(%rip), %rdi      # 0x5fd0
pushq $0x2
popq %rsi
callq 0x1100
leaq 0x1c0f(%rip), %rsi      # 0x3104
movq %rax, %rdi
callq 0x10b0
pushq $0x2
popq %rsi
movq %rax, %rdi
callq 0x1100
leaq 0x1c35(%rip), %rsi      # 0x3144
movq %rax, %rdi
callq 0x10b0
movq 0x4ab2(%rip), %rdi      # 0x5fd0
leaq 0x1cc1(%rip), %rsi      # 0x31e6
callq 0x10b0
leaq -0x60(%rbp), %r14
movq 0x4a9b(%rip), %rbx      # 0x5fd0
movq (%r14), %r14
testq %r14, %r14
je 0x1555
movq 0x8(%r14), %rax
movl (%rax), %esi
movq %rbx, %rdi
callq 0x1100
movq %rax, %rdi
callq 0x1050
jmp 0x1535
movq 0x4a74(%rip), %rdi      # 0x5fd0
leaq 0x1cbf(%rip), %rsi      # 0x3222
callq 0x10b0
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1f18
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1f18
movl -0x88(%rbp), %esi
movl -0x84(%rbp), %edx
leaq -0xb0(%rbp), %rdi
callq 0x1e63
leaq -0xb0(%rbp), %rdi
callq 0x1fbe
movq 0x4a1a(%rip), %rdi      # 0x5fd0
leaq 0x1c79(%rip), %rsi      # 0x3236
callq 0x10b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movss (%rax), %xmm0
movq 0x49fb(%rip), %rdi      # 0x5fd0
callq 0x1080
leaq 0x1b63(%rip), %rsi      # 0x3144
movq %rax, %rdi
callq 0x10b0
leaq -0x90(%rbp), %rdi
callq 0x1fbe
leaq -0x70(%rbp), %rdi
callq 0x222a
leaq -0x48(%rbp), %rdi
callq 0x1fbe
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a0f(%rip), %rdi      # 0x302f
leaq 0x1a24(%rip), %rsi      # 0x304b
leaq 0x1a26(%rip), %rcx      # 0x3054
pushq $0x34
jmp 0x167b
leaq 0x1a34(%rip), %rdi      # 0x306d
leaq 0x1a0b(%rip), %rsi      # 0x304b
leaq 0x1a0d(%rip), %rcx      # 0x3054
pushq $0x35
jmp 0x167b
leaq 0x1aa7(%rip), %rdi      # 0x30f9
leaq 0x19f2(%rip), %rsi      # 0x304b
leaq 0x19f4(%rip), %rcx      # 0x3054
pushq $0x3e
jmp 0x167b
leaq 0x1a8e(%rip), %rdi      # 0x30f9
leaq 0x19d9(%rip), %rsi      # 0x304b
leaq 0x19db(%rip), %rcx      # 0x3054
pushq $0x4f
popq %rdx
callq 0x1070
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x1fbe
jmp 0x16bf
jmp 0x16d5
jmp 0x16d5
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x222a
jmp 0x16d8
jmp 0x16e7
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x1fbe
jmp 0x16ea
jmp 0x16bc
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x1fbe
jmp 0x16d8
jmp 0x16e7
jmp 0x16e7
jmp 0x16e7
jmp 0x16d5
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x222a
jmp 0x16ea
jmp 0x16e7
jmp 0x16e7
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x1fbe
movq %rbx, %rdi
callq 0x1110