; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-15/upsolved/G - Cipher Message 3 - lzy.ll (Z3fftPSt7complexIdEii)

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

@_ZL2pi = external hidden global double, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6changePSt7complexIdEi(ptr 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 @_Z3fftPSt7complexIdEii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %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 %"class.std::complex", align 8
  %10 = alloca %"class.std::complex", align 8
  %11 = alloca %"class.std::complex", align 8
  %12 = alloca %"class.std::complex", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::complex", align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::complex", align 8
  %17 = alloca %"class.std::complex", align 8
  %18 = alloca %"class.std::complex", align 8
  %19 = alloca %"class.std::complex", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::complex", align 8
  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
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load i32, ptr %5, align 4, !tbaa !9
  call void @_Z6changePSt7complexIdEi(ptr noundef %22, i32 noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 2, ptr %7, align 4, !tbaa !9
  br label %24

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

28:                                               ; preds = %24
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %124

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = sub nsw i32 0, %30
  %32 = mul nsw i32 %31, 2
  %33 = sitofp i32 %32 to double
  %34 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %35 = fmul double %33, %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = sitofp i32 %36 to double
  %38 = fdiv double %35, %37
  %39 = call double @cos(double noundef %38) #6
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = sub nsw i32 0, %40
  %42 = mul nsw i32 %41, 2
  %43 = sitofp i32 %42 to double
  %44 = load double, ptr @_ZL2pi, align 8, !tbaa !11
  %45 = fmul double %43, %44
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = sitofp i32 %46 to double
  %48 = fdiv double %45, %47
  %49 = call double @sin(double noundef %48) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %39, double noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %116, %29
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = load i32, ptr %5, align 4, !tbaa !9
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %120

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %14, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %56 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %56, ptr %15, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %112, %55
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = ashr i32 %60, 1
  %62 = add nsw i32 %59, %61
  %63 = icmp slt i32 %58, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %57
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %115

65:                                               ; preds = %57
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = load i32, ptr %15, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %"class.std::complex", ptr %66, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %69, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = ashr i32 %72, 1
  %74 = add nsw i32 %71, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %"class.std::complex", ptr %70, i64 %75
  %77 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %76)
  %78 = getelementptr inbounds %"class.std::complex", ptr %16, i32 0, i32 0
  %79 = getelementptr inbounds { double, double }, ptr %78, i32 0, i32 0
  %80 = extractvalue { double, double } %77, 0
  store double %80, ptr %79, align 8
  %81 = getelementptr inbounds { double, double }, ptr %78, i32 0, i32 1
  %82 = extractvalue { double, double } %77, 1
  store double %82, ptr %81, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %83 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %84 = getelementptr inbounds %"class.std::complex", ptr %17, i32 0, i32 0
  %85 = getelementptr inbounds { double, double }, ptr %84, i32 0, i32 0
  %86 = extractvalue { double, double } %83, 0
  store double %86, ptr %85, align 8
  %87 = getelementptr inbounds { double, double }, ptr %84, i32 0, i32 1
  %88 = extractvalue { double, double } %83, 1
  store double %88, ptr %87, align 8
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %15, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %"class.std::complex", ptr %89, i64 %91
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %92, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %93 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %94 = getelementptr inbounds %"class.std::complex", ptr %18, i32 0, i32 0
  %95 = getelementptr inbounds { double, double }, ptr %94, i32 0, i32 0
  %96 = extractvalue { double, double } %93, 0
  store double %96, ptr %95, align 8
  %97 = getelementptr inbounds { double, double }, ptr %94, i32 0, i32 1
  %98 = extractvalue { double, double } %93, 1
  store double %98, ptr %97, align 8
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load i32, ptr %15, align 4, !tbaa !9
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = ashr i32 %101, 1
  %103 = add nsw i32 %100, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %"class.std::complex", ptr %99, i64 %104
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %105, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %106 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %107 = getelementptr inbounds %"class.std::complex", ptr %19, i32 0, i32 0
  %108 = getelementptr inbounds { double, double }, ptr %107, i32 0, i32 0
  %109 = extractvalue { double, double } %106, 0
  store double %109, ptr %108, align 8
  %110 = getelementptr inbounds { double, double }, ptr %107, i32 0, i32 1
  %111 = extractvalue { double, double } %106, 1
  store double %111, ptr %110, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %112

112:                                              ; preds = %65
  %113 = load i32, ptr %15, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %15, align 4, !tbaa !9
  br label %57, !llvm.loop !15

115:                                              ; preds = %64
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %7, align 4, !tbaa !9
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = add nsw i32 %118, %117
  store i32 %119, ptr %13, align 4, !tbaa !9
  br label %50, !llvm.loop !17

120:                                              ; preds = %54
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = shl i32 %122, 1
  store i32 %123, ptr %7, align 4, !tbaa !9
  br label %24, !llvm.loop !18

124:                                              ; preds = %28
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = icmp eq i32 %125, -1
  br i1 %126, label %127, label %155

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %151, %127
  %129 = load i32, ptr %20, align 4, !tbaa !9
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %154

133:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load i32, ptr %20, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %"class.std::complex", ptr %134, i64 %136
  %138 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %137)
  %139 = load i32, ptr %5, align 4, !tbaa !9
  %140 = sitofp i32 %139 to double
  %141 = fdiv double %138, %140
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = load i32, ptr %20, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %"class.std::complex", ptr %142, i64 %144
  %146 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %145)
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %21, double noundef %141, double noundef %146)
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds %"class.std::complex", ptr %147, i64 %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %150, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %151

151:                                              ; preds = %133
  %152 = load i32, ptr %20, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %20, align 4, !tbaa !9
  br label %128, !llvm.loop !19

154:                                              ; preds = %132
  br label %155

155:                                              ; preds = %154, %124
  ret void
}

; 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: nounwind
declare double @cos(double noundef) #3

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

; 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) #4

; 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)) #5

; 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)) #5

; 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)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) #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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{i64 0, i64 16, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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

@_ZL2pi = external hidden local_unnamed_addr global double, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6changePSt7complexIdEi(ptr 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 @_Z3fftPSt7complexIdEii(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca %"class.std::complex", align 8
  %5 = alloca %"class.std::complex", align 8
  %6 = alloca %"class.std::complex", align 8
  %7 = alloca %"class.std::complex", align 8
  %8 = alloca %"class.std::complex", align 8
  %9 = alloca %"class.std::complex", align 8
  tail call void @_Z6changePSt7complexIdEi(ptr noundef %0, i32 noundef %1)
  %.not53 = icmp slt i32 %1, 2
  br i1 %.not53, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %3
  %.neg = mul i32 %2, -2
  %10 = sitofp i32 %.neg to double
  %.sroa.410.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %11 = zext nneg i32 %1 to i64
  br label %.lr.ph51.us

.lr.ph51.us:                                      ; preds = %._crit_edge52.us, %.lr.ph56
  %.04454.us = phi i32 [ 2, %.lr.ph56 ], [ %42, %._crit_edge52.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %6, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %12 = load double, ptr @_ZL2pi, align 8, !tbaa !5
  %13 = fmul double %12, %10
  %14 = sitofp i32 %.04454.us to double
  %15 = fdiv double %13, %14
  %16 = call double @cos(double noundef %15) #6
  %17 = load double, ptr @_ZL2pi, align 8, !tbaa !5
  %18 = fmul double %17, %10
  %19 = fdiv double %18, %14
  %20 = call double @sin(double noundef %19) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %16, double noundef %20)
  %21 = ashr exact i32 %.04454.us, 1
  %22 = sext i32 %.04454.us to i64
  %23 = sext i32 %21 to i64
  %24 = icmp sgt i32 %21, 0
  %invariant.gep = getelementptr %"class.std::complex", ptr %0, i64 %23
  br label %25

25:                                               ; preds = %.lr.ph51.us, %._crit_edge.us
  %indvars.iv = phi i64 [ 0, %.lr.ph51.us ], [ %indvars.iv.next, %._crit_edge.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %8, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %26 = add nsw i64 %indvars.iv, %23
  br i1 %24, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.lr.ph.us, %25
  %indvars.iv.next = add nsw i64 %indvars.iv, %22
  %27 = icmp slt i64 %indvars.iv.next, %11
  br i1 %27, label %25, label %._crit_edge52.us, !llvm.loop !11

.lr.ph.us:                                        ; preds = %25, %.lr.ph.us
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph.us ], [ %indvars.iv, %25 ]
  %28 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %indvars.iv59
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %28, i64 16, i1 false), !tbaa.struct !9
  %gep = getelementptr %"class.std::complex", ptr %invariant.gep, i64 %indvars.iv59
  %29 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %gep)
  %30 = extractvalue { double, double } %29, 0
  %31 = extractvalue { double, double } %29, 1
  store double %30, ptr %6, align 8
  store double %31, ptr %.sroa.410.0..sroa_idx, align 8, !tbaa !10
  %32 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %33 = extractvalue { double, double } %32, 0
  %34 = extractvalue { double, double } %32, 1
  store double %33, ptr %28, align 8
  %.sroa.48.0..sroa_idx.us = getelementptr inbounds i8, ptr %28, i64 8
  store double %34, ptr %.sroa.48.0..sroa_idx.us, align 8, !tbaa !10
  %35 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %36 = extractvalue { double, double } %35, 0
  %37 = extractvalue { double, double } %35, 1
  store double %36, ptr %gep, align 8
  %.sroa.46.0..sroa_idx.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %37, ptr %.sroa.46.0..sroa_idx.us, align 8, !tbaa !10
  %38 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %39 = extractvalue { double, double } %38, 0
  %40 = extractvalue { double, double } %38, 1
  store double %39, ptr %4, align 8
  store double %40, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !10
  %indvars.iv.next60 = add nsw i64 %indvars.iv59, 1
  %41 = icmp slt i64 %indvars.iv.next60, %26
  br i1 %41, label %.lr.ph.us, label %._crit_edge.us, !llvm.loop !13

._crit_edge52.us:                                 ; preds = %._crit_edge.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  %42 = shl i32 %.04454.us, 1
  %.not.us = icmp sgt i32 %42, %1
  br i1 %.not.us, label %._crit_edge57, label %.lr.ph51.us, !llvm.loop !14

._crit_edge57:                                    ; preds = %._crit_edge52.us, %3
  %43 = icmp eq i32 %2, -1
  %44 = icmp sgt i32 %1, 0
  %or.cond = and i1 %43, %44
  br i1 %or.cond, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %._crit_edge57
  %45 = uitofp nneg i32 %1 to double
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %46

46:                                               ; preds = %.lr.ph, %46
  %indvars.iv63 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next64, %46 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %47 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %indvars.iv63
  %48 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %47)
  %49 = fdiv double %48, %45
  %50 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %47)
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef %49, double noundef %50)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(16) %9, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %46, !llvm.loop !15

.loopexit:                                        ; preds = %46, %._crit_edge57
  ret void
}

; 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 nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

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

; 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) #4

; 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 #5

; 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 #5

; 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 #5

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

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


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