; LLVM IR from dynexcoin/Dynex :: src/DynexCNCore (Blockchain)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.DynexCN::Blockchain::BlockEntry" = type { %"struct.DynexCN::Block", i32, i64, i64, i64, %"class.std::vector.227" }
%"struct.DynexCN::Block" = type { %"struct.DynexCN::BlockHeader", %"struct.DynexCN::ParentBlock", %"struct.DynexCN::Transaction", %"class.std::vector.147" }
%"struct.DynexCN::BlockHeader" = type { i8, i8, i32, i64, %"struct.Crypto::Hash" }
%"struct.Crypto::Hash" = type { [32 x i8] }
%"struct.DynexCN::ParentBlock" = type { i8, i8, %"struct.Crypto::Hash", i16, %"class.std::vector.147", %"struct.DynexCN::Transaction", %"class.std::vector.147" }
%"struct.DynexCN::Transaction" = type { %"struct.DynexCN::TransactionPrefix", %"class.std::vector.167" }
%"struct.DynexCN::TransactionPrefix" = type { i8, i64, %"class.std::vector.152", %"class.std::vector.157", %"class.std::vector.162" }
%"class.std::vector.152" = type { %"struct.std::_Vector_base.153" }
%"struct.std::_Vector_base.153" = type { %"struct.std::_Vector_base<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>, std::allocator<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>>>::_Vector_impl" }
%"struct.std::_Vector_base<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>, std::allocator<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>>>::_Vector_impl" = type { %"struct.std::_Vector_base<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>, std::allocator<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>, std::allocator<boost::variant<DynexCN::BaseInput, DynexCN::KeyInput, DynexCN::MultisignatureInput>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.157" = type { %"struct.std::_Vector_base.158" }
%"struct.std::_Vector_base.158" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutput, std::allocator<DynexCN::TransactionOutput>>::_Vector_impl" }
%"struct.std::_Vector_base<DynexCN::TransactionOutput, std::allocator<DynexCN::TransactionOutput>>::_Vector_impl" = type { %"struct.std::_Vector_base<DynexCN::TransactionOutput, std::allocator<DynexCN::TransactionOutput>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DynexCN::TransactionOutput, std::allocator<DynexCN::TransactionOutput>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.162" = type { %"struct.std::_Vector_base.163" }
%"struct.std::_Vector_base.163" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.167" = type { %"struct.std::_Vector_base.168" }
%"struct.std::_Vector_base.168" = type { %"struct.std::_Vector_base<std::vector<Crypto::Signature>, std::allocator<std::vector<Crypto::Signature>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Crypto::Signature>, std::allocator<std::vector<Crypto::Signature>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Crypto::Signature>, std::allocator<std::vector<Crypto::Signature>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Crypto::Signature>, std::allocator<std::vector<Crypto::Signature>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.147" = type { %"struct.std::_Vector_base.148" }
%"struct.std::_Vector_base.148" = type { %"struct.std::_Vector_base<Crypto::Hash, std::allocator<Crypto::Hash>>::_Vector_impl" }
%"struct.std::_Vector_base<Crypto::Hash, std::allocator<Crypto::Hash>>::_Vector_impl" = type { %"struct.std::_Vector_base<Crypto::Hash, std::allocator<Crypto::Hash>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Crypto::Hash, std::allocator<Crypto::Hash>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.227" = type { %"struct.std::_Vector_base.228" }
%"struct.std::_Vector_base.228" = type { %"struct.std::_Vector_base<DynexCN::Blockchain::TransactionEntry, std::allocator<DynexCN::Blockchain::TransactionEntry>>::_Vector_impl" }
%"struct.std::_Vector_base<DynexCN::Blockchain::TransactionEntry, std::allocator<DynexCN::Blockchain::TransactionEntry>>::_Vector_impl" = type { %"struct.std::_Vector_base<DynexCN::Blockchain::TransactionEntry, std::allocator<DynexCN::Blockchain::TransactionEntry>>::_Vector_impl_data" }
%"struct.std::_Vector_base<DynexCN::Blockchain::TransactionEntry, std::allocator<DynexCN::Blockchain::TransactionEntry>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.DynexCN::Blockchain::TransactionEntry" = type { %"struct.DynexCN::Transaction", %"class.std::vector.234" }
%"class.std::vector.234" = type { %"struct.std::_Vector_base.235" }
%"struct.std::_Vector_base.235" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(136) ptr @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(32) ptr @_ZNKSt6vectorIN6Crypto4HashESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN10Blockchain15popTransactionsERKNS0_10BlockEntryERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %0, ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef nonnull align 1 dereferenceable(32) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %38, %3
  %10 = load i64, ptr %7, align 8, !tbaa !9
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %11, i32 0, i32 5
  %13 = call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  %14 = sub i64 %13, 1
  %15 = icmp ult i64 %10, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %41

17:                                               ; preds = %9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %18, i32 0, i32 5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %20, i32 0, i32 5
  %22 = call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %23 = sub i64 %22, 1
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = sub i64 %23, %24
  %26 = call noundef nonnull align 8 dereferenceable(136) ptr @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %25) #3
  %27 = getelementptr inbounds %"struct.DynexCN::Blockchain::TransactionEntry", ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %"struct.DynexCN::Block", ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %31, i32 0, i32 5
  %33 = call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #3
  %34 = sub i64 %33, 2
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = sub i64 %34, %35
  %37 = call noundef nonnull align 1 dereferenceable(32) ptr @_ZNKSt6vectorIN6Crypto4HashESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %36) #3
  call void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %8, ptr noundef nonnull align 8 dereferenceable(112) %27, ptr noundef nonnull align 1 dereferenceable(32) %37)
  br label %38

38:                                               ; preds = %17
  %39 = load i64, ptr %7, align 8, !tbaa !9
  %40 = add i64 %39, 1
  store i64 %40, ptr %7, align 8, !tbaa !9
  br label %9, !llvm.loop !11

41:                                               ; preds = %16
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.DynexCN::Blockchain::BlockEntry", ptr %42, i32 0, i32 0
  %44 = getelementptr inbounds %"struct.DynexCN::Block", ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %8, ptr noundef nonnull align 8 dereferenceable(112) %44, ptr noundef nonnull align 1 dereferenceable(32) %45)
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636), ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 1 dereferenceable(32)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(136) ptr @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(32) ptr @_ZNKSt6vectorIN6Crypto4HashESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7DynexCN10Blockchain15popTransactionsERKNS0_10BlockEntryERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %0, ptr noundef nonnull align 8 dereferenceable(440) %1, ptr noundef nonnull align 1 dereferenceable(32) %2) local_unnamed_addr #1 align 2 {
  %4 = getelementptr inbounds i8, ptr %1, i64 416
  %5 = tail call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %.not = icmp eq i64 %5, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %6 = getelementptr inbounds i8, ptr %1, i64 360
  br label %8

._crit_edge:                                      ; preds = %8, %3
  %7 = getelementptr inbounds i8, ptr %1, i64 248
  tail call void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %0, ptr noundef nonnull align 8 dereferenceable(112) %7, ptr noundef nonnull align 1 dereferenceable(32) %2)
  ret void

8:                                                ; preds = %.lr.ph, %8
  %.011 = phi i64 [ 0, %.lr.ph ], [ %16, %8 ]
  %9 = tail call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %10 = xor i64 %.011, -1
  %11 = add i64 %9, %10
  %12 = tail call noundef nonnull align 8 dereferenceable(136) ptr @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %11) #2
  %13 = tail call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %reass.sub = sub i64 %13, %.011
  %14 = add i64 %reass.sub, -2
  %15 = tail call noundef nonnull align 1 dereferenceable(32) ptr @_ZNKSt6vectorIN6Crypto4HashESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %14) #2
  tail call void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636) %0, ptr noundef nonnull align 8 dereferenceable(112) %12, ptr noundef nonnull align 1 dereferenceable(32) %15)
  %16 = add nuw i64 %.011, 1
  %17 = tail call noundef i64 @_ZNKSt6vectorIN7DynexCN10Blockchain16TransactionEntryESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  %18 = add i64 %17, -1
  %19 = icmp ult i64 %16, %18
  br i1 %19, label %8, label %._crit_edge, !llvm.loop !5
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN10Blockchain14popTransactionERKNS_11TransactionERKN6Crypto4HashE(ptr noundef nonnull align 8 dereferenceable(2636), ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 1 dereferenceable(32)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass