; LLVM IR from rcliftonharvey/dspfilters4juce :: DSPFilters4JUCEDemo/JuceLibraryCode (juce_cryptography)

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

%"class.juce::MD5" = type { [16 x i8] }
%"class.juce::MD5Generator" = type { [64 x i8], [4 x i32], [2 x i32] }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }

; 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
define dso_local void @_ZN4juce3MD59fromUTF32ENS_9StringRefE(ptr dead_on_unwind noalias writable sret(%"class.juce::MD5") align 1 %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::MD5Generator", align 4
  %6 = alloca %"class.juce::CharPointer_UTF8", align 8
  %7 = alloca i32, align 4
  %8 = alloca i1, align 1
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr %5) #3
  call void @_ZN4juce12MD5GeneratorC2Ev(ptr noundef nonnull align 4 dereferenceable(88) %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %9 = getelementptr inbounds %"class.juce::StringRef", ptr %1, i32 0, i32 0
  call void @_ZN4juce16CharPointer_UTF8C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  br label %10

10:                                               ; preds = %13, %2
  %11 = call noundef zeroext i1 @_ZNK4juce16CharPointer_UTF87isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %12 = xor i1 %11, true
  br i1 %12, label %13, label %16

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %14 = call noundef signext i32 @_ZN4juce16CharPointer_UTF813getAndAdvanceEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %15 = call noundef i32 @_ZN4juce9ByteOrder15swapIfBigEndianEj(i32 noundef %14) #3
  store i32 %15, ptr %7, align 4, !tbaa !9
  call void @_ZN4juce12MD5Generator12processBlockEPKvm(ptr noundef nonnull align 4 dereferenceable(88) %5, ptr noundef %7, i64 noundef 4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %10, !llvm.loop !11

16:                                               ; preds = %10
  store i1 false, ptr %8, align 1
  call void @_ZN4juce3MD5C1Ev(ptr noundef nonnull align 1 dereferenceable(16) %0) #3
  %17 = getelementptr inbounds %"class.juce::MD5", ptr %0, i32 0, i32 0
  %18 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @_ZN4juce12MD5Generator6finishEPv(ptr noundef nonnull align 4 dereferenceable(88) %5, ptr noundef %18) #3
  store i1 true, ptr %8, align 1
  %19 = load i1, ptr %8, align 1
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @_ZN4juce3MD5D1Ev(ptr noundef nonnull align 1 dereferenceable(16) %0) #3
  br label %21

21:                                               ; preds = %20, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 88, ptr %5) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5GeneratorC2Ev(ptr noundef nonnull align 4 dereferenceable(88)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce16CharPointer_UTF8C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce16CharPointer_UTF87isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce9ByteOrder15swapIfBigEndianEj(i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i32 @_ZN4juce16CharPointer_UTF813getAndAdvanceEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5Generator12processBlockEPKvm(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5Generator6finishEPv(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef) #1 align 2

declare void @_ZN4juce3MD5C1Ev(ptr)

declare void @_ZN4juce3MD5D1Ev(ptr)

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 = { inlinehint 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 #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 = !{!"int", !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"

%"class.juce::MD5" = type { [16 x i8] }
%"class.juce::MD5Generator" = type { [64 x i8], [4 x i32], [2 x i32] }
%"class.juce::CharPointer_UTF8" = type { ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce3MD59fromUTF32ENS_9StringRefE(ptr dead_on_unwind noalias writable sret(%"class.juce::MD5") align 1 %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.juce::MD5Generator", align 4
  %4 = alloca %"class.juce::CharPointer_UTF8", align 8
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #3
  call void @_ZN4juce12MD5GeneratorC2Ev(ptr noundef nonnull align 4 dereferenceable(88) %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @_ZN4juce16CharPointer_UTF8C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %1) #3
  %6 = call noundef zeroext i1 @_ZNK4juce16CharPointer_UTF87isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %6, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %7 = call noundef signext i32 @_ZN4juce16CharPointer_UTF813getAndAdvanceEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %8 = call noundef i32 @_ZN4juce9ByteOrder15swapIfBigEndianEj(i32 noundef %7) #3
  store i32 %8, ptr %5, align 4, !tbaa !5
  call void @_ZN4juce12MD5Generator12processBlockEPKvm(ptr noundef nonnull align 4 dereferenceable(88) %3, ptr noundef nonnull %5, i64 noundef 4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  %9 = call noundef zeroext i1 @_ZNK4juce16CharPointer_UTF87isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  br i1 %9, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %2
  call void @_ZN4juce3MD5C1Ev(ptr noundef nonnull align 1 dereferenceable(16) %0) #3
  call void @_ZN4juce12MD5Generator6finishEPv(ptr noundef nonnull align 4 dereferenceable(88) %3, ptr noundef %0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5GeneratorC2Ev(ptr noundef nonnull align 4 dereferenceable(88)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce16CharPointer_UTF8C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce16CharPointer_UTF87isEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce9ByteOrder15swapIfBigEndianEj(i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i32 @_ZN4juce16CharPointer_UTF813getAndAdvanceEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5Generator12processBlockEPKvm(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce12MD5Generator6finishEPv(ptr noundef nonnull align 4 dereferenceable(88), ptr noundef) local_unnamed_addr #1 align 2

declare void @_ZN4juce3MD5C1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress 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 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass