; LLVM IR from simbody/simbody :: SimTKmath/Integrators/src/CPodes/sundials/tests (pendEs)

; 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._generic_N_Vector = type { ptr, ptr }
%struct._N_VectorContent_Serial = type { i64, i32, ptr }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %16 = call double @atan(double noundef 1.000000e+00) #5
  %17 = fmul double 2.000000e+00, %16
  store double %17, ptr %10, align 8, !tbaa !5
  %18 = call ptr @N_VNew_Serial(i64 noundef 2)
  store ptr %18, ptr %3, align 8, !tbaa !9
  %19 = call ptr @N_VNew_Serial(i64 noundef 2)
  store ptr %19, ptr %4, align 8, !tbaa !9
  %20 = load double, ptr %10, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct._generic_N_Vector, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %23, i32 0, i32 2
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds double, ptr %25, i64 0
  store double %20, ptr %26, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct._generic_N_Vector, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds double, ptr %31, i64 1
  store double 0.000000e+00, ptr %32, align 8, !tbaa !5
  store double 1.000000e-10, ptr %6, align 8, !tbaa !5
  store double 1.000000e-10, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %14, align 4, !tbaa !17
  %33 = load i32, ptr %14, align 4, !tbaa !17
  %34 = sitofp i32 %33 to double
  %35 = fmul double %34, 1.000000e+00
  store double %35, ptr %9, align 8, !tbaa !5
  %36 = call ptr @CPodeCreate(i32 noundef 1, i32 noundef 2, i32 noundef 2)
  store ptr %36, ptr %2, align 8, !tbaa !9
  %37 = load ptr, ptr %2, align 8, !tbaa !9
  %38 = call i32 @CPodeSetMaxNumSteps(ptr noundef %37, i64 noundef 50000)
  store i32 %38, ptr %15, align 4, !tbaa !17
  %39 = load ptr, ptr %2, align 8, !tbaa !9
  %40 = load double, ptr %9, align 8, !tbaa !5
  %41 = call i32 @CPodeSetStopTime(ptr noundef %39, double noundef %40)
  store i32 %41, ptr %15, align 4, !tbaa !17
  %42 = load ptr, ptr %2, align 8, !tbaa !9
  %43 = load ptr, ptr %3, align 8, !tbaa !9
  %44 = load ptr, ptr %4, align 8, !tbaa !9
  %45 = load double, ptr %6, align 8, !tbaa !5
  %46 = call i32 @CPodeInit(ptr noundef %42, ptr noundef @f, ptr noundef null, double noundef 0.000000e+00, ptr noundef %43, ptr noundef %44, i32 noundef 1, double noundef %45, ptr noundef %7)
  store i32 %46, ptr %15, align 4, !tbaa !17
  %47 = load ptr, ptr %2, align 8, !tbaa !9
  %48 = call i32 @CPDense(ptr noundef %47, i32 noundef 2)
  store i32 %48, ptr %15, align 4, !tbaa !17
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %62, %0
  %50 = load double, ptr %8, align 8, !tbaa !5
  %51 = load double, ptr %9, align 8, !tbaa !5
  %52 = fcmp olt double %50, %51
  br i1 %52, label %53, label %89

53:                                               ; preds = %49
  %54 = load ptr, ptr %2, align 8, !tbaa !9
  %55 = load double, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !9
  %58 = call i32 @CPode(ptr noundef %54, double noundef %55, ptr noundef %8, ptr noundef %56, ptr noundef %57, i32 noundef 4)
  store i32 %58, ptr %15, align 4, !tbaa !17
  %59 = load i32, ptr %15, align 4, !tbaa !17
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %53
  br label %89

62:                                               ; preds = %53
  %63 = load ptr, ptr %3, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct._generic_N_Vector, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = getelementptr inbounds double, ptr %67, i64 0
  %69 = load double, ptr %68, align 8, !tbaa !5
  store double %69, ptr %11, align 8, !tbaa !5
  %70 = load ptr, ptr %3, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct._generic_N_Vector, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = getelementptr inbounds double, ptr %74, i64 1
  %76 = load double, ptr %75, align 8, !tbaa !5
  store double %76, ptr %12, align 8, !tbaa !5
  %77 = load double, ptr %12, align 8, !tbaa !5
  %78 = load double, ptr %12, align 8, !tbaa !5
  %79 = load double, ptr %11, align 8, !tbaa !5
  %80 = call double @cos(double noundef %79) #5
  %81 = fmul double 0x403B8030B6145A1A, %80
  %82 = fneg double %81
  %83 = call double @llvm.fmuladd.f64(double %77, double %78, double %82)
  store double %83, ptr %13, align 8, !tbaa !5
  %84 = load double, ptr %8, align 8, !tbaa !5
  %85 = load double, ptr %11, align 8, !tbaa !5
  %86 = load double, ptr %12, align 8, !tbaa !5
  %87 = load double, ptr %13, align 8, !tbaa !5
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %84, double noundef %85, double noundef %86, double noundef %87)
  br label %49, !llvm.loop !18

89:                                               ; preds = %61, %49
  %90 = load ptr, ptr %2, align 8, !tbaa !9
  call void @PrintFinalStats(ptr noundef %90, i32 noundef 0)
  %91 = load double, ptr %10, align 8, !tbaa !5
  %92 = load ptr, ptr %3, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct._generic_N_Vector, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = getelementptr inbounds double, ptr %96, i64 0
  store double %91, ptr %97, align 8, !tbaa !5
  %98 = load ptr, ptr %3, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct._generic_N_Vector, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !13
  %103 = getelementptr inbounds double, ptr %102, i64 1
  store double 0.000000e+00, ptr %103, align 8, !tbaa !5
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %105 = load ptr, ptr %3, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct._generic_N_Vector, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !11
  %108 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = getelementptr inbounds double, ptr %109, i64 0
  %111 = load double, ptr %110, align 8, !tbaa !5
  store double %111, ptr %11, align 8, !tbaa !5
  %112 = load ptr, ptr %3, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct._generic_N_Vector, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !11
  %115 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !13
  %117 = getelementptr inbounds double, ptr %116, i64 1
  %118 = load double, ptr %117, align 8, !tbaa !5
  store double %118, ptr %12, align 8, !tbaa !5
  %119 = load double, ptr %12, align 8, !tbaa !5
  %120 = load double, ptr %12, align 8, !tbaa !5
  %121 = load double, ptr %11, align 8, !tbaa !5
  %122 = call double @cos(double noundef %121) #5
  %123 = fmul double 0x403B8030B6145A1A, %122
  %124 = fneg double %123
  %125 = call double @llvm.fmuladd.f64(double %119, double %120, double %124)
  store double %125, ptr %13, align 8, !tbaa !5
  %126 = load double, ptr %11, align 8, !tbaa !5
  %127 = load double, ptr %12, align 8, !tbaa !5
  %128 = load double, ptr %13, align 8, !tbaa !5
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %126, double noundef %127, double noundef %128)
  %130 = load ptr, ptr %2, align 8, !tbaa !9
  %131 = load ptr, ptr %3, align 8, !tbaa !9
  %132 = load ptr, ptr %4, align 8, !tbaa !9
  %133 = load double, ptr %6, align 8, !tbaa !5
  %134 = call i32 @CPodeReInit(ptr noundef %130, ptr noundef @f, ptr noundef null, double noundef 0.000000e+00, ptr noundef %131, ptr noundef %132, i32 noundef 1, double noundef %133, ptr noundef %7)
  store i32 %134, ptr %15, align 4, !tbaa !17
  %135 = load ptr, ptr %2, align 8, !tbaa !9
  %136 = call i32 @CPDense(ptr noundef %135, i32 noundef 2)
  store i32 %136, ptr %15, align 4, !tbaa !17
  %137 = call ptr @N_VNew_Serial(i64 noundef 1)
  store ptr %137, ptr %5, align 8, !tbaa !9
  %138 = load ptr, ptr %5, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct._generic_N_Vector, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !13
  %143 = getelementptr inbounds double, ptr %142, i64 0
  store double 1.000000e-02, ptr %143, align 8, !tbaa !5
  %144 = load ptr, ptr %2, align 8, !tbaa !9
  %145 = load ptr, ptr %5, align 8, !tbaa !9
  %146 = call i32 @CPodeProjInit(ptr noundef %144, i32 noundef 1, i32 noundef 2, ptr noundef @cfun, ptr noundef null, ptr noundef %145)
  store i32 %146, ptr %15, align 4, !tbaa !17
  %147 = load ptr, ptr %2, align 8, !tbaa !9
  %148 = call i32 @CPodeSetProjNonlinConvCoef(ptr noundef %147, double noundef 1.000000e-03)
  store i32 %148, ptr %15, align 4, !tbaa !17
  %149 = load ptr, ptr %2, align 8, !tbaa !9
  %150 = call i32 @CPDenseProj(ptr noundef %149, i32 noundef 1, i32 noundef 2, i32 noundef 1)
  store i32 %150, ptr %15, align 4, !tbaa !17
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %164, %89
  %152 = load double, ptr %8, align 8, !tbaa !5
  %153 = load double, ptr %9, align 8, !tbaa !5
  %154 = fcmp olt double %152, %153
  br i1 %154, label %155, label %191

155:                                              ; preds = %151
  %156 = load ptr, ptr %2, align 8, !tbaa !9
  %157 = load double, ptr %9, align 8, !tbaa !5
  %158 = load ptr, ptr %3, align 8, !tbaa !9
  %159 = load ptr, ptr %4, align 8, !tbaa !9
  %160 = call i32 @CPode(ptr noundef %156, double noundef %157, ptr noundef %8, ptr noundef %158, ptr noundef %159, i32 noundef 4)
  store i32 %160, ptr %15, align 4, !tbaa !17
  %161 = load i32, ptr %15, align 4, !tbaa !17
  %162 = icmp slt i32 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %155
  br label %191

164:                                              ; preds = %155
  %165 = load ptr, ptr %3, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct._generic_N_Vector, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !11
  %168 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !13
  %170 = getelementptr inbounds double, ptr %169, i64 0
  %171 = load double, ptr %170, align 8, !tbaa !5
  store double %171, ptr %11, align 8, !tbaa !5
  %172 = load ptr, ptr %3, align 8, !tbaa !9
  %173 = getelementptr inbounds %struct._generic_N_Vector, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !11
  %175 = getelementptr inbounds %struct._N_VectorContent_Serial, ptr %174, i32 0, i32 2
  %176 = load ptr, ptr %175, align 8, !tbaa !13
  %177 = getelementptr inbounds double, ptr %176, i64 1
  %178 = load double, ptr %177, align 8, !tbaa !5
  store double %178, ptr %12, align 8, !tbaa !5
  %179 = load double, ptr %12, align 8, !tbaa !5
  %180 = load double, ptr %12, align 8, !tbaa !5
  %181 = load double, ptr %11, align 8, !tbaa !5
  %182 = call double @cos(double noundef %181) #5
  %183 = fmul double 0x403B8030B6145A1A, %182
  %184 = fneg double %183
  %185 = call double @llvm.fmuladd.f64(double %179, double %180, double %184)
  store double %185, ptr %13, align 8, !tbaa !5
  %186 = load double, ptr %8, align 8, !tbaa !5
  %187 = load double, ptr %11, align 8, !tbaa !5
  %188 = load double, ptr %12, align 8, !tbaa !5
  %189 = load double, ptr %13, align 8, !tbaa !5
  %190 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %186, double noundef %187, double noundef %188, double noundef %189)
  br label %151, !llvm.loop !20

191:                                              ; preds = %163, %151
  %192 = load ptr, ptr %2, align 8, !tbaa !9
  call void @PrintFinalStats(ptr noundef %192, i32 noundef 1)
  %193 = load ptr, ptr %3, align 8, !tbaa !9
  call void @N_VDestroy_Serial(ptr noundef %193)
  %194 = load ptr, ptr %4, align 8, !tbaa !9
  call void @N_VDestroy_Serial(ptr noundef %194)
  %195 = load ptr, ptr %5, align 8, !tbaa !9
  call void @N_VDestroy_Serial(ptr noundef %195)
  call void @CPodeFree(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

; Function Attrs: nounwind
declare double @atan(double noundef) #2

declare ptr @N_VNew_Serial(i64 noundef) #3

declare ptr @CPodeCreate(i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @CPodeSetMaxNumSteps(ptr noundef, i64 noundef) #3

declare i32 @CPodeSetStopTime(ptr noundef, double noundef) #3

declare i32 @CPodeInit(ptr noundef, ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @f(double noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @CPDense(ptr noundef, i32 noundef) #3

declare i32 @CPode(ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare double @cos(double noundef) #2

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare hidden void @PrintFinalStats(ptr noundef, i32 noundef) #0

declare i32 @CPodeReInit(ptr noundef, ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) #3

declare i32 @CPodeProjInit(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @cfun(double noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @CPodeSetProjNonlinConvCoef(ptr noundef, double noundef) #3

declare i32 @CPDenseProj(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare void @N_VDestroy_Serial(ptr noundef) #3

declare void @CPodeFree(ptr noundef) #3

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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 = !{!12, !10, i64 0}
!12 = !{!"_generic_N_Vector", !10, i64 0, !10, i64 8}
!13 = !{!14, !10, i64 16}
!14 = !{!"_N_VectorContent_Serial", !15, i64 0, !16, i64 8, !10, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %4 = tail call ptr @N_VNew_Serial(i64 noundef 2) #6
  %5 = tail call ptr @N_VNew_Serial(i64 noundef 2) #6
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !10
  store <2 x double> <double 0x3FF921FB54442D18, double 0.000000e+00>, ptr %8, align 8, !tbaa !14
  store double 1.000000e-10, ptr %2, align 8, !tbaa !14
  %9 = tail call ptr @CPodeCreate(i32 noundef 1, i32 noundef 2, i32 noundef 2) #6
  store ptr %9, ptr %1, align 8, !tbaa !16
  %10 = tail call i32 @CPodeSetMaxNumSteps(ptr noundef %9, i64 noundef 50000) #6
  %11 = tail call i32 @CPodeSetStopTime(ptr noundef %9, double noundef 1.000000e+00) #6
  %12 = call i32 @CPodeInit(ptr noundef %9, ptr noundef nonnull @f, ptr noundef null, double noundef 0.000000e+00, ptr noundef nonnull %4, ptr noundef %5, i32 noundef 1, double noundef 1.000000e-10, ptr noundef nonnull %2) #6
  %13 = call i32 @CPDense(ptr noundef %9, i32 noundef 2) #6
  store double 0.000000e+00, ptr %3, align 8, !tbaa !14
  br label %14

14:                                               ; preds = %0, %17
  %15 = call i32 @CPode(ptr noundef %9, double noundef 1.000000e+00, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %5, i32 noundef 4) #6
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %30, label %17

17:                                               ; preds = %14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !10
  %21 = load double, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %20, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !14
  %24 = call double @cos(double noundef %21) #6
  %25 = fmul double %24, 0xC03B8030B6145A1A
  %26 = call double @llvm.fmuladd.f64(double %23, double %23, double %25)
  %27 = load double, ptr %3, align 8, !tbaa !14
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %27, double noundef %21, double noundef %23, double noundef %26)
  %.pr = load double, ptr %3, align 8, !tbaa !14
  %29 = fcmp olt double %.pr, 1.000000e+00
  br i1 %29, label %14, label %30, !llvm.loop !17

30:                                               ; preds = %14, %17
  call void @PrintFinalStats(ptr noundef %9, i32 noundef 0)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load ptr, ptr %32, align 8, !tbaa !10
  store <2 x double> <double 0x3FF921FB54442D18, double 0.000000e+00>, ptr %33, align 8, !tbaa !14
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !10
  %38 = load double, ptr %37, align 8, !tbaa !14
  %39 = getelementptr inbounds i8, ptr %37, i64 8
  %40 = load double, ptr %39, align 8, !tbaa !14
  %41 = call double @cos(double noundef %38) #6
  %42 = fmul double %41, 0xC03B8030B6145A1A
  %43 = call double @llvm.fmuladd.f64(double %40, double %40, double %42)
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %38, double noundef %40, double noundef %43)
  %45 = call i32 @CPodeReInit(ptr noundef %9, ptr noundef nonnull @f, ptr noundef null, double noundef 0.000000e+00, ptr noundef nonnull %4, ptr noundef %5, i32 noundef 1, double noundef 1.000000e-10, ptr noundef nonnull %2) #6
  %46 = call i32 @CPDense(ptr noundef %9, i32 noundef 2) #6
  %47 = call ptr @N_VNew_Serial(i64 noundef 1) #6
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !10
  store double 1.000000e-02, ptr %50, align 8, !tbaa !14
  %51 = call i32 @CPodeProjInit(ptr noundef %9, i32 noundef 1, i32 noundef 2, ptr noundef nonnull @cfun, ptr noundef null, ptr noundef nonnull %47) #6
  %52 = call i32 @CPodeSetProjNonlinConvCoef(ptr noundef %9, double noundef 1.000000e-03) #6
  %53 = call i32 @CPDenseProj(ptr noundef %9, i32 noundef 1, i32 noundef 2, i32 noundef 1) #6
  store double 0.000000e+00, ptr %3, align 8, !tbaa !14
  br label %54

54:                                               ; preds = %30, %57
  %55 = call i32 @CPode(ptr noundef %9, double noundef 1.000000e+00, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef %5, i32 noundef 4) #6
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %70, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !10
  %61 = load double, ptr %60, align 8, !tbaa !14
  %62 = getelementptr inbounds i8, ptr %60, i64 8
  %63 = load double, ptr %62, align 8, !tbaa !14
  %64 = call double @cos(double noundef %61) #6
  %65 = fmul double %64, 0xC03B8030B6145A1A
  %66 = call double @llvm.fmuladd.f64(double %63, double %63, double %65)
  %67 = load double, ptr %3, align 8, !tbaa !14
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %67, double noundef %61, double noundef %63, double noundef %66)
  %.pr52 = load double, ptr %3, align 8, !tbaa !14
  %69 = fcmp olt double %.pr52, 1.000000e+00
  br i1 %69, label %54, label %70, !llvm.loop !19

70:                                               ; preds = %54, %57
  call void @PrintFinalStats(ptr noundef %9, i32 noundef 1)
  call void @N_VDestroy_Serial(ptr noundef nonnull %4) #6
  call void @N_VDestroy_Serial(ptr noundef %5) #6
  call void @N_VDestroy_Serial(ptr noundef nonnull %47) #6
  call void @CPodeFree(ptr noundef nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

declare ptr @N_VNew_Serial(i64 noundef) local_unnamed_addr #2

declare ptr @CPodeCreate(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @CPodeSetMaxNumSteps(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @CPodeSetStopTime(ptr noundef, double noundef) local_unnamed_addr #2

declare i32 @CPodeInit(ptr noundef, ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @f(double noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @CPDense(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @CPode(ptr noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden void @PrintFinalStats(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @CPodeReInit(ptr noundef, ptr noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, i32 noundef, double noundef, ptr noundef) local_unnamed_addr #2

declare i32 @CPodeProjInit(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @cfun(double noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @CPodeSetProjNonlinConvCoef(ptr noundef, double noundef) local_unnamed_addr #2

declare i32 @CPDenseProj(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @N_VDestroy_Serial(ptr noundef) local_unnamed_addr #2

declare void @CPodeFree(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { 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 willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree 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 #6 = { 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 = !{!"_generic_N_Vector", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 16}
!11 = !{!"_N_VectorContent_Serial", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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