; LLVM IR from chrr/libECP :: src (gc_integrators)

; 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.GCIntegrationTable = type { i32, i32, ptr, ptr, double, double, i32, i32 }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.initGridGC_PS93 = external hidden unnamed_addr constant [61 x i8], align 1

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 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
declare double @pow(double noundef, double noundef) #2

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @initGridGC_PS93(i32 noundef %0, double noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sitofp i32 %22 to double
  %24 = call double @log(double noundef %23) #6
  %25 = call double @log(double noundef 2.000000e+00) #6
  %26 = fdiv double %24, %25
  %27 = call double @llvm.floor.f64(double %26)
  %28 = fptosi double %27 to i32
  store i32 %28, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sitofp i32 %29 to double
  %31 = call double @pow(double noundef 2.000000e+00, double noundef %30) #6
  %32 = fptosi double %31 to i32
  store i32 %32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %33 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 48) #7
  store ptr %33, ptr %21, align 8, !tbaa !11
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = mul nsw i32 3, %34
  %36 = sub nsw i32 %35, 1
  store i32 %36, ptr %10, align 4, !tbaa !5
  %37 = load ptr, ptr %21, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.GCIntegrationTable, ptr %37, i32 0, i32 1
  store i32 %36, ptr %38, align 4, !tbaa !13
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = icmp sge i32 %39, 3
  br i1 %40, label %41, label %42

41:                                               ; preds = %2
  br label %43

42:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 231, ptr noundef @__PRETTY_FUNCTION__.initGridGC_PS93) #8
  unreachable

43:                                               ; preds = %41
  %44 = load ptr, ptr %21, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.GCIntegrationTable, ptr %44, i32 0, i32 6
  store i32 0, ptr %45, align 8, !tbaa !15
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = load ptr, ptr %21, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.GCIntegrationTable, ptr %48, i32 0, i32 7
  store i32 %47, ptr %49, align 4, !tbaa !16
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load ptr, ptr %21, align 8, !tbaa !11
  %52 = getelementptr inbounds %struct.GCIntegrationTable, ptr %51, i32 0, i32 0
  store i32 %50, ptr %52, align 8, !tbaa !17
  %53 = load double, ptr %4, align 8, !tbaa !9
  %54 = load ptr, ptr %21, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.GCIntegrationTable, ptr %54, i32 0, i32 4
  store double %53, ptr %55, align 8, !tbaa !18
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call noalias ptr @calloc(i64 noundef %57, i64 noundef 8) #7
  %59 = load ptr, ptr %21, align 8, !tbaa !11
  %60 = getelementptr inbounds %struct.GCIntegrationTable, ptr %59, i32 0, i32 2
  store ptr %58, ptr %60, align 8, !tbaa !19
  store ptr %58, ptr %19, align 8, !tbaa !11
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = call noalias ptr @calloc(i64 noundef %62, i64 noundef 8) #7
  %64 = load ptr, ptr %21, align 8, !tbaa !11
  %65 = getelementptr inbounds %struct.GCIntegrationTable, ptr %64, i32 0, i32 3
  store ptr %63, ptr %65, align 8, !tbaa !20
  store ptr %63, ptr %20, align 8, !tbaa !11
  store i32 3, ptr %9, align 4, !tbaa !5
  %66 = call double @sin(double noundef 0x3FF0C152382D7365) #6
  store double %66, ptr %11, align 8, !tbaa !9
  store double 5.000000e-01, ptr %12, align 8, !tbaa !9
  %67 = load double, ptr %12, align 8, !tbaa !9
  store double %67, ptr %14, align 8, !tbaa !9
  %68 = load double, ptr %11, align 8, !tbaa !9
  store double %68, ptr %13, align 8, !tbaa !9
  %69 = call double @cos(double noundef 0x3FF0C152382D7365) #6
  store double %69, ptr %17, align 8, !tbaa !9
  %70 = load double, ptr %11, align 8, !tbaa !9
  store double %70, ptr %15, align 8, !tbaa !9
  %71 = load double, ptr %15, align 8, !tbaa !9
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = fmul double %71, %72
  store double %73, ptr %16, align 8, !tbaa !9
  %74 = load ptr, ptr %19, align 8, !tbaa !11
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = sdiv i32 %75, 2
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds double, ptr %74, i64 %77
  store double 0.000000e+00, ptr %78, align 8, !tbaa !9
  %79 = load ptr, ptr %20, align 8, !tbaa !11
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sdiv i32 %80, 2
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %79, i64 %82
  store double 1.000000e+00, ptr %83, align 8, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = sitofp i32 %84 to double
  %86 = fsub double %85, 2.000000e+00
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sitofp i32 %87 to double
  %89 = fdiv double %86, %88
  %90 = load double, ptr %16, align 8, !tbaa !9
  %91 = fmul double 2.000000e+00, %90
  %92 = fdiv double %91, 3.000000e+00
  %93 = fadd double 1.000000e+00, %92
  %94 = fmul double 0x3FE45F306DC9C883, %93
  %95 = load double, ptr %17, align 8, !tbaa !9
  %96 = fmul double %94, %95
  %97 = load double, ptr %15, align 8, !tbaa !9
  %98 = call double @llvm.fmuladd.f64(double %96, double %97, double %89)
  store double %98, ptr %18, align 8, !tbaa !9
  %99 = load double, ptr %18, align 8, !tbaa !9
  %100 = fneg double %99
  %101 = load ptr, ptr %19, align 8, !tbaa !11
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %101, i64 %104
  store double %100, ptr %105, align 8, !tbaa !9
  %106 = load double, ptr %18, align 8, !tbaa !9
  %107 = load ptr, ptr %19, align 8, !tbaa !11
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sub nsw i32 %108, %109
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %107, i64 %111
  store double %106, ptr %112, align 8, !tbaa !9
  %113 = load double, ptr %16, align 8, !tbaa !9
  %114 = load double, ptr %16, align 8, !tbaa !9
  %115 = fmul double %113, %114
  %116 = load ptr, ptr %20, align 8, !tbaa !11
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %116, i64 %119
  store double %115, ptr %120, align 8, !tbaa !9
  %121 = load ptr, ptr %20, align 8, !tbaa !11
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = load i32, ptr %6, align 4, !tbaa !5
  %124 = sub nsw i32 %122, %123
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %121, i64 %125
  store double %115, ptr %126, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %209, %43
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = mul nsw i32 4, %128
  %130 = sdiv i32 %129, 3
  %131 = sub nsw i32 %130, 1
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = icmp sle i32 %131, %132
  br i1 %133, label %134, label %222

134:                                              ; preds = %127
  %135 = load double, ptr %11, align 8, !tbaa !9
  store double %135, ptr %17, align 8, !tbaa !9
  %136 = load double, ptr %12, align 8, !tbaa !9
  store double %136, ptr %15, align 8, !tbaa !9
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sdiv i32 %137, 2
  store i32 %138, ptr %6, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %206, %134
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %143, label %209

143:                                              ; preds = %139
  %144 = load double, ptr %15, align 8, !tbaa !9
  %145 = load double, ptr %15, align 8, !tbaa !9
  %146 = fmul double %144, %145
  store double %146, ptr %16, align 8, !tbaa !9
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = mul nsw i32 %147, %148
  %150 = sub nsw i32 %149, 1
  store i32 %150, ptr %8, align 4, !tbaa !5
  %151 = load double, ptr %15, align 8, !tbaa !9
  %152 = fmul double 0x3FCB2995E7B7B604, %151
  %153 = load double, ptr %17, align 8, !tbaa !9
  %154 = fmul double %152, %153
  %155 = load double, ptr %16, align 8, !tbaa !9
  %156 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %155, double 3.000000e+00)
  %157 = call double @llvm.fmuladd.f64(double %154, double %156, double 1.000000e+00)
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = sitofp i32 %158 to double
  %160 = load i32, ptr %9, align 4, !tbaa !5
  %161 = sitofp i32 %160 to double
  %162 = fdiv double %159, %161
  %163 = fsub double %157, %162
  store double %163, ptr %18, align 8, !tbaa !9
  %164 = load double, ptr %18, align 8, !tbaa !9
  %165 = fneg double %164
  %166 = load ptr, ptr %19, align 8, !tbaa !11
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds double, ptr %166, i64 %168
  store double %165, ptr %169, align 8, !tbaa !9
  %170 = load double, ptr %18, align 8, !tbaa !9
  %171 = load ptr, ptr %19, align 8, !tbaa !11
  %172 = load i32, ptr %10, align 4, !tbaa !5
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sub nsw i32 %172, %173
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds double, ptr %171, i64 %176
  store double %170, ptr %177, align 8, !tbaa !9
  %178 = load double, ptr %16, align 8, !tbaa !9
  %179 = load double, ptr %16, align 8, !tbaa !9
  %180 = fmul double %178, %179
  %181 = load ptr, ptr %20, align 8, !tbaa !11
  %182 = load i32, ptr %8, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds double, ptr %181, i64 %183
  store double %180, ptr %184, align 8, !tbaa !9
  %185 = load ptr, ptr %20, align 8, !tbaa !11
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = load i32, ptr %8, align 4, !tbaa !5
  %188 = sub nsw i32 %186, %187
  %189 = sub nsw i32 %188, 1
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %185, i64 %190
  store double %180, ptr %191, align 8, !tbaa !9
  %192 = load double, ptr %15, align 8, !tbaa !9
  store double %192, ptr %18, align 8, !tbaa !9
  %193 = load double, ptr %15, align 8, !tbaa !9
  %194 = load double, ptr %14, align 8, !tbaa !9
  %195 = load double, ptr %17, align 8, !tbaa !9
  %196 = load double, ptr %13, align 8, !tbaa !9
  %197 = fmul double %195, %196
  %198 = call double @llvm.fmuladd.f64(double %193, double %194, double %197)
  store double %198, ptr %15, align 8, !tbaa !9
  %199 = load double, ptr %17, align 8, !tbaa !9
  %200 = load double, ptr %14, align 8, !tbaa !9
  %201 = load double, ptr %18, align 8, !tbaa !9
  %202 = load double, ptr %13, align 8, !tbaa !9
  %203 = fmul double %201, %202
  %204 = fneg double %203
  %205 = call double @llvm.fmuladd.f64(double %199, double %200, double %204)
  store double %205, ptr %17, align 8, !tbaa !9
  br label %206

206:                                              ; preds = %143
  %207 = load i32, ptr %7, align 4, !tbaa !5
  %208 = add nsw i32 %207, 2
  store i32 %208, ptr %7, align 4, !tbaa !5
  br label %139, !llvm.loop !21

209:                                              ; preds = %139
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = mul nsw i32 %210, 2
  store i32 %211, ptr %9, align 4, !tbaa !5
  %212 = load double, ptr %11, align 8, !tbaa !9
  store double %212, ptr %14, align 8, !tbaa !9
  %213 = load double, ptr %12, align 8, !tbaa !9
  store double %213, ptr %13, align 8, !tbaa !9
  %214 = load double, ptr %11, align 8, !tbaa !9
  %215 = fadd double 1.000000e+00, %214
  %216 = fdiv double %215, 2.000000e+00
  %217 = call double @sqrt(double noundef %216) #6
  store double %217, ptr %11, align 8, !tbaa !9
  %218 = load double, ptr %12, align 8, !tbaa !9
  %219 = load double, ptr %11, align 8, !tbaa !9
  %220 = fmul double 2.000000e+00, %219
  %221 = fdiv double %218, %220
  store double %221, ptr %12, align 8, !tbaa !9
  br label %127, !llvm.loop !23

222:                                              ; preds = %127
  %223 = load ptr, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret ptr %223
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,1) "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 "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { noreturn 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn 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 = !{!"int", !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 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 4}
!14 = !{!"", !6, i64 0, !6, i64 4, !12, i64 8, !12, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 44}
!15 = !{!14, !6, i64 40}
!16 = !{!14, !6, i64 44}
!17 = !{!14, !6, i64 0}
!18 = !{!14, !10, i64 24}
!19 = !{!14, !12, i64 8}
!20 = !{!14, !12, i64 16}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; 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 [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.initGridGC_PS93 = external hidden unnamed_addr constant [61 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @initGridGC_PS93(i32 noundef %0, double noundef %1) local_unnamed_addr #4 {
  %3 = sitofp i32 %0 to double
  %4 = tail call double @log(double noundef %3) #6
  %5 = fdiv double %4, 0x3FE62E42FEFA39EF
  %6 = tail call double @llvm.floor.f64(double %5)
  %7 = fptosi double %6 to i32
  %ldexp = tail call double @ldexp(double 1.000000e+00, i32 %7) #6
  %8 = fptosi double %ldexp to i32
  %9 = tail call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 1, i64 noundef 48) #7
  %10 = mul nsw i32 %8, 3
  %11 = add nsw i32 %10, -1
  %12 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 %11, ptr %12, align 4, !tbaa !5
  %13 = icmp sgt i32 %8, 1
  br i1 %13, label %.lr.ph110.preheader, label %14

14:                                               ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 231, ptr noundef nonnull @__PRETTY_FUNCTION__.initGridGC_PS93) #8
  unreachable

.lr.ph110.preheader:                              ; preds = %2
  %15 = add nsw i32 %10, -2
  %16 = getelementptr inbounds i8, ptr %9, i64 44
  store i32 %15, ptr %16, align 4, !tbaa !12
  store i32 %0, ptr %9, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %9, i64 24
  store double %1, ptr %17, align 8, !tbaa !14
  %18 = zext nneg i32 %11 to i64
  %19 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 8) #7
  %20 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr %19, ptr %20, align 8, !tbaa !15
  %21 = tail call noalias ptr @calloc(i64 noundef %18, i64 noundef 8) #7
  %22 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr %21, ptr %22, align 8, !tbaa !16
  %23 = lshr i32 %11, 1
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds double, ptr %21, i64 %24
  store double 1.000000e+00, ptr %25, align 8, !tbaa !17
  %26 = add nsw i32 %8, -1
  %27 = zext nneg i32 %26 to i64
  %28 = getelementptr inbounds double, ptr %19, i64 %27
  store double 0xBFE7E60809D6E67A, ptr %28, align 8, !tbaa !17
  %29 = sub nsw i32 %11, %8
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds double, ptr %19, i64 %30
  store double 0x3FE7E60809D6E67A, ptr %31, align 8, !tbaa !17
  %32 = getelementptr inbounds double, ptr %21, i64 %27
  store double 0x3FE1FFFFFFFFFFFF, ptr %32, align 8, !tbaa !17
  %33 = getelementptr inbounds double, ptr %21, i64 %30
  store double 0x3FE1FFFFFFFFFFFF, ptr %33, align 8, !tbaa !17
  br label %.lr.ph110

.lr.ph110:                                        ; preds = %.lr.ph110.preheader, %._crit_edge
  %.0108 = phi i32 [ %34, %._crit_edge ], [ %8, %.lr.ph110.preheader ]
  %.091107 = phi i32 [ %67, %._crit_edge ], [ 3, %.lr.ph110.preheader ]
  %.094106 = phi double [ %.097103, %._crit_edge ], [ 5.000000e-01, %.lr.ph110.preheader ]
  %.095105 = phi double [ %.096104, %._crit_edge ], [ 0x3FEBB67AE8584CAA, %.lr.ph110.preheader ]
  %.096104 = phi double [ %72, %._crit_edge ], [ 5.000000e-01, %.lr.ph110.preheader ]
  %.097103 = phi double [ %70, %._crit_edge ], [ 0x3FEBB67AE8584CAA, %.lr.ph110.preheader ]
  %34 = sdiv i32 %.0108, 2
  %35 = icmp ugt i32 %.091107, 1
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph110
  %36 = sitofp i32 %.091107 to double
  %37 = sext i32 %34 to i64
  %38 = zext i32 %.091107 to i64
  br label %39

39:                                               ; preds = %.lr.ph, %39
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %39 ]
  %.092100 = phi double [ %.097103, %.lr.ph ], [ %65, %39 ]
  %.09399 = phi double [ %.096104, %.lr.ph ], [ %62, %39 ]
  %40 = fmul double %.09399, %.09399
  %41 = mul nsw i64 %indvars.iv, %37
  %42 = add nsw i64 %41, -1
  %43 = fmul double %.09399, 0x3FCB2995E7B7B604
  %44 = fmul double %43, %.092100
  %45 = tail call double @llvm.fmuladd.f64(double %40, double 2.000000e+00, double 3.000000e+00)
  %46 = tail call double @llvm.fmuladd.f64(double %44, double %45, double 1.000000e+00)
  %47 = trunc nuw nsw i64 %indvars.iv to i32
  %48 = uitofp nneg i32 %47 to double
  %49 = fdiv double %48, %36
  %50 = fsub double %46, %49
  %51 = fneg double %50
  %52 = getelementptr inbounds double, ptr %19, i64 %42
  store double %51, ptr %52, align 8, !tbaa !17
  %53 = trunc nsw i64 %41 to i32
  %54 = xor i32 %53, -1
  %55 = add i32 %10, %54
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %19, i64 %56
  store double %50, ptr %57, align 8, !tbaa !17
  %58 = fmul double %40, %40
  %59 = getelementptr inbounds double, ptr %21, i64 %42
  store double %58, ptr %59, align 8, !tbaa !17
  %60 = getelementptr inbounds double, ptr %21, i64 %56
  store double %58, ptr %60, align 8, !tbaa !17
  %61 = fmul double %.095105, %.092100
  %62 = tail call double @llvm.fmuladd.f64(double %.09399, double %.094106, double %61)
  %63 = fneg double %.09399
  %64 = fmul double %.095105, %63
  %65 = tail call double @llvm.fmuladd.f64(double %.092100, double %.094106, double %64)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %66 = icmp ult i64 %indvars.iv.next, %38
  br i1 %66, label %39, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %39, %.lr.ph110
  %67 = shl nsw i32 %.091107, 1
  %68 = fadd double %.097103, 1.000000e+00
  %69 = fmul double %68, 5.000000e-01
  %70 = tail call double @sqrt(double noundef %69) #6
  %71 = fmul double %70, 2.000000e+00
  %72 = fdiv double %.096104, %71
  %73 = shl nsw i32 %.091107, 3
  %74 = udiv i32 %73, 3
  %.not = icmp sgt i32 %74, %10
  br i1 %.not, label %._crit_edge111, label %.lr.ph110, !llvm.loop !20

._crit_edge111:                                   ; preds = %._crit_edge
  ret ptr %9
}

; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) local_unnamed_addr #5

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { noreturn 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 #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree willreturn }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn 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 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 44}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 44}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !11, i64 24}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !10, i64 16}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass