; LLVM IR from sp-nitech/SPTK :: third_party/WORLD (cheaptrick)

; 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.sptk::world::RandnState" = type { i32, i32, i32, i32 }
%"struct.sptk::world::ForwardRealFFT" = type { i32, ptr, ptr, %"struct.sptk::world::fft_plan" }
%"struct.sptk::world::fft_plan" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.sptk::world::InverseRealFFT" = type { i32, ptr, ptr, %"struct.sptk::world::fft_plan" }
%"struct.sptk::world::CheapTrickOption" = type { double, double, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4sptk5world23GetF0FloorForCheapTrickEii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5world10CheapTrickEPKdiiS2_S2_iPKNS0_16CheapTrickOptionEPPd(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7) #1 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.sptk::world::RandnState", align 4
  %19 = alloca double, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"struct.sptk::world::ForwardRealFFT", align 8
  %22 = alloca %"struct.sptk::world::InverseRealFFT", align 8
  %23 = alloca double, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store i32 %5, ptr %14, align 4, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %27 = load ptr, ptr %15, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.sptk::world::CheapTrickOption", ptr %27, i32 0, i32 2
  %29 = load i32, ptr %28, align 8, !tbaa !11
  store i32 %29, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  call void @llvm.memset.p0.i64(ptr align 4 %18, i8 0, i64 16, i1 false)
  call void @_ZN4sptk5world12randn_reseedEPNS0_10RandnStateE(ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = load i32, ptr %17, align 4, !tbaa !9
  %32 = call noundef double @_ZN4sptk5world23GetF0FloorForCheapTrickEii(i32 noundef %30, i32 noundef %31)
  store double %32, ptr %19, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %33 = load i32, ptr %17, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %34, i64 8)
  %36 = extractvalue { i64, i1 } %35, 1
  %37 = extractvalue { i64, i1 } %35, 0
  %38 = select i1 %36, i64 -1, i64 %37
  %39 = call noalias noundef nonnull ptr @_Znam(i64 noundef %38) #9
  store ptr %39, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %21) #8
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 96, i1 false)
  %40 = load i32, ptr %17, align 4, !tbaa !9
  call void @_ZN4sptk5world24InitializeForwardRealFFTEiPNS0_14ForwardRealFFTE(i32 noundef %40, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 96, ptr %22) #8
  call void @llvm.memset.p0.i64(ptr align 8 %22, i8 0, i64 96, i1 false)
  %41 = load i32, ptr %17, align 4, !tbaa !9
  call void @_ZN4sptk5world24InitializeInverseRealFFTEiPNS0_14InverseRealFFTE(i32 noundef %41, ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %102, %8
  %43 = load i32, ptr %24, align 4, !tbaa !9
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 2, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %105

47:                                               ; preds = %42
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = load i32, ptr %24, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %48, i64 %50
  %52 = load double, ptr %51, align 8, !tbaa !14
  %53 = load double, ptr %19, align 8, !tbaa !14
  %54 = fcmp ole double %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %47
  br label %62

56:                                               ; preds = %47
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load i32, ptr %24, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !14
  br label %62

62:                                               ; preds = %56, %55
  %63 = phi double [ 5.000000e+02, %55 ], [ %61, %56 ]
  store double %63, ptr %23, align 8, !tbaa !14
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = load double, ptr %23, align 8, !tbaa !14
  %68 = load i32, ptr %17, align 4, !tbaa !9
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load i32, ptr %24, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %69, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !14
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.sptk::world::CheapTrickOption", ptr %74, i32 0, i32 0
  %76 = load double, ptr %75, align 8, !tbaa !15
  %77 = load ptr, ptr %20, align 8, !tbaa !5
  call void @_ZN4sptk5world12_GLOBAL__N_121CheapTrickGeneralBodyEPKdiididdPKNS0_14ForwardRealFFTEPKNS0_14InverseRealFFTEPdPNS0_10RandnStateE(ptr noundef %64, i32 noundef %65, i32 noundef %66, double noundef %67, i32 noundef %68, double noundef %73, double noundef %76, ptr noundef %21, ptr noundef %22, ptr noundef %77, ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %98, %62
  %79 = load i32, ptr %26, align 4, !tbaa !9
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = sdiv i32 %80, 2
  %82 = icmp sle i32 %79, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  store i32 5, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %101

84:                                               ; preds = %78
  %85 = load ptr, ptr %20, align 8, !tbaa !5
  %86 = load i32, ptr %26, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %85, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !14
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = load i32, ptr %24, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = load i32, ptr %26, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds double, ptr %94, i64 %96
  store double %89, ptr %97, align 8, !tbaa !14
  br label %98

98:                                               ; preds = %84
  %99 = load i32, ptr %26, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %26, align 4, !tbaa !9
  br label %78, !llvm.loop !16

101:                                              ; preds = %83
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %24, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %24, align 4, !tbaa !9
  br label %42, !llvm.loop !18

105:                                              ; preds = %46
  call void @_ZN4sptk5world21DestroyForwardRealFFTEPNS0_14ForwardRealFFTE(ptr noundef %21)
  call void @_ZN4sptk5world21DestroyInverseRealFFTEPNS0_14InverseRealFFTE(ptr noundef %22)
  %106 = load ptr, ptr %20, align 8, !tbaa !5
  %107 = icmp eq ptr %106, null
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  call void @_ZdaPv(ptr noundef %106) #10
  br label %109

109:                                              ; preds = %108, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 96, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @_ZN4sptk5world12randn_reseedEPNS0_10RandnStateE(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #6

declare void @_ZN4sptk5world24InitializeForwardRealFFTEiPNS0_14ForwardRealFFTE(i32 noundef, ptr noundef) #4

declare void @_ZN4sptk5world24InitializeInverseRealFFTEiPNS0_14InverseRealFFTE(i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4sptk5world12_GLOBAL__N_121CheapTrickGeneralBodyEPKdiididdPKNS0_14ForwardRealFFTEPKNS0_14InverseRealFFTEPdPNS0_10RandnStateE(ptr noundef, i32 noundef, i32 noundef, double noundef, i32 noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

declare void @_ZN4sptk5world21DestroyForwardRealFFTEPNS0_14ForwardRealFFTE(ptr noundef) #4

declare void @_ZN4sptk5world21DestroyInverseRealFFTEPNS0_14InverseRealFFTE(ptr noundef) #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

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" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin allocsize(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 #7 = { nobuiltin 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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, !10, i64 16}
!12 = !{!"_ZTSN4sptk5world16CheapTrickOptionE", !13, i64 0, !13, i64 8, !10, i64 16}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


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

%"struct.sptk::world::RandnState" = type { i32, i32, i32, i32 }
%"struct.sptk::world::ForwardRealFFT" = type { i32, ptr, ptr, %"struct.sptk::world::fft_plan" }
%"struct.sptk::world::fft_plan" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.sptk::world::InverseRealFFT" = type { i32, ptr, ptr, %"struct.sptk::world::fft_plan" }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4sptk5world23GetF0FloorForCheapTrickEii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5world10CheapTrickEPKdiiS2_S2_iPKNS0_16CheapTrickOptionEPPd(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, i32 noundef %5, ptr nocapture noundef readonly %6, ptr nocapture noundef readonly %7) local_unnamed_addr #1 {
  %9 = alloca %"struct.sptk::world::RandnState", align 4
  %10 = alloca %"struct.sptk::world::ForwardRealFFT", align 8
  %11 = alloca %"struct.sptk::world::InverseRealFFT", align 8
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %.fr = freeze i32 %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  call void @_ZN4sptk5world12randn_reseedEPNS0_10RandnStateE(ptr noundef nonnull %9)
  %14 = call noundef double @_ZN4sptk5world23GetF0FloorForCheapTrickEii(i32 noundef %2, i32 noundef %.fr)
  %15 = zext nneg i32 %.fr to i64
  %16 = icmp slt i32 %.fr, 0
  %17 = shl nuw nsw i64 %15, 3
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #8
  %20 = ptrtoint ptr %19 to i64
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %10) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %10, i8 0, i64 96, i1 false)
  call void @_ZN4sptk5world24InitializeForwardRealFFTEiPNS0_14ForwardRealFFTE(i32 noundef %.fr, ptr noundef nonnull %10)
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %11) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %11, i8 0, i64 96, i1 false)
  call void @_ZN4sptk5world24InitializeInverseRealFFTEiPNS0_14InverseRealFFTE(i32 noundef %.fr, ptr noundef nonnull %11)
  %21 = icmp sgt i32 %5, 0
  br i1 %21, label %.lr.ph37, label %._crit_edge38

.lr.ph37:                                         ; preds = %8
  %.not33 = icmp slt i32 %.fr, -1
  br i1 %.not33, label %.lr.ph37.split.us.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph37
  %22 = sdiv i32 %.fr, 2
  %23 = add nuw nsw i32 %22, 1
  %wide.trip.count44 = zext nneg i32 %5 to i64
  %wide.trip.count = zext i32 %23 to i64
  %24 = zext i32 %22 to i64
  %min.iters.check = icmp ult i32 %22, 3
  %n.vec = and i64 %wide.trip.count, 4294967292
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph

.lr.ph37.split.us.preheader:                      ; preds = %.lr.ph37
  %wide.trip.count49 = zext nneg i32 %5 to i64
  br label %.lr.ph37.split.us

.lr.ph37.split.us:                                ; preds = %.lr.ph37.split.us.preheader, %.lr.ph37.split.us
  %indvars.iv46 = phi i64 [ 0, %.lr.ph37.split.us.preheader ], [ %indvars.iv.next47, %.lr.ph37.split.us ]
  %25 = getelementptr inbounds double, ptr %4, i64 %indvars.iv46
  %26 = load double, ptr %25, align 8, !tbaa !11
  %27 = fcmp ugt double %26, %14
  %28 = select i1 %27, double %26, double 5.000000e+02
  %29 = getelementptr inbounds double, ptr %3, i64 %indvars.iv46
  %30 = load double, ptr %29, align 8, !tbaa !11
  %31 = load double, ptr %6, align 8, !tbaa !12
  call void @_ZN4sptk5world12_GLOBAL__N_121CheapTrickGeneralBodyEPKdiididdPKNS0_14ForwardRealFFTEPKNS0_14InverseRealFFTEPdPNS0_10RandnStateE(ptr noundef %0, i32 noundef %1, i32 noundef %2, double noundef %28, i32 noundef %.fr, double noundef %30, double noundef %31, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %19, ptr noundef nonnull %9)
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %._crit_edge38, label %.lr.ph37.split.us, !llvm.loop !13

._crit_edge38:                                    ; preds = %._crit_edge, %.lr.ph37.split.us, %8
  call void @_ZN4sptk5world21DestroyForwardRealFFTEPNS0_14ForwardRealFFTE(ptr noundef nonnull %10)
  call void @_ZN4sptk5world21DestroyInverseRealFFTEPNS0_14InverseRealFFTE(ptr noundef nonnull %11)
  call void @_ZdaPv(ptr noundef nonnull %19) #9
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  ret void

.lr.ph:                                           ; preds = %.lr.ph.preheader, %._crit_edge
  %indvars.iv41 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next42, %._crit_edge ]
  %32 = getelementptr inbounds double, ptr %4, i64 %indvars.iv41
  %33 = load double, ptr %32, align 8, !tbaa !11
  %34 = fcmp ugt double %33, %14
  %35 = select i1 %34, double %33, double 5.000000e+02
  %36 = getelementptr inbounds double, ptr %3, i64 %indvars.iv41
  %37 = load double, ptr %36, align 8, !tbaa !11
  %38 = load double, ptr %6, align 8, !tbaa !12
  call void @_ZN4sptk5world12_GLOBAL__N_121CheapTrickGeneralBodyEPKdiididdPKNS0_14ForwardRealFFTEPKNS0_14InverseRealFFTEPdPNS0_10RandnStateE(ptr noundef %0, i32 noundef %1, i32 noundef %2, double noundef %35, i32 noundef %.fr, double noundef %37, double noundef %38, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %19, ptr noundef nonnull %9)
  %39 = getelementptr inbounds ptr, ptr %7, i64 %indvars.iv41
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, %20
  %diff.check = icmp ult i64 %42, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %43 = sub nsw i64 %24, %indvars.iv.ph
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %44 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.prol
  %45 = load double, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds double, ptr %40, i64 %indvars.iv.prol
  store double %45, ptr %46, align 8, !tbaa !11
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !17

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %47 = icmp ult i64 %43, 3
  br i1 %47, label %._crit_edge, label %scalar.ph

vector.body:                                      ; preds = %.lr.ph, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.lr.ph ]
  %48 = getelementptr inbounds double, ptr %19, i64 %index
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load = load <2 x double>, ptr %48, align 8, !tbaa !11
  %wide.load53 = load <2 x double>, ptr %49, align 8, !tbaa !11
  %50 = getelementptr inbounds double, ptr %40, i64 %index
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store <2 x double> %wide.load, ptr %50, align 8, !tbaa !11
  store <2 x double> %wide.load53, ptr %51, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %52 = icmp eq i64 %index.next, %n.vec
  br i1 %52, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %exitcond45.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count44
  br i1 %exitcond45.not, label %._crit_edge38, label %.lr.ph, !llvm.loop !13

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %53 = getelementptr inbounds double, ptr %19, i64 %indvars.iv
  %54 = load double, ptr %53, align 8, !tbaa !11
  %55 = getelementptr inbounds double, ptr %40, i64 %indvars.iv
  store double %54, ptr %55, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next
  %57 = load double, ptr %56, align 8, !tbaa !11
  %58 = getelementptr inbounds double, ptr %40, i64 %indvars.iv.next
  store double %57, ptr %58, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %59 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next.1
  %60 = load double, ptr %59, align 8, !tbaa !11
  %61 = getelementptr inbounds double, ptr %40, i64 %indvars.iv.next.1
  store double %60, ptr %61, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %62 = getelementptr inbounds double, ptr %19, i64 %indvars.iv.next.2
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = getelementptr inbounds double, ptr %40, i64 %indvars.iv.next.2
  store double %63, ptr %64, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph, !llvm.loop !22
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @_ZN4sptk5world12randn_reseedEPNS0_10RandnStateE(ptr noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

declare void @_ZN4sptk5world24InitializeForwardRealFFTEiPNS0_14ForwardRealFFTE(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @_ZN4sptk5world24InitializeInverseRealFFTEiPNS0_14InverseRealFFTE(i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN4sptk5world12_GLOBAL__N_121CheapTrickGeneralBodyEPKdiididdPKNS0_14ForwardRealFFTEPKNS0_14InverseRealFFTEPdPNS0_10RandnStateE(ptr noundef, i32 noundef, i32 noundef, double noundef, i32 noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @_ZN4sptk5world21DestroyForwardRealFFTEPNS0_14ForwardRealFFTE(ptr noundef) local_unnamed_addr #4

declare void @_ZN4sptk5world21DestroyInverseRealFFTEPNS0_14InverseRealFFTE(ptr noundef) local_unnamed_addr #4

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

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" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 = { nobuiltin allocsize(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 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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, !10, i64 16}
!6 = !{!"_ZTSN4sptk5world16CheapTrickOptionE", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !14, !20}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass