; LLVM IR from CLASS-SZ/class_sz :: class-sz/hyrec (hydrogen)

; 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"

%struct.TWO_PHOTON_PARAMS = type { [311 x double], [311 x double], [311 x double], [311 x double], [311 x 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: nounwind
declare double @sqrt(double noundef) #1

; Function Attrs: nounwind
declare double @log(double noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @fplus_from_fminus(ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, double noundef, double noundef, i32 noundef, double noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @update_fminus_Saha(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, i32 noundef %8, double noundef %9, i32 noundef %10) #2 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca ptr, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca [311 x double], align 16
  %24 = alloca [2 x double], align 16
  %25 = alloca i32, align 4
  %26 = alloca double, align 8
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store double %2, ptr %14, align 8, !tbaa !9
  store double %3, ptr %15, align 8, !tbaa !9
  store double %4, ptr %16, align 8, !tbaa !9
  store ptr %5, ptr %17, align 8, !tbaa !5
  store double %6, ptr %18, align 8, !tbaa !9
  store double %7, ptr %19, align 8, !tbaa !9
  store i32 %8, ptr %20, align 4, !tbaa !11
  store double %9, ptr %21, align 8, !tbaa !9
  store i32 %10, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 2488, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %27 = load i32, ptr %22, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %79

29:                                               ; preds = %11
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %30

30:                                               ; preds = %51, %29
  %31 = load i32, ptr %25, align 4, !tbaa !11
  %32 = icmp ult i32 %31, 311
  br i1 %32, label %33, label %54

33:                                               ; preds = %30
  %34 = load ptr, ptr %17, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.TWO_PHOTON_PARAMS, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %25, align 4, !tbaa !11
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds [311 x double], ptr %35, i64 0, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !9
  %40 = fneg double %39
  %41 = load double, ptr %15, align 8, !tbaa !9
  %42 = fdiv double %40, %41
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load i32, ptr %25, align 4, !tbaa !11
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = load i32, ptr %20, align 4, !tbaa !11
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds double, ptr %47, i64 %49
  store double %42, ptr %50, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %33
  %52 = load i32, ptr %25, align 4, !tbaa !11
  %53 = add i32 %52, 1
  store i32 %53, ptr %25, align 4, !tbaa !11
  br label %30, !llvm.loop !13

54:                                               ; preds = %30
  %55 = load double, ptr %15, align 8, !tbaa !9
  %56 = fdiv double 0xC02465BDE9FCF0EC, %55
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = getelementptr inbounds ptr, ptr %57, i64 0
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = load i32, ptr %20, align 4, !tbaa !11
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds double, ptr %59, i64 %61
  store double %56, ptr %62, align 8, !tbaa !9
  %63 = load double, ptr %15, align 8, !tbaa !9
  %64 = fdiv double 0xC0282CBB284839FB, %63
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = getelementptr inbounds ptr, ptr %65, i64 1
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = load i32, ptr %20, align 4, !tbaa !11
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  store double %64, ptr %70, align 8, !tbaa !9
  %71 = load double, ptr %15, align 8, !tbaa !9
  %72 = fdiv double 0xC0297F2D647C2D27, %71
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds ptr, ptr %73, i64 2
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = load i32, ptr %20, align 4, !tbaa !11
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %75, i64 %77
  store double %72, ptr %78, align 8, !tbaa !9
  br label %158

79:                                               ; preds = %11
  %80 = getelementptr inbounds [311 x double], ptr %23, i64 0, i64 0
  %81 = getelementptr inbounds [2 x double], ptr %24, i64 0, i64 0
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = load double, ptr %15, align 8, !tbaa !9
  %85 = load double, ptr %18, align 8, !tbaa !9
  %86 = load double, ptr %19, align 8, !tbaa !9
  %87 = load i32, ptr %20, align 4, !tbaa !11
  %88 = load double, ptr %21, align 8, !tbaa !9
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.TWO_PHOTON_PARAMS, ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds [311 x double], ptr %90, i64 0, i64 0
  call void @fplus_from_fminus(ptr noundef %80, ptr noundef %81, ptr noundef %82, ptr noundef %83, double noundef %84, double noundef %85, double noundef %86, i32 noundef %87, double noundef %88, ptr noundef %91)
  store i32 0, ptr %25, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %109, %79
  %93 = load i32, ptr %25, align 4, !tbaa !11
  %94 = icmp ult i32 %93, 311
  br i1 %94, label %95, label %112

95:                                               ; preds = %92
  %96 = load i32, ptr %25, align 4, !tbaa !11
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds [311 x double], ptr %23, i64 0, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = call double @log(double noundef %99) #3
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = load i32, ptr %25, align 4, !tbaa !11
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = load i32, ptr %20, align 4, !tbaa !11
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds double, ptr %105, i64 %107
  store double %100, ptr %108, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %95
  %110 = load i32, ptr %25, align 4, !tbaa !11
  %111 = add i32 %110, 1
  store i32 %111, ptr %25, align 4, !tbaa !11
  br label %92, !llvm.loop !15

112:                                              ; preds = %92
  %113 = load double, ptr %16, align 8, !tbaa !9
  %114 = load double, ptr %14, align 8, !tbaa !9
  %115 = fmul double %113, %114
  %116 = load double, ptr %14, align 8, !tbaa !9
  %117 = fmul double %115, %116
  %118 = load double, ptr %14, align 8, !tbaa !9
  %119 = fsub double 1.000000e+00, %118
  %120 = fdiv double %117, %119
  %121 = load double, ptr %15, align 8, !tbaa !9
  %122 = fmul double 0x4464701ACFEF92A1, %121
  %123 = load double, ptr %15, align 8, !tbaa !9
  %124 = call double @sqrt(double noundef %123) #3
  %125 = fmul double %122, %124
  %126 = fdiv double %120, %125
  %127 = call double @log(double noundef %126) #3
  store double %127, ptr %26, align 8, !tbaa !9
  %128 = load double, ptr %26, align 8, !tbaa !9
  %129 = load double, ptr %15, align 8, !tbaa !9
  %130 = fdiv double 0x400B32528D51413B, %129
  %131 = fadd double %128, %130
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  %133 = getelementptr inbounds ptr, ptr %132, i64 0
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = load i32, ptr %20, align 4, !tbaa !11
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %134, i64 %136
  store double %131, ptr %137, align 8, !tbaa !9
  %138 = load double, ptr %26, align 8, !tbaa !9
  %139 = load double, ptr %15, align 8, !tbaa !9
  %140 = fdiv double 0x3FF82CBB284839FC, %139
  %141 = fadd double %138, %140
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds ptr, ptr %142, i64 1
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = load i32, ptr %20, align 4, !tbaa !11
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds double, ptr %144, i64 %146
  store double %141, ptr %147, align 8, !tbaa !9
  %148 = load double, ptr %26, align 8, !tbaa !9
  %149 = load double, ptr %15, align 8, !tbaa !9
  %150 = fdiv double 0x3FEB32528D51413B, %149
  %151 = fadd double %148, %150
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = getelementptr inbounds ptr, ptr %152, i64 2
  %154 = load ptr, ptr %153, align 8, !tbaa !5
  %155 = load i32, ptr %20, align 4, !tbaa !11
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds double, ptr %154, i64 %156
  store double %151, ptr %157, align 8, !tbaa !9
  br label %158

158:                                              ; preds = %112, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 2488, ptr %23) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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 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 nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @fplus_from_fminus(ptr noundef, ptr noundef, ptr noundef, ptr noundef, double noundef, double noundef, double noundef, i32 noundef, double noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @update_fminus_Saha(ptr noundef %0, ptr noundef %1, double noundef %2, double noundef %3, double noundef %4, ptr noundef %5, double noundef %6, double noundef %7, i32 noundef %8, double noundef %9, i32 noundef %10) local_unnamed_addr #2 {
  %12 = alloca [311 x double], align 16
  %13 = alloca [2 x double], align 16
  call void @llvm.lifetime.start.p0(i64 2488, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #3
  %14 = icmp eq i32 %10, 0
  br i1 %14, label %.preheader, label %41

.preheader:                                       ; preds = %11
  %15 = zext i32 %8 to i64
  br label %16

16:                                               ; preds = %24, %.preheader
  %indvars.iv52 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next53.1, %24 ]
  %17 = getelementptr inbounds [311 x double], ptr %5, i64 0, i64 %indvars.iv52
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = fneg double %18
  %20 = fdiv double %19, %3
  %21 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv52
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds double, ptr %22, i64 %15
  store double %20, ptr %23, align 8, !tbaa !5
  %exitcond55.not = icmp eq i64 %indvars.iv52, 310
  br i1 %exitcond55.not, label %32, label %24, !llvm.loop !11

24:                                               ; preds = %16
  %indvars.iv.next53 = or disjoint i64 %indvars.iv52, 1
  %25 = getelementptr inbounds [311 x double], ptr %5, i64 0, i64 %indvars.iv.next53
  %26 = load double, ptr %25, align 8, !tbaa !5
  %27 = fneg double %26
  %28 = fdiv double %27, %3
  %29 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next53
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds double, ptr %30, i64 %15
  store double %28, ptr %31, align 8, !tbaa !5
  %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 2
  br label %16

32:                                               ; preds = %16
  %33 = fdiv double 0xC02465BDE9FCF0EC, %3
  %34 = load ptr, ptr %1, align 8, !tbaa !9
  %35 = getelementptr inbounds double, ptr %34, i64 %15
  store double %33, ptr %35, align 8, !tbaa !5
  %36 = fdiv double 0xC0282CBB284839FB, %3
  %37 = getelementptr inbounds i8, ptr %1, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds double, ptr %38, i64 %15
  store double %36, ptr %39, align 8, !tbaa !5
  %40 = fdiv double 0xC0297F2D647C2D27, %3
  br label %71

41:                                               ; preds = %11
  call void @fplus_from_fminus(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef %0, ptr noundef %1, double noundef %3, double noundef %6, double noundef %7, i32 noundef %8, double noundef %9, ptr noundef %5)
  %42 = zext i32 %8 to i64
  br label %43

43:                                               ; preds = %41, %43
  %indvars.iv = phi i64 [ 0, %41 ], [ %indvars.iv.next, %43 ]
  %44 = getelementptr inbounds [311 x double], ptr %12, i64 0, i64 %indvars.iv
  %45 = load double, ptr %44, align 8, !tbaa !5
  %46 = call double @log(double noundef %45) #3
  %47 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds double, ptr %48, i64 %42
  store double %46, ptr %49, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 311
  br i1 %exitcond.not, label %50, label %43, !llvm.loop !13

50:                                               ; preds = %43
  %51 = fmul double %2, %4
  %52 = fmul double %51, %2
  %53 = fsub double 1.000000e+00, %2
  %54 = fdiv double %52, %53
  %55 = fmul double %3, 0x4464701ACFEF92A1
  %56 = call double @sqrt(double noundef %3) #3
  %57 = fmul double %55, %56
  %58 = fdiv double %54, %57
  %59 = call double @log(double noundef %58) #3
  %60 = fdiv double 0x400B32528D51413B, %3
  %61 = fadd double %60, %59
  %62 = load ptr, ptr %1, align 8, !tbaa !9
  %63 = getelementptr inbounds double, ptr %62, i64 %42
  store double %61, ptr %63, align 8, !tbaa !5
  %64 = fdiv double 0x3FF82CBB284839FC, %3
  %65 = fadd double %64, %59
  %66 = getelementptr inbounds i8, ptr %1, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds double, ptr %67, i64 %42
  store double %65, ptr %68, align 8, !tbaa !5
  %69 = fdiv double 0x3FEB32528D51413B, %3
  %70 = fadd double %69, %59
  br label %71

71:                                               ; preds = %50, %32
  %.sink58 = phi i64 [ %42, %50 ], [ %15, %32 ]
  %.sink = phi double [ %70, %50 ], [ %40, %32 ]
  %72 = getelementptr inbounds i8, ptr %1, i64 16
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds double, ptr %73, i64 %.sink58
  store double %.sink, ptr %74, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 2488, ptr nonnull %12) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass