; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ/5751（FFT+线段树）.ll (ZN3FFT3FFTEPNS_4compEii)

; 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.FFT::comp" = type { double, double }

@pos = external dso_local global [524300 x i32], align 16
@_ZN3FFTL2piE = external hidden global double, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3FFT3FFTEPNS_4compEii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, 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 i32, align 4
  %12 = alloca double, align 8
  %13 = alloca %"struct.FFT::comp", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.FFT::comp", align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.FFT::comp", align 8
  %20 = alloca %"struct.FFT::comp", align 8
  %21 = alloca %"struct.FFT::comp", align 8
  %22 = alloca %"struct.FFT::comp", align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %49, %3
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %52

29:                                               ; preds = %24
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [524300 x i32], ptr @pos, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = icmp sgt i32 %33, %34
  br i1 %35, label %36, label %48

36:                                               ; preds = %29
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %"struct.FFT::comp", ptr %37, i64 %39
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [524300 x i32], ptr @pos, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %"struct.FFT::comp", ptr %41, i64 %46
  call void @_ZSt4swapIN3FFT4compEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) %47) #6
  br label %48

48:                                               ; preds = %36, %29
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %7, align 4, !tbaa !9
  br label %24, !llvm.loop !11

52:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %136, %52
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = shl i32 1, %54
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %139

59:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = shl i32 1, %60
  store i32 %61, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = shl i32 %62, 1
  store i32 %63, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %64 = load double, ptr @_ZN3FFTL2piE, align 8, !tbaa !13
  %65 = fmul double %64, 2.000000e+00
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = sitofp i32 %66 to double
  %68 = fdiv double %65, %67
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = sitofp i32 %69 to double
  %71 = fmul double %68, %70
  store double %71, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %72 = load double, ptr %12, align 8, !tbaa !13
  %73 = call double @cos(double noundef %72) #6
  %74 = load double, ptr %12, align 8, !tbaa !13
  %75 = call double @sin(double noundef %74) #6
  call void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %73, double noundef %75)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %131, %59
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %135

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %127, %81
  %83 = load i32, ptr %16, align 4, !tbaa !9
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %130

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = load i32, ptr %16, align 4, !tbaa !9
  %91 = add nsw i32 %89, %90
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = add nsw i32 %91, %92
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %"struct.FFT::comp", ptr %88, i64 %94
  store ptr %95, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = load i32, ptr %16, align 4, !tbaa !9
  %99 = add nsw i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %"struct.FFT::comp", ptr %96, i64 %100
  store ptr %101, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %102 = load ptr, ptr %17, align 8, !tbaa !5
  %103 = call { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %102)
  %104 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %105 = extractvalue { double, double } %103, 0
  store double %105, ptr %104, align 8
  %106 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %107 = extractvalue { double, double } %103, 1
  store double %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = call { double, double } @_ZN3FFT4compmiERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %108, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %110 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %111 = extractvalue { double, double } %109, 0
  store double %111, ptr %110, align 8
  %112 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %113 = extractvalue { double, double } %109, 1
  store double %113, ptr %112, align 8
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %114, ptr align 8 %20, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = call { double, double } @_ZN3FFT4compplERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %115, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %117 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %118 = extractvalue { double, double } %116, 0
  store double %118, ptr %117, align 8
  %119 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %120 = extractvalue { double, double } %116, 1
  store double %120, ptr %119, align 8
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %121, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %122 = call { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %123 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %124 = extractvalue { double, double } %122, 0
  store double %124, ptr %123, align 8
  %125 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %126 = extractvalue { double, double } %122, 1
  store double %126, ptr %125, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %22, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, 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
  br label %127

127:                                              ; preds = %87
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %16, align 4, !tbaa !9
  br label %82, !llvm.loop !16

130:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %11, align 4, !tbaa !9
  %133 = load i32, ptr %14, align 4, !tbaa !9
  %134 = add nsw i32 %133, %132
  store i32 %134, ptr %14, align 4, !tbaa !9
  br label %76, !llvm.loop !17

135:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %8, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %8, align 4, !tbaa !9
  br label %53, !llvm.loop !18

139:                                              ; preds = %58
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = icmp eq i32 %140, -1
  br i1 %141, label %142, label %162

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %158, %142
  %144 = load i32, ptr %23, align 4, !tbaa !9
  %145 = load i32, ptr %5, align 4, !tbaa !9
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %161

148:                                              ; preds = %143
  %149 = load i32, ptr %5, align 4, !tbaa !9
  %150 = sitofp i32 %149 to double
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = load i32, ptr %23, align 4, !tbaa !9
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds %"struct.FFT::comp", ptr %151, i64 %153
  %155 = getelementptr inbounds %"struct.FFT::comp", ptr %154, i32 0, i32 0
  %156 = load double, ptr %155, align 8, !tbaa !19
  %157 = fdiv double %156, %150
  store double %157, ptr %155, align 8, !tbaa !19
  br label %158

158:                                              ; preds = %148
  %159 = load i32, ptr %23, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %23, align 4, !tbaa !9
  br label %143, !llvm.loop !21

161:                                              ; preds = %147
  br label %162

162:                                              ; preds = %161, %139
  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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN3FFT4compEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compmiERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compplERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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 = { inlinehint 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !14, i64 0}
!20 = !{!"_ZTSN3FFT4compE", !14, i64 0, !14, i64 8}
!21 = distinct !{!21, !12}


; 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.FFT::comp" = type { double, double }

@pos = external dso_local local_unnamed_addr global [524300 x i32], align 16
@_ZN3FFTL2piE = external hidden local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3FFT3FFTEPNS_4compEii(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %"struct.FFT::comp", align 8
  %5 = alloca %"struct.FFT::comp", align 8
  %6 = alloca %"struct.FFT::comp", align 8
  %7 = icmp sgt i32 %1, 1
  br i1 %7, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph

.preheader54:                                     ; preds = %50
  br i1 %7, label %.lr.ph63, label %._crit_edge

.lr.ph63:                                         ; preds = %.preheader54
  %8 = sitofp i32 %2 to double
  %9 = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %10 = zext nneg i32 %1 to i64
  br label %.lr.ph60.us

.lr.ph60.us:                                      ; preds = %._crit_edge61.us, %.lr.ph63
  %11 = phi i32 [ 1, %.lr.ph63 ], [ %12, %._crit_edge61.us ]
  %.04862.us = phi i32 [ 0, %.lr.ph63 ], [ %25, %._crit_edge61.us ]
  %.fr = freeze i32 %11
  %12 = shl i32 2, %.04862.us
  %13 = load double, ptr @_ZN3FFTL2piE, align 8, !tbaa !5
  %14 = fmul double %13, 2.000000e+00
  %15 = sitofp i32 %12 to double
  %16 = fdiv double %14, %15
  %17 = fmul double %16, %8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %18 = call double @cos(double noundef %17) #5
  %19 = call double @sin(double noundef %17) #5
  call void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef %18, double noundef %19)
  %20 = icmp sgt i32 %.fr, 0
  br i1 %20, label %.lr.ph57.us.us.preheader, label %.lr.ph60.split.us66

.lr.ph57.us.us.preheader:                         ; preds = %.lr.ph60.us
  %21 = zext nneg i32 %.fr to i64
  %22 = sext i32 %12 to i64
  %wide.trip.count74 = zext nneg i32 %.fr to i64
  %invariant.gep = getelementptr %"struct.FFT::comp", ptr %0, i64 %21
  br label %.lr.ph57.us.us

.lr.ph60.split.us66:                              ; preds = %.lr.ph60.us, %.lr.ph60.split.us66
  %.04958.us64 = phi i32 [ %23, %.lr.ph60.split.us66 ], [ 0, %.lr.ph60.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %23 = add nsw i32 %.04958.us64, %12
  %24 = icmp slt i32 %23, %1
  br i1 %24, label %.lr.ph60.split.us66, label %._crit_edge61.us, !llvm.loop !9

._crit_edge61.us:                                 ; preds = %.lr.ph60.split.us66, %._crit_edge.us.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %25 = add nuw nsw i32 %.04862.us, 1
  %26 = icmp slt i32 %12, %1
  br i1 %26, label %.lr.ph60.us, label %._crit_edge, !llvm.loop !11

.lr.ph57.us.us:                                   ; preds = %.lr.ph57.us.us.preheader, %._crit_edge.us.us
  %indvars.iv76 = phi i64 [ 0, %.lr.ph57.us.us.preheader ], [ %indvars.iv.next77, %._crit_edge.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN3FFT4compC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 1.000000e+00, double noundef 0.000000e+00)
  br label %27

27:                                               ; preds = %27, %.lr.ph57.us.us
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %27 ], [ 0, %.lr.ph57.us.us ]
  %28 = add nsw i64 %indvars.iv71, %indvars.iv76
  %gep = getelementptr %"struct.FFT::comp", ptr %invariant.gep, i64 %28
  %29 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %28
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %30 = call { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %gep)
  %31 = extractvalue { double, double } %30, 0
  store double %31, ptr %6, align 8
  %32 = extractvalue { double, double } %30, 1
  store double %32, ptr %9, align 8
  %33 = call { double, double } @_ZN3FFT4compmiERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %34 = extractvalue { double, double } %33, 0
  %35 = extractvalue { double, double } %33, 1
  store double %34, ptr %gep, align 8, !tbaa !5
  %.sroa.46.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %35, ptr %.sroa.46.0..sroa_idx.us.us, align 8, !tbaa !5
  %36 = call { double, double } @_ZN3FFT4compplERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %37 = extractvalue { double, double } %36, 0
  %38 = extractvalue { double, double } %36, 1
  store double %37, ptr %29, align 8, !tbaa !5
  %.sroa.44.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %29, i64 8
  store double %38, ptr %.sroa.44.0..sroa_idx.us.us, align 8, !tbaa !5
  %39 = call { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  store double %40, ptr %5, align 8, !tbaa !5
  store double %41, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge.us.us, label %27, !llvm.loop !12

._crit_edge.us.us:                                ; preds = %27
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, %22
  %42 = icmp slt i64 %indvars.iv.next77, %10
  br i1 %42, label %.lr.ph57.us.us, label %._crit_edge61.us, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %50 ]
  %43 = getelementptr inbounds [524300 x i32], ptr @pos, i64 0, i64 %indvars.iv
  %44 = load i32, ptr %43, align 4, !tbaa !13
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv, %45
  br i1 %46, label %47, label %50

47:                                               ; preds = %.lr.ph
  %48 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %indvars.iv
  %49 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %45
  tail call void @_ZSt4swapIN3FFT4compEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 8 dereferenceable(16) %49) #5
  br label %50

50:                                               ; preds = %.lr.ph, %47
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader54, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %._crit_edge61.us, %3, %.preheader54
  %51 = icmp eq i32 %2, -1
  %52 = icmp sgt i32 %1, 0
  %or.cond = and i1 %51, %52
  br i1 %or.cond, label %.lr.ph68, label %.loopexit

.lr.ph68:                                         ; preds = %._crit_edge
  %53 = uitofp nneg i32 %1 to double
  %wide.trip.count82 = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph68
  %.neg = or i64 %wide.trip.count82, -2
  %n.vec = add nsw i64 %.neg, %wide.trip.count82
  %broadcast.splatinsert = insertelement <2 x double> poison, double %53, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %54 = or disjoint i64 %index, 1
  %55 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %index
  %56 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %54
  %57 = load double, ptr %55, align 8, !tbaa !16
  %58 = load double, ptr %56, align 8, !tbaa !16
  %59 = insertelement <2 x double> poison, double %57, i64 0
  %60 = insertelement <2 x double> %59, double %58, i64 1
  %61 = fdiv <2 x double> %60, %broadcast.splat
  %62 = extractelement <2 x double> %61, i64 0
  store double %62, ptr %55, align 8, !tbaa !16
  %63 = extractelement <2 x double> %61, i64 1
  store double %63, ptr %56, align 8, !tbaa !16
  %index.next = add nuw i64 %index, 2
  %64 = icmp eq i64 %index.next, %n.vec
  br i1 %64, label %scalar.ph.preheader, label %vector.body, !llvm.loop !18

scalar.ph.preheader:                              ; preds = %vector.body, %.lr.ph68
  %indvars.iv79.ph = phi i64 [ 0, %.lr.ph68 ], [ %n.vec, %vector.body ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %scalar.ph ], [ %indvars.iv79.ph, %scalar.ph.preheader ]
  %65 = getelementptr inbounds %"struct.FFT::comp", ptr %0, i64 %indvars.iv79
  %66 = load double, ptr %65, align 8, !tbaa !16
  %67 = fdiv double %66, %53
  store double %67, ptr %65, align 8, !tbaa !16
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82
  br i1 %exitcond83.not, label %.loopexit, label %scalar.ph, !llvm.loop !21

.loopexit:                                        ; preds = %scalar.ph, %._crit_edge
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIN3FFT4compEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compmlERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compmiERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZN3FFT4compplERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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 = { inlinehint 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 #4 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTSN3FFT4compE", !6, i64 0, !6, i64 8}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10, !20, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass