// File: /workspace/github_cpp_makefile_star2_O1/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 0x5bb4
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x148e5(%rip), %rsi     # 0x1984c
leaq 0x148e1(%rip), %rdx     # 0x1984f
leaq 0x1e0(%rsp), %rdi
callq 0xeb7a
leaq 0x1d0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x148c2(%rip), %rsi     # 0x19850
leaq 0x148bf(%rip), %rdx     # 0x19854
leaq 0x1c0(%rsp), %rdi
callq 0xeb7a
leaq 0x408(%rsp), %rdi
movsd 0x140fe(%rip), %xmm0    # 0x190b0
leaq 0x1e0(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x408(%rsp), %rsi
callq 0x5ca6
leaq 0x460(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4ff8
movq 0x460(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x440(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5019
movq 0x440(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x420(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x503a
movq 0x420(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x5057
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x5074
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x1b0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x147c9(%rip), %rsi     # 0x19850
leaq 0x147c6(%rip), %rdx     # 0x19854
leaq 0x1a0(%rsp), %rdi
callq 0xeb7a
leaq 0x190(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x147a7(%rip), %rsi     # 0x19855
leaq 0x147a4(%rip), %rdx     # 0x19859
leaq 0x180(%rsp), %rdi
callq 0xeb7a
leaq 0x3a0(%rsp), %rdi
movsd 0x13fe6(%rip), %xmm0    # 0x190b8
leaq 0x1a0(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x5ca6
leaq 0x3f8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5118
movq 0x3f8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x3d8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5139
movq 0x3d8(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x3b8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x515a
movq 0x3b8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x5177
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x5194
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x170(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x146a5(%rip), %rsi     # 0x1984c
leaq 0x146a1(%rip), %rdx     # 0x1984f
leaq 0x160(%rsp), %rdi
callq 0xeb7a
leaq 0x150(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14687(%rip), %rsi     # 0x19855
leaq 0x14684(%rip), %rdx     # 0x19859
leaq 0x140(%rsp), %rdi
callq 0xeb7a
leaq 0x338(%rsp), %rdi
movsd 0x13ece(%rip), %xmm0    # 0x190c0
leaq 0x160(%rsp), %rsi
leaq 0x140(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x338(%rsp), %rsi
callq 0x5ca6
leaq 0x390(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5238
movq 0x390(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x370(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5259
movq 0x370(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x350(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x527a
movq 0x350(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x5297
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x52b4
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x130(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x14593(%rip), %rsi     # 0x1985a
leaq 0x14591(%rip), %rdx     # 0x1985f
leaq 0x120(%rsp), %rdi
callq 0xeb7a
leaq 0x110(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1455e(%rip), %rsi     # 0x1984c
leaq 0x1455a(%rip), %rdx     # 0x1984f
leaq 0x100(%rsp), %rdi
callq 0xeb7a
leaq 0x2d0(%rsp), %rdi
movsd 0x13db6(%rip), %xmm0    # 0x190c8
leaq 0x120(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x5ca6
leaq 0x328(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5358
movq 0x328(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x308(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5379
movq 0x308(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x2e8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x539a
movq 0x2e8(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x53b7
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x53d4
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xf0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1446e(%rip), %rsi     # 0x19855
leaq 0x1446b(%rip), %rdx     # 0x19859
leaq 0xe0(%rsp), %rdi
callq 0xeb7a
leaq 0xd0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1444c(%rip), %rsi     # 0x1985a
leaq 0x1444a(%rip), %rdx     # 0x1985f
leaq 0xc0(%rsp), %rdi
callq 0xeb7a
leaq 0x268(%rsp), %rdi
movsd 0x13c9e(%rip), %xmm0    # 0x190d0
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x268(%rsp), %rsi
callq 0x5ca6
leaq 0x2c0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5478
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5499
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x54ba
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x54d7
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x54f4
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x14345(%rip), %rsi     # 0x1984c
leaq 0x14341(%rip), %rdx     # 0x1984f
leaq 0xa0(%rsp), %rdi
callq 0xeb7a
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1432c(%rip), %rsi     # 0x1985a
leaq 0x1432a(%rip), %rdx     # 0x1985f
leaq 0x80(%rsp), %rdi
callq 0xeb7a
leaq 0x200(%rsp), %rdi
movsd 0x13b86(%rip), %xmm0    # 0x190d8
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x60b4
movq %rsp, %rdi
leaq 0x200(%rsp), %rsi
callq 0x5ca6
leaq 0x258(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5598
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x55b9
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x218(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x55da
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x55f7
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x5614
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
movl $0x4, %edx
callq 0x61f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x1f999(%rip), %rdi     # 0x24fd0
callq 0x43a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5681
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x141cf(%rip), %rsi     # 0x19860
leaq 0x141d7(%rip), %rdx     # 0x1986f
leaq 0x60(%rsp), %rdi
callq 0xeb7a
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
movl $0x4, %edx
callq 0x6654
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x56cb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4340
movq 0x1f8fe(%rip), %rdi     # 0x24fd0
leaq 0x14197(%rip), %rsi     # 0x19870
movl $0x15, %edx
callq 0x43a0
movq %rsp, %rdi
callq 0x68a6
movzbl %al, %esi
movq 0x1f8db(%rip), %rdi     # 0x24fd0
callq 0x44d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4320
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4240
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1412c(%rip), %rsi     # 0x19860
leaq 0x14134(%rip), %rdx     # 0x1986f
leaq 0x40(%rsp), %rdi
callq 0xeb7a
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x6c08
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x576b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4340
leaq 0x28(%rsp), %rdi
callq 0x6f56
leaq 0x8(%rsp), %rdi
callq 0x6f56
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 0x59fe
movq 0x50(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0x70(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
jmp 0x59fb
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x61a0
jmp 0x57e8
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x580a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x580a
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0xb0(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x61a0
jmp 0x5842
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r15, %rdi
je 0x5864
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x5864
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0xf0(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0x61a0
jmp 0x589c
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r15, %rdi
je 0x58be
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x58be
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0x130(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x338(%rsp), %rdi
callq 0x61a0
jmp 0x58f6
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x5918
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x5918
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0x170(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x3a0(%rsp), %rdi
callq 0x61a0
jmp 0x5950
movq %rax, %rbx
movq 0x180(%rsp), %rdi
cmpq %r15, %rdi
je 0x5972
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x5972
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0x1b0(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x408(%rsp), %rdi
callq 0x61a0
jmp 0x59a0
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r15, %rdi
je 0x59c2
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x59c2
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x59fe
movq 0x1f0(%rsp), %rsi
jmp 0x59f1
jmp 0x59fb
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59fe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4340
jmp 0x59fe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6f56
movq %rbx, %rdi
callq 0x4510