; LLVM IR from pictools/pica :: test/src/utility/UtilityTests.ll (ZN28IndexIntervalTest_ToInt_Test8TestBodyEv)

; 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.testing::AssertionResult" = type { i8, %"class.testing::internal::scoped_ptr" }
%"class.testing::internal::scoped_ptr" = type { ptr }
%"struct.pica::IndexInterval" = type { %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3" }
%"struct.pica::Vector3" = type { i32, i32, i32 }
%"class.testing::Message" = type { %"class.testing::internal::scoped_ptr.0" }
%"class.testing::internal::scoped_ptr.0" = type { ptr }
%"class.testing::internal::AssertHelper" = type { ptr }
%class.IndexIntervalTest = type <{ %"class.testing::Test", %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3", [4 x i8] }>
%"class.testing::Test" = type { ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.147 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local void @_ZN7testing8internal8EqHelperILb0EE7CompareIiiEENS_15AssertionResultEPKcS6_RKT_RKT0_(ptr dead_on_unwind noalias writable sret(%"class.testing::AssertionResult") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing7MessageC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing15AssertionResult15failure_messageEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

declare void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

declare void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: nounwind
declare void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4pica7Vector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4pica13IndexIntervalINS_7Vector3IiEEEC2ERKS2_S5_S5_(ptr noundef nonnull align 4 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN28IndexIntervalTest_ToInt_Test8TestBodyEv(ptr noundef nonnull align 8 dereferenceable(52) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.pica::IndexInterval", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.testing::AssertionResult", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.pica::Vector3", align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.testing::Message", align 8
  %15 = alloca %"class.testing::internal::AssertHelper", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 60, ptr %3) #6
  %17 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 2
  %19 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 3
  call void @_ZN4pica13IndexIntervalINS_7Vector3IiEEEC2ERKS2_S5_S5_(ptr noundef nonnull align 4 dereferenceable(60) %3, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %18, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %20 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 1
  %21 = getelementptr inbounds %"struct.pica::Vector3", ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  store i32 %22, ptr %5, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %109, %1
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 2
  %26 = getelementptr inbounds %"struct.pica::Vector3", ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !15
  %28 = icmp slt i32 %24, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %23
  store i32 2, ptr %6, align 4
  br label %115

30:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %31 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 1
  %32 = getelementptr inbounds %"struct.pica::Vector3", ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !16
  store i32 %33, ptr %7, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %100, %30
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 2
  %37 = getelementptr inbounds %"struct.pica::Vector3", ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !17
  %39 = icmp slt i32 %35, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  store i32 5, ptr %6, align 4
  br label %106

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %42 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 1
  %43 = getelementptr inbounds %"struct.pica::Vector3", ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !18
  store i32 %44, ptr %8, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %90, %41
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 2
  %48 = getelementptr inbounds %"struct.pica::Vector3", ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !19
  %50 = icmp slt i32 %46, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  store i32 8, ptr %6, align 4
  br label %97

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #6
  %53 = load i32, ptr %5, align 4, !tbaa !9
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN4pica7Vector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %11, i32 noundef %53, i32 noundef %54, i32 noundef %55)
  %56 = call noundef i32 @_ZNK4pica13IndexIntervalINS_7Vector3IiEEE5toIntERKS2_(ptr noundef nonnull align 4 dereferenceable(60) %3, ptr noundef nonnull align 4 dereferenceable(12) %11)
  store i32 %56, ptr %10, align 4, !tbaa !9
  call void @_ZN7testing8internal8EqHelperILb0EE7CompareIiiEENS_15AssertionResultEPKcS6_RKT_RKT0_(ptr dead_on_unwind writable sret(%"class.testing::AssertionResult") align 8 %9, ptr noundef @.str.146, ptr noundef @.str.147, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %57 = invoke noundef zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %58 unwind label %60

58:                                               ; preds = %52
  br i1 %57, label %59, label %64

59:                                               ; preds = %58
  br label %84

60:                                               ; preds = %52
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %12, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %13, align 4
  br label %96

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  invoke void @_ZN7testing7MessageC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %65 unwind label %70

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %66 = invoke noundef ptr @_ZNK7testing15AssertionResult15failure_messageEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %67 unwind label %74

67:                                               ; preds = %65
  invoke void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 2, ptr noundef @.str.5, i32 noundef 154, ptr noundef %66)
          to label %68 unwind label %74

68:                                               ; preds = %67
  invoke void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %69 unwind label %78

69:                                               ; preds = %68
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  store i32 1, ptr %6, align 4
  br label %85

70:                                               ; preds = %64
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %12, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %13, align 4
  br label %83

74:                                               ; preds = %67, %65
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %12, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %13, align 4
  br label %82

78:                                               ; preds = %68
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %82

82:                                               ; preds = %78, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  br label %83

83:                                               ; preds = %82, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %96

84:                                               ; preds = %59
  store i32 0, ptr %6, align 4
  br label %85

85:                                               ; preds = %84, %69
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  %86 = load i32, ptr %6, align 4
  switch i32 %86, label %97 [
    i32 0, label %87
  ]

87:                                               ; preds = %85
  %88 = load i32, ptr %4, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %4, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 3
  %92 = getelementptr inbounds %"struct.pica::Vector3", ptr %91, i32 0, i32 2
  %93 = load i32, ptr %92, align 8, !tbaa !20
  %94 = load i32, ptr %8, align 4, !tbaa !9
  %95 = add nsw i32 %94, %93
  store i32 %95, ptr %8, align 4, !tbaa !9
  br label %45, !llvm.loop !21

96:                                               ; preds = %83, %60
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %3) #6
  br label %121

97:                                               ; preds = %85, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %98 = load i32, ptr %6, align 4
  switch i32 %98, label %106 [
    i32 8, label %99
  ]

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 3
  %102 = getelementptr inbounds %"struct.pica::Vector3", ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 4, !tbaa !23
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = add nsw i32 %104, %103
  store i32 %105, ptr %7, align 4, !tbaa !9
  br label %34, !llvm.loop !24

106:                                              ; preds = %97, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %107 = load i32, ptr %6, align 4
  switch i32 %107, label %115 [
    i32 5, label %108
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  %110 = getelementptr inbounds %class.IndexIntervalTest, ptr %16, i32 0, i32 3
  %111 = getelementptr inbounds %"struct.pica::Vector3", ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !25
  %113 = load i32, ptr %5, align 4, !tbaa !9
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr %5, align 4, !tbaa !9
  br label %23, !llvm.loop !26

115:                                              ; preds = %106, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %116 = load i32, ptr %6, align 4
  switch i32 %116, label %118 [
    i32 2, label %117
  ]

117:                                              ; preds = %115
  store i32 0, ptr %6, align 4
  br label %118

118:                                              ; preds = %117, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %3) #6
  %119 = load i32, ptr %6, align 4
  switch i32 %119, label %126 [
    i32 0, label %120
    i32 1, label %120
  ]

120:                                              ; preds = %118, %118
  ret void

121:                                              ; preds = %96
  %122 = load ptr, ptr %12, align 8
  %123 = load i32, ptr %13, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125

126:                                              ; preds = %118
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK4pica13IndexIntervalINS_7Vector3IiEEE5toIntERKS2_(ptr noundef nonnull align 4 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 #4 = { 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 #5 = { 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 #6 = { 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 = !{!12, !10, i64 16}
!12 = !{!"_ZTS17IndexIntervalTest", !13, i64 0, !14, i64 16, !14, i64 28, !14, i64 40}
!13 = !{!"_ZTSN7testing4TestE", !6, i64 8}
!14 = !{!"_ZTSN4pica7Vector3IiEE", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!12, !10, i64 28}
!16 = !{!12, !10, i64 20}
!17 = !{!12, !10, i64 32}
!18 = !{!12, !10, i64 24}
!19 = !{!12, !10, i64 36}
!20 = !{!12, !10, i64 48}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !10, i64 44}
!24 = distinct !{!24, !22}
!25 = !{!12, !10, i64 40}
!26 = distinct !{!26, !22}


; 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.testing::AssertionResult" = type { i8, %"class.testing::internal::scoped_ptr" }
%"class.testing::internal::scoped_ptr" = type { ptr }
%"struct.pica::IndexInterval" = type { %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3", %"struct.pica::Vector3" }
%"struct.pica::Vector3" = type { i32, i32, i32 }
%"class.testing::Message" = type { %"class.testing::internal::scoped_ptr.0" }
%"class.testing::internal::scoped_ptr.0" = type { ptr }
%"class.testing::internal::AssertHelper" = type { ptr }

@.str.5 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.146 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.147 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local void @_ZN7testing8internal8EqHelperILb0EE7CompareIiiEENS_15AssertionResultEPKcS6_RKT_RKT0_(ptr dead_on_unwind noalias writable sret(%"class.testing::AssertionResult") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing7MessageC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7testing15AssertionResult15failure_messageEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

declare void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

declare void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4pica7Vector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4pica13IndexIntervalINS_7Vector3IiEEEC2ERKS2_S5_S5_(ptr noundef nonnull align 4 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN28IndexIntervalTest_ToInt_Test8TestBodyEv(ptr noundef nonnull align 8 dereferenceable(52) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.pica::IndexInterval", align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.testing::AssertionResult", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.pica::Vector3", align 4
  %7 = alloca %"class.testing::Message", align 8
  %8 = alloca %"class.testing::internal::AssertHelper", align 8
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %2) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = getelementptr inbounds i8, ptr %0, i64 28
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZN4pica13IndexIntervalINS_7Vector3IiEEEC2ERKS2_S5_S5_(ptr noundef nonnull align 4 dereferenceable(60) %2, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %12 = load i32, ptr %9, align 8, !tbaa !9
  %13 = load i32, ptr %10, align 4, !tbaa !14
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %.lr.ph39, label %.loopexit

.lr.ph39:                                         ; preds = %1
  %15 = getelementptr inbounds i8, ptr %0, i64 20
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = getelementptr inbounds i8, ptr %0, i64 36
  %19 = getelementptr inbounds i8, ptr %0, i64 48
  %20 = getelementptr inbounds i8, ptr %0, i64 44
  %21 = load i32, ptr %15, align 4, !tbaa !15
  %22 = load i32, ptr %16, align 8, !tbaa !16
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph39.split, label %.loopexit

.lr.ph39.split:                                   ; preds = %.lr.ph39, %.critedge31
  %24 = phi i32 [ %60, %.critedge31 ], [ %13, %.lr.ph39 ]
  %25 = phi i32 [ %61, %.critedge31 ], [ %22, %.lr.ph39 ]
  %26 = phi i32 [ %62, %.critedge31 ], [ %22, %.lr.ph39 ]
  %.02437 = phi i32 [ %64, %.critedge31 ], [ %12, %.lr.ph39 ]
  %27 = load i32, ptr %15, align 4, !tbaa !15
  %.not2734 = icmp slt i32 %27, %26
  br i1 %.not2734, label %.lr.ph36, label %.critedge31

.lr.ph36:                                         ; preds = %.lr.ph39.split
  %28 = load i32, ptr %17, align 8, !tbaa !17
  %29 = load i32, ptr %18, align 4, !tbaa !18
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph36.split, label %.critedge31

.lr.ph36.split:                                   ; preds = %.lr.ph36, %.critedge29
  %31 = phi i32 [ %55, %.critedge29 ], [ %25, %.lr.ph36 ]
  %32 = phi i32 [ %56, %.critedge29 ], [ %29, %.lr.ph36 ]
  %.02135 = phi i32 [ %58, %.critedge29 ], [ %27, %.lr.ph36 ]
  %33 = load i32, ptr %17, align 8, !tbaa !17
  %.not32 = icmp slt i32 %33, %32
  br i1 %.not32, label %.lr.ph, label %.critedge29

.lr.ph:                                           ; preds = %.lr.ph36.split, %49
  %.02033 = phi i32 [ %53, %49 ], [ %33, %.lr.ph36.split ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @_ZN4pica7Vector3IiEC2Eiii(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %.02437, i32 noundef %.02135, i32 noundef %.02033)
  %34 = call noundef i32 @_ZNK4pica13IndexIntervalINS_7Vector3IiEEE5toIntERKS2_(ptr noundef nonnull align 4 dereferenceable(60) %2, ptr noundef nonnull align 4 dereferenceable(12) %6)
  store i32 %34, ptr %5, align 4, !tbaa !5
  call void @_ZN7testing8internal8EqHelperILb0EE7CompareIiiEENS_15AssertionResultEPKcS6_RKT_RKT0_(ptr dead_on_unwind nonnull writable sret(%"class.testing::AssertionResult") align 8 %4, ptr noundef nonnull @.str.146, ptr noundef nonnull @.str.147, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %35 = call noundef zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  br i1 %35, label %49, label %36

36:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  invoke void @_ZN7testing7MessageC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %37 unwind label %41

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %38 = invoke noundef ptr @_ZNK7testing15AssertionResult15failure_messageEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %39 unwind label %43

39:                                               ; preds = %37
  invoke void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 2, ptr noundef nonnull @.str.5, i32 noundef 154, ptr noundef %38)
          to label %40 unwind label %43

40:                                               ; preds = %39
  invoke void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %59 unwind label %45

41:                                               ; preds = %36
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %48

43:                                               ; preds = %39, %37
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %40
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %47

47:                                               ; preds = %45, %43
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %48

48:                                               ; preds = %47, %41
  %.pn.pn = phi { ptr, i32 } [ %.pn, %47 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn

49:                                               ; preds = %.lr.ph
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr %19, align 8, !tbaa !19
  %53 = add nsw i32 %52, %.02033
  %54 = load i32, ptr %18, align 4, !tbaa !18
  %.not = icmp slt i32 %53, %54
  br i1 %.not, label %.lr.ph, label %.critedge29.loopexit, !llvm.loop !20

.critedge29.loopexit:                             ; preds = %49
  %.pre = load i32, ptr %16, align 8, !tbaa !16
  br label %.critedge29

.critedge29:                                      ; preds = %.critedge29.loopexit, %.lr.ph36.split
  %55 = phi i32 [ %.pre, %.critedge29.loopexit ], [ %31, %.lr.ph36.split ]
  %56 = phi i32 [ %54, %.critedge29.loopexit ], [ %32, %.lr.ph36.split ]
  %57 = load i32, ptr %20, align 4, !tbaa !22
  %58 = add nsw i32 %57, %.02135
  %.not27 = icmp slt i32 %58, %55
  br i1 %.not27, label %.lr.ph36.split, label %.critedge31.loopexit, !llvm.loop !23

59:                                               ; preds = %40
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %.loopexit

.critedge31.loopexit:                             ; preds = %.critedge29
  %.pre42 = load i32, ptr %10, align 4, !tbaa !14
  br label %.critedge31

.critedge31:                                      ; preds = %.lr.ph36, %.critedge31.loopexit, %.lr.ph39.split
  %60 = phi i32 [ %.pre42, %.critedge31.loopexit ], [ %24, %.lr.ph39.split ], [ %24, %.lr.ph36 ]
  %61 = phi i32 [ %55, %.critedge31.loopexit ], [ %25, %.lr.ph39.split ], [ %25, %.lr.ph36 ]
  %62 = phi i32 [ %55, %.critedge31.loopexit ], [ %26, %.lr.ph39.split ], [ %26, %.lr.ph36 ]
  %63 = load i32, ptr %11, align 8, !tbaa !25
  %64 = add nsw i32 %63, %.02437
  %65 = icmp slt i32 %64, %60
  br i1 %65, label %.lr.ph39.split, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %.critedge31, %.lr.ph39, %1, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %2) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK4pica13IndexIntervalINS_7Vector3IiEEE5toIntERKS2_(ptr noundef nonnull align 4 dereferenceable(60), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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 #4 = { 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 #5 = { 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 #6 = { 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 = !{!10, !6, i64 16}
!10 = !{!"_ZTS17IndexIntervalTest", !11, i64 0, !13, i64 16, !13, i64 28, !13, i64 40}
!11 = !{!"_ZTSN7testing4TestE", !12, i64 8}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSN4pica7Vector3IiEE", !6, i64 0, !6, i64 4, !6, i64 8}
!14 = !{!10, !6, i64 28}
!15 = !{!10, !6, i64 20}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 24}
!18 = !{!10, !6, i64 36}
!19 = !{!10, !6, i64 48}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !6, i64 44}
!23 = distinct !{!23, !21, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = !{!10, !6, i64 40}
!26 = distinct !{!26, !21, !24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass