// File: /workspace/github_cpp_makefile_star2_O1/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
movl %r13d, -0x48(%rbp)
movb $0x1, -0x44(%rbp)
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movl %r13d, -0x30(%rbp)
testb %r13b, %r13b
jne 0x170f
movl $0x7, %ebx
xorl %r15d, %r15d
cmpl $0x0, -0x3c(%rbp)
jle 0x135e
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movss %xmm0, -0x4c(%rbp)
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r13d, %eax
addl %r12d, %eax
je 0x1351
testl %r12d, %r12d
je 0x1335
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 0x1eb0
jmp 0x1351
movss -0x4c(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x1eb0
incl %r12d
addl $-0x3, %r14d
cmpl -0x3c(%rbp), %r12d
jl 0x12f7
incl %r15d
movl -0x40(%rbp), %eax
decl %r13d
incl %ebx
cmpl %eax, %r15d
jl 0x12de
cmpl $0x3, %eax
jne 0x170f
cmpl $0x3, -0x3c(%rbp)
jne 0x172e
movq 0x5c44(%rip), %rdi      # 0x6fd0
leaq 0x2cf9(%rip), %rsi      # 0x408c
movl $0x3b, %edx
callq 0x10d0
leaq -0xf0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21ba
movl -0x40(%rbp), %esi
movl -0x3c(%rbp), %edx
leaq -0xf0(%rbp), %rdi
callq 0x20dc
leaq -0xf0(%rbp), %rdi
callq 0x2274
leaq -0x48(%rbp), %rdi
callq 0x229d
movl %eax, %ebx
movq 0x5bf3(%rip), %rdi      # 0x6fd0
leaq 0x2ce4(%rip), %rsi      # 0x40c8
movl $0x30, %edx
callq 0x10d0
cmpl $0x2, %ebx
jne 0x174d
movq 0x5bd2(%rip), %rdi      # 0x6fd0
movl $0x2, %esi
callq 0x1120
movq %rax, %rbx
leaq 0x2cf2(%rip), %rsi      # 0x4104
movl $0x3, %edx
movq %rax, %rdi
callq 0x10d0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1120
leaq 0x2d11(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x5b89(%rip), %rdi      # 0x6fd0
leaq 0x2cba(%rip), %rsi      # 0x4108
movl $0x3a, %edx
callq 0x10d0
movq -0x38(%rbp), %r15
testq %r15, %r15
je 0x14ad
movq 0x5b68(%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 0x1468
movq -0x38(%rbp), %rbx
movq 0x5b18(%rip), %rdi      # 0x6fd0
leaq 0x2c84(%rip), %rsi      # 0x4143
movl $0x2, %edx
callq 0x10d0
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq 0x5af5(%rip), %rdi      # 0x6fd0
callq 0x10f0
leaq 0x2c5d(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x5ad5(%rip), %rdi      # 0x6fd0
leaq 0x2c44(%rip), %rsi      # 0x4146
movl $0x30, %edx
callq 0x10d0
leaq -0x70(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x22f6
movq 0x5ab0(%rip), %rdi      # 0x6fd0
leaq 0x2c50(%rip), %rsi      # 0x4177
movl $0x3c, %edx
callq 0x10d0
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x249e
movl -0x68(%rbp), %esi
movl -0x64(%rbp), %edx
leaq -0xd0(%rbp), %rdi
callq 0x23c4
leaq -0xd0(%rbp), %rdi
callq 0x2554
leaq -0x70(%rbp), %rdi
callq 0x257d
movl %eax, %ebx
movq 0x5a5f(%rip), %rdi      # 0x6fd0
leaq 0x2c3c(%rip), %rsi      # 0x41b4
movl $0x31, %edx
callq 0x10d0
cmpl $0x2, %ebx
jne 0x176c
movq 0x5a3e(%rip), %rdi      # 0x6fd0
movl $0x2, %esi
callq 0x1120
movq %rax, %rbx
leaq 0x2b5e(%rip), %rsi      # 0x4104
movl $0x3, %edx
movq %rax, %rdi
callq 0x10d0
movq %rbx, %rdi
movl $0x2, %esi
callq 0x1120
leaq 0x2b7d(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
movq 0x59f5(%rip), %rdi      # 0x6fd0
leaq 0x2c04(%rip), %rsi      # 0x41e6
movl $0x3b, %edx
callq 0x10d0
movq -0x60(%rbp), %r15
testq %r15, %r15
je 0x163c
movq 0x59d4(%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 0x15fc
movq 0x598d(%rip), %rdi      # 0x6fd0
leaq 0x2bd8(%rip), %rsi      # 0x4222
movl $0x13, %edx
callq 0x10d0
leaq -0x90(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21ba
leaq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21ba
movl -0x88(%rbp), %esi
movl -0x84(%rbp), %edx
leaq -0xb0(%rbp), %rdi
callq 0x20dc
leaq -0xb0(%rbp), %rdi
callq 0x2274
movq 0x592e(%rip), %rdi      # 0x6fd0
leaq 0x2b8d(%rip), %rsi      # 0x4236
movl $0x21, %edx
callq 0x10d0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
cvtss2sd (%rax), %xmm0
movq 0x590a(%rip), %rdi      # 0x6fd0
callq 0x10f0
leaq 0x2a72(%rip), %rsi      # 0x4144
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
leaq -0x90(%rbp), %rdi
callq 0x2274
leaq -0x70(%rbp), %rdi
callq 0x2554
leaq -0x48(%rbp), %rdi
callq 0x2274
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2919(%rip), %rdi      # 0x402f
leaq 0x292e(%rip), %rsi      # 0x404b
leaq 0x2930(%rip), %rcx      # 0x4054
movl $0x34, %edx
callq 0x1070
leaq 0x2938(%rip), %rdi      # 0x406d
leaq 0x290f(%rip), %rsi      # 0x404b
leaq 0x2911(%rip), %rcx      # 0x4054
movl $0x35, %edx
callq 0x1070
leaq 0x29a5(%rip), %rdi      # 0x40f9
leaq 0x28f0(%rip), %rsi      # 0x404b
leaq 0x28f2(%rip), %rcx      # 0x4054
movl $0x3e, %edx
callq 0x1070
leaq 0x2986(%rip), %rdi      # 0x40f9
leaq 0x28d1(%rip), %rsi      # 0x404b
leaq 0x28d3(%rip), %rcx      # 0x4054
movl $0x4f, %edx
callq 0x1070
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2274
jmp 0x17c9
jmp 0x17df
jmp 0x17df
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2554
jmp 0x17e2
jmp 0x17f1
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x2274
jmp 0x17f4
jmp 0x17c6
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x2274
jmp 0x17e2
jmp 0x17f1
jmp 0x17f1
jmp 0x17f1
jmp 0x17df
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2554
jmp 0x17f4
jmp 0x17f1
jmp 0x17f1
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2274
movq %rbx, %rdi
callq 0x1130