; LLVM IR from dynexcoin/Dynex :: src/Wallet (WalletGreen)

; 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"

@.str.17 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [120 x i8], align 1
@__PRETTY_FUNCTION__._ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll = external hidden unnamed_addr constant [105 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [17 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll(ptr noundef nonnull align 8 dereferenceable(1872) %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %4, i64 noundef %5) #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i8, align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  store i64 %5, ptr %12, align 8, !tbaa !9
  %14 = load ptr, ptr %7, align 8
  %15 = load i64, ptr %11, align 8, !tbaa !9
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %17, label %20

17:                                               ; preds = %6
  %18 = load i64, ptr %12, align 8, !tbaa !9
  %19 = icmp sgt i64 %18, 0
  br i1 %19, label %32, label %20

20:                                               ; preds = %17, %6
  %21 = load i64, ptr %11, align 8, !tbaa !9
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = load i64, ptr %12, align 8, !tbaa !9
  %25 = icmp slt i64 %24, 0
  br i1 %25, label %32, label %26

26:                                               ; preds = %23, %20
  %27 = load i64, ptr %11, align 8, !tbaa !9
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %32, label %29

29:                                               ; preds = %26
  %30 = load i64, ptr %12, align 8, !tbaa !9
  %31 = icmp eq i64 %30, 0
  br label %32

32:                                               ; preds = %29, %26, %23, %17
  %33 = phi i1 [ true, %26 ], [ true, %23 ], [ true, %17 ], [ %31, %29 ]
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  br label %37

35:                                               ; preds = %32
  call void @__assert_fail(ptr noundef @.str.172, ptr noundef @.str.17, i32 noundef 2208, ptr noundef @__PRETTY_FUNCTION__._ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll) #3
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  store i8 0, ptr %13, align 1, !tbaa !11
  %38 = load i64, ptr %11, align 8, !tbaa !9
  %39 = load i64, ptr %12, align 8, !tbaa !9
  %40 = icmp ne i64 %38, %39
  br i1 %40, label %41, label %87

41:                                               ; preds = %37
  %42 = load i64, ptr %11, align 8, !tbaa !9
  %43 = icmp eq i64 %42, 0
  br i1 %43, label %44, label %49

44:                                               ; preds = %41
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = load i64, ptr %9, align 8, !tbaa !9
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load i64, ptr %12, align 8, !tbaa !9
  call void @_ZN7DynexCN11WalletGreen14appendTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872) %14, i64 noundef %45, i64 noundef %46, ptr noundef nonnull align 8 dereferenceable(32) %47, i64 noundef %48)
  store i8 1, ptr %13, align 1, !tbaa !11
  br label %86

49:                                               ; preds = %41
  %50 = load i64, ptr %12, align 8, !tbaa !9
  %51 = icmp eq i64 %50, 0
  br i1 %51, label %52, label %72

52:                                               ; preds = %49
  %53 = load i64, ptr %11, align 8, !tbaa !9
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  br label %58

56:                                               ; preds = %52
  call void @__assert_fail(ptr noundef @.str.173, ptr noundef @.str.17, i32 noundef 2217, ptr noundef @__PRETTY_FUNCTION__._ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll) #3
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = load i64, ptr %9, align 8, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %11, align 8, !tbaa !9
  %63 = icmp sgt i64 %62, 0
  %64 = call noundef zeroext i1 @_ZN7DynexCN11WalletGreen23eraseTransfersByAddressEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(1872) %14, i64 noundef %59, i64 noundef %60, ptr noundef nonnull align 8 dereferenceable(32) %61, i1 noundef zeroext %63)
  %65 = zext i1 %64 to i32
  %66 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  %68 = zext i1 %67 to i32
  %69 = or i32 %68, %65
  %70 = icmp ne i32 %69, 0
  %71 = zext i1 %70 to i8
  store i8 %71, ptr %13, align 1, !tbaa !11
  br label %85

72:                                               ; preds = %49
  %73 = load i64, ptr %8, align 8, !tbaa !9
  %74 = load i64, ptr %9, align 8, !tbaa !9
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = load i64, ptr %12, align 8, !tbaa !9
  %77 = call noundef zeroext i1 @_ZN7DynexCN11WalletGreen14adjustTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872) %14, i64 noundef %73, i64 noundef %74, ptr noundef nonnull align 8 dereferenceable(32) %75, i64 noundef %76)
  %78 = zext i1 %77 to i32
  %79 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %80 = trunc i8 %79 to i1
  %81 = zext i1 %80 to i32
  %82 = or i32 %81, %78
  %83 = icmp ne i32 %82, 0
  %84 = zext i1 %83 to i8
  store i8 %84, ptr %13, align 1, !tbaa !11
  br label %85

85:                                               ; preds = %72, %58
  br label %86

86:                                               ; preds = %85, %44
  br label %87

87:                                               ; preds = %86, %37
  %88 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %89 = trunc i8 %88 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  ret i1 %89
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7DynexCN11WalletGreen14appendTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen23eraseTransfersByAddressEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(1872), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen14adjustTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { noreturn nounwind }
attributes #4 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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"

@.str.17 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [120 x i8], align 1
@__PRETTY_FUNCTION__._ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll = external hidden unnamed_addr constant [105 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll(ptr noundef nonnull align 8 dereferenceable(1872) %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %4, i64 noundef %5) local_unnamed_addr #1 align 2 {
  %7 = icmp sgt i64 %4, 0
  %8 = icmp sgt i64 %5, 0
  %or.cond = and i1 %7, %8
  br i1 %or.cond, label %.critedge, label %9

9:                                                ; preds = %6
  %10 = and i64 %5, %4
  %or.cond3 = icmp slt i64 %10, 0
  %11 = icmp eq i64 %4, 0
  %or.cond5 = or i1 %11, %or.cond3
  %12 = icmp eq i64 %5, 0
  %or.cond7 = or i1 %12, %or.cond5
  br i1 %or.cond7, label %.critedge, label %13

13:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.172, ptr noundef nonnull @.str.17, i32 noundef 2208, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7DynexCN11WalletGreen22updateAddressTransfersEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEll) #2
  unreachable

.critedge:                                        ; preds = %6, %9
  %.not = icmp eq i64 %4, %5
  br i1 %.not, label %23, label %14

14:                                               ; preds = %.critedge
  %15 = icmp eq i64 %4, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %14
  tail call void @_ZN7DynexCN11WalletGreen14appendTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872) %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %5)
  br label %23

17:                                               ; preds = %14
  %18 = icmp eq i64 %5, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %17
  %20 = tail call noundef zeroext i1 @_ZN7DynexCN11WalletGreen23eraseTransfersByAddressEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(1872) %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i1 noundef zeroext %7)
  br label %23

21:                                               ; preds = %17
  %22 = tail call noundef zeroext i1 @_ZN7DynexCN11WalletGreen14adjustTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872) %0, i64 noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %5)
  br label %23

23:                                               ; preds = %16, %21, %19, %.critedge
  %.0.shrunk = phi i1 [ true, %16 ], [ %20, %19 ], [ %22, %21 ], [ false, %.critedge ]
  ret i1 %.0.shrunk
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen23eraseTransfersByAddressEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(1872), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7DynexCN11WalletGreen14adjustTransferEmmRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEl(ptr noundef nonnull align 8 dereferenceable(1872), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

attributes #0 = { noreturn nounwind "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 = { noreturn 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass