; LLVM IR from kylechampley/XrayPhysics :: src/xscatter.ll (ZN8xscatter7SmatrixEdi)

; 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.xscatter = type { %class.xsec, %"class.std::vector.3", double, double, double, double }
%class.xsec = type { [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector", [101 x i32], %"class.std::vector", %"class.std::vector", %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl" }
%"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl" = type { %"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float *, std::allocator<float *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl" }
%"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl" = type { %"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl_data" }
%"struct.std::_Vector_base<xscatter::IncoherentAndCoherentScatterFunctions_elem_s, std::allocator<xscatter::IncoherentAndCoherentScatterFunctions_elem_s>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s" = type { %"struct.xscatter::reaction_record_s", %"struct.xscatter::reaction_record_s", %"struct.xscatter::reaction_record_s", %"struct.xscatter::reaction_record_s" }
%"struct.xscatter::reaction_record_s" = type { %"struct.xscatter::header_s", %"class.std::vector.8" }
%"struct.xscatter::header_s" = type { i32, i32, i32, i32, double, %"class.std::__cxx11::basic_string", i32, i32, i32, i32, double }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<xscatter::data, std::allocator<xscatter::data>>::_Vector_impl" }
%"struct.std::_Vector_base<xscatter::data, std::allocator<xscatter::data>>::_Vector_impl" = type { %"struct.std::_Vector_base<xscatter::data, std::allocator<xscatter::data>>::_Vector_impl_data" }
%"struct.std::_Vector_base<xscatter::data, std::allocator<xscatter::data>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.xscatter::data" = type { 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: 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(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN8xscatter7SmatrixEdi(ptr noundef nonnull align 8 dereferenceable(2456) %0, double noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  %15 = load ptr, ptr %5, align 8
  %16 = load double, ptr %6, align 8, !tbaa !9
  %17 = fcmp olt double %16, 0.000000e+00
  br i1 %17, label %24, label %18

18:                                               ; preds = %3
  %19 = load i32, ptr %7, align 4, !tbaa !11
  %20 = icmp slt i32 %19, 1
  br i1 %20, label %24, label %21

21:                                               ; preds = %18
  %22 = load i32, ptr %7, align 4, !tbaa !11
  %23 = icmp sgt i32 %22, 100
  br i1 %23, label %24, label %25

24:                                               ; preds = %21, %18, %3
  store double 0.000000e+00, ptr %4, align 8
  br label %178

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %26 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %27 = load i32, ptr %7, align 4, !tbaa !11
  %28 = sub nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %29) #3
  %31 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %31, i32 0, i32 1
  %33 = call noundef i64 @_ZNKSt6vectorIN8xscatter4dataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #3
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %8, align 4, !tbaa !11
  %35 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %36 = load i32, ptr %7, align 4, !tbaa !11
  %37 = sub nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %38) #3
  %40 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %40, i32 0, i32 1
  %42 = load i32, ptr %8, align 4, !tbaa !11
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %44) #3
  %46 = getelementptr inbounds %"struct.xscatter::data", ptr %45, i32 0, i32 0
  %47 = load double, ptr %46, align 8, !tbaa !13
  %48 = load double, ptr %6, align 8, !tbaa !9
  %49 = fcmp ole double %47, %48
  br i1 %49, label %50, label %64

50:                                               ; preds = %25
  %51 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %52 = load i32, ptr %7, align 4, !tbaa !11
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %54) #3
  %56 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %56, i32 0, i32 1
  %58 = load i32, ptr %8, align 4, !tbaa !11
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %60) #3
  %62 = getelementptr inbounds %"struct.xscatter::data", ptr %61, i32 0, i32 1
  %63 = load double, ptr %62, align 8, !tbaa !15
  store double %63, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %177

64:                                               ; preds = %25
  %65 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %66 = load i32, ptr %7, align 4, !tbaa !11
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %68) #3
  %70 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %70, i32 0, i32 1
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef 0) #3
  %73 = getelementptr inbounds %"struct.xscatter::data", ptr %72, i32 0, i32 0
  %74 = load double, ptr %73, align 8, !tbaa !13
  %75 = load double, ptr %6, align 8, !tbaa !9
  %76 = fcmp ogt double %74, %75
  br i1 %76, label %77, label %88

77:                                               ; preds = %64
  %78 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %79 = load i32, ptr %7, align 4, !tbaa !11
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %81) #3
  %83 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %83, i32 0, i32 1
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef 0) #3
  %86 = getelementptr inbounds %"struct.xscatter::data", ptr %85, i32 0, i32 1
  %87 = load double, ptr %86, align 8, !tbaa !15
  store double %87, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %177

88:                                               ; preds = %64
  br label %89

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !11
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %111, %89
  %91 = load i32, ptr %10, align 4, !tbaa !11
  %92 = load i32, ptr %8, align 4, !tbaa !11
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %114

94:                                               ; preds = %90
  %95 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %96 = load i32, ptr %7, align 4, !tbaa !11
  %97 = sub nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %98) #3
  %100 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %100, i32 0, i32 1
  %102 = load i32, ptr %10, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %103) #3
  %105 = getelementptr inbounds %"struct.xscatter::data", ptr %104, i32 0, i32 0
  %106 = load double, ptr %105, align 8, !tbaa !13
  %107 = load double, ptr %6, align 8, !tbaa !9
  %108 = fcmp ogt double %106, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %94
  br label %114

110:                                              ; preds = %94
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %10, align 4, !tbaa !11
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %10, align 4, !tbaa !11
  br label %90, !llvm.loop !16

114:                                              ; preds = %109, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %115 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %116 = load i32, ptr %7, align 4, !tbaa !11
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %118) #3
  %120 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %120, i32 0, i32 1
  %122 = load i32, ptr %10, align 4, !tbaa !11
  %123 = sub nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %124) #3
  %126 = getelementptr inbounds %"struct.xscatter::data", ptr %125, i32 0, i32 0
  %127 = load double, ptr %126, align 8, !tbaa !13
  store double %127, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %128 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %129 = load i32, ptr %7, align 4, !tbaa !11
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %131) #3
  %133 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %133, i32 0, i32 1
  %135 = load i32, ptr %10, align 4, !tbaa !11
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %136) #3
  %138 = getelementptr inbounds %"struct.xscatter::data", ptr %137, i32 0, i32 0
  %139 = load double, ptr %138, align 8, !tbaa !13
  store double %139, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %140 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %141 = load i32, ptr %7, align 4, !tbaa !11
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %140, i64 noundef %143) #3
  %145 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %145, i32 0, i32 1
  %147 = load i32, ptr %10, align 4, !tbaa !11
  %148 = sub nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %146, i64 noundef %149) #3
  %151 = getelementptr inbounds %"struct.xscatter::data", ptr %150, i32 0, i32 1
  %152 = load double, ptr %151, align 8, !tbaa !15
  store double %152, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %153 = getelementptr inbounds %class.xscatter, ptr %15, i32 0, i32 1
  %154 = load i32, ptr %7, align 4, !tbaa !11
  %155 = sub nsw i32 %154, 1
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %153, i64 noundef %156) #3
  %158 = getelementptr inbounds %"struct.xscatter::IncoherentAndCoherentScatterFunctions_elem_s", ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %"struct.xscatter::reaction_record_s", ptr %158, i32 0, i32 1
  %160 = load i32, ptr %10, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %159, i64 noundef %161) #3
  %163 = getelementptr inbounds %"struct.xscatter::data", ptr %162, i32 0, i32 1
  %164 = load double, ptr %163, align 8, !tbaa !15
  store double %164, ptr %14, align 8, !tbaa !9
  %165 = load double, ptr %14, align 8, !tbaa !9
  %166 = load double, ptr %13, align 8, !tbaa !9
  %167 = fsub double %165, %166
  %168 = load double, ptr %12, align 8, !tbaa !9
  %169 = load double, ptr %11, align 8, !tbaa !9
  %170 = fsub double %168, %169
  %171 = fdiv double %167, %170
  %172 = load double, ptr %6, align 8, !tbaa !9
  %173 = load double, ptr %11, align 8, !tbaa !9
  %174 = fsub double %172, %173
  %175 = load double, ptr %13, align 8, !tbaa !9
  %176 = call double @llvm.fmuladd.f64(double %171, double %174, double %175)
  store double %176, ptr %4, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %177

177:                                              ; preds = %114, %77, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %178

178:                                              ; preds = %177, %24
  %179 = load double, ptr %4, align 8
  ret double %179
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN8xscatter4dataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN8xscatter4dataE", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"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"

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN8xscatter7SmatrixEdi(ptr noundef nonnull align 8 dereferenceable(2456) %0, double noundef %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = fcmp olt double %1, 0.000000e+00
  %5 = add i32 %2, -101
  %6 = icmp ult i32 %5, -100
  %or.cond3 = or i1 %4, %6
  br i1 %or.cond3, label %72, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 2400
  %9 = add nsw i32 %2, -1
  %10 = zext nneg i32 %9 to i64
  %11 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %12 = getelementptr inbounds i8, ptr %11, i64 80
  %13 = tail call noundef i64 @_ZNKSt6vectorIN8xscatter4dataESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #2
  %14 = trunc i64 %13 to i32
  %15 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %16 = getelementptr inbounds i8, ptr %15, i64 80
  %17 = shl i64 %13, 32
  %sext = add i64 %17, -4294967296
  %18 = ashr exact i64 %sext, 32
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %18) #2
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = fcmp ugt double %20, %1
  %22 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %23 = getelementptr inbounds i8, ptr %22, i64 80
  br i1 %21, label %28, label %24

24:                                               ; preds = %7
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %18) #2
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load double, ptr %26, align 8, !tbaa !10
  br label %72

28:                                               ; preds = %7
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef 0) #2
  %30 = load double, ptr %29, align 8, !tbaa !5
  %31 = fcmp ogt double %30, %1
  br i1 %31, label %33, label %.preheader

.preheader:                                       ; preds = %28
  %32 = icmp sgt i32 %14, 0
  br i1 %32, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = and i64 %13, 2147483647
  br label %.lr.ph

33:                                               ; preds = %28
  %34 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %35 = getelementptr inbounds i8, ptr %34, i64 80
  %36 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef 0) #2
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load double, ptr %37, align 8, !tbaa !10
  br label %72

.lr.ph:                                           ; preds = %.lr.ph.preheader, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %44 ]
  %39 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %40 = getelementptr inbounds i8, ptr %39, i64 80
  %41 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %indvars.iv) #2
  %42 = load double, ptr %41, align 8, !tbaa !5
  %43 = fcmp ogt double %42, %1
  br i1 %43, label %._crit_edge.loopexit.split.loop.exit, label %44

44:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge.loopexit.split.loop.exit:             ; preds = %.lr.ph
  %45 = trunc nuw nsw i64 %indvars.iv to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %44, %._crit_edge.loopexit.split.loop.exit, %.preheader
  %.037.lcssa = phi i32 [ 0, %.preheader ], [ %45, %._crit_edge.loopexit.split.loop.exit ], [ %14, %44 ]
  %46 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %47 = getelementptr inbounds i8, ptr %46, i64 80
  %48 = add nsw i32 %.037.lcssa, -1
  %49 = sext i32 %48 to i64
  %50 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %49) #2
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %53 = getelementptr inbounds i8, ptr %52, i64 80
  %54 = zext nneg i32 %.037.lcssa to i64
  %55 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #2
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %58 = getelementptr inbounds i8, ptr %57, i64 80
  %59 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %49) #2
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load double, ptr %60, align 8, !tbaa !10
  %62 = tail call noundef nonnull align 8 dereferenceable(416) ptr @_ZNSt6vectorIN8xscatter44IncoherentAndCoherentScatterFunctions_elem_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10) #2
  %63 = getelementptr inbounds i8, ptr %62, i64 80
  %64 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN8xscatter4dataESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %54) #2
  %65 = getelementptr inbounds i8, ptr %64, i64 8
  %66 = load double, ptr %65, align 8, !tbaa !10
  %67 = fsub double %66, %61
  %68 = fsub double %56, %51
  %69 = fdiv double %67, %68
  %70 = fsub double %1, %51
  %71 = tail call double @llvm.fmuladd.f64(double %69, double %70, double %61)
  br label %72

72:                                               ; preds = %24, %33, %._crit_edge, %3
  %.1 = phi double [ 0.000000e+00, %3 ], [ %27, %24 ], [ %38, %33 ], [ %71, %._crit_edge ]
  ret double %.1
}

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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, !7, i64 0}
!6 = !{!"_ZTSN8xscatter4dataE", !7, i64 0, !7, i64 8}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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