// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x480, %rsp            # imm = 0x480
leaq 0x30(%rsp), %rdi
pushq $0x3
popq %rsi
pushq $0x2
popq %rdx
callq 0x5456
leaq 0x10b45(%rip), %rsi     # 0x15824
leaq 0x1f0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x10b30(%rip), %rsi     # 0x15828
leaq 0x1d0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x418(%rsp), %rdi
movsd 0x10386(%rip), %xmm0    # 0x150a0
leaq 0x1f0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x418(%rsp), %rsi
callq 0x54ca
leaq 0x418(%rsp), %rdi
callq 0x56cc
leaq 0x1d0(%rsp), %rdi
callq 0x41a0
leaq 0x1f0(%rsp), %rdi
callq 0x41a0
leaq 0x10ab9(%rip), %rsi     # 0x15828
leaq 0x1b0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x10aa5(%rip), %rsi     # 0x1582d
leaq 0x190(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x3b0(%rsp), %rdi
movsd 0x102fe(%rip), %xmm0    # 0x150a8
leaq 0x1b0(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
callq 0x54ca
leaq 0x3b0(%rsp), %rdi
callq 0x56cc
leaq 0x190(%rsp), %rdi
callq 0x41a0
leaq 0x1b0(%rsp), %rdi
callq 0x41a0
leaq 0x10a25(%rip), %rsi     # 0x15824
leaq 0x170(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x10a15(%rip), %rsi     # 0x1582d
leaq 0x150(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x348(%rsp), %rdi
movsd 0x10276(%rip), %xmm0    # 0x150b0
leaq 0x170(%rsp), %rsi
leaq 0x150(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x348(%rsp), %rsi
callq 0x54ca
leaq 0x348(%rsp), %rdi
callq 0x56cc
leaq 0x150(%rsp), %rdi
callq 0x41a0
leaq 0x170(%rsp), %rdi
callq 0x41a0
leaq 0x109a3(%rip), %rsi     # 0x15832
leaq 0x130(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x1097c(%rip), %rsi     # 0x15824
leaq 0x110(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x2e0(%rsp), %rdi
movsd 0x101ee(%rip), %xmm0    # 0x150b8
leaq 0x130(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x2e0(%rsp), %rsi
callq 0x54ca
leaq 0x2e0(%rsp), %rdi
callq 0x56cc
leaq 0x110(%rsp), %rdi
callq 0x41a0
leaq 0x130(%rsp), %rdi
callq 0x41a0
leaq 0x1090e(%rip), %rsi     # 0x1582d
leaq 0xf0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x108fa(%rip), %rsi     # 0x15832
leaq 0xd0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x278(%rsp), %rdi
movsd 0x10166(%rip), %xmm0    # 0x150c0
leaq 0xf0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x54ca
leaq 0x278(%rsp), %rdi
callq 0x56cc
leaq 0xd0(%rsp), %rdi
callq 0x41a0
leaq 0xf0(%rsp), %rdi
callq 0x41a0
leaq 0x10875(%rip), %rsi     # 0x15824
leaq 0xb0(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x1086a(%rip), %rsi     # 0x15832
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x210(%rsp), %rdi
movsd 0x100de(%rip), %xmm0    # 0x150c8
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x561e
leaq 0x30(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x54ca
leaq 0x210(%rsp), %rdi
callq 0x56cc
leaq 0x90(%rsp), %rdi
callq 0x41a0
leaq 0xb0(%rsp), %rdi
callq 0x41a0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x56f0
movq 0x1ff7f(%rip), %rdi     # 0x24fd0
leaq 0x10(%rsp), %rsi
callq 0x4350
movq %rax, %rdi
callq 0x41c0
leaq 0x10(%rsp), %rdi
callq 0x41a0
leaq 0x107c4(%rip), %rsi     # 0x15838
leaq 0x70(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x52b2
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x59b2
leaq 0x70(%rsp), %rdi
callq 0x41a0
movq 0x1ff2a(%rip), %rdi     # 0x24fd0
leaq 0x1079b(%rip), %rsi     # 0x15848
callq 0x4370
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x5b86
movzbl %al, %esi
movq %rbx, %rdi
callq 0x4530
movq %rax, %rdi
callq 0x41c0
leaq 0x1075f(%rip), %rsi     # 0x15838
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x52b2
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x5d02
leaq 0x50(%rsp), %rdi
callq 0x41a0
leaq 0x18(%rsp), %rdi
callq 0x5ef4
leaq 0x38(%rsp), %rdi
callq 0x5ef4
xorl %eax, %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbx
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
jmp 0x5295
jmp 0x529c
jmp 0x529c
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0x56cc
jmp 0x515e
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x41a0
jmp 0x5170
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
callq 0x56cc
jmp 0x5197
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x41a0
jmp 0x51a9
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x2e0(%rsp), %rdi
callq 0x56cc
jmp 0x51d0
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x41a0
jmp 0x51e2
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x348(%rsp), %rdi
callq 0x56cc
jmp 0x5209
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x41a0
jmp 0x521b
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x3b0(%rsp), %rdi
callq 0x56cc
jmp 0x523c
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x41a0
jmp 0x524e
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x418(%rsp), %rdi
callq 0x56cc
jmp 0x526f
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x41a0
jmp 0x5281
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
jmp 0x5295
jmp 0x529c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x41a0
jmp 0x529f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x5ef4
movq %rbx, %rdi
callq 0x4570
nop