; LLVM IR from LukeMcCulloch/cfd_solvers_cpp :: src/EulerShockTube1D.ll (ZN13EulerSolver1D6Solver6outputEv)

; 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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"struct.std::_Setprecision" = type { i32 }
%"class.EulerSolver1D::Solver" = type { float, float, float, float, float, float, float, float, float, float, float, i32, i32, i32, i32, i32, i32, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D, ptr }
%class.Array2D = type { i32, i32, i32, i32, i32, i32, i8, i8, ptr }
%"struct.EulerSolver1D::cell_data" = type { float, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D }

@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 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 noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13EulerSolver1D6Solver6outputEv(ptr noundef nonnull align 8 dereferenceable(280) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca %"class.std::basic_ofstream", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Setprecision", align 4
  %9 = alloca %"struct.std::_Setprecision", align 4
  %10 = alloca %"struct.std::_Setprecision", align 4
  %11 = alloca %"struct.std::_Setprecision", align 4
  %12 = alloca %"struct.std::_Setprecision", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 512, ptr %4) #5
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(248) %4)
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %4, ptr noundef @.str.6, i32 noundef 16)
          to label %14 unwind label %22

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %149, %14
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 11
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = add nsw i32 %18, 1
  %20 = icmp slt i32 %16, %19
  br i1 %20, label %26, label %21

21:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %156

22:                                               ; preds = %156, %1
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %5, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %6, align 4
  br label %158

26:                                               ; preds = %15
  %27 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %28, i64 %30
  %32 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %31, i32 0, i32 3
  %33 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %32, i32 noundef 2)
          to label %34 unwind label %152

34:                                               ; preds = %26
  %35 = load float, ptr %33, align 4, !tbaa !17
  %36 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %37, i64 %39
  %41 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %40, i32 0, i32 3
  %42 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %41, i32 noundef 0)
          to label %43 unwind label %152

43:                                               ; preds = %34
  %44 = load float, ptr %42, align 4, !tbaa !17
  %45 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 3
  %46 = load float, ptr %45, align 4, !tbaa !18
  %47 = fneg float %46
  %48 = invoke noundef float @_ZSt3powff(float noundef %44, float noundef %47)
          to label %49 unwind label %152

49:                                               ; preds = %43
  %50 = fmul float %35, %48
  %51 = invoke noundef float @_ZSt3logf(float noundef %50)
          to label %52 unwind label %152

52:                                               ; preds = %49
  %53 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 3
  %54 = load float, ptr %53, align 4, !tbaa !18
  %55 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 1
  %56 = load float, ptr %55, align 4, !tbaa !19
  %57 = fsub float %54, %56
  %58 = fdiv float %51, %57
  store float %58, ptr %3, align 4, !tbaa !17
  %59 = invoke i32 @_ZSt12setprecisioni(i32 noundef 16)
          to label %60 unwind label %152

60:                                               ; preds = %52
  %61 = getelementptr inbounds %"struct.std::_Setprecision", ptr %8, i32 0, i32 0
  store i32 %59, ptr %61, align 4
  %62 = getelementptr inbounds %"struct.std::_Setprecision", ptr %8, i32 0, i32 0
  %63 = load i32, ptr %62, align 4
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 %63)
          to label %65 unwind label %152

65:                                               ; preds = %60
  %66 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %67, i64 %69
  %71 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %70, i32 0, i32 0
  %72 = load float, ptr %71, align 8, !tbaa !20
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %64, float noundef %72)
          to label %74 unwind label %152

74:                                               ; preds = %65
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %73, i8 noundef signext 9)
          to label %76 unwind label %152

76:                                               ; preds = %74
  %77 = invoke i32 @_ZSt12setprecisioni(i32 noundef 16)
          to label %78 unwind label %152

78:                                               ; preds = %76
  %79 = getelementptr inbounds %"struct.std::_Setprecision", ptr %9, i32 0, i32 0
  store i32 %77, ptr %79, align 4
  %80 = getelementptr inbounds %"struct.std::_Setprecision", ptr %9, i32 0, i32 0
  %81 = load i32, ptr %80, align 4
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 %81)
          to label %83 unwind label %152

83:                                               ; preds = %78
  %84 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = load i32, ptr %7, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %85, i64 %87
  %89 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %88, i32 0, i32 3
  %90 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %89, i32 noundef 0)
          to label %91 unwind label %152

91:                                               ; preds = %83
  %92 = load float, ptr %90, align 4, !tbaa !17
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %82, float noundef %92)
          to label %94 unwind label %152

94:                                               ; preds = %91
  %95 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %93, i8 noundef signext 9)
          to label %96 unwind label %152

96:                                               ; preds = %94
  %97 = invoke i32 @_ZSt12setprecisioni(i32 noundef 16)
          to label %98 unwind label %152

98:                                               ; preds = %96
  %99 = getelementptr inbounds %"struct.std::_Setprecision", ptr %10, i32 0, i32 0
  store i32 %97, ptr %99, align 4
  %100 = getelementptr inbounds %"struct.std::_Setprecision", ptr %10, i32 0, i32 0
  %101 = load i32, ptr %100, align 4
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %95, i32 %101)
          to label %103 unwind label %152

103:                                              ; preds = %98
  %104 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  %106 = load i32, ptr %7, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %105, i64 %107
  %109 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %108, i32 0, i32 3
  %110 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %109, i32 noundef 1)
          to label %111 unwind label %152

111:                                              ; preds = %103
  %112 = load float, ptr %110, align 4, !tbaa !17
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %102, float noundef %112)
          to label %114 unwind label %152

114:                                              ; preds = %111
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %113, i8 noundef signext 9)
          to label %116 unwind label %152

116:                                              ; preds = %114
  %117 = invoke i32 @_ZSt12setprecisioni(i32 noundef 16)
          to label %118 unwind label %152

118:                                              ; preds = %116
  %119 = getelementptr inbounds %"struct.std::_Setprecision", ptr %11, i32 0, i32 0
  store i32 %117, ptr %119, align 4
  %120 = getelementptr inbounds %"struct.std::_Setprecision", ptr %11, i32 0, i32 0
  %121 = load i32, ptr %120, align 4
  %122 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 %121)
          to label %123 unwind label %152

123:                                              ; preds = %118
  %124 = getelementptr inbounds %"class.EulerSolver1D::Solver", ptr %13, i32 0, i32 22
  %125 = load ptr, ptr %124, align 8, !tbaa !16
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %125, i64 %127
  %129 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %128, i32 0, i32 3
  %130 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %129, i32 noundef 2)
          to label %131 unwind label %152

131:                                              ; preds = %123
  %132 = load float, ptr %130, align 4, !tbaa !17
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %122, float noundef %132)
          to label %134 unwind label %152

134:                                              ; preds = %131
  %135 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %133, i8 noundef signext 9)
          to label %136 unwind label %152

136:                                              ; preds = %134
  %137 = invoke i32 @_ZSt12setprecisioni(i32 noundef 16)
          to label %138 unwind label %152

138:                                              ; preds = %136
  %139 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  store i32 %137, ptr %139, align 4
  %140 = getelementptr inbounds %"struct.std::_Setprecision", ptr %12, i32 0, i32 0
  %141 = load i32, ptr %140, align 4
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %135, i32 %141)
          to label %143 unwind label %152

143:                                              ; preds = %138
  %144 = load float, ptr %3, align 4, !tbaa !17
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %142, float noundef %144)
          to label %146 unwind label %152

146:                                              ; preds = %143
  %147 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str.4)
          to label %148 unwind label %152

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %7, align 4, !tbaa !9
  br label %15, !llvm.loop !22

152:                                              ; preds = %146, %143, %138, %136, %134, %131, %123, %118, %116, %114, %111, %103, %98, %96, %94, %91, %83, %78, %76, %74, %65, %60, %52, %49, %43, %34, %26
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %5, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %158

156:                                              ; preds = %21
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %4)
          to label %157 unwind label %22

157:                                              ; preds = %156
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %4) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void

158:                                              ; preds = %152, %22
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %4) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %5, align 8
  %161 = load i32, ptr %6, align 4
  %162 = insertvalue { ptr, i32 } poison, ptr %160, 0
  %163 = insertvalue { ptr, i32 } %162, i32 %161, 1
  resume { ptr, i32 } %163
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3logf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8), float noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #4 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 44}
!12 = !{!"_ZTSN13EulerSolver1D6SolverE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !14, i64 72, !14, i64 112, !14, i64 152, !14, i64 192, !14, i64 232, !6, i64 272}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS7Array2DIfE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !15, i64 24, !15, i64 25, !6, i64 32}
!15 = !{!"bool", !7, i64 0}
!16 = !{!12, !6, i64 272}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !13, i64 12}
!19 = !{!12, !13, i64 4}
!20 = !{!21, !13, i64 0}
!21 = !{!"_ZTSN13EulerSolver1D9cell_dataE", !13, i64 0, !14, i64 8, !14, i64 48, !14, i64 88, !14, i64 128, !14, i64 168}
!22 = distinct !{!22, !23}
!23 = !{!"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.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"struct.EulerSolver1D::cell_data" = type { float, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D, %class.Array2D }
%class.Array2D = type { i32, i32, i32, i32, i32, i32, i8, i8, ptr }

@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 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 noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13EulerSolver1D6Solver6outputEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(280) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::basic_ofstream", align 8
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #5
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2)
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.6, i32 noundef 16)
          to label %.preheader unwind label %8

.preheader:                                       ; preds = %1
  %3 = getelementptr inbounds i8, ptr %0, i64 44
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %.not18 = icmp slt i32 %4, 1
  br i1 %.not18, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %5 = getelementptr inbounds i8, ptr %0, i64 272
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  br label %10

._crit_edge:                                      ; preds = %82, %.preheader
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248) %2)
          to label %87 unwind label %8

8:                                                ; preds = %._crit_edge, %1
  %9 = landingpad { ptr, i32 }
          cleanup
  br label %88

10:                                               ; preds = %.lr.ph, %82
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %82 ]
  %11 = load ptr, ptr %5, align 8, !tbaa !14
  %12 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %11, i64 %indvars.iv, i32 3
  %13 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %12, i32 noundef 2)
          to label %14 unwind label %85

14:                                               ; preds = %10
  %15 = load float, ptr %13, align 4, !tbaa !15
  %16 = load ptr, ptr %5, align 8, !tbaa !14
  %17 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %16, i64 %indvars.iv, i32 3
  %18 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %17, i32 noundef 0)
          to label %19 unwind label %85

19:                                               ; preds = %14
  %20 = load float, ptr %18, align 4, !tbaa !15
  %21 = load float, ptr %6, align 4, !tbaa !16
  %22 = fneg float %21
  %23 = call noundef float @_ZSt3powff(float noundef %20, float noundef %22)
  %24 = fmul float %15, %23
  %25 = call noundef float @_ZSt3logf(float noundef %24)
  %26 = load float, ptr %6, align 4, !tbaa !16
  %27 = load float, ptr %7, align 4, !tbaa !17
  %28 = fsub float %26, %27
  %29 = fdiv float %25, %28
  %30 = call i32 @_ZSt12setprecisioni(i32 noundef 16)
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %2, i32 %30)
          to label %32 unwind label %85

32:                                               ; preds = %19
  %33 = load ptr, ptr %5, align 8, !tbaa !14
  %34 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %33, i64 %indvars.iv
  %35 = load float, ptr %34, align 8, !tbaa !18
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %31, float noundef %35)
          to label %37 unwind label %85

37:                                               ; preds = %32
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %36, i8 noundef signext 9)
          to label %39 unwind label %85

39:                                               ; preds = %37
  %40 = call i32 @_ZSt12setprecisioni(i32 noundef 16)
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %38, i32 %40)
          to label %42 unwind label %85

42:                                               ; preds = %39
  %43 = load ptr, ptr %5, align 8, !tbaa !14
  %44 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %43, i64 %indvars.iv, i32 3
  %45 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %44, i32 noundef 0)
          to label %46 unwind label %85

46:                                               ; preds = %42
  %47 = load float, ptr %45, align 4, !tbaa !15
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %41, float noundef %47)
          to label %49 unwind label %85

49:                                               ; preds = %46
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %48, i8 noundef signext 9)
          to label %51 unwind label %85

51:                                               ; preds = %49
  %52 = call i32 @_ZSt12setprecisioni(i32 noundef 16)
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %50, i32 %52)
          to label %54 unwind label %85

54:                                               ; preds = %51
  %55 = load ptr, ptr %5, align 8, !tbaa !14
  %56 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %55, i64 %indvars.iv, i32 3
  %57 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %56, i32 noundef 1)
          to label %58 unwind label %85

58:                                               ; preds = %54
  %59 = load float, ptr %57, align 4, !tbaa !15
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %53, float noundef %59)
          to label %61 unwind label %85

61:                                               ; preds = %58
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %60, i8 noundef signext 9)
          to label %63 unwind label %85

63:                                               ; preds = %61
  %64 = call i32 @_ZSt12setprecisioni(i32 noundef 16)
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %62, i32 %64)
          to label %66 unwind label %85

66:                                               ; preds = %63
  %67 = load ptr, ptr %5, align 8, !tbaa !14
  %68 = getelementptr inbounds %"struct.EulerSolver1D::cell_data", ptr %67, i64 %indvars.iv, i32 3
  %69 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Array2DIfEclEi(ptr noundef nonnull align 8 dereferenceable(40) %68, i32 noundef 2)
          to label %70 unwind label %85

70:                                               ; preds = %66
  %71 = load float, ptr %69, align 4, !tbaa !15
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %65, float noundef %71)
          to label %73 unwind label %85

73:                                               ; preds = %70
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %72, i8 noundef signext 9)
          to label %75 unwind label %85

75:                                               ; preds = %73
  %76 = call i32 @_ZSt12setprecisioni(i32 noundef 16)
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %74, i32 %76)
          to label %78 unwind label %85

78:                                               ; preds = %75
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) %77, float noundef %29)
          to label %80 unwind label %85

80:                                               ; preds = %78
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @.str.4)
          to label %82 unwind label %85

82:                                               ; preds = %80
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %.not.not = icmp slt i64 %indvars.iv, %84
  br i1 %.not.not, label %10, label %._crit_edge, !llvm.loop !20

85:                                               ; preds = %80, %78, %75, %73, %70, %66, %63, %61, %58, %54, %51, %49, %46, %42, %39, %37, %32, %19, %14, %10
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %88

87:                                               ; preds = %._crit_edge
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #5
  ret void

88:                                               ; preds = %85, %8
  %.pn = phi { ptr, i32 } [ %86, %85 ], [ %9, %8 ]
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3logf(float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3powff(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8), float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(248)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #4 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #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, !10, i64 44}
!6 = !{!"_ZTSN13EulerSolver1D6SolverE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !11, i64 72, !11, i64 112, !11, i64 152, !11, i64 192, !11, i64 232, !13, i64 272}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS7Array2DIfE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !12, i64 24, !12, i64 25, !13, i64 32}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !13, i64 272}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !7, i64 12}
!17 = !{!6, !7, i64 4}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ZTSN13EulerSolver1D9cell_dataE", !7, i64 0, !11, i64 8, !11, i64 48, !11, i64 88, !11, i64 128, !11, i64 168}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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