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

; 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.REC_COSMOPARAMS = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, i64, double, i16, double, double, double, double, 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: nounwind
declare double @log(double noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local double @rec_HubbleConstant(ptr noundef %0, double noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca [5 x double], align 16
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %10 = load double, ptr %4, align 8, !tbaa !9
  %11 = fadd double 1.000000e+00, %10
  store double %11, ptr %8, align 8, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %12, i32 0, i32 2
  %14 = load double, ptr %13, align 8, !tbaa !11
  %15 = load double, ptr %8, align 8, !tbaa !9
  %16 = fmul double %14, %15
  %17 = load double, ptr %8, align 8, !tbaa !9
  %18 = fmul double %16, %17
  %19 = load double, ptr %8, align 8, !tbaa !9
  %20 = fmul double %18, %19
  %21 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 0
  store double %20, ptr %21, align 16, !tbaa !9
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %22, i32 0, i32 3
  %24 = load double, ptr %23, align 8, !tbaa !15
  %25 = load double, ptr %8, align 8, !tbaa !9
  %26 = fmul double %24, %25
  %27 = load double, ptr %8, align 8, !tbaa !9
  %28 = fmul double %26, %27
  %29 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 1
  store double %28, ptr %29, align 8, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %30, i32 0, i32 4
  %32 = load double, ptr %31, align 8, !tbaa !16
  %33 = load double, ptr %8, align 8, !tbaa !9
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %34, i32 0, i32 5
  %36 = load double, ptr %35, align 8, !tbaa !17
  %37 = fadd double 1.000000e+00, %36
  %38 = fmul double 3.000000e+00, %37
  %39 = call double @pow(double noundef %33, double noundef %38) #3
  %40 = fmul double %32, %39
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %41, i32 0, i32 6
  %43 = load double, ptr %42, align 8, !tbaa !18
  %44 = fmul double 3.000000e+00, %43
  %45 = load double, ptr %8, align 8, !tbaa !9
  %46 = call double @log(double noundef %45) #3
  %47 = fsub double %46, 1.000000e+00
  %48 = load double, ptr %8, align 8, !tbaa !9
  %49 = fdiv double 1.000000e+00, %48
  %50 = fadd double %47, %49
  %51 = fmul double %44, %50
  %52 = call double @exp(double noundef %51) #3
  %53 = fmul double %40, %52
  %54 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 2
  store double %53, ptr %54, align 16, !tbaa !9
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %55, i32 0, i32 0
  %57 = load double, ptr %56, align 8, !tbaa !19
  %58 = fmul double 0x3E9E1360585A68D5, %57
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !19
  %62 = fmul double %58, %61
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %63, i32 0, i32 0
  %65 = load double, ptr %64, align 8, !tbaa !19
  %66 = fmul double %62, %65
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %67, i32 0, i32 0
  %69 = load double, ptr %68, align 8, !tbaa !19
  %70 = fmul double %66, %69
  store double %70, ptr %9, align 8, !tbaa !9
  %71 = load double, ptr %9, align 8, !tbaa !9
  %72 = load double, ptr %8, align 8, !tbaa !9
  %73 = fmul double %71, %72
  %74 = load double, ptr %8, align 8, !tbaa !9
  %75 = fmul double %73, %74
  %76 = load double, ptr %8, align 8, !tbaa !9
  %77 = fmul double %75, %76
  %78 = load double, ptr %8, align 8, !tbaa !9
  %79 = fmul double %77, %78
  %80 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 3
  store double %79, ptr %80, align 8, !tbaa !9
  %81 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 3
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = fmul double 0x3FCD11DA430439AA, %82
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.REC_COSMOPARAMS, ptr %84, i32 0, i32 8
  %86 = load double, ptr %85, align 8, !tbaa !20
  %87 = fmul double %83, %86
  %88 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 4
  store double %87, ptr %88, align 16, !tbaa !9
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  store i32 0, ptr %5, align 4, !tbaa !21
  br label %89

89:                                               ; preds = %99, %2
  %90 = load i32, ptr %5, align 4, !tbaa !21
  %91 = icmp slt i32 %90, 5
  br i1 %91, label %92, label %102

92:                                               ; preds = %89
  %93 = load i32, ptr %5, align 4, !tbaa !21
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [5 x double], ptr %7, i64 0, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = load double, ptr %6, align 8, !tbaa !9
  %98 = fadd double %97, %96
  store double %98, ptr %6, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %92
  %100 = load i32, ptr %5, align 4, !tbaa !21
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %5, align 4, !tbaa !21
  br label %89, !llvm.loop !23

102:                                              ; preds = %89
  %103 = load double, ptr %6, align 8, !tbaa !9
  %104 = call double @sqrt(double noundef %103) #3
  %105 = fmul double 0x3C4DE412E12433CA, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret double %105
}

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

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

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

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, !10, i64 16}
!12 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !13, i64 112, !10, i64 120, !14, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184}
!13 = !{!"long", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !10, i64 24}
!16 = !{!12, !10, i64 32}
!17 = !{!12, !10, i64 40}
!18 = !{!12, !10, i64 48}
!19 = !{!12, !10, i64 0}
!20 = !{!12, !10, i64 64}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"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 nofree nounwind willreturn memory(write)
declare double @log(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local double @rec_HubbleConstant(ptr nocapture noundef readonly %0, double noundef %1) local_unnamed_addr #1 {
  %3 = fadd double %1, 1.000000e+00
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load double, ptr %4, align 8, !tbaa !5
  %6 = fmul double %3, %5
  %7 = getelementptr inbounds i8, ptr %0, i64 24
  %8 = load double, ptr %7, align 8, !tbaa !12
  %9 = insertelement <2 x double> poison, double %3, i64 0
  %10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
  %11 = insertelement <2 x double> poison, double %6, i64 0
  %12 = insertelement <2 x double> %11, double %8, i64 1
  %13 = fmul <2 x double> %10, %12
  %14 = fmul <2 x double> %10, %13
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %16 = load double, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = load double, ptr %17, align 8, !tbaa !14
  %19 = fadd double %18, 1.000000e+00
  %20 = fmul double %19, 3.000000e+00
  %21 = tail call double @pow(double noundef %3, double noundef %20) #2
  %22 = fmul double %16, %21
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = load double, ptr %23, align 8, !tbaa !15
  %25 = fmul double %24, 3.000000e+00
  %26 = tail call double @log(double noundef %3) #2
  %27 = fadd double %26, -1.000000e+00
  %28 = fdiv double 1.000000e+00, %3
  %29 = fadd double %28, %27
  %30 = fmul double %25, %29
  %31 = tail call double @exp(double noundef %30) #2
  %32 = fmul double %22, %31
  %33 = load double, ptr %0, align 8, !tbaa !16
  %34 = fmul double %33, 0x3E9E1360585A68D5
  %35 = fmul double %33, %34
  %36 = fmul double %33, %35
  %37 = fmul double %33, %36
  %38 = fmul double %3, %37
  %39 = fmul double %3, %38
  %40 = fmul double %3, %39
  %41 = fmul double %3, %40
  %42 = fmul double %41, 0x3FCD11DA430439AA
  %43 = getelementptr inbounds i8, ptr %0, i64 64
  %44 = load double, ptr %43, align 8, !tbaa !17
  %45 = fmul double %44, %42
  %46 = extractelement <2 x double> %14, i64 0
  %47 = fadd double %46, 0.000000e+00
  %48 = extractelement <2 x double> %14, i64 1
  %49 = fadd double %47, %48
  %50 = fadd double %49, %32
  %51 = fadd double %50, %41
  %52 = fadd double %51, %45
  %53 = tail call double @sqrt(double noundef %52) #2
  %54 = fmul double %53, 0x3C4DE412E12433CA
  ret double %54
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #0

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

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

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) 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 = { 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 16}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !10, i64 112, !7, i64 120, !11, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"short", !8, i64 0}
!12 = !{!6, !7, i64 24}
!13 = !{!6, !7, i64 32}
!14 = !{!6, !7, i64 40}
!15 = !{!6, !7, i64 48}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 64}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass