; LLVM IR from bohanwang/libpgo :: src/core/perlinNoise/perlinNoise.ll (ZN3pgo11PerlinNoise11PerlinNoise7noise3DEPd)

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

; 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 double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496), double noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496), double noundef, double noundef, double noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496), i32 noundef, double noundef, double noundef, double noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise7noise3DEPd(ptr noundef nonnull align 8 dereferenceable(2496) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [3 x i32], align 4
  %6 = alloca [3 x double], align 16
  %7 = alloca [3 x double], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %71, %2
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = icmp slt i32 %17, 3
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  br label %74

20:                                               ; preds = %16
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds double, ptr %21, i64 %23
  %25 = load double, ptr %24, align 8, !tbaa !11
  %26 = fcmp ogt double %25, 0.000000e+00
  br i1 %26, label %27, label %37

27:                                               ; preds = %20
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds double, ptr %28, i64 %30
  %32 = load double, ptr %31, align 8, !tbaa !11
  %33 = fptosi double %32 to i32
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !9
  br label %48

37:                                               ; preds = %20
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds double, ptr %38, i64 %40
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = fsub double %42, 1.000000e+00
  %44 = fptosi double %43 to i32
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %37, %27
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %49, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sitofp i32 %57 to double
  %59 = fsub double %53, %58
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %61
  store double %59, ptr %62, align 8, !tbaa !11
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !11
  %67 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %66)
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 %69
  store double %67, ptr %70, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %48
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %8, align 4, !tbaa !9
  br label %16, !llvm.loop !13

74:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %75 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %76)
  %78 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = add nsw i32 %77, %79
  store i32 %80, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %81 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  %84 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %83)
  %85 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 1
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = add nsw i32 %84, %86
  store i32 %87, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %88)
  %90 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = add nsw i32 %89, %91
  store i32 %92, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  %95 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %94)
  %96 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = add nsw i32 %95, %97
  store i32 %98, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %99)
  %101 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = add nsw i32 %100, %102
  store i32 %103, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  %106 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %105)
  %107 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 2
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = add nsw i32 %106, %108
  store i32 %109, ptr %14, align 4, !tbaa !9
  %110 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 2
  %111 = load double, ptr %110, align 16, !tbaa !11
  %112 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 1
  %113 = load double, ptr %112, align 8, !tbaa !11
  %114 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  %115 = load double, ptr %114, align 16, !tbaa !11
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %116)
  %118 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %119 = load double, ptr %118, align 16, !tbaa !11
  %120 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %121 = load double, ptr %120, align 8, !tbaa !11
  %122 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %123 = load double, ptr %122, align 16, !tbaa !11
  %124 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %117, double noundef %119, double noundef %121, double noundef %123)
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %125)
  %127 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %128 = load double, ptr %127, align 16, !tbaa !11
  %129 = fsub double %128, 1.000000e+00
  %130 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %131 = load double, ptr %130, align 8, !tbaa !11
  %132 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %133 = load double, ptr %132, align 16, !tbaa !11
  %134 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %126, double noundef %129, double noundef %131, double noundef %133)
  %135 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %115, double noundef %124, double noundef %134)
  %136 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  %137 = load double, ptr %136, align 16, !tbaa !11
  %138 = load i32, ptr %12, align 4, !tbaa !9
  %139 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %138)
  %140 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %141 = load double, ptr %140, align 16, !tbaa !11
  %142 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = fsub double %143, 1.000000e+00
  %145 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %146 = load double, ptr %145, align 16, !tbaa !11
  %147 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %139, double noundef %141, double noundef %144, double noundef %146)
  %148 = load i32, ptr %14, align 4, !tbaa !9
  %149 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %148)
  %150 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %151 = load double, ptr %150, align 16, !tbaa !11
  %152 = fsub double %151, 1.000000e+00
  %153 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = fsub double %154, 1.000000e+00
  %156 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %157 = load double, ptr %156, align 16, !tbaa !11
  %158 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %149, double noundef %152, double noundef %155, double noundef %157)
  %159 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %137, double noundef %147, double noundef %158)
  %160 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %113, double noundef %135, double noundef %159)
  %161 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 1
  %162 = load double, ptr %161, align 8, !tbaa !11
  %163 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  %164 = load double, ptr %163, align 16, !tbaa !11
  %165 = load i32, ptr %11, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  %167 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %166)
  %168 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %169 = load double, ptr %168, align 16, !tbaa !11
  %170 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %171 = load double, ptr %170, align 8, !tbaa !11
  %172 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %173 = load double, ptr %172, align 16, !tbaa !11
  %174 = fsub double %173, 1.000000e+00
  %175 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %167, double noundef %169, double noundef %171, double noundef %174)
  %176 = load i32, ptr %13, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  %178 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %177)
  %179 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %180 = load double, ptr %179, align 16, !tbaa !11
  %181 = fsub double %180, 1.000000e+00
  %182 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %183 = load double, ptr %182, align 8, !tbaa !11
  %184 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %185 = load double, ptr %184, align 16, !tbaa !11
  %186 = fsub double %185, 1.000000e+00
  %187 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %178, double noundef %181, double noundef %183, double noundef %186)
  %188 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %164, double noundef %175, double noundef %187)
  %189 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  %190 = load double, ptr %189, align 16, !tbaa !11
  %191 = load i32, ptr %12, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  %193 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %192)
  %194 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %195 = load double, ptr %194, align 16, !tbaa !11
  %196 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = fsub double %197, 1.000000e+00
  %199 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %200 = load double, ptr %199, align 16, !tbaa !11
  %201 = fsub double %200, 1.000000e+00
  %202 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %193, double noundef %195, double noundef %198, double noundef %201)
  %203 = load i32, ptr %14, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  %205 = call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %204)
  %206 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %207 = load double, ptr %206, align 16, !tbaa !11
  %208 = fsub double %207, 1.000000e+00
  %209 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 1
  %210 = load double, ptr %209, align 8, !tbaa !11
  %211 = fsub double %210, 1.000000e+00
  %212 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 2
  %213 = load double, ptr %212, align 16, !tbaa !11
  %214 = fsub double %213, 1.000000e+00
  %215 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, i32 noundef %205, double noundef %208, double noundef %211, double noundef %214)
  %216 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %190, double noundef %202, double noundef %215)
  %217 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %162, double noundef %188, double noundef %216)
  %218 = call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %15, double noundef %111, double noundef %160, double noundef %217)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #2
  ret double %218
}

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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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 double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496), double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496), double noundef, double noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496), i32 noundef, double noundef, double noundef, double noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN3pgo11PerlinNoise11PerlinNoise7noise3DEPd(ptr noundef nonnull align 8 dereferenceable(2496) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 align 2 {
  %3 = load double, ptr %1, align 8, !tbaa !5
  %4 = fcmp ogt double %3, 0.000000e+00
  %5 = fadd double %3, -1.000000e+00
  %.sroa.034.0.in = select i1 %4, double %3, double %5
  %.sroa.034.0 = fptosi double %.sroa.034.0.in to i32
  %6 = sitofp i32 %.sroa.034.0 to double
  %7 = fsub double %3, %6
  %8 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %7)
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = fcmp ogt double %10, 0.000000e+00
  %12 = fadd double %10, -1.000000e+00
  %.sroa.636.0.in = select i1 %11, double %10, double %12
  %.sroa.636.0 = fptosi double %.sroa.636.0.in to i32
  %13 = sitofp i32 %.sroa.636.0 to double
  %14 = fsub double %10, %13
  %15 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %14)
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = fcmp ogt double %17, 0.000000e+00
  %19 = fadd double %17, -1.000000e+00
  %.sroa.10.0.in = select i1 %18, double %17, double %19
  %.sroa.10.0 = fptosi double %.sroa.10.0.in to i32
  %20 = sitofp i32 %.sroa.10.0 to double
  %21 = fsub double %17, %20
  %22 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise17computeFadeCurvesEd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %21)
  %23 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %.sroa.034.0)
  %24 = add nsw i32 %23, %.sroa.636.0
  %25 = add nsw i32 %.sroa.034.0, 1
  %26 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %25)
  %27 = add nsw i32 %26, %.sroa.636.0
  %28 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %24)
  %29 = add nsw i32 %28, %.sroa.10.0
  %30 = add nsw i32 %24, 1
  %31 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %30)
  %32 = add nsw i32 %31, %.sroa.10.0
  %33 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %27)
  %34 = add nsw i32 %33, %.sroa.10.0
  %35 = add nsw i32 %27, 1
  %36 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %35)
  %37 = add nsw i32 %36, %.sroa.10.0
  %38 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %29)
  %39 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %38, double noundef %7, double noundef %14, double noundef %21)
  %40 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %34)
  %41 = fadd double %7, -1.000000e+00
  %42 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %40, double noundef %41, double noundef %14, double noundef %21)
  %43 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %8, double noundef %39, double noundef %42)
  %44 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %32)
  %45 = fadd double %14, -1.000000e+00
  %46 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %44, double noundef %7, double noundef %45, double noundef %21)
  %47 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %37)
  %48 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %47, double noundef %41, double noundef %45, double noundef %21)
  %49 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %8, double noundef %46, double noundef %48)
  %50 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %15, double noundef %43, double noundef %49)
  %51 = add nsw i32 %29, 1
  %52 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %51)
  %53 = fadd double %21, -1.000000e+00
  %54 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %52, double noundef %7, double noundef %14, double noundef %53)
  %55 = add nsw i32 %34, 1
  %56 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %55)
  %57 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %56, double noundef %41, double noundef %14, double noundef %53)
  %58 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %8, double noundef %54, double noundef %57)
  %59 = add nsw i32 %32, 1
  %60 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %59)
  %61 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %60, double noundef %7, double noundef %45, double noundef %53)
  %62 = add nsw i32 %37, 1
  %63 = tail call noundef i32 @_ZN3pgo11PerlinNoise11PerlinNoise14getPermutationEi(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %62)
  %64 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise10gradient3DEiddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, i32 noundef %63, double noundef %41, double noundef %45, double noundef %53)
  %65 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %8, double noundef %61, double noundef %64)
  %66 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %15, double noundef %58, double noundef %65)
  %67 = tail call noundef double @_ZN3pgo11PerlinNoise11PerlinNoise19linearInterpolationEddd(ptr noundef nonnull align 8 dereferenceable(2496) %0, double noundef %22, double noundef %50, double noundef %66)
  ret double %67
}

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

!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++ TBAA"}


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