; LLVM IR from sp-nitech/SPTK :: src/conversion (spectrum_to_spectrum)

; 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.sptk::SpectrumToSpectrum" = type <{ ptr, i32, i32, i32, [4 x i8], double, double, %"class.std::vector", i8, [7 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sptk::SpectrumToSpectrum::OperationInterface *, std::allocator<sptk::SpectrumToSpectrum::OperationInterface *>>::_Vector_impl" }
%"struct.std::_Vector_base<sptk::SpectrumToSpectrum::OperationInterface *, std::allocator<sptk::SpectrumToSpectrum::OperationInterface *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sptk::SpectrumToSpectrum::OperationInterface *, std::allocator<sptk::SpectrumToSpectrum::OperationInterface *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sptk::SpectrumToSpectrum::OperationInterface *, std::allocator<sptk::SpectrumToSpectrum::OperationInterface *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTVN4sptk18SpectrumToSpectrumE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk18SpectrumToSpectrumC2EiNS0_18InputOutputFormatsES1_dd(ptr noundef nonnull align 8 dereferenceable(65) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !11
  store i32 %3, ptr %10, align 4, !tbaa !11
  store double %4, ptr %11, align 8, !tbaa !13
  store double %5, ptr %12, align 8, !tbaa !13
  %20 = load ptr, ptr %7, align 8
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN4sptk18SpectrumToSpectrumE, i32 0, i32 0, i32 2), ptr %20, align 8, !tbaa !15
  %21 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %22, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 2
  %24 = load i32, ptr %9, align 4, !tbaa !11
  store i32 %24, ptr %23, align 4, !tbaa !24
  %25 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %26 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %26, ptr %25, align 8, !tbaa !25
  %27 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 5
  %28 = load double, ptr %11, align 8, !tbaa !13
  store double %28, ptr %27, align 8, !tbaa !26
  %29 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %30 = load double, ptr %12, align 8, !tbaa !13
  store double %30, ptr %29, align 8, !tbaa !27
  %31 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #7
  %32 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 8
  store i8 1, ptr %32, align 8, !tbaa !28
  %33 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 1
  %34 = load i32, ptr %33, align 8, !tbaa !17
  %35 = icmp sle i32 %34, 0
  br i1 %35, label %65, label %36

36:                                               ; preds = %6
  %37 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !17
  %39 = invoke noundef zeroext i1 @_ZN4sptk12IsPowerOfTwoEi(i32 noundef %38)
          to label %40 unwind label %67

40:                                               ; preds = %36
  br i1 %39, label %41, label %65

41:                                               ; preds = %40
  %42 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !24
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %65, label %45

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !24
  %48 = icmp sle i32 4, %47
  br i1 %48, label %65, label %49

49:                                               ; preds = %45
  %50 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %51 = load i32, ptr %50, align 8, !tbaa !25
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %65, label %53

53:                                               ; preds = %49
  %54 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %55 = load i32, ptr %54, align 8, !tbaa !25
  %56 = icmp sle i32 4, %55
  br i1 %56, label %65, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 5
  %59 = load double, ptr %58, align 8, !tbaa !26
  %60 = fcmp olt double %59, 0.000000e+00
  br i1 %60, label %65, label %61

61:                                               ; preds = %57
  %62 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %63 = load double, ptr %62, align 8, !tbaa !27
  %64 = fcmp ole double 0.000000e+00, %63
  br i1 %64, label %65, label %71

65:                                               ; preds = %61, %57, %53, %49, %45, %41, %40, %6
  %66 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 8
  store i8 0, ptr %66, align 8, !tbaa !28
  br label %189

67:                                               ; preds = %100, %86, %75, %36
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %13, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %14, align 4
  br label %190

71:                                               ; preds = %61
  %72 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 5
  %73 = load double, ptr %72, align 8, !tbaa !26
  %74 = fcmp une double 0.000000e+00, %73
  br i1 %74, label %75, label %100

75:                                               ; preds = %71
  %76 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !24
  %78 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  invoke void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef %77, i32 noundef 3, ptr noundef %78)
          to label %79 unwind label %67

79:                                               ; preds = %75
  %80 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %81 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %82 unwind label %91

82:                                               ; preds = %79
  %83 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 5
  %84 = load double, ptr %83, align 8, !tbaa !26
  invoke void @_ZN12_GLOBAL__N_18AdditionC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %81, double noundef %84)
          to label %85 unwind label %95

85:                                               ; preds = %82
  store ptr %81, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %80, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %86 unwind label %91

86:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  %87 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %88 = load i32, ptr %87, align 8, !tbaa !25
  %89 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  invoke void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef 3, i32 noundef %88, ptr noundef %89)
          to label %90 unwind label %67

90:                                               ; preds = %86
  br label %107

91:                                               ; preds = %85, %79
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %13, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %14, align 4
  br label %99

95:                                               ; preds = %82
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %13, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %81, i64 noundef 16) #9
  br label %99

99:                                               ; preds = %95, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %190

100:                                              ; preds = %71
  %101 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !24
  %103 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %104 = load i32, ptr %103, align 8, !tbaa !25
  %105 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  invoke void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef %102, i32 noundef %104, ptr noundef %105)
          to label %106 unwind label %67

106:                                              ; preds = %100
  br label %107

107:                                              ; preds = %106, %90
  %108 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %109 = load double, ptr %108, align 8, !tbaa !27
  %110 = fcmp une double 0xFFEFFFFFFFFFFFFF, %109
  br i1 %110, label %111, label %189

111:                                              ; preds = %107
  %112 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 3
  %113 = load i32, ptr %112, align 8, !tbaa !25
  switch i32 %113, label %187 [
    i32 0, label %114
    i32 1, label %131
    i32 2, label %149
    i32 3, label %168
  ]

114:                                              ; preds = %111
  %115 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %116 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %117 unwind label %122

117:                                              ; preds = %114
  %118 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %119 = load double, ptr %118, align 8, !tbaa !27
  invoke void @_ZN12_GLOBAL__N_119FlooringOnLogarithmC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %116, double noundef %119)
          to label %120 unwind label %126

120:                                              ; preds = %117
  store ptr %116, ptr %16, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %121 unwind label %122

121:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %188

122:                                              ; preds = %120, %114
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %13, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %14, align 4
  br label %130

126:                                              ; preds = %117
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %13, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %116, i64 noundef 16) #9
  br label %130

130:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %190

131:                                              ; preds = %111
  %132 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %133 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %134 unwind label %140

134:                                              ; preds = %131
  %135 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %136 = load double, ptr %135, align 8, !tbaa !27
  %137 = fdiv double %136, 0x40215F2CED384F28
  invoke void @_ZN12_GLOBAL__N_119FlooringOnLogarithmC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %133, double noundef %137)
          to label %138 unwind label %144

138:                                              ; preds = %134
  store ptr %133, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %132, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %139 unwind label %140

139:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %188

140:                                              ; preds = %138, %131
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %13, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %14, align 4
  br label %148

144:                                              ; preds = %134
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %13, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %133, i64 noundef 16) #9
  br label %148

148:                                              ; preds = %144, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %190

149:                                              ; preds = %111
  %150 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %151 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %152 unwind label %159

152:                                              ; preds = %149
  %153 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %154 = load double, ptr %153, align 8, !tbaa !27
  %155 = fmul double 5.000000e-02, %154
  %156 = call double @pow(double noundef 1.000000e+01, double noundef %155) #7
  invoke void @_ZN12_GLOBAL__N_116FlooringOnLinearC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %151, double noundef %156)
          to label %157 unwind label %163

157:                                              ; preds = %152
  store ptr %151, ptr %18, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %150, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %158 unwind label %159

158:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %188

159:                                              ; preds = %157, %149
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %13, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %14, align 4
  br label %167

163:                                              ; preds = %152
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %13, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %151, i64 noundef 16) #9
  br label %167

167:                                              ; preds = %163, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %190

168:                                              ; preds = %111
  %169 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %170 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
          to label %171 unwind label %178

171:                                              ; preds = %168
  %172 = getelementptr inbounds %"class.sptk::SpectrumToSpectrum", ptr %20, i32 0, i32 6
  %173 = load double, ptr %172, align 8, !tbaa !27
  %174 = fmul double 1.000000e-01, %173
  %175 = call double @pow(double noundef 1.000000e+01, double noundef %174) #7
  invoke void @_ZN12_GLOBAL__N_116FlooringOnLinearC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %170, double noundef %175)
          to label %176 unwind label %182

176:                                              ; preds = %171
  store ptr %170, ptr %19, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %169, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %177 unwind label %178

177:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %188

178:                                              ; preds = %176, %168
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %13, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %14, align 4
  br label %186

182:                                              ; preds = %171
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %13, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %170, i64 noundef 16) #9
  br label %186

186:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %190

187:                                              ; preds = %111
  br label %189

188:                                              ; preds = %177, %158, %139, %121
  br label %189

189:                                              ; preds = %188, %187, %107, %65
  ret void

190:                                              ; preds = %186, %167, %148, %130, %99, %67
  call void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %31) #7
  br label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr %13, align 8
  %193 = load i32, ptr %14, align 4
  %194 = insertvalue { ptr, i32 } poison, ptr %192, 0
  %195 = insertvalue { ptr, i32 } %194, i32 %193, 1
  resume { ptr, i32 } %195
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN4sptk12IsPowerOfTwoEi(i32 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef, i32 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

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

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

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"_ZTSN4sptk18SpectrumToSpectrum18InputOutputFormatsE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTSN4sptk18SpectrumToSpectrumE", !10, i64 8, !12, i64 12, !12, i64 16, !14, i64 24, !14, i64 32, !19, i64 40, !23, i64 64}
!19 = !{!"_ZTSSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"bool", !7, i64 0}
!24 = !{!18, !12, i64 12}
!25 = !{!18, !12, i64 16}
!26 = !{!18, !14, i64 24}
!27 = !{!18, !14, i64 32}
!28 = !{!18, !23, i64 64}


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

@_ZTVN4sptk18SpectrumToSpectrumE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk18SpectrumToSpectrumC2EiNS0_18InputOutputFormatsES1_dd(ptr noundef nonnull align 8 dereferenceable(65) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %4, double noundef %5) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN4sptk18SpectrumToSpectrumE, i64 16), ptr %0, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %12, align 8, !tbaa !8
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %13, align 4, !tbaa !20
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %3, ptr %14, align 8, !tbaa !21
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  store double %4, ptr %15, align 8, !tbaa !22
  %16 = getelementptr inbounds i8, ptr %0, i64 32
  store double %5, ptr %16, align 8, !tbaa !23
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  store i8 1, ptr %18, align 8, !tbaa !24
  %19 = load i32, ptr %12, align 8, !tbaa !8
  %20 = icmp slt i32 %19, 1
  br i1 %20, label %33, label %21

21:                                               ; preds = %6
  %22 = invoke noundef zeroext i1 @_ZN4sptk12IsPowerOfTwoEi(i32 noundef %19)
          to label %23 unwind label %34

23:                                               ; preds = %21
  br i1 %22, label %24, label %33

24:                                               ; preds = %23
  %25 = load i32, ptr %13, align 4, !tbaa !20
  %or.cond = icmp ugt i32 %25, 3
  br i1 %or.cond, label %33, label %26

26:                                               ; preds = %24
  %27 = load i32, ptr %14, align 8, !tbaa !21
  %or.cond13 = icmp ugt i32 %27, 3
  br i1 %or.cond13, label %33, label %28

28:                                               ; preds = %26
  %29 = load double, ptr %15, align 8, !tbaa !22
  %30 = fcmp uge double %29, 0.000000e+00
  %31 = load double, ptr %16, align 8
  %32 = fcmp ult double %31, 0.000000e+00
  %or.cond15 = select i1 %30, i1 %32, i1 false
  br i1 %or.cond15, label %36, label %33

33:                                               ; preds = %28, %26, %24, %23, %6
  store i8 0, ptr %18, align 8, !tbaa !24
  br label %83

34:                                               ; preds = %.invoke, %38, %21
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %84

36:                                               ; preds = %28
  %37 = fcmp une double %29, 0.000000e+00
  br i1 %37, label %38, label %.invoke

38:                                               ; preds = %36
  invoke void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef %25, i32 noundef 3, ptr noundef nonnull %17)
          to label %39 unwind label %34

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %40 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %41 unwind label %45

41:                                               ; preds = %39
  %42 = load double, ptr %15, align 8, !tbaa !22
  tail call void @_ZN12_GLOBAL__N_18AdditionC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %40, double noundef %42)
  store ptr %40, ptr %7, align 8, !tbaa !25
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %43 unwind label %45

43:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %44 = load i32, ptr %14, align 8, !tbaa !21
  br label %.invoke

45:                                               ; preds = %41, %39
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %84

.invoke:                                          ; preds = %36, %43
  %47 = phi i32 [ 3, %43 ], [ %25, %36 ]
  %48 = phi i32 [ %44, %43 ], [ %27, %36 ]
  invoke void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef %47, i32 noundef %48, ptr noundef nonnull %17)
          to label %49 unwind label %34

49:                                               ; preds = %.invoke
  %50 = load double, ptr %16, align 8, !tbaa !23
  %51 = fcmp une double %50, 0xFFEFFFFFFFFFFFFF
  br i1 %51, label %52, label %83

52:                                               ; preds = %49
  %53 = load i32, ptr %14, align 8, !tbaa !21
  switch i32 %53, label %83 [
    i32 0, label %54
    i32 1, label %60
    i32 2, label %67
    i32 3, label %75
  ]

54:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %55 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %56 unwind label %58

56:                                               ; preds = %54
  call void @_ZN12_GLOBAL__N_119FlooringOnLogarithmC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %55, double noundef %50)
  store ptr %55, ptr %8, align 8, !tbaa !25
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %57 unwind label %58

57:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %83

58:                                               ; preds = %56, %54
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %84

60:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %61 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %62 unwind label %65

62:                                               ; preds = %60
  %63 = fdiv double %50, 0x40215F2CED384F28
  call void @_ZN12_GLOBAL__N_119FlooringOnLogarithmC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %61, double noundef %63)
  store ptr %61, ptr %9, align 8, !tbaa !25
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %64 unwind label %65

64:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %83

65:                                               ; preds = %62, %60
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %84

67:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %68 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %69 unwind label %73

69:                                               ; preds = %67
  %70 = fmul double %50, 5.000000e-02
  %71 = call double @pow(double noundef 1.000000e+01, double noundef %70) #6
  call void @_ZN12_GLOBAL__N_116FlooringOnLinearC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %68, double noundef %71)
  store ptr %68, ptr %10, align 8, !tbaa !25
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %72 unwind label %73

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %83

73:                                               ; preds = %69, %67
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %84

75:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %76 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
          to label %77 unwind label %81

77:                                               ; preds = %75
  %78 = fmul double %50, 1.000000e-01
  %79 = call double @pow(double noundef 1.000000e+01, double noundef %78) #6
  call void @_ZN12_GLOBAL__N_116FlooringOnLinearC2Ed(ptr noundef nonnull align 8 dereferenceable(16) %76, double noundef %79)
  store ptr %76, ptr %11, align 8, !tbaa !25
  invoke void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %80 unwind label %81

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %83

81:                                               ; preds = %77, %75
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %84

83:                                               ; preds = %57, %64, %72, %80, %52, %49, %33
  ret void

84:                                               ; preds = %81, %73, %65, %58, %45, %34
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %74, %73 ], [ %66, %65 ], [ %59, %58 ], [ %35, %34 ], [ %46, %45 ]
  call void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN4sptk12IsPowerOfTwoEi(i32 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN12_GLOBAL__N_115SelectOperationEN4sptk18SpectrumToSpectrum18InputOutputFormatsES2_PSt6vectorIPNS1_18OperationInterfaceESaIS5_EE(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE9push_backEOS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { 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 #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 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN4sptk18SpectrumToSpectrumE", !10, i64 8, !12, i64 12, !12, i64 16, !13, i64 24, !13, i64 32, !14, i64 40, !19, i64 64}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTSN4sptk18SpectrumToSpectrum18InputOutputFormatsE", !11, i64 0}
!13 = !{!"double", !11, i64 0}
!14 = !{!"_ZTSSt6vectorIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN4sptk18SpectrumToSpectrum18OperationInterfaceESaIS3_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!18 = !{!"any pointer", !11, i64 0}
!19 = !{!"bool", !11, i64 0}
!20 = !{!9, !12, i64 12}
!21 = !{!9, !12, i64 16}
!22 = !{!9, !13, i64 24}
!23 = !{!9, !13, i64 32}
!24 = !{!9, !19, i64 64}
!25 = !{!18, !18, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass