; LLVM IR from ImperialCollegeLondon/pnflow :: src/pnm/pnflow/ElementConstSolver.ll (ZNK4Elem17connectedToOutletERK5Fluid)

; 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.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl" }
%"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl" }
%"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl" = type { %"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%class.Elem = type { %class.Apex, [5 x %class.SlvrElm], i8, i32, ptr, double, double, i32, %"class.std::vector", ptr, double, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %"struct.std::pair", %"struct.std::pair", %"struct.std::pair", i32, i32, i32, i32, %class.var3 }
%class.Apex = type { ptr, i8, double, double, ptr, i32, double, double, double, double, i8, i8, i8, i8, %"struct.std::pair" }
%class.SlvrElm = type { i8, i8, i8, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Elem *, std::allocator<Elem *>>::_Vector_impl" }
%"struct.std::_Vector_base<Elem *, std::allocator<Elem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Elem *, std::allocator<Elem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Elem *, std::allocator<Elem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, double }
%class.var3 = type { double, double, double }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK9ElemModel11conductsAnyERK5Fluid(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408), i16 noundef zeroext) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4Elem17connectedToOutletERK5Fluid(ptr noundef nonnull align 8 dereferenceable(408) %0, ptr noundef nonnull align 8 dereferenceable(80) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::vector.31", align 8
  %11 = alloca %"class.std::stack", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = getelementptr inbounds %class.Elem, ptr %16, i32 0, i32 9
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK9ElemModel11conductsAnyERK5Fluid(ptr noundef nonnull align 8 dereferenceable(152) %18, ptr noundef nonnull align 8 dereferenceable(80) %19)
  br i1 %20, label %24, label %21

21:                                               ; preds = %2
  %22 = call noundef zeroext i1 @_ZNK4Elem16isEntryOrExitResEv(ptr noundef nonnull align 8 dereferenceable(408) %16)
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  store i1 false, ptr %3, align 1
  br label %169

24:                                               ; preds = %21, %2
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = call noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
  %27 = call noundef zeroext i16 @_Zan6fluidfS_(i16 noundef zeroext %26, i16 noundef zeroext 1)
  %28 = icmp ne i16 %27, 0
  br i1 %28, label %29, label %53

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !21
  br label %30

30:                                               ; preds = %47, %29
  %31 = load i32, ptr %6, align 4, !tbaa !21
  %32 = getelementptr inbounds %class.Elem, ptr %16, i32 0, i32 7
  %33 = load i32, ptr %32, align 8, !tbaa !22
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %30
  store i32 2, ptr %7, align 4
  br label %50

36:                                               ; preds = %30
  %37 = getelementptr inbounds %class.Elem, ptr %16, i32 0, i32 8
  %38 = load i32, ptr %6, align 4, !tbaa !21
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIP4ElemSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %39) #5
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = call noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80) %42)
  %44 = call noundef zeroext i1 @_ZNK4Elem22markWaterElemForSolverEPKS_6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %16, ptr noundef %41, i16 noundef zeroext %43)
  br i1 %44, label %45, label %46

45:                                               ; preds = %36
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %50

46:                                               ; preds = %36
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %6, align 4, !tbaa !21
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !21
  br label %30, !llvm.loop !23

50:                                               ; preds = %45, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %51 = load i32, ptr %7, align 4
  switch i32 %51, label %176 [
    i32 2, label %52
    i32 1, label %169
  ]

52:                                               ; preds = %50
  br label %168

53:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !21
  br label %54

54:                                               ; preds = %159, %53
  %55 = load i32, ptr %8, align 4, !tbaa !21
  %56 = getelementptr inbounds %class.Elem, ptr %16, i32 0, i32 7
  %57 = load i32, ptr %56, align 8, !tbaa !22
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  store i32 5, ptr %7, align 4
  br label %165

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %61 = getelementptr inbounds %class.Elem, ptr %16, i32 0, i32 8
  %62 = load i32, ptr %8, align 4, !tbaa !21
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIP4ElemSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %63) #5
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  store ptr %65, ptr %9, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = call noundef ptr @_ZNK4Elem5modelEv(ptr noundef nonnull align 8 dereferenceable(408) %66)
  %68 = call noundef zeroext i1 @_ZNK9ElemModel14conductsAnyOilEv(ptr noundef nonnull align 8 dereferenceable(152) %67)
  br i1 %68, label %72, label %69

69:                                               ; preds = %60
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZNK4Elem22connectedToEntryOrExitEv(ptr noundef nonnull align 8 dereferenceable(408) %70)
  br i1 %71, label %72, label %79

72:                                               ; preds = %69, %60
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %73, i16 noundef zeroext 2)
  %75 = call noundef zeroext i1 @_ZNK7SlvrElm10isSearchedEv(ptr noundef nonnull align 8 dereferenceable(24) %74)
  br i1 %75, label %79, label %76

76:                                               ; preds = %72
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = call noundef zeroext i1 @_ZNK4Elem17isInsideSolverBoxEv(ptr noundef nonnull align 8 dereferenceable(408) %77)
  br i1 %78, label %80, label %79

79:                                               ; preds = %76, %72, %69
  store i32 7, ptr %7, align 4
  br label %156

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #5
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %81 unwind label %104

81:                                               ; preds = %80
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %82 unwind label %108

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  store i8 0, ptr %14, align 1, !tbaa !25
  br label %83

83:                                               ; preds = %128, %82
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %129

86:                                               ; preds = %83
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %87, i16 noundef zeroext 2)
          to label %89 unwind label %112

89:                                               ; preds = %86
  invoke void @_ZNK7SlvrElm11setAllFlagsEv(ptr noundef nonnull align 8 dereferenceable(24) %88)
          to label %90 unwind label %112

90:                                               ; preds = %89
  invoke void @_ZNSt6vectorIPK4ElemSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %91 unwind label %112

91:                                               ; preds = %90
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = invoke noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408) %92, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %94 unwind label %112

94:                                               ; preds = %91
  store ptr %93, ptr %9, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %122, %94
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  %98 = xor i1 %97, true
  br i1 %98, label %99, label %123

99:                                               ; preds = %95
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %100 unwind label %112

100:                                              ; preds = %99
  %101 = invoke noundef zeroext i1 @_ZNKSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %102 unwind label %112

102:                                              ; preds = %100
  br i1 %101, label %103, label %116

103:                                              ; preds = %102
  br label %123

104:                                              ; preds = %80
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %12, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %13, align 4
  br label %164

108:                                              ; preds = %81
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %12, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %13, align 4
  br label %163

112:                                              ; preds = %126, %118, %116, %100, %99, %91, %90, %89, %86
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %12, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %13, align 4
  br label %162

116:                                              ; preds = %102
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %118 unwind label %112

118:                                              ; preds = %116
  %119 = load ptr, ptr %117, align 8, !tbaa !5
  store ptr %119, ptr %9, align 8, !tbaa !5
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = invoke noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408) %120, ptr noundef nonnull align 1 dereferenceable(1) %14)
          to label %122 unwind label %112

122:                                              ; preds = %118
  store ptr %121, ptr %9, align 8, !tbaa !5
  br label %95, !llvm.loop !26

123:                                              ; preds = %103, %95
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %128

126:                                              ; preds = %123
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %127 unwind label %112

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127, %123
  br label %83, !llvm.loop !27

129:                                              ; preds = %83
  %130 = load i8, ptr %14, align 1, !tbaa !25, !range !28, !noundef !29
  %131 = trunc i8 %130 to i1
  br i1 %131, label %153, label %132

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !30
  br label %133

133:                                              ; preds = %145, %132
  %134 = load i64, ptr %15, align 8, !tbaa !30
  %135 = call noundef i64 @_ZNKSt6vectorIPK4ElemSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  %136 = icmp ult i64 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 12, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %152

138:                                              ; preds = %133
  %139 = load i64, ptr %15, align 8, !tbaa !30
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPK4ElemSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %139) #5
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  %142 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %141, i16 noundef zeroext 2)
          to label %143 unwind label %148

143:                                              ; preds = %138
  invoke void @_ZNK7SlvrElm9clearFlagEv(ptr noundef nonnull align 8 dereferenceable(24) %142)
          to label %144 unwind label %148

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  %146 = load i64, ptr %15, align 8, !tbaa !30
  %147 = add i64 %146, 1
  store i64 %147, ptr %15, align 8, !tbaa !30
  br label %133, !llvm.loop !32

148:                                              ; preds = %143, %138
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %12, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %162

152:                                              ; preds = %137
  br label %154

153:                                              ; preds = %129
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %155

154:                                              ; preds = %152
  store i32 0, ptr %7, align 4
  br label %155

155:                                              ; preds = %154, %153
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  br label %156

156:                                              ; preds = %155, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %157 = load i32, ptr %7, align 4
  switch i32 %157, label %165 [
    i32 0, label %158
    i32 7, label %159
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158, %156
  %160 = load i32, ptr %8, align 4, !tbaa !21
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %8, align 4, !tbaa !21
  br label %54, !llvm.loop !33

162:                                              ; preds = %148, %112
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  br label %163

163:                                              ; preds = %162, %108
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #5
  br label %164

164:                                              ; preds = %163, %104
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %171

165:                                              ; preds = %156, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %166 = load i32, ptr %7, align 4
  switch i32 %166, label %176 [
    i32 5, label %167
    i32 1, label %169
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %52
  store i1 false, ptr %3, align 1
  br label %169

169:                                              ; preds = %168, %165, %50, %23
  %170 = load i1, ptr %3, align 1
  ret i1 %170

171:                                              ; preds = %164
  %172 = load ptr, ptr %12, align 8
  %173 = load i32, ptr %13, align 4
  %174 = insertvalue { ptr, i32 } poison, ptr %172, 0
  %175 = insertvalue { ptr, i32 } %174, i32 %173, 1
  resume { ptr, i32 } %175

176:                                              ; preds = %165, %50
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_Zan6fluidfS_(i16 noundef zeroext, i16 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem22markWaterElemForSolverEPKS_6fluidf(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef, i16 noundef zeroext) #2 align 2

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK7SlvrElm11setAllFlagsEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK7SlvrElm9clearFlagEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 = { 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 #4 = { 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 #5 = { 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, !6, i64 288}
!10 = !{!"_ZTS4Elem", !11, i64 0, !7, i64 104, !12, i64 224, !14, i64 228, !6, i64 232, !13, i64 240, !13, i64 248, !14, i64 256, !16, i64 264, !6, i64 288, !13, i64 296, !12, i64 304, !12, i64 305, !12, i64 306, !12, i64 307, !12, i64 308, !12, i64 309, !12, i64 310, !12, i64 311, !12, i64 312, !12, i64 313, !15, i64 320, !15, i64 336, !15, i64 352, !14, i64 368, !14, i64 372, !14, i64 376, !14, i64 380, !20, i64 384}
!11 = !{!"_ZTS4Apex", !12, i64 8, !13, i64 16, !13, i64 24, !6, i64 32, !14, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !12, i64 80, !12, i64 81, !12, i64 82, !12, i64 83, !15, i64 88}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSSt4pairIidE", !14, i64 0, !13, i64 8}
!16 = !{!"_ZTSSt6vectorIP4ElemSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIP4ElemSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP4ElemSaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP4ElemSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTS4var3IdE", !13, i64 0, !13, i64 8, !13, i64 16}
!21 = !{!14, !14, i64 0}
!22 = !{!10, !14, i64 256}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!12, !12, i64 0}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!31, !31, i64 0}
!31 = !{!"long", !7, i64 0}
!32 = distinct !{!32, !24}
!33 = distinct !{!33, !24}


; 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.std::vector.31" = type { %"struct.std::_Vector_base.32" }
%"struct.std::_Vector_base.32" = type { %"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl" }
%"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const Elem *, std::allocator<const Elem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl" }
%"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl" = type { %"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<const Elem *, std::allocator<const Elem *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK4Elem5modelEv(ptr noundef nonnull align 8 dereferenceable(408)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK9ElemModel11conductsAnyERK5Fluid(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408), i16 noundef zeroext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4Elem17connectedToOutletERK5Fluid(ptr noundef nonnull align 8 dereferenceable(408) %0, ptr noundef nonnull align 8 dereferenceable(80) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::vector.31", align 8
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca i8, align 1
  %7 = getelementptr inbounds i8, ptr %0, i64 288
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call noundef zeroext i1 @_ZNK9ElemModel11conductsAnyERK5Fluid(ptr noundef nonnull align 8 dereferenceable(152) %8, ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %9, label %12, label %10

10:                                               ; preds = %2
  %11 = tail call noundef zeroext i1 @_ZNK4Elem16isEntryOrExitResEv(ptr noundef nonnull align 8 dereferenceable(408) %0)
  br i1 %11, label %12, label %.thread

12:                                               ; preds = %10, %2
  %13 = tail call noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %14 = tail call noundef zeroext i16 @_Zan6fluidfS_(i16 noundef zeroext %13, i16 noundef zeroext 1)
  %.not = icmp eq i16 %14, 0
  %15 = getelementptr inbounds i8, ptr %0, i64 256
  %16 = load i32, ptr %15, align 8, !tbaa !20
  %17 = icmp sgt i32 %16, 0
  br i1 %.not, label %.preheader51, label %.preheader52

.preheader52:                                     ; preds = %12
  br i1 %17, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader52
  %18 = getelementptr inbounds i8, ptr %0, i64 264
  br label %24

.preheader51:                                     ; preds = %12
  br i1 %17, label %.lr.ph63, label %.thread

.lr.ph63:                                         ; preds = %.preheader51
  %19 = getelementptr inbounds i8, ptr %0, i64 264
  br label %29

20:                                               ; preds = %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr %15, align 8, !tbaa !20
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %24, label %.thread, !llvm.loop !21

24:                                               ; preds = %.lr.ph, %20
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %20 ]
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIP4ElemSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %indvars.iv) #5
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = tail call noundef zeroext i16 @_ZNK5Fluid2ffEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %28 = tail call noundef zeroext i1 @_ZNK4Elem22markWaterElemForSolverEPKS_6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %0, ptr noundef %26, i16 noundef zeroext %27)
  br i1 %28, label %.thread, label %20

29:                                               ; preds = %.lr.ph63, %74
  %indvars.iv67 = phi i64 [ 0, %.lr.ph63 ], [ %indvars.iv.next68, %74 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIP4ElemSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %indvars.iv67) #5
  %31 = load ptr, ptr %30, align 8, !tbaa !23
  store ptr %31, ptr %3, align 8, !tbaa !23
  %32 = call noundef ptr @_ZNK4Elem5modelEv(ptr noundef nonnull align 8 dereferenceable(408) %31)
  %33 = call noundef zeroext i1 @_ZNK9ElemModel14conductsAnyOilEv(ptr noundef nonnull align 8 dereferenceable(152) %32)
  br i1 %33, label %37, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr %3, align 8, !tbaa !23
  %36 = call noundef zeroext i1 @_ZNK4Elem22connectedToEntryOrExitEv(ptr noundef nonnull align 8 dereferenceable(408) %35)
  br i1 %36, label %37, label %.thread42

37:                                               ; preds = %34, %29
  %38 = load ptr, ptr %3, align 8, !tbaa !23
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %38, i16 noundef zeroext 2)
  %40 = call noundef zeroext i1 @_ZNK7SlvrElm10isSearchedEv(ptr noundef nonnull align 8 dereferenceable(24) %39)
  br i1 %40, label %.thread42, label %41

41:                                               ; preds = %37
  %42 = load ptr, ptr %3, align 8, !tbaa !23
  %43 = call noundef zeroext i1 @_ZNK4Elem17isInsideSolverBoxEv(ptr noundef nonnull align 8 dereferenceable(408) %42)
  br i1 %43, label %44, label %.thread42

44:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #5
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %45 unwind label %55

45:                                               ; preds = %44
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %46 unwind label %57

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  store i8 0, ptr %6, align 1, !tbaa !24
  %47 = load ptr, ptr %3, align 8, !tbaa !23
  %.not3057 = icmp eq ptr %47, null
  br i1 %.not3057, label %.preheader50, label %.lr.ph58

.lr.ph58:                                         ; preds = %46, %65
  %48 = phi ptr [ %.pre, %65 ], [ %47, %46 ]
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %48, i16 noundef zeroext 2)
  call void @_ZNK7SlvrElm11setAllFlagsEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
  invoke void @_ZNSt6vectorIPK4ElemSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %50 unwind label %.loopexit.split-lp

50:                                               ; preds = %.lr.ph58
  %51 = load ptr, ptr %3, align 8, !tbaa !23
  %52 = invoke noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408) %51, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %50, %60
  %storemerge = phi ptr [ %63, %60 ], [ %52, %50 ]
  store ptr %storemerge, ptr %3, align 8, !tbaa !23
  %.not31 = icmp eq ptr %storemerge, null
  br i1 %.not31, label %53, label %.thread40

53:                                               ; preds = %.preheader
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %54 = call noundef zeroext i1 @_ZNKSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %54, label %64, label %60

55:                                               ; preds = %44
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %79

57:                                               ; preds = %45
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %78

.loopexit:                                        ; preds = %60
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %59

.loopexit.split-lp:                               ; preds = %.lr.ph58, %50, %.thread40
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %59

59:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  br label %78

60:                                               ; preds = %53
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  store ptr %62, ptr %3, align 8, !tbaa !23
  %63 = invoke noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408) %62, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %.preheader unwind label %.loopexit, !llvm.loop !25

64:                                               ; preds = %53
  %.pr = load ptr, ptr %3, align 8, !tbaa !23
  %.not32 = icmp eq ptr %.pr, null
  br i1 %.not32, label %._crit_edge, label %.thread40

.thread40:                                        ; preds = %.preheader, %64
  invoke void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %65 unwind label %.loopexit.split-lp

65:                                               ; preds = %.thread40
  %.pre = load ptr, ptr %3, align 8, !tbaa !23
  %.not30 = icmp eq ptr %.pre, null
  br i1 %.not30, label %._crit_edge, label %.lr.ph58, !llvm.loop !26

._crit_edge:                                      ; preds = %64, %65
  %.pre70 = load i8, ptr %6, align 1, !tbaa !24, !range !27
  %66 = trunc nuw i8 %.pre70 to i1
  br i1 %66, label %80, label %.preheader50

.preheader50:                                     ; preds = %46, %._crit_edge
  %67 = call noundef i64 @_ZNKSt6vectorIPK4ElemSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %.not64 = icmp eq i64 %67, 0
  br i1 %.not64, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader50, %.lr.ph60
  %.059 = phi i64 [ %71, %.lr.ph60 ], [ 0, %.preheader50 ]
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPK4ElemSaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.059) #5
  %69 = load ptr, ptr %68, align 8, !tbaa !23
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK4Elem8slvrCnctE6fluidf(ptr noundef nonnull align 8 dereferenceable(408) %69, i16 noundef zeroext 2)
  call void @_ZNK7SlvrElm9clearFlagEv(ptr noundef nonnull align 8 dereferenceable(24) %70)
  %71 = add nuw i64 %.059, 1
  %72 = call noundef i64 @_ZNKSt6vectorIPK4ElemSaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  %73 = icmp ult i64 %71, %72
  br i1 %73, label %.lr.ph60, label %._crit_edge61, !llvm.loop !28

.thread42:                                        ; preds = %41, %37, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %74

._crit_edge61:                                    ; preds = %.lr.ph60, %.preheader50
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %74

74:                                               ; preds = %._crit_edge61, %.thread42
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %75 = load i32, ptr %15, align 8, !tbaa !20
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next68, %76
  br i1 %77, label %29, label %.thread, !llvm.loop !29

78:                                               ; preds = %59, %57
  %.pn = phi { ptr, i32 } [ %lpad.phi, %59 ], [ %58, %57 ]
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  br label %79

79:                                               ; preds = %78, %55
  %.pn.pn = phi { ptr, i32 } [ %.pn, %78 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn.pn

80:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %.thread

.thread:                                          ; preds = %20, %24, %74, %.preheader52, %.preheader51, %80, %10
  %.5 = phi i1 [ true, %80 ], [ false, %10 ], [ false, %.preheader51 ], [ false, %.preheader52 ], [ false, %74 ], [ %28, %24 ], [ %28, %20 ]
  ret i1 %.5
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_Zan6fluidfS_(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4Elem22markWaterElemForSolverEPKS_6fluidf(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef, i16 noundef zeroext) local_unnamed_addr #2 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK7SlvrElm11setAllFlagsEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPK4ElemSaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK4Elem16nextSuccSolvrOilERb(ptr noundef nonnull align 8 dereferenceable(408), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIPK4ElemSt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK7SlvrElm9clearFlagEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPK4ElemSaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 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 = { 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 #4 = { 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 #5 = { 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, !12, i64 288}
!6 = !{!"_ZTS4Elem", !7, i64 0, !9, i64 104, !8, i64 224, !13, i64 228, !12, i64 232, !11, i64 240, !11, i64 248, !13, i64 256, !15, i64 264, !12, i64 288, !11, i64 296, !8, i64 304, !8, i64 305, !8, i64 306, !8, i64 307, !8, i64 308, !8, i64 309, !8, i64 310, !8, i64 311, !8, i64 312, !8, i64 313, !14, i64 320, !14, i64 336, !14, i64 352, !13, i64 368, !13, i64 372, !13, i64 376, !13, i64 380, !19, i64 384}
!7 = !{!"_ZTS4Apex", !8, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !8, i64 80, !8, i64 81, !8, i64 82, !8, i64 83, !14, i64 88}
!8 = !{!"bool", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"_ZTSSt4pairIidE", !13, i64 0, !11, i64 8}
!15 = !{!"_ZTSSt6vectorIP4ElemSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP4ElemSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP4ElemSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP4ElemSaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!19 = !{!"_ZTS4var3IdE", !11, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!6, !13, i64 256}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !12, i64 0}
!24 = !{!8, !8, i64 0}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22}
!27 = !{i8 0, i8 2}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass