; LLVM IR from pictools/pica :: test/src/grid/YeeGridTests.ll (ZN31YeeGridTest1d_GetCellIndex_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::internal::String" = type { ptr, i64 }
%"struct.pica::Vector1.0" = type { i32 }
%"struct.pica::Vector1" = type { double }
%"class.testing::AssertionResult" = type { i8, %"class.testing::internal::scoped_ptr" }
%"class.testing::internal::scoped_ptr" = type { ptr }
%"class.testing::Message" = type { %"class.testing::internal::scoped_ptr.1" }
%"class.testing::internal::scoped_ptr.1" = type { ptr }
%"class.testing::internal::AssertHelper" = type { ptr }
%class.YeeGridTest1d = type <{ %"class.testing::Test", %"class.std::auto_ptr", %"struct.pica::Vector1", %"struct.pica::Vector1", %"struct.pica::Vector1.0", [4 x i8] }>
%"class.testing::Test" = type { ptr, ptr }
%"class.std::auto_ptr" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [45 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: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local double @_ZNK4pica4GridILNS_9DimensionE1EdE9getOriginEv(ptr noundef nonnull align 8 dereferenceable(232)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing15AssertionResultC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #2 align 2

; 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 zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

declare void @_ZN7testing8internal30GetBoolAssertionFailureMessageERKNS_15AssertionResultEPKcS5_S5_(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7testing8internal6String5c_strEv(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: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; 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 double @_ZNK4pica4GridILNS_9DimensionE1EdE7getStepEv(ptr noundef nonnull align 8 dereferenceable(232)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4picaeqIiEEbRKNS_7Vector1IT_EES5_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK4pica4GridILNS_9DimensionE1EdE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(232)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN31YeeGridTest1d_GetCellIndex_Test8TestBodyEv(ptr noundef nonnull align 8 dereferenceable(44) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"struct.pica::Vector1.0", align 4
  %5 = alloca %"struct.pica::Vector1", align 8
  %6 = alloca %"struct.pica::Vector1", align 8
  %7 = alloca %"struct.pica::Vector1", align 8
  %8 = alloca %"struct.pica::Vector1", align 8
  %9 = alloca %"class.testing::AssertionResult", align 8
  %10 = alloca %"struct.pica::Vector1.0", align 4
  %11 = alloca %"struct.pica::Vector1.0", 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
  %16 = alloca %"class.testing::internal::String", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %84, %1
  %19 = load i32, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %20 = getelementptr inbounds %class.YeeGridTest1d, ptr %17, i32 0, i32 1
  %21 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %22 = call i32 @_ZNK4pica4GridILNS_9DimensionE1EdE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(232) %21)
  %23 = getelementptr inbounds %"struct.pica::Vector1.0", ptr %4, i32 0, i32 0
  store i32 %22, ptr %23, align 4
  %24 = getelementptr inbounds %"struct.pica::Vector1.0", ptr %4, i32 0, i32 0
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = icmp slt i32 %19, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br i1 %26, label %28, label %27

27:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %88

28:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %29 = getelementptr inbounds %class.YeeGridTest1d, ptr %17, i32 0, i32 1
  %30 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  %31 = call double @_ZNK4pica4GridILNS_9DimensionE1EdE9getOriginEv(ptr noundef nonnull align 8 dereferenceable(232) %30)
  %32 = getelementptr inbounds %"struct.pica::Vector1", ptr %6, i32 0, i32 0
  store double %31, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %33 = getelementptr inbounds %class.YeeGridTest1d, ptr %17, i32 0, i32 1
  %34 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #7
  %35 = call double @_ZNK4pica4GridILNS_9DimensionE1EdE7getStepEv(ptr noundef nonnull align 8 dereferenceable(232) %34)
  %36 = getelementptr inbounds %"struct.pica::Vector1", ptr %8, i32 0, i32 0
  store double %35, ptr %36, align 8
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = sitofp i32 %37 to double
  %39 = fadd double %38, 5.000000e-01
  %40 = call double @_ZN4picamlIdEEKNS_7Vector1IT_EERS4_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, double noundef %39)
  %41 = getelementptr inbounds %"struct.pica::Vector1", ptr %7, i32 0, i32 0
  store double %40, ptr %41, align 8
  %42 = call double @_ZN4picaplIdEEKNS_7Vector1IT_EERS4_S5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %43 = getelementptr inbounds %"struct.pica::Vector1", ptr %5, i32 0, i32 0
  store double %42, ptr %43, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %44 = load i32, ptr %3, align 4, !tbaa !9
  call void @_ZN4pica7Vector1IiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef %44)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %45 = getelementptr inbounds %class.YeeGridTest1d, ptr %17, i32 0, i32 1
  %46 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %45) #7
  %47 = call i32 @_ZN4pica4GridILNS_9DimensionE1EdE12getCellIndexERKNS_7Vector1IdEE(ptr noundef nonnull align 8 dereferenceable(232) %46, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %48 = getelementptr inbounds %"struct.pica::Vector1.0", ptr %11, i32 0, i32 0
  store i32 %47, ptr %48, align 4
  %49 = call noundef zeroext i1 @_ZN4picaeqIiEEbRKNS_7Vector1IT_EES5_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @_ZN7testing15AssertionResultC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %9, i1 noundef zeroext %49)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %50 = invoke noundef zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %51 unwind label %53

51:                                               ; preds = %28
  br i1 %50, label %52, label %57

52:                                               ; preds = %51
  br label %83

53:                                               ; preds = %28
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %12, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %13, align 4
  br label %87

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

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  invoke void @_ZN7testing8internal30GetBoolAssertionFailureMessageERKNS_15AssertionResultEPKcS5_S5_(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8 %16, ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef @.str.15, ptr noundef @.str.5, ptr noundef @.str.6)
          to label %59 unwind label %68

59:                                               ; preds = %58
  %60 = invoke noundef ptr @_ZNK7testing8internal6String5c_strEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %61 unwind label %72

61:                                               ; preds = %59
  invoke void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 1, ptr noundef @.str.3, i32 noundef 46, ptr noundef %60)
          to label %62 unwind label %72

62:                                               ; preds = %61
  invoke void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %63 unwind label %76

63:                                               ; preds = %62
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %83

64:                                               ; preds = %57
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %12, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %13, align 4
  br label %82

68:                                               ; preds = %58
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %12, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %13, align 4
  br label %81

72:                                               ; preds = %61, %59
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %12, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %13, align 4
  br label %80

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

80:                                               ; preds = %76, %72
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  br label %81

81:                                               ; preds = %80, %68
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #7
  br label %82

82:                                               ; preds = %81, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %87

83:                                               ; preds = %63, %52
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %3, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %3, align 4, !tbaa !9
  br label %18, !llvm.loop !13

87:                                               ; preds = %82, %53
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %89

88:                                               ; preds = %27
  ret void

89:                                               ; preds = %87
  %90 = load ptr, ptr %12, align 8
  %91 = load i32, ptr %13, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local double @_ZN4picaplIdEEKNS_7Vector1IT_EERS4_S5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local double @_ZN4picamlIdEEKNS_7Vector1IT_EERS4_S2_(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN4pica4GridILNS_9DimensionE1EdE12getCellIndexERKNS_7Vector1IdEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { "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 = { inlinehint 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 #7 = { 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 0}
!12 = !{!"_ZTSN4pica7Vector1IiEE", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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.testing::internal::String" = type { ptr, i64 }
%"struct.pica::Vector1" = type { double }
%"class.testing::AssertionResult" = type { i8, %"class.testing::internal::scoped_ptr" }
%"class.testing::internal::scoped_ptr" = type { ptr }
%"struct.pica::Vector1.0" = type { i32 }
%"class.testing::Message" = type { %"class.testing::internal::scoped_ptr.1" }
%"class.testing::internal::scoped_ptr.1" = type { ptr }
%"class.testing::internal::AssertHelper" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [45 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local double @_ZNK4pica4GridILNS_9DimensionE1EdE9getOriginEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7testing15AssertionResultC2Eb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) unnamed_addr #2 align 2

; 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
declare dso_local noundef zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

declare void @_ZN7testing8internal30GetBoolAssertionFailureMessageERKNS_15AssertionResultEPKcS5_S5_(ptr dead_on_unwind writable sret(%"class.testing::internal::String") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7testing8internal6String5c_strEv(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: mustprogress nounwind uwtable
declare dso_local void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #1 align 2

; 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 double @_ZNK4pica4GridILNS_9DimensionE1EdE7getStepEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4picaeqIiEEbRKNS_7Vector1IT_EES5_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZNK4pica4GridILNS_9DimensionE1EdE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN31YeeGridTest1d_GetCellIndex_Test8TestBodyEv(ptr noundef nonnull align 8 dereferenceable(44) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.pica::Vector1", align 8
  %3 = alloca %"struct.pica::Vector1", align 8
  %4 = alloca %"struct.pica::Vector1", align 8
  %5 = alloca %"struct.pica::Vector1", align 8
  %6 = alloca %"class.testing::AssertionResult", align 8
  %7 = alloca %"struct.pica::Vector1.0", align 4
  %8 = alloca %"struct.pica::Vector1.0", align 4
  %9 = alloca %"class.testing::Message", align 8
  %10 = alloca %"class.testing::internal::AssertHelper", align 8
  %11 = alloca %"class.testing::internal::String", align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = tail call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %14 = tail call i32 @_ZNK4pica4GridILNS_9DimensionE1EdE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(232) %13)
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %45, %1
  ret void

.lr.ph:                                           ; preds = %1, %45
  %.0913 = phi i32 [ %46, %45 ], [ 0, %1 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %16 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %17 = call double @_ZNK4pica4GridILNS_9DimensionE1EdE9getOriginEv(ptr noundef nonnull align 8 dereferenceable(232) %16)
  store double %17, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %18 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %19 = call double @_ZNK4pica4GridILNS_9DimensionE1EdE7getStepEv(ptr noundef nonnull align 8 dereferenceable(232) %18)
  store double %19, ptr %5, align 8
  %20 = uitofp nneg i32 %.0913 to double
  %21 = fadd double %20, 5.000000e-01
  %22 = call double @_ZN4picamlIdEEKNS_7Vector1IT_EERS4_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, double noundef %21)
  store double %22, ptr %4, align 8
  %23 = call double @_ZN4picaplIdEEKNS_7Vector1IT_EERS4_S5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  store double %23, ptr %2, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @_ZN4pica7Vector1IiEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %.0913)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %24 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %25 = call i32 @_ZN4pica4GridILNS_9DimensionE1EdE12getCellIndexERKNS_7Vector1IdEE(ptr noundef nonnull align 8 dereferenceable(232) %24, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store i32 %25, ptr %8, align 4
  %26 = call noundef zeroext i1 @_ZN4picaeqIiEEbRKNS_7Vector1IT_EES5_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZN7testing15AssertionResultC2Eb(ptr noundef nonnull align 8 dereferenceable(16) %6, i1 noundef zeroext %26)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %27 = call noundef zeroext i1 @_ZNK7testing15AssertionResultcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  br i1 %27, label %45, label %28

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

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  invoke void @_ZN7testing8internal30GetBoolAssertionFailureMessageERKNS_15AssertionResultEPKcS5_S5_(ptr dead_on_unwind nonnull writable sret(%"class.testing::internal::String") align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6)
          to label %30 unwind label %36

30:                                               ; preds = %29
  %31 = call noundef ptr @_ZNK7testing8internal6String5c_strEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  invoke void @_ZN7testing8internal12AssertHelperC1ENS_14TestPartResult4TypeEPKciS5_(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 1, ptr noundef nonnull @.str.3, i32 noundef 46, ptr noundef %31)
          to label %32 unwind label %38

32:                                               ; preds = %30
  invoke void @_ZNK7testing8internal12AssertHelperaSERKNS_7MessageE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %33 unwind label %40

33:                                               ; preds = %32
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %45

34:                                               ; preds = %28
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %44

36:                                               ; preds = %29
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %43

38:                                               ; preds = %30
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %42

40:                                               ; preds = %32
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7testing8internal12AssertHelperD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %42

42:                                               ; preds = %40, %38
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %39, %38 ]
  call void @_ZN7testing8internal6StringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  br label %43

43:                                               ; preds = %42, %36
  %.pn.pn = phi { ptr, i32 } [ %.pn, %42 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @_ZN7testing7MessageD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %44

44:                                               ; preds = %43, %34
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %43 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn.pn.pn

45:                                               ; preds = %.lr.ph, %33
  call void @_ZN7testing15AssertionResultD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %46 = add nuw nsw i32 %.0913, 1
  %47 = call noundef ptr @_ZNKSt8auto_ptrIN4pica7YeeGridILNS0_9DimensionE1EdEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %48 = call i32 @_ZNK4pica4GridILNS_9DimensionE1EdE7getSizeEv(ptr noundef nonnull align 8 dereferenceable(232) %47)
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local double @_ZN4picaplIdEEKNS_7Vector1IT_EERS4_S5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local double @_ZN4picamlIdEEKNS_7Vector1IT_EERS4_S2_(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @_ZN4pica4GridILNS_9DimensionE1EdE12getCellIndexERKNS_7Vector1IdEE(ptr noundef nonnull align 8 dereferenceable(232), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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 = { 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 = { "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 = { inlinehint 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 #7 = { 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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass