; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/296 Division 1/Problem D/D.ll (Z3fftRSt6vectorISt7complexIdESaIS1_EEb)

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

%"class.std::complex" = type { { double, double } }

@PI = external dso_local global double, align 8

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

; 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 uwtable
define dso_local void @_Z3fftRSt6vectorISt7complexIdESaIS1_EEb(ptr noundef nonnull align 8 dereferenceable(24) %0, i1 noundef zeroext %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %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 double, align 8
  %11 = alloca %"class.std::complex", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::complex", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::complex", align 8
  %16 = alloca %"class.std::complex", align 8
  %17 = alloca %"class.std::complex", align 8
  %18 = alloca %"class.std::complex", align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %20 = zext i1 %1 to i8
  store i8 %20, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call noundef i64 @_ZNKSt6vectorISt7complexIdESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #7
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %24

24:                                               ; preds = %29, %2
  %25 = load i32, ptr %6, align 4, !tbaa !11
  %26 = shl i32 1, %25
  %27 = load i32, ptr %5, align 4, !tbaa !11
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %32

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !11
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %6, align 4, !tbaa !11
  br label %24, !llvm.loop !13

32:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %56, %32
  %34 = load i32, ptr %7, align 4, !tbaa !11
  %35 = load i32, ptr %5, align 4, !tbaa !11
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %59

38:                                               ; preds = %33
  %39 = load i32, ptr %7, align 4, !tbaa !11
  %40 = load i32, ptr %7, align 4, !tbaa !11
  %41 = load i32, ptr %6, align 4, !tbaa !11
  %42 = call noundef i32 @_Z3revii(i32 noundef %40, i32 noundef %41)
  %43 = icmp slt i32 %39, %42
  br i1 %43, label %44, label %55

44:                                               ; preds = %38
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #7
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !11
  %51 = load i32, ptr %6, align 4, !tbaa !11
  %52 = call noundef i32 @_Z3revii(i32 noundef %50, i32 noundef %51)
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %53) #7
  call void @_ZSt4swapISt7complexIdEENSt9enable_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) %54) #7
  br label %55

55:                                               ; preds = %44, %38
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %7, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %7, align 4, !tbaa !11
  br label %33, !llvm.loop !15

59:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 2, ptr %8, align 4, !tbaa !11
  br label %60

60:                                               ; preds = %152, %59
  %61 = load i32, ptr %8, align 4, !tbaa !11
  %62 = load i32, ptr %5, align 4, !tbaa !11
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %155

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %66 = load double, ptr @PI, align 8, !tbaa !16
  %67 = fmul double 2.000000e+00, %66
  %68 = load i32, ptr %8, align 4, !tbaa !11
  %69 = sitofp i32 %68 to double
  %70 = fdiv double %67, %69
  %71 = load i8, ptr %4, align 1, !tbaa !9, !range !18, !noundef !19
  %72 = trunc i8 %71 to i1
  %73 = zext i1 %72 to i64
  %74 = select i1 %72, i32 -1, i32 1
  %75 = sitofp i32 %74 to double
  %76 = fmul double %70, %75
  store double %76, ptr %10, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %77 = load double, ptr %10, align 8, !tbaa !16
  %78 = call double @cos(double noundef %77) #7
  %79 = load double, ptr %10, align 8, !tbaa !16
  %80 = call double @sin(double noundef %79) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %78, double noundef %80)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %81

81:                                               ; preds = %147, %65
  %82 = load i32, ptr %12, align 4, !tbaa !11
  %83 = load i32, ptr %5, align 4, !tbaa !11
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %151

86:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %143, %86
  %88 = load i32, ptr %14, align 4, !tbaa !11
  %89 = load i32, ptr %8, align 4, !tbaa !11
  %90 = sdiv i32 %89, 2
  %91 = icmp slt i32 %88, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %87
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %146

93:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !11
  %96 = load i32, ptr %14, align 4, !tbaa !11
  %97 = add nsw i32 %95, %96
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef %98) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %99, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load i32, ptr %12, align 4, !tbaa !11
  %102 = load i32, ptr %14, align 4, !tbaa !11
  %103 = add nsw i32 %101, %102
  %104 = load i32, ptr %8, align 4, !tbaa !11
  %105 = sdiv i32 %104, 2
  %106 = add nsw i32 %103, %105
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %107) #7
  %109 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %108, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %110 = getelementptr inbounds %"class.std::complex", ptr %16, i32 0, i32 0
  %111 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 0
  %112 = extractvalue { double, double } %109, 0
  store double %112, ptr %111, align 8
  %113 = getelementptr inbounds { double, double }, ptr %110, i32 0, i32 1
  %114 = extractvalue { double, double } %109, 1
  store double %114, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  %115 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %116 = getelementptr inbounds %"class.std::complex", ptr %17, i32 0, i32 0
  %117 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 0
  %118 = extractvalue { double, double } %115, 0
  store double %118, ptr %117, align 8
  %119 = getelementptr inbounds { double, double }, ptr %116, i32 0, i32 1
  %120 = extractvalue { double, double } %115, 1
  store double %120, ptr %119, align 8
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = load i32, ptr %12, align 4, !tbaa !11
  %123 = load i32, ptr %14, align 4, !tbaa !11
  %124 = add nsw i32 %122, %123
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %121, i64 noundef %125) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %126, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %127 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %128 = getelementptr inbounds %"class.std::complex", ptr %18, i32 0, i32 0
  %129 = getelementptr inbounds { double, double }, ptr %128, i32 0, i32 0
  %130 = extractvalue { double, double } %127, 0
  store double %130, ptr %129, align 8
  %131 = getelementptr inbounds { double, double }, ptr %128, i32 0, i32 1
  %132 = extractvalue { double, double } %127, 1
  store double %132, ptr %131, align 8
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = load i32, ptr %12, align 4, !tbaa !11
  %135 = load i32, ptr %14, align 4, !tbaa !11
  %136 = add nsw i32 %134, %135
  %137 = load i32, ptr %8, align 4, !tbaa !11
  %138 = sdiv i32 %137, 2
  %139 = add nsw i32 %136, %138
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %133, i64 noundef %140) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %141, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  %142 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEmLIdEERS0_RKS_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  br label %143

143:                                              ; preds = %93
  %144 = load i32, ptr %14, align 4, !tbaa !11
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %14, align 4, !tbaa !11
  br label %87, !llvm.loop !22

146:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %8, align 4, !tbaa !11
  %149 = load i32, ptr %12, align 4, !tbaa !11
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr %12, align 4, !tbaa !11
  br label %81, !llvm.loop !23

151:                                              ; preds = %85
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %8, align 4, !tbaa !11
  %154 = shl i32 %153, 1
  store i32 %154, ptr %8, align 4, !tbaa !11
  br label %60, !llvm.loop !24

155:                                              ; preds = %64
  %156 = load i8, ptr %4, align 1, !tbaa !9, !range !18, !noundef !19
  %157 = trunc i8 %156 to i1
  br i1 %157, label %158, label %176

158:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %159

159:                                              ; preds = %172, %158
  %160 = load i32, ptr %19, align 4, !tbaa !11
  %161 = load i32, ptr %5, align 4, !tbaa !11
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %175

164:                                              ; preds = %159
  %165 = load i32, ptr %5, align 4, !tbaa !11
  %166 = sitofp i32 %165 to double
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = load i32, ptr %19, align 4, !tbaa !11
  %169 = sext i32 %168 to i64
  %170 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %167, i64 noundef %169) #7
  %171 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEdVEd(ptr noundef nonnull align 8 dereferenceable(16) %170, double noundef %166)
  br label %172

172:                                              ; preds = %164
  %173 = load i32, ptr %19, align 4, !tbaa !11
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %19, align 4, !tbaa !11
  br label %159, !llvm.loop !25

175:                                              ; preds = %163
  br label %176

176:                                              ; preds = %175, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt7complexIdESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt7complexIdEENSt9enable_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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 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: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEdVEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) #0 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { inlinehint 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 #7 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{i64 0, i64 16, !21}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


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

%"class.std::complex" = type { { double, double } }

@PI = external dso_local local_unnamed_addr global double, align 8

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3fftRSt6vectorISt7complexIdESaIS1_EEb(ptr noundef nonnull align 8 dereferenceable(24) %0, i1 noundef zeroext %1) local_unnamed_addr #2 {
  %3 = alloca %"class.std::complex", align 8
  %4 = alloca %"class.std::complex", align 8
  %5 = alloca %"class.std::complex", align 8
  %6 = alloca %"class.std::complex", align 8
  %7 = tail call noundef i64 @_ZNKSt6vectorISt7complexIdESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %8 = trunc i64 %7 to i32
  br label %9

9:                                                ; preds = %9, %2
  %.051 = phi i32 [ 0, %2 ], [ %12, %9 ]
  %10 = shl nuw i32 1, %.051
  %11 = icmp slt i32 %10, %8
  %12 = add nuw nsw i32 %.051, 1
  br i1 %11, label %9, label %.preheader59, !llvm.loop !5

.preheader59:                                     ; preds = %9
  %13 = icmp sgt i32 %8, 0
  br i1 %13, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader59
  %wide.trip.count = and i64 %7, 2147483647
  br label %.lr.ph

.preheader58:                                     ; preds = %58
  %.not67 = icmp eq i32 %8, 1
  br i1 %.not67, label %._crit_edge, label %.lr.ph70

.lr.ph70:                                         ; preds = %.preheader58
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = and i64 %7, 2147483647
  br label %.lr.ph65.us

.lr.ph65.us:                                      ; preds = %._crit_edge66.us, %.lr.ph70
  %.05368.us = phi i32 [ 2, %.lr.ph70 ], [ %30, %._crit_edge66.us ]
  %16 = load double, ptr @PI, align 8, !tbaa !7
  %17 = fmul double %16, 2.000000e+00
  %18 = sitofp i32 %.05368.us to double
  %19 = fdiv double %17, %18
  %20 = fneg double %19
  %21 = select i1 %1, double %20, double %19
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %22 = call double @cos(double noundef %21) #7
  %23 = call double @sin(double noundef %21) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %3, double noundef %22, double noundef %23)
  %24 = ashr exact i32 %.05368.us, 1
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph62.us.us.preheader, label %.lr.ph65.split.us73

.lr.ph62.us.us.preheader:                         ; preds = %.lr.ph65.us
  %26 = zext nneg i32 %24 to i64
  %27 = zext nneg i32 %.05368.us to i64
  %wide.trip.count83 = zext nneg i32 %24 to i64
  br label %.lr.ph62.us.us

.lr.ph65.split.us73:                              ; preds = %.lr.ph65.us, %.lr.ph65.split.us73
  %.05563.us71 = phi i32 [ %28, %.lr.ph65.split.us73 ], [ 0, %.lr.ph65.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %28 = add nsw i32 %.05563.us71, %.05368.us
  %29 = icmp slt i32 %28, %8
  br i1 %29, label %.lr.ph65.split.us73, label %._crit_edge66.us, !llvm.loop !11

._crit_edge66.us:                                 ; preds = %.lr.ph65.split.us73, %._crit_edge.us.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %30 = shl i32 %.05368.us, 1
  %.not.us = icmp sgt i32 %30, %8
  br i1 %.not.us, label %._crit_edge, label %.lr.ph65.us, !llvm.loop !12

.lr.ph62.us.us:                                   ; preds = %.lr.ph62.us.us.preheader, %._crit_edge.us.us
  %indvars.iv85 = phi i64 [ 0, %.lr.ph62.us.us.preheader ], [ %indvars.iv.next86, %._crit_edge.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef 1.000000e+00, double noundef 0.000000e+00)
  br label %31

31:                                               ; preds = %31, %.lr.ph62.us.us
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %31 ], [ 0, %.lr.ph62.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %32 = add nuw nsw i64 %indvars.iv80, %indvars.iv85
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %32) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %33, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %34 = add nuw nsw i64 %32, %26
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %34) #7
  %36 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %37 = extractvalue { double, double } %36, 0
  store double %37, ptr %6, align 8
  %38 = extractvalue { double, double } %36, 1
  store double %38, ptr %14, align 8
  %39 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %40 = extractvalue { double, double } %39, 0
  %41 = extractvalue { double, double } %39, 1
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %32) #7
  store double %40, ptr %42, align 8
  %.sroa.44.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %42, i64 8
  store double %41, ptr %.sroa.44.0..sroa_idx.us.us, align 8, !tbaa !14
  %43 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %44 = extractvalue { double, double } %43, 0
  %45 = extractvalue { double, double } %43, 1
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %34) #7
  store double %44, ptr %46, align 8
  %.sroa.4.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %46, i64 8
  store double %45, ptr %.sroa.4.0..sroa_idx.us.us, align 8, !tbaa !14
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEmLIdEERS0_RKS_IT_E(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge.us.us, label %31, !llvm.loop !15

._crit_edge.us.us:                                ; preds = %31
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, %27
  %48 = icmp ult i64 %indvars.iv.next86, %15
  br i1 %48, label %.lr.ph62.us.us, label %._crit_edge66.us, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph.preheader, %58
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %58 ]
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  %50 = tail call noundef i32 @_Z3revii(i32 noundef %49, i32 noundef %.051)
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv, %51
  br i1 %52, label %53, label %58

53:                                               ; preds = %.lr.ph
  %54 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #7
  %55 = tail call noundef i32 @_Z3revii(i32 noundef %49, i32 noundef %.051)
  %56 = sext i32 %55 to i64
  %57 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %56) #7
  tail call void @_ZSt4swapISt7complexIdEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(16) %57) #7
  br label %58

58:                                               ; preds = %.lr.ph, %53
  %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 %.preheader58, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %._crit_edge66.us, %.preheader58
  %or.cond = and i1 %13, %1
  br i1 %or.cond, label %.lr.ph77, label %.loopexit

.lr.ph77:                                         ; preds = %._crit_edge
  %59 = uitofp nneg i32 %8 to double
  %wide.trip.count91 = and i64 %7, 2147483647
  br label %60

60:                                               ; preds = %.lr.ph77, %60
  %indvars.iv88 = phi i64 [ 0, %.lr.ph77 ], [ %indvars.iv.next89, %60 ]
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv88) #7
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEdVEd(ptr noundef nonnull align 8 dereferenceable(16) %61, double noundef %59)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
  br i1 %exitcond92.not, label %.loopexit, label %60, !llvm.loop !17

.loopexit:                                        ; preds = %60, %.preheader59, %._crit_edge
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt7complexIdESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapISt7complexIdEENSt9enable_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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt7complexIdESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 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 nounwind uwtable
declare dso_local void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress 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: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt7complexIdEdVEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #0 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint 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 #7 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{i64 0, i64 16, !14}
!14 = !{!9, !9, i64 0}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}


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