; LLVM IR from zsiciarz/aquila :: aquila/transform/AquilaFft.ll (ZN6Aquila9AquilaFft14getCachedFftWiEj)

; 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 } }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.Aquila::AquilaFft" = type { %"class.Aquila::Fft", %"class.std::map" }
%"class.Aquila::Fft" = type { ptr, i64 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, std::complex<double> **>, std::_Select1st<std::pair<const unsigned int, std::complex<double> **>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, std::complex<double> **>, std::_Select1st<std::pair<const unsigned int, std::complex<double> **>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@_ZN6Aquila9AquilaFft1jE = external dso_local constant %"class.std::complex", align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN6Aquila9AquilaFft14getCachedFftWiEj(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::complex", align 8
  %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 double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::complex", align 8
  %25 = alloca i32, align 4
  %26 = alloca %"class.std::complex", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %27 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %28 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %28, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %29 = getelementptr inbounds %"class.Aquila::AquilaFft", ptr %27, i32 0, i32 1
  %30 = call ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %31 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %7, i32 0, i32 0
  store ptr %30, ptr %31, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %32 = getelementptr inbounds %"class.Aquila::AquilaFft", ptr %27, i32 0, i32 1
  %33 = call ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %32) #8
  %34 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  %35 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKjPPSt7complexIdEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br i1 %35, label %36, label %40

36:                                               ; preds = %2
  %37 = getelementptr inbounds %"class.Aquila::AquilaFft", ptr %27, i32 0, i32 1
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  store ptr %39, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %164

40:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = add i32 %41, 1
  %43 = zext i32 %42 to i64
  %44 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %43, i64 8)
  %45 = extractvalue { i64, i1 } %44, 1
  %46 = extractvalue { i64, i1 } %44, 0
  %47 = select i1 %45, i64 -1, i64 %46
  %48 = call noalias noundef nonnull ptr @_Znam(i64 noundef %47) #9
  store ptr %48, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %156, %40
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = icmp ule i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %159

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = shl i32 1, %55
  store i32 %56, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = sub i32 %57, 1
  %59 = shl i32 1, %58
  store i32 %59, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  %60 = call { double, double } @_ZStngIdESt7complexIT_ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @_ZN6Aquila9AquilaFft1jE)
  %61 = getelementptr inbounds %"class.std::complex", ptr %18, i32 0, i32 0
  %62 = getelementptr inbounds { double, double }, ptr %61, i32 0, i32 0
  %63 = extractvalue { double, double } %60, 0
  store double %63, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %61, i32 0, i32 1
  %65 = extractvalue { double, double } %60, 1
  store double %65, ptr %64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store double 2.000000e+00, ptr %19, align 8, !tbaa !11
  %66 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %67 = getelementptr inbounds %"class.std::complex", ptr %17, i32 0, i32 0
  %68 = getelementptr inbounds { double, double }, ptr %67, i32 0, i32 0
  %69 = extractvalue { double, double } %66, 0
  store double %69, ptr %68, align 8
  %70 = getelementptr inbounds { double, double }, ptr %67, i32 0, i32 1
  %71 = extractvalue { double, double } %66, 1
  store double %71, ptr %70, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store double 0x400921FB54442D18, ptr %20, align 8, !tbaa !11
  %72 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %73 = getelementptr inbounds %"class.std::complex", ptr %16, i32 0, i32 0
  %74 = getelementptr inbounds { double, double }, ptr %73, i32 0, i32 0
  %75 = extractvalue { double, double } %72, 0
  store double %75, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %73, i32 0, i32 1
  %77 = extractvalue { double, double } %72, 1
  store double %77, ptr %76, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = uitofp i32 %78 to double
  store double %79, ptr %21, align 8, !tbaa !11
  %80 = call { double, double } @_ZStdvIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %81 = getelementptr inbounds %"class.std::complex", ptr %15, i32 0, i32 0
  %82 = getelementptr inbounds { double, double }, ptr %81, i32 0, i32 0
  %83 = extractvalue { double, double } %80, 0
  store double %83, ptr %82, align 8
  %84 = getelementptr inbounds { double, double }, ptr %81, i32 0, i32 1
  %85 = extractvalue { double, double } %80, 1
  store double %85, ptr %84, align 8
  %86 = call { double, double } @_ZSt3expIdESt7complexIT_ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %87 = getelementptr inbounds %"class.std::complex", ptr %14, i32 0, i32 0
  %88 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 0
  %89 = extractvalue { double, double } %86, 0
  store double %89, ptr %88, align 8
  %90 = getelementptr inbounds { double, double }, ptr %87, i32 0, i32 1
  %91 = extractvalue { double, double } %86, 1
  store double %91, ptr %90, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #8
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = add i32 %92, 1
  %94 = zext i32 %93 to i64
  %95 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %94, i64 16)
  %96 = extractvalue { i64, i1 } %95, 1
  %97 = extractvalue { i64, i1 } %95, 0
  %98 = select i1 %96, i64 -1, i64 %97
  %99 = call noalias noundef nonnull ptr @_Znam(i64 noundef %98) #9
  %100 = icmp eq i64 %94, 0
  br i1 %100, label %108, label %101

101:                                              ; preds = %54
  %102 = getelementptr inbounds %"class.std::complex", ptr %99, i64 %94
  br label %103

103:                                              ; preds = %105, %101
  %104 = phi ptr [ %99, %101 ], [ %106, %105 ]
  invoke void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %104, double noundef 0.000000e+00, double noundef 0.000000e+00)
          to label %105 unwind label %124

105:                                              ; preds = %103
  %106 = getelementptr inbounds %"class.std::complex", ptr %104, i64 1
  %107 = icmp eq ptr %106, %102
  br i1 %107, label %108, label %103

108:                                              ; preds = %105, %54
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = zext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %109, i64 %111
  store ptr %99, ptr %112, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #8
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %24, double noundef 1.000000e+00, double noundef 0.000000e+00)
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.std::complex", ptr %117, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %118, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  store i32 1, ptr %25, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %152, %108
  %120 = load i32, ptr %25, align 4, !tbaa !9
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = icmp ule i32 %120, %121
  br i1 %122, label %128, label %123

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

124:                                              ; preds = %103
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %22, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %23, align 4
  call void @_ZdaPvm(ptr noundef %99, i64 noundef %98) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %166

128:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #8
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = load i32, ptr %25, align 4, !tbaa !9
  %135 = sub i32 %134, 1
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds %"class.std::complex", ptr %133, i64 %136
  %138 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %137, ptr noundef nonnull align 8 dereferenceable(16) %14)
  %139 = getelementptr inbounds %"class.std::complex", ptr %26, i32 0, i32 0
  %140 = getelementptr inbounds { double, double }, ptr %139, i32 0, i32 0
  %141 = extractvalue { double, double } %138, 0
  store double %141, ptr %140, align 8
  %142 = getelementptr inbounds { double, double }, ptr %139, i32 0, i32 1
  %143 = extractvalue { double, double } %138, 1
  store double %143, ptr %142, align 8
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = load i32, ptr %25, align 4, !tbaa !9
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds %"class.std::complex", ptr %148, i64 %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %151, ptr align 8 %26, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #8
  br label %152

152:                                              ; preds = %128
  %153 = load i32, ptr %25, align 4, !tbaa !9
  %154 = add i32 %153, 1
  store i32 %154, ptr %25, align 4, !tbaa !9
  br label %119, !llvm.loop !15

155:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = add i32 %157, 1
  store i32 %158, ptr %11, align 4, !tbaa !9
  br label %49, !llvm.loop !17

159:                                              ; preds = %53
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = getelementptr inbounds %"class.Aquila::AquilaFft", ptr %27, i32 0, i32 1
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48) %161, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store ptr %160, ptr %162, align 8, !tbaa !5
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %163, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %164

164:                                              ; preds = %159, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %165 = load ptr, ptr %3, align 8
  ret ptr %165

166:                                              ; preds = %124
  %167 = load ptr, ptr %22, align 8
  %168 = load i32, ptr %23, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKjPPSt7complexIdEEES9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !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}


; 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 } }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@_ZN6Aquila9AquilaFft1jE = external dso_local constant %"class.std::complex", align 8

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN6Aquila9AquilaFft14getCachedFftWiEj(ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", 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
  %10 = alloca %"class.std::complex", align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca %"class.std::complex", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 %1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = call ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %16, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %17 = call ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  store ptr %17, ptr %5, align 8
  %18 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKjPPSt7complexIdEEES9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %18, label %19, label %22

19:                                               ; preds = %2
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  br label %79

22:                                               ; preds = %2
  %23 = add i32 %1, 1
  %24 = zext i32 %23 to i64
  %25 = shl nuw nsw i64 %24, 3
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #7
  %.not29 = icmp eq i32 %1, 0
  br i1 %.not29, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %22
  %27 = getelementptr inbounds i8, ptr %10, i64 8
  %28 = getelementptr inbounds i8, ptr %9, i64 8
  %29 = getelementptr inbounds i8, ptr %8, i64 8
  %30 = getelementptr inbounds i8, ptr %7, i64 8
  %31 = getelementptr inbounds i8, ptr %6, i64 8
  br label %33

._crit_edge:                                      ; preds = %65, %22
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store ptr %26, ptr %32, align 8, !tbaa !9
  br label %79

33:                                               ; preds = %.lr.ph, %65
  %.02630 = phi i32 [ 1, %.lr.ph ], [ %66, %65 ]
  %34 = shl nuw i32 1, %.02630
  %35 = add i32 %.02630, -1
  %36 = shl nuw i32 1, %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %37 = call { double, double } @_ZStngIdESt7complexIT_ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) @_ZN6Aquila9AquilaFft1jE)
  %38 = extractvalue { double, double } %37, 0
  store double %38, ptr %10, align 8
  %39 = extractvalue { double, double } %37, 1
  store double %39, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  store double 2.000000e+00, ptr %11, align 8, !tbaa !11
  %40 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %41 = extractvalue { double, double } %40, 0
  store double %41, ptr %9, align 8
  %42 = extractvalue { double, double } %40, 1
  store double %42, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  store double 0x400921FB54442D18, ptr %12, align 8, !tbaa !11
  %43 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %44 = extractvalue { double, double } %43, 0
  store double %44, ptr %8, align 8
  %45 = extractvalue { double, double } %43, 1
  store double %45, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %46 = uitofp i32 %34 to double
  store double %46, ptr %13, align 8, !tbaa !11
  %47 = call { double, double } @_ZStdvIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %48 = extractvalue { double, double } %47, 0
  store double %48, ptr %7, align 8
  %49 = extractvalue { double, double } %47, 1
  store double %49, ptr %30, align 8
  %50 = call { double, double } @_ZSt3expIdESt7complexIT_ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %51 = extractvalue { double, double } %50, 0
  store double %51, ptr %6, align 8
  %52 = extractvalue { double, double } %50, 1
  store double %52, ptr %31, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %53 = add nuw i32 %36, 1
  %54 = zext i32 %53 to i64
  %55 = shl nuw nsw i64 %54, 4
  %56 = call noalias noundef nonnull ptr @_Znam(i64 noundef %55) #7
  %57 = getelementptr inbounds %"class.std::complex", ptr %56, i64 %54
  br label %58

58:                                               ; preds = %58, %33
  %59 = phi ptr [ %56, %33 ], [ %60, %58 ]
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %59, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %60 = getelementptr inbounds i8, ptr %59, i64 16
  %61 = icmp eq ptr %60, %57
  br i1 %61, label %62, label %58

62:                                               ; preds = %58
  %63 = zext i32 %.02630 to i64
  %64 = getelementptr inbounds ptr, ptr %26, i64 %63
  store ptr %56, ptr %64, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %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 noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(16) %14, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  br label %67

65:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  %66 = add i32 %.02630, 1
  %.not = icmp ugt i32 %66, %1
  br i1 %.not, label %._crit_edge, label %33, !llvm.loop !15

67:                                               ; preds = %62, %67
  %68 = phi ptr [ %56, %62 ], [ %75, %67 ]
  %.02528 = phi i32 [ 1, %62 ], [ %78, %67 ]
  %69 = add i32 %.02528, -1
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds %"class.std::complex", ptr %68, i64 %70
  %72 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %73 = extractvalue { double, double } %72, 0
  %74 = extractvalue { double, double } %72, 1
  %75 = load ptr, ptr %64, align 8, !tbaa !9
  %76 = zext i32 %.02528 to i64
  %77 = getelementptr inbounds %"class.std::complex", ptr %75, i64 %76
  store double %73, ptr %77, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %77, i64 8
  store double %74, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !14
  %78 = add i32 %.02528, 1
  %.not27 = icmp ugt i32 %78, %36
  br i1 %.not27, label %65, label %67, !llvm.loop !17

79:                                               ; preds = %._crit_edge, %19
  %.0 = phi ptr [ %21, %19 ], [ %26, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret ptr %.0
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKjPPSt7complexIdEEES9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE4findERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIjPPSt7complexIdESt4lessIjESaISt4pairIKjS3_EEEixERS7_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass