; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Core/Noise.ll (ZN3imp7simplexEddi)

; 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: mustprogress uwtable
declare dso_local void @_ZN3imp16PermutationTable4initEijj(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, i32 noundef, i32 noundef) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3imp9fastfloorEd(double noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3imp10randomGradEiii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3imp16PermutationTable11getInstanceEv() #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3imp9perlinDotEPidd(ptr noundef, double noundef, double noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3imp7simplexEddi(double noundef %0, double noundef %1, i32 noundef %2) #0 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %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 i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  store double %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %31 = call noundef ptr @_ZN3imp16PermutationTable11getInstanceEv()
  call void @_ZN3imp16PermutationTable4initEijj(ptr noundef nonnull align 8 dereferenceable(25) %31, i32 noundef 0, i32 noundef 256, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %32 = call float @sqrtf(float noundef 3.000000e+00) #5
  %33 = fpext float %32 to double
  %34 = fsub double %33, 1.000000e+00
  %35 = fmul double 5.000000e-01, %34
  store double %35, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %36 = load double, ptr %4, align 8, !tbaa !5
  %37 = load double, ptr %5, align 8, !tbaa !5
  %38 = fadd double %36, %37
  %39 = load double, ptr %7, align 8, !tbaa !5
  %40 = fmul double %38, %39
  store double %40, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %41 = load double, ptr %4, align 8, !tbaa !5
  %42 = load double, ptr %8, align 8, !tbaa !5
  %43 = fadd double %41, %42
  %44 = call noundef i32 @_ZN3imp9fastfloorEd(double noundef %43)
  store i32 %44, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %45 = load double, ptr %5, align 8, !tbaa !5
  %46 = load double, ptr %8, align 8, !tbaa !5
  %47 = fadd double %45, %46
  %48 = call noundef i32 @_ZN3imp9fastfloorEd(double noundef %47)
  store i32 %48, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %49 = call float @sqrtf(float noundef 3.000000e+00) #5
  %50 = fpext float %49 to double
  %51 = fsub double 3.000000e+00, %50
  %52 = fdiv double %51, 6.000000e+00
  store double %52, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = add nsw i32 %53, %54
  %56 = sitofp i32 %55 to double
  %57 = load double, ptr %11, align 8, !tbaa !5
  %58 = fmul double %56, %57
  store double %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = sitofp i32 %59 to double
  %61 = load double, ptr %12, align 8, !tbaa !5
  %62 = fsub double %60, %61
  store double %62, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = sitofp i32 %63 to double
  %65 = load double, ptr %12, align 8, !tbaa !5
  %66 = fsub double %64, %65
  store double %66, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %67 = load double, ptr %4, align 8, !tbaa !5
  %68 = load double, ptr %13, align 8, !tbaa !5
  %69 = fsub double %67, %68
  store double %69, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %70 = load double, ptr %5, align 8, !tbaa !5
  %71 = load double, ptr %14, align 8, !tbaa !5
  %72 = fsub double %70, %71
  store double %72, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %73 = load double, ptr %15, align 8, !tbaa !5
  %74 = load double, ptr %16, align 8, !tbaa !5
  %75 = fcmp ogt double %73, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %3
  store i32 1, ptr %17, align 4, !tbaa !9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %78

77:                                               ; preds = %3
  store i32 0, ptr %17, align 4, !tbaa !9
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %77, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %79 = load double, ptr %15, align 8, !tbaa !5
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = sitofp i32 %80 to double
  %82 = fsub double %79, %81
  %83 = load double, ptr %11, align 8, !tbaa !5
  %84 = fadd double %82, %83
  store double %84, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %85 = load double, ptr %16, align 8, !tbaa !5
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = sitofp i32 %86 to double
  %88 = fsub double %85, %87
  %89 = load double, ptr %11, align 8, !tbaa !5
  %90 = fadd double %88, %89
  store double %90, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %91 = load double, ptr %15, align 8, !tbaa !5
  %92 = fsub double %91, 1.000000e+00
  %93 = load double, ptr %11, align 8, !tbaa !5
  %94 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %93, double %92)
  store double %94, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %95 = load double, ptr %16, align 8, !tbaa !5
  %96 = fsub double %95, 1.000000e+00
  %97 = load double, ptr %11, align 8, !tbaa !5
  %98 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %97, double %96)
  store double %98, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = and i32 %99, 255
  store i32 %100, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = and i32 %101, 255
  store i32 %102, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %103 = load double, ptr %15, align 8, !tbaa !5
  %104 = load double, ptr %15, align 8, !tbaa !5
  %105 = fneg double %103
  %106 = call double @llvm.fmuladd.f64(double %105, double %104, double 5.000000e-01)
  %107 = load double, ptr %16, align 8, !tbaa !5
  %108 = load double, ptr %16, align 8, !tbaa !5
  %109 = fneg double %107
  %110 = call double @llvm.fmuladd.f64(double %109, double %108, double %106)
  store double %110, ptr %28, align 8, !tbaa !5
  %111 = load double, ptr %28, align 8, !tbaa !5
  %112 = fcmp olt double %111, 0.000000e+00
  br i1 %112, label %113, label %114

113:                                              ; preds = %78
  store double 0.000000e+00, ptr %25, align 8, !tbaa !5
  br label %132

114:                                              ; preds = %78
  %115 = load double, ptr %28, align 8, !tbaa !5
  %116 = load double, ptr %28, align 8, !tbaa !5
  %117 = fmul double %116, %115
  store double %117, ptr %28, align 8, !tbaa !5
  %118 = load double, ptr %28, align 8, !tbaa !5
  %119 = load double, ptr %28, align 8, !tbaa !5
  %120 = fmul double %118, %119
  %121 = load i32, ptr %23, align 4, !tbaa !9
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = srem i32 %121, %122
  %124 = load i32, ptr %24, align 4, !tbaa !9
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = srem i32 %124, %125
  %127 = call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %123, i32 noundef %126, i32 noundef 0)
  %128 = load double, ptr %15, align 8, !tbaa !5
  %129 = load double, ptr %16, align 8, !tbaa !5
  %130 = call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %127, double noundef %128, double noundef %129)
  %131 = fmul double %120, %130
  store double %131, ptr %25, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %114, %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %133 = load double, ptr %19, align 8, !tbaa !5
  %134 = load double, ptr %19, align 8, !tbaa !5
  %135 = fneg double %133
  %136 = call double @llvm.fmuladd.f64(double %135, double %134, double 5.000000e-01)
  %137 = load double, ptr %20, align 8, !tbaa !5
  %138 = load double, ptr %20, align 8, !tbaa !5
  %139 = fneg double %137
  %140 = call double @llvm.fmuladd.f64(double %139, double %138, double %136)
  store double %140, ptr %29, align 8, !tbaa !5
  %141 = load double, ptr %29, align 8, !tbaa !5
  %142 = fcmp olt double %141, 0.000000e+00
  br i1 %142, label %143, label %144

143:                                              ; preds = %132
  store double 0.000000e+00, ptr %26, align 8, !tbaa !5
  br label %166

144:                                              ; preds = %132
  %145 = load double, ptr %29, align 8, !tbaa !5
  %146 = load double, ptr %29, align 8, !tbaa !5
  %147 = fmul double %146, %145
  store double %147, ptr %29, align 8, !tbaa !5
  %148 = load double, ptr %29, align 8, !tbaa !5
  %149 = load double, ptr %29, align 8, !tbaa !5
  %150 = fmul double %148, %149
  %151 = load i32, ptr %23, align 4, !tbaa !9
  %152 = load i32, ptr %17, align 4, !tbaa !9
  %153 = add nsw i32 %151, %152
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = srem i32 %153, %154
  %156 = load i32, ptr %24, align 4, !tbaa !9
  %157 = load i32, ptr %18, align 4, !tbaa !9
  %158 = add nsw i32 %156, %157
  %159 = load i32, ptr %6, align 4, !tbaa !9
  %160 = srem i32 %158, %159
  %161 = call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %155, i32 noundef %160, i32 noundef 0)
  %162 = load double, ptr %19, align 8, !tbaa !5
  %163 = load double, ptr %20, align 8, !tbaa !5
  %164 = call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %161, double noundef %162, double noundef %163)
  %165 = fmul double %150, %164
  store double %165, ptr %26, align 8, !tbaa !5
  br label %166

166:                                              ; preds = %144, %143
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %167 = load double, ptr %21, align 8, !tbaa !5
  %168 = load double, ptr %21, align 8, !tbaa !5
  %169 = fneg double %167
  %170 = call double @llvm.fmuladd.f64(double %169, double %168, double 5.000000e-01)
  %171 = load double, ptr %22, align 8, !tbaa !5
  %172 = load double, ptr %22, align 8, !tbaa !5
  %173 = fneg double %171
  %174 = call double @llvm.fmuladd.f64(double %173, double %172, double %170)
  store double %174, ptr %30, align 8, !tbaa !5
  %175 = load double, ptr %30, align 8, !tbaa !5
  %176 = fcmp olt double %175, 0.000000e+00
  br i1 %176, label %177, label %178

177:                                              ; preds = %166
  store double 0.000000e+00, ptr %27, align 8, !tbaa !5
  br label %198

178:                                              ; preds = %166
  %179 = load double, ptr %30, align 8, !tbaa !5
  %180 = load double, ptr %30, align 8, !tbaa !5
  %181 = fmul double %180, %179
  store double %181, ptr %30, align 8, !tbaa !5
  %182 = load double, ptr %30, align 8, !tbaa !5
  %183 = load double, ptr %30, align 8, !tbaa !5
  %184 = fmul double %182, %183
  %185 = load i32, ptr %23, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  %187 = load i32, ptr %6, align 4, !tbaa !9
  %188 = srem i32 %186, %187
  %189 = load i32, ptr %24, align 4, !tbaa !9
  %190 = add nsw i32 %189, 1
  %191 = load i32, ptr %6, align 4, !tbaa !9
  %192 = srem i32 %190, %191
  %193 = call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %188, i32 noundef %192, i32 noundef 0)
  %194 = load double, ptr %21, align 8, !tbaa !5
  %195 = load double, ptr %22, align 8, !tbaa !5
  %196 = call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %193, double noundef %194, double noundef %195)
  %197 = fmul double %184, %196
  store double %197, ptr %27, align 8, !tbaa !5
  br label %198

198:                                              ; preds = %178, %177
  %199 = load double, ptr %25, align 8, !tbaa !5
  %200 = load double, ptr %26, align 8, !tbaa !5
  %201 = fadd double %199, %200
  %202 = load double, ptr %27, align 8, !tbaa !5
  %203 = fadd double %201, %202
  %204 = fmul double 7.000000e+01, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret double %204
}

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #4

attributes #0 = { mustprogress 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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 }

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; 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 uwtable
declare dso_local void @_ZN3imp16PermutationTable4initEijj(ptr noundef nonnull align 8 dereferenceable(25), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3imp9fastfloorEd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3imp10randomGradEiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN3imp16PermutationTable11getInstanceEv() local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3imp9perlinDotEPidd(ptr noundef, double noundef, double noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN3imp7simplexEddi(double noundef %0, double noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = tail call noundef ptr @_ZN3imp16PermutationTable11getInstanceEv()
  tail call void @_ZN3imp16PermutationTable4initEijj(ptr noundef nonnull align 8 dereferenceable(25) %4, i32 noundef 0, i32 noundef 256, i32 noundef 2)
  %5 = fadd double %0, %1
  %6 = fmul double %5, 0x3FD76CF5C0000000
  %7 = fadd double %6, %0
  %8 = tail call noundef i32 @_ZN3imp9fastfloorEd(double noundef %7)
  %9 = fadd double %6, %1
  %10 = tail call noundef i32 @_ZN3imp9fastfloorEd(double noundef %9)
  %11 = add nsw i32 %10, %8
  %12 = sitofp i32 %11 to double
  %13 = fmul double %12, 0x3FCB0CB180000000
  %14 = sitofp i32 %8 to double
  %15 = fsub double %14, %13
  %16 = sitofp i32 %10 to double
  %17 = fsub double %16, %13
  %18 = fsub double %0, %15
  %19 = fsub double %1, %17
  %20 = fcmp ule double %18, %19
  %. = zext i1 %20 to i32
  %not. = xor i1 %20, true
  %.88 = zext i1 %not. to i32
  %21 = uitofp i1 %not. to double
  %22 = fsub double %18, %21
  %23 = fadd double %22, 0x3FCB0CB180000000
  %24 = uitofp i1 %20 to double
  %25 = fsub double %19, %24
  %26 = fadd double %25, 0x3FCB0CB180000000
  %27 = fadd double %18, -1.000000e+00
  %28 = fadd double %27, 0x3FDB0CB180000000
  %29 = fadd double %19, -1.000000e+00
  %30 = fadd double %29, 0x3FDB0CB180000000
  %31 = and i32 %8, 255
  %32 = and i32 %10, 255
  %33 = fneg double %18
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %18, double 5.000000e-01)
  %35 = fneg double %19
  %36 = tail call double @llvm.fmuladd.f64(double %35, double %19, double %34)
  %37 = fcmp olt double %36, 0.000000e+00
  br i1 %37, label %46, label %38

38:                                               ; preds = %3
  %39 = fmul double %36, %36
  %40 = fmul double %39, %39
  %41 = srem i32 %31, %2
  %42 = srem i32 %32, %2
  %43 = tail call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %41, i32 noundef %42, i32 noundef 0)
  %44 = tail call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %43, double noundef %18, double noundef %19)
  %45 = fmul double %40, %44
  br label %46

46:                                               ; preds = %3, %38
  %.082 = phi double [ %45, %38 ], [ 0.000000e+00, %3 ]
  %47 = fneg double %23
  %48 = tail call double @llvm.fmuladd.f64(double %47, double %23, double 5.000000e-01)
  %49 = fneg double %26
  %50 = tail call double @llvm.fmuladd.f64(double %49, double %26, double %48)
  %51 = fcmp olt double %50, 0.000000e+00
  br i1 %51, label %62, label %52

52:                                               ; preds = %46
  %53 = fmul double %50, %50
  %54 = fmul double %53, %53
  %55 = add nuw nsw i32 %31, %.88
  %56 = srem i32 %55, %2
  %57 = add nuw nsw i32 %32, %.
  %58 = srem i32 %57, %2
  %59 = tail call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %56, i32 noundef %58, i32 noundef 0)
  %60 = tail call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %59, double noundef %23, double noundef %26)
  %61 = fmul double %54, %60
  br label %62

62:                                               ; preds = %46, %52
  %.081 = phi double [ %61, %52 ], [ 0.000000e+00, %46 ]
  %63 = fneg double %28
  %64 = tail call double @llvm.fmuladd.f64(double %63, double %28, double 5.000000e-01)
  %65 = fneg double %30
  %66 = tail call double @llvm.fmuladd.f64(double %65, double %30, double %64)
  %67 = fcmp olt double %66, 0.000000e+00
  br i1 %67, label %78, label %68

68:                                               ; preds = %62
  %69 = fmul double %66, %66
  %70 = fmul double %69, %69
  %71 = add nuw nsw i32 %31, 1
  %72 = srem i32 %71, %2
  %73 = add nuw nsw i32 %32, 1
  %74 = srem i32 %73, %2
  %75 = tail call noundef ptr @_ZN3imp10randomGradEiii(i32 noundef %72, i32 noundef %74, i32 noundef 0)
  %76 = tail call noundef double @_ZN3imp9perlinDotEPidd(ptr noundef %75, double noundef %28, double noundef %30)
  %77 = fmul double %70, %76
  br label %78

78:                                               ; preds = %62, %68
  %.0 = phi double [ %77, %68 ], [ 0.000000e+00, %62 ]
  %79 = fadd double %.082, %.081
  %80 = fadd double %79, %.0
  %81 = fmul double %80, 7.000000e+01
  ret double %81
}

attributes #0 = { mustprogress 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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass