// File: dlcgold[P]sparsematrix-unimib/main.cpp
// Function: test_point()
void test_point(){
  std::cout << "\ntest stampa matrice di point con iteratore\n";
  smatrixp testp(point(0,0));
 
  std::cout << "\n";
  testp.add(point(1,1), 2, 5);
  testp.add(point(1,2), 1, 2);
  testp.add(point(2,7), 0, 10000);
  testp.add(point(0,0), 1, 5);
  testp.add(point(2,4), 1, 2);
  testp.add(point(5,4), 200, 4000);
  testp.add(point(1,0), 1, 5);
  assert(testp.get_size()==5);
  assert(testp.get_size_row()==200);
  assert(testp.get_size_column()==10000);  
  smatrixp::iterator ip,iep;
   for(ip=testp.begin(), iep=testp.end(); ip != iep; ip++)
     std::cout << ip->v.a << ", " << ip->v.b << std::endl;
  std::cout << "\ntest stampa matrice di point assegnata\n";
  smatrixp testpp = testp;
  testp.clear();
  for(ip=testpp.begin(), iep=testpp.end(); ip!=iep; ip++)
    std::cout << ip->v.a << ", " << ip->v.b << std::endl;
  pointxMax max;
  int count = evaluate(testpp, max);
  assert(count == 2);
  std::cout << "valori accettabili: " << count << " = 2\n";
  testpp.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq 0x9196(%rip), %rdi      # 0xbfd8
movq %rdi, -0xf8(%rbp)
leaq 0x5483(%rip), %rsi      # 0x82d3
callq 0x20b0
leaq -0x30(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x4c70
movq -0x30(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x4c90
movq -0xf8(%rbp), %rdi
leaq 0x52c7(%rip), %rsi      # 0x8144
callq 0x20b0
jmp 0x2e84
leaq -0x44(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x4c70
jmp 0x2e96
leaq -0x28(%rbp), %rdi
leaq -0x44(%rbp), %rsi
movl $0x2, %edx
movl $0x5, %ecx
callq 0x4cd0
jmp 0x2eaf
leaq -0x4c(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x4c70
jmp 0x2ec4
leaq -0x28(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x4cd0
jmp 0x2edd
leaq -0x54(%rbp), %rdi
movl $0x2, %esi
movl $0x7, %edx
callq 0x4c70
jmp 0x2ef2
leaq -0x28(%rbp), %rdi
leaq -0x54(%rbp), %rsi
xorl %edx, %edx
movl $0x2710, %ecx           # imm = 0x2710
callq 0x4cd0
jmp 0x2f08
leaq -0x5c(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x4c70
jmp 0x2f17
leaq -0x28(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movl $0x1, %edx
movl $0x5, %ecx
callq 0x4cd0
jmp 0x2f30
leaq -0x64(%rbp), %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0x4c70
jmp 0x2f45
leaq -0x28(%rbp), %rdi
leaq -0x64(%rbp), %rsi
movl $0x1, %edx
movl $0x2, %ecx
callq 0x4cd0
jmp 0x2f5e
leaq -0x6c(%rbp), %rdi
movl $0x5, %esi
movl $0x4, %edx
callq 0x4c70
jmp 0x2f73
leaq -0x28(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
movl $0xc8, %edx
movl $0xfa0, %ecx            # imm = 0xFA0
callq 0x4cd0
jmp 0x2f8c
leaq -0x74(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4c70
jmp 0x2f9e
leaq -0x28(%rbp), %rdi
leaq -0x74(%rbp), %rsi
movl $0x1, %edx
movl $0x5, %ecx
callq 0x4cd0
jmp 0x2fb7
leaq -0x28(%rbp), %rdi
callq 0x51b0
movl %eax, -0xfc(%rbp)
jmp 0x2fc8
movl -0xfc(%rbp), %eax
cmpl $0x5, %eax
jne 0x2fd5
jmp 0x3005
leaq 0x5324(%rip), %rdi      # 0x8300
leaq 0x5068(%rip), %rsi      # 0x804b
movl $0x76, %edx
leaq 0x5325(%rip), %rcx      # 0x8314
callq 0x2070
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x34f3
leaq -0x28(%rbp), %rdi
callq 0x51d0
movl %eax, -0x100(%rbp)
jmp 0x3016
movl -0x100(%rbp), %eax
cmpl $0xc8, %eax
jne 0x3025
jmp 0x3044
leaq 0x52fa(%rip), %rdi      # 0x8326
leaq 0x5018(%rip), %rsi      # 0x804b
movl $0x77, %edx
leaq 0x52d5(%rip), %rcx      # 0x8314
callq 0x2070
leaq -0x28(%rbp), %rdi
callq 0x51f0
movl %eax, -0x104(%rbp)
jmp 0x3055
movl -0x104(%rbp), %eax
cmpl $0x2710, %eax           # imm = 0x2710
jne 0x3064
jmp 0x3083
leaq 0x52d5(%rip), %rdi      # 0x8340
leaq 0x4fd9(%rip), %rsi      # 0x804b
movl $0x78, %edx
leaq 0x5296(%rip), %rcx      # 0x8314
callq 0x2070
leaq -0x80(%rbp), %rdi
callq 0x5210
jmp 0x308e
leaq -0x88(%rbp), %rdi
callq 0x5210
jmp 0x309c
leaq -0x90(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5230
jmp 0x30ae
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x5260
jmp 0x30c0
leaq -0x98(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5280
jmp 0x30d2
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5260
jmp 0x30e7
leaq -0x98(%rbp), %rdi
callq 0x52b0
leaq -0x90(%rbp), %rdi
callq 0x52b0
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x52c0
movb %al, -0x105(%rbp)
jmp 0x3117
movb -0x105(%rbp), %al
testb $0x1, %al
jne 0x3126
jmp 0x3238
leaq -0x80(%rbp), %rdi
callq 0x52f0
movq %rax, -0x110(%rbp)
jmp 0x3138
movq -0x110(%rbp), %rax
movl (%rax), %esi
movq 0x8e90(%rip), %rdi      # 0xbfd8
callq 0x2110
movq %rax, -0x118(%rbp)
jmp 0x3156
movq -0x118(%rbp), %rdi
leaq 0x51fb(%rip), %rsi      # 0x835f
callq 0x20b0
movq %rax, -0x120(%rbp)
jmp 0x3172
leaq -0x80(%rbp), %rdi
callq 0x52f0
movq %rax, -0x128(%rbp)
jmp 0x3184
movq -0x120(%rbp), %rdi
movq -0x128(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x2110
movq %rax, -0x130(%rbp)
jmp 0x31a3
movq -0x130(%rbp), %rdi
movq 0x8e0f(%rip), %rsi      # 0xbfc0
callq 0x20d0
jmp 0x31b8
jmp 0x31ba
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x5310
jmp 0x31ce
leaq -0xa0(%rbp), %rdi
callq 0x52b0
jmp 0x30ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x34ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x34de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x3227
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x52b0
leaq -0x90(%rbp), %rdi
callq 0x52b0
jmp 0x34de
movq 0x8d99(%rip), %rdi      # 0xbfd8
leaq 0x511c(%rip), %rsi      # 0x8362
callq 0x20b0
jmp 0x324d
leaq -0xc8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x5370
jmp 0x325f
leaq -0x28(%rbp), %rdi
callq 0x5480
jmp 0x326a
leaq -0xd0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5230
jmp 0x327f
leaq -0x80(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x5260
jmp 0x3291
leaq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x5280
jmp 0x32a6
leaq -0x88(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x5260
jmp 0x32bb
leaq -0xd8(%rbp), %rdi
callq 0x52b0
leaq -0xd0(%rbp), %rdi
callq 0x52b0
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x52c0
movb %al, -0x131(%rbp)
jmp 0x32eb
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x32fa
jmp 0x33fb
leaq -0x80(%rbp), %rdi
callq 0x52f0
movq %rax, -0x140(%rbp)
jmp 0x330c
movq -0x140(%rbp), %rax
movl (%rax), %esi
movq 0x8cbc(%rip), %rdi      # 0xbfd8
callq 0x2110
movq %rax, -0x148(%rbp)
jmp 0x332a
movq -0x148(%rbp), %rdi
leaq 0x5027(%rip), %rsi      # 0x835f
callq 0x20b0
movq %rax, -0x150(%rbp)
jmp 0x3346
leaq -0x80(%rbp), %rdi
callq 0x52f0
movq %rax, -0x158(%rbp)
jmp 0x3358
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x2110
movq %rax, -0x160(%rbp)
jmp 0x3377
movq -0x160(%rbp), %rdi
movq 0x8c3b(%rip), %rsi      # 0xbfc0
callq 0x20d0
jmp 0x338c
jmp 0x338e
leaq -0xe0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
xorl %edx, %edx
callq 0x5310
jmp 0x33a2
leaq -0xe0(%rbp), %rdi
callq 0x52b0
jmp 0x32d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x34d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x33ea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x52b0
leaq -0xd0(%rbp), %rdi
callq 0x52b0
jmp 0x34d2
leaq -0xc8(%rbp), %rdi
callq 0x54b0
movl %eax, -0x164(%rbp)
jmp 0x340f
movl -0x164(%rbp), %eax
movl %eax, -0xe8(%rbp)
cmpl $0x2, -0xe8(%rbp)
jne 0x3426
jmp 0x3445
leaq 0x4ccc(%rip), %rdi      # 0x80f9
leaq 0x4c17(%rip), %rsi      # 0x804b
movl $0x83, %edx
leaq 0x4ed4(%rip), %rcx      # 0x8314
callq 0x2070
movq 0x8b8c(%rip), %rdi      # 0xbfd8
leaq 0x4e6b(%rip), %rsi      # 0x82be
callq 0x20b0
movq %rax, -0x170(%rbp)
jmp 0x3461
movq -0x170(%rbp), %rdi
movl -0xe8(%rbp), %esi
callq 0x2110
movq %rax, -0x178(%rbp)
jmp 0x347c
movq -0x178(%rbp), %rdi
leaq 0x4f01(%rip), %rsi      # 0x838b
callq 0x20b0
jmp 0x3491
leaq -0xc8(%rbp), %rdi
callq 0x5480
jmp 0x349f
leaq -0xc8(%rbp), %rdi
callq 0x56e0
leaq -0x88(%rbp), %rdi
callq 0x52b0
leaq -0x80(%rbp), %rdi
callq 0x52b0
leaq -0x28(%rbp), %rdi
callq 0x56e0
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0xc8(%rbp), %rdi
callq 0x56e0
leaq -0x88(%rbp), %rdi
callq 0x52b0
leaq -0x80(%rbp), %rdi
callq 0x52b0
leaq -0x28(%rbp), %rdi
callq 0x56e0
movq -0x38(%rbp), %rdi
callq 0x2120
nopw %cs:(%rax,%rax)