// File: /workspace/github_cpp_makefile_star2_O3/ArthoPacini[P]blockchaincpp/main.cpp
// Function: main
int main()
{
    //Create blockchain with difficulty level 3 and 2 transactions per block max
    Blockchain blockchain(3, 2); 

    //add transactions
    //the block is mined when the transaction count reaches maximum value
    blockchain.push_transaction({1.0, "Joe", "Paul"});
    blockchain.push_transaction({3.14, "Paul", "Ruth"});
    blockchain.push_transaction({1.32, "Joe", "Ruth"});
    blockchain.push_transaction({5.52, "Steve", "Joe"});
    blockchain.push_transaction({6.7, "Ruth", "Steve"});
    blockchain.push_transaction({7.62, "Joe", "Steve"});

    //prints blockchain
    std::cout << blockchain.dump() << std::endl;

    //saves blockchain do disk
    blockchain.save();

    //validates the chain
    std::cout << "Is blockchain valid? " << blockchain.validate() << std::endl;

    //load blockchain from disk
    Blockchain alternative;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x470, %rsp            # imm = 0x470
movq %rsp, %rdi
movl $0x3, %esi
movl $0x2, %edx
callq 0x4c5e
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1483a(%rip), %rsi     # 0x1884c
leaq 0x14836(%rip), %rdx     # 0x1884f
leaq 0x1e0(%rsp), %rdi
callq 0xd9ec
leaq 0x1d0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14817(%rip), %rsi     # 0x18850
leaq 0x14814(%rip), %rdx     # 0x18854
leaq 0x1c0(%rsp), %rdi
callq 0xd9ec
leaq 0x408(%rsp), %rdi
movsd 0x14053(%rip), %xmm0    # 0x180b0
leaq 0x1e0(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x408(%rsp), %rsi
callq 0x4d50
leaq 0x460(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40a3
movq 0x460(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x440(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40c4
movq 0x440(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x420(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e5
movq 0x420(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x4102
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x411f
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x1b0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1471e(%rip), %rsi     # 0x18850
leaq 0x1471b(%rip), %rdx     # 0x18854
leaq 0x1a0(%rsp), %rdi
callq 0xd9ec
leaq 0x190(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x146fc(%rip), %rsi     # 0x18855
leaq 0x146f9(%rip), %rdx     # 0x18859
leaq 0x180(%rsp), %rdi
callq 0xd9ec
leaq 0x3a0(%rsp), %rdi
movsd 0x13f3b(%rip), %xmm0    # 0x180b8
leaq 0x1a0(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x4d50
leaq 0x3f8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41c3
movq 0x3f8(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x3d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x41e4
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x3b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4205
movq 0x3b8(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x4222
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x423f
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x170(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x145fa(%rip), %rsi     # 0x1884c
leaq 0x145f6(%rip), %rdx     # 0x1884f
leaq 0x160(%rsp), %rdi
callq 0xd9ec
leaq 0x150(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x145dc(%rip), %rsi     # 0x18855
leaq 0x145d9(%rip), %rdx     # 0x18859
leaq 0x140(%rsp), %rdi
callq 0xd9ec
leaq 0x338(%rsp), %rdi
movsd 0x13e23(%rip), %xmm0    # 0x180c0
leaq 0x160(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x338(%rsp), %rsi
callq 0x4d50
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42e3
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x370(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4304
movq 0x370(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4325
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x4342
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x435f
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x130(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x144e8(%rip), %rsi     # 0x1885a
leaq 0x144e6(%rip), %rdx     # 0x1885f
leaq 0x120(%rsp), %rdi
callq 0xd9ec
leaq 0x110(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x144b3(%rip), %rsi     # 0x1884c
leaq 0x144af(%rip), %rdx     # 0x1884f
leaq 0x100(%rsp), %rdi
callq 0xd9ec
leaq 0x2d0(%rsp), %rdi
movsd 0x13d0b(%rip), %xmm0    # 0x180c8
leaq 0x120(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x4d50
leaq 0x328(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4403
movq 0x328(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4424
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x2e8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4445
movq 0x2e8(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x4462
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x447f
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xf0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x143c3(%rip), %rsi     # 0x18855
leaq 0x143c0(%rip), %rdx     # 0x18859
leaq 0xe0(%rsp), %rdi
callq 0xd9ec
leaq 0xd0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x143a1(%rip), %rsi     # 0x1885a
leaq 0x1439f(%rip), %rdx     # 0x1885f
leaq 0xc0(%rsp), %rdi
callq 0xd9ec
leaq 0x268(%rsp), %rdi
movsd 0x13bf3(%rip), %xmm0    # 0x180d0
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x268(%rsp), %rsi
callq 0x4d50
leaq 0x2c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4523
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4544
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4565
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x4582
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x459f
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1429a(%rip), %rsi     # 0x1884c
leaq 0x14296(%rip), %rdx     # 0x1884f
leaq 0xa0(%rsp), %rdi
callq 0xd9ec
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14281(%rip), %rsi     # 0x1885a
leaq 0x1427f(%rip), %rdx     # 0x1885f
leaq 0x80(%rsp), %rdi
callq 0xd9ec
leaq 0x200(%rsp), %rdi
movsd 0x13adb(%rip), %xmm0    # 0x180d8
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x515e
movq %rsp, %rdi
leaq 0x200(%rsp), %rsi
callq 0x4d50
leaq 0x258(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4643
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4664
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x218(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4685
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x46a2
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x46bf
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x529a
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x1f8ee(%rip), %rdi     # 0x23fd0
callq 0x33a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3240
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x472c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x14124(%rip), %rsi     # 0x18860
leaq 0x1412c(%rip), %rdx     # 0x1886f
leaq 0x60(%rsp), %rdi
callq 0xd9ec
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
movl $0x4, %edx
callq 0x56b4
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x4776
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3340
movq 0x1f853(%rip), %rdi     # 0x23fd0
leaq 0x140ec(%rip), %rsi     # 0x18870
movl $0x15, %edx
callq 0x33a0
movq %rsp, %rdi
callq 0x5906
movzbl %al, %esi
movq 0x1f830(%rip), %rdi     # 0x23fd0
callq 0x34d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3240
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x14081(%rip), %rsi     # 0x18860
leaq 0x14089(%rip), %rdx     # 0x1886f
leaq 0x40(%rsp), %rdi
callq 0xd9ec
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x5c38
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x4816
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3340
leaq 0x28(%rsp), %rdi
callq 0x5f86
leaq 0x8(%rsp), %rdi
callq 0x5f86
xorl %eax, %eax
addq $0x470, %rsp            # imm = 0x470
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x50(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x70(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
jmp 0x4aa6
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x524a
jmp 0x4893
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x48b5
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x48b5
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0xb0(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x524a
jmp 0x48ed
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x490f
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x490f
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0xf0(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x524a
jmp 0x4947
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x4969
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x4969
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x130(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x338(%rsp), %rdi
callq 0x524a
jmp 0x49a1
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x49c3
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x49c3
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x170(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x524a
jmp 0x49fb
movq %rax, %rbx
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a1d
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x4a1d
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x1b0(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x408(%rsp), %rdi
callq 0x524a
jmp 0x4a4b
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a6d
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x4a6d
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4aa9
movq 0x1f0(%rsp), %rsi
jmp 0x4a9c
jmp 0x4aa6
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4aa9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3340
jmp 0x4aa9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5f86
movq %rbx, %rdi
callq 0x3510