; LLVM IR from kkumatani/distant_speech_recognition :: btk20_src/matrix/linpack_c.ll (Z5cgefaPSt7complexIfEiiPi)

; 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 { { float, float } }

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZStdvIfESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZStngIfESt7complexIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(8)) #3

declare void @_Z5caxpyiSt7complexIfEPS0_iS1_i(i32 noundef, <2 x float>, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

declare noundef float @_Z5cabs1St7complexIfE(<2 x float>) #4

declare noundef i32 @_Z6icamaxiPSt7complexIfEi(i32 noundef, ptr noundef, i32 noundef) #4

declare void @_Z5cscaliSt7complexIfEPS0_i(i32 noundef, <2 x float>, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5cgefaPSt7complexIfEiiPi(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #5 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::complex", align 4
  %14 = alloca %"class.std::complex", align 4
  %15 = alloca %"class.std::complex", align 4
  %16 = alloca %"class.std::complex", align 4
  %17 = alloca %"class.std::complex", align 4
  %18 = alloca %"class.std::complex", align 4
  %19 = alloca %"class.std::complex", align 4
  %20 = alloca %"class.std::complex", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @_ZNSt7complexIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %13, float noundef 0.000000e+00, float noundef 0.000000e+00)
  store i32 0, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %225, %4
  %22 = load i32, ptr %11, align 4, !tbaa !9
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = sub nsw i32 %23, 1
  %25 = icmp sle i32 %22, %24
  br i1 %25, label %26, label %228

26:                                               ; preds = %21
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = sub nsw i32 %27, %28
  %30 = add nsw i32 %29, 1
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %"class.std::complex", ptr %31, i64 %34
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = sub nsw i32 %36, 1
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = mul nsw i32 %37, %38
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %"class.std::complex", ptr %35, i64 %40
  %42 = call noundef i32 @_Z6icamaxiPSt7complexIfEi(i32 noundef %30, ptr noundef %41, i32 noundef 1)
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = add nsw i32 %42, %43
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr %12, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %47, i64 %50
  store i32 %46, ptr %51, align 4, !tbaa !9
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = sub nsw i32 %55, 1
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = mul nsw i32 %56, %57
  %59 = add nsw i32 %54, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %"class.std::complex", ptr %52, i64 %60
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %61, i64 8, i1 false), !tbaa.struct !11
  %62 = getelementptr inbounds %"class.std::complex", ptr %14, i32 0, i32 0
  %63 = load <2 x float>, ptr %62, align 4
  %64 = call noundef float @_Z5cabs1St7complexIfE(<2 x float> %63)
  %65 = fpext float %64 to double
  %66 = fcmp oeq double %65, 0.000000e+00
  br i1 %66, label %67, label %69

67:                                               ; preds = %26
  %68 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %68, ptr %9, align 4, !tbaa !9
  br label %225

69:                                               ; preds = %26
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = icmp ne i32 %70, %71
  br i1 %72, label %73, label %114

73:                                               ; preds = %69
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = sub nsw i32 %75, 1
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = mul nsw i32 %78, %79
  %81 = add nsw i32 %76, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %"class.std::complex", ptr %74, i64 %82
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %83, i64 8, i1 false), !tbaa.struct !11
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = sub nsw i32 %85, 1
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = sub nsw i32 %87, 1
  %89 = load i32, ptr %6, align 4, !tbaa !9
  %90 = mul nsw i32 %88, %89
  %91 = add nsw i32 %86, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds %"class.std::complex", ptr %84, i64 %92
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = sub nsw i32 %95, 1
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = sub nsw i32 %97, 1
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = mul nsw i32 %98, %99
  %101 = add nsw i32 %96, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds %"class.std::complex", ptr %94, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %103, ptr align 4 %93, i64 8, i1 false), !tbaa.struct !11
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = sub nsw i32 %105, 1
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = sub nsw i32 %107, 1
  %109 = load i32, ptr %6, align 4, !tbaa !9
  %110 = mul nsw i32 %108, %109
  %111 = add nsw i32 %106, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %"class.std::complex", ptr %104, i64 %112
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %113, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  br label %114

114:                                              ; preds = %73, %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @_ZNSt7complexIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %17, float noundef 1.000000e+00, float noundef 0.000000e+00)
  %115 = call <2 x float> @_ZStngIfESt7complexIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(8) %17)
  %116 = getelementptr inbounds %"class.std::complex", ptr %16, i32 0, i32 0
  store <2 x float> %115, ptr %116, align 4
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = sub nsw i32 %118, 1
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = sub nsw i32 %120, 1
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = mul nsw i32 %121, %122
  %124 = add nsw i32 %119, %123
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %"class.std::complex", ptr %117, i64 %125
  %127 = call <2 x float> @_ZStdvIfESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %126)
  %128 = getelementptr inbounds %"class.std::complex", ptr %15, i32 0, i32 0
  store <2 x float> %127, ptr %128, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %129 = load i32, ptr %7, align 4, !tbaa !9
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = sub nsw i32 %129, %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %"class.std::complex", ptr %132, i64 %134
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = sub nsw i32 %136, 1
  %138 = load i32, ptr %6, align 4, !tbaa !9
  %139 = mul nsw i32 %137, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %"class.std::complex", ptr %135, i64 %140
  %142 = getelementptr inbounds %"class.std::complex", ptr %18, i32 0, i32 0
  %143 = load <2 x float>, ptr %142, align 4
  call void @_Z5cscaliSt7complexIfEPS0_i(i32 noundef %131, <2 x float> %143, ptr noundef %141, i32 noundef 1)
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %10, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %221, %114
  %147 = load i32, ptr %10, align 4, !tbaa !9
  %148 = load i32, ptr %7, align 4, !tbaa !9
  %149 = icmp sle i32 %147, %148
  br i1 %149, label %150, label %224

150:                                              ; preds = %146
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = load i32, ptr %12, align 4, !tbaa !9
  %153 = sub nsw i32 %152, 1
  %154 = load i32, ptr %10, align 4, !tbaa !9
  %155 = sub nsw i32 %154, 1
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = mul nsw i32 %155, %156
  %158 = add nsw i32 %153, %157
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds %"class.std::complex", ptr %151, i64 %159
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %160, i64 8, i1 false), !tbaa.struct !11
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = load i32, ptr %11, align 4, !tbaa !9
  %163 = icmp ne i32 %161, %162
  br i1 %163, label %164, label %195

164:                                              ; preds = %150
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = sub nsw i32 %166, 1
  %168 = load i32, ptr %10, align 4, !tbaa !9
  %169 = sub nsw i32 %168, 1
  %170 = load i32, ptr %6, align 4, !tbaa !9
  %171 = mul nsw i32 %169, %170
  %172 = add nsw i32 %167, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds %"class.std::complex", ptr %165, i64 %173
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = load i32, ptr %12, align 4, !tbaa !9
  %177 = sub nsw i32 %176, 1
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = sub nsw i32 %178, 1
  %180 = load i32, ptr %6, align 4, !tbaa !9
  %181 = mul nsw i32 %179, %180
  %182 = add nsw i32 %177, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds %"class.std::complex", ptr %175, i64 %183
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %184, ptr align 4 %174, i64 8, i1 false), !tbaa.struct !11
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = load i32, ptr %11, align 4, !tbaa !9
  %187 = sub nsw i32 %186, 1
  %188 = load i32, ptr %10, align 4, !tbaa !9
  %189 = sub nsw i32 %188, 1
  %190 = load i32, ptr %6, align 4, !tbaa !9
  %191 = mul nsw i32 %189, %190
  %192 = add nsw i32 %187, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds %"class.std::complex", ptr %185, i64 %193
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %194, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  br label %195

195:                                              ; preds = %164, %150
  %196 = load i32, ptr %7, align 4, !tbaa !9
  %197 = load i32, ptr %11, align 4, !tbaa !9
  %198 = sub nsw i32 %196, %197
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = load i32, ptr %11, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds %"class.std::complex", ptr %199, i64 %201
  %203 = load i32, ptr %11, align 4, !tbaa !9
  %204 = sub nsw i32 %203, 1
  %205 = load i32, ptr %6, align 4, !tbaa !9
  %206 = mul nsw i32 %204, %205
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds %"class.std::complex", ptr %202, i64 %207
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = load i32, ptr %11, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds %"class.std::complex", ptr %209, i64 %211
  %213 = load i32, ptr %10, align 4, !tbaa !9
  %214 = sub nsw i32 %213, 1
  %215 = load i32, ptr %6, align 4, !tbaa !9
  %216 = mul nsw i32 %214, %215
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds %"class.std::complex", ptr %212, i64 %217
  %219 = getelementptr inbounds %"class.std::complex", ptr %19, i32 0, i32 0
  %220 = load <2 x float>, ptr %219, align 4
  call void @_Z5caxpyiSt7complexIfEPS0_iS1_i(i32 noundef %198, <2 x float> %220, ptr noundef %208, i32 noundef 1, ptr noundef %218, i32 noundef 1)
  br label %221

221:                                              ; preds = %195
  %222 = load i32, ptr %10, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %10, align 4, !tbaa !9
  br label %146, !llvm.loop !13

224:                                              ; preds = %146
  br label %225

225:                                              ; preds = %224, %67
  %226 = load i32, ptr %11, align 4, !tbaa !9
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %11, align 4, !tbaa !9
  br label %21, !llvm.loop !15

228:                                              ; preds = %21
  %229 = load i32, ptr %7, align 4, !tbaa !9
  %230 = load ptr, ptr %8, align 8, !tbaa !5
  %231 = load i32, ptr %7, align 4, !tbaa !9
  %232 = sub nsw i32 %231, 1
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds i32, ptr %230, i64 %233
  store i32 %229, ptr %234, align 4, !tbaa !9
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = load i32, ptr %7, align 4, !tbaa !9
  %237 = sub nsw i32 %236, 1
  %238 = load i32, ptr %7, align 4, !tbaa !9
  %239 = sub nsw i32 %238, 1
  %240 = load i32, ptr %6, align 4, !tbaa !9
  %241 = mul nsw i32 %239, %240
  %242 = add nsw i32 %237, %241
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds %"class.std::complex", ptr %235, i64 %243
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %244, i64 8, i1 false), !tbaa.struct !11
  %245 = getelementptr inbounds %"class.std::complex", ptr %20, i32 0, i32 0
  %246 = load <2 x float>, ptr %245, align 4
  %247 = call noundef float @_Z5cabs1St7complexIfE(<2 x float> %246)
  %248 = fpext float %247 to double
  %249 = fcmp oeq double %248, 0.000000e+00
  br i1 %249, label %250, label %252

250:                                              ; preds = %228
  %251 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %251, ptr %9, align 4, !tbaa !9
  br label %252

252:                                              ; preds = %250, %228
  %253 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret i32 %253
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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 uwtable "min-legal-vector-width"="64" "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 = !{i64 0, i64 8, !12}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7complexIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float 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) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZStdvIfESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZStngIfESt7complexIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

declare void @_Z5caxpyiSt7complexIfEPS0_iS1_i(i32 noundef, <2 x float>, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare noundef float @_Z5cabs1St7complexIfE(<2 x float>) local_unnamed_addr #3

declare noundef i32 @_Z6icamaxiPSt7complexIfEi(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @_Z5cscaliSt7complexIfEPS0_i(i32 noundef, <2 x float>, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5cgefaPSt7complexIfEiiPi(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #4 {
  %5 = alloca %"class.std::complex", align 8
  %6 = alloca %"class.std::complex", align 8
  %7 = alloca %"class.std::complex", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt7complexIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %.not.not98 = icmp sgt i32 %2, 1
  br i1 %.not.not98, label %.lr.ph103.preheader, label %._crit_edge

.lr.ph103.preheader:                              ; preds = %4
  %8 = sext i32 %1 to i64
  %9 = zext nneg i32 %2 to i64
  %wide.trip.count124 = zext nneg i32 %2 to i64
  br label %.lr.ph103

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %.loopexit
  %indvars.iv107 = phi i64 [ 1, %.lr.ph103.preheader ], [ %indvars.iv.next108, %.loopexit ]
  %.0102 = phi i32 [ 0, %.lr.ph103.preheader ], [ %.1, %.loopexit ]
  %10 = sub nsw i64 %9, %indvars.iv107
  %11 = add nsw i64 %indvars.iv107, -1
  %12 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %11
  %13 = mul nsw i64 %11, %8
  %14 = getelementptr inbounds %"class.std::complex", ptr %12, i64 %13
  %15 = trunc i64 %10 to i32
  %16 = add i32 %15, 1
  %17 = call noundef i32 @_Z6icamaxiPSt7complexIfEi(i32 noundef %16, ptr noundef %14, i32 noundef 1)
  %18 = trunc nuw nsw i64 %indvars.iv107 to i32
  %19 = add nsw i32 %17, %18
  %20 = add nsw i32 %19, -1
  %21 = getelementptr inbounds i32, ptr %3, i64 %11
  store i32 %20, ptr %21, align 4, !tbaa !5
  %22 = add nsw i32 %19, -2
  %23 = sext i32 %22 to i64
  %24 = getelementptr %"class.std::complex", ptr %0, i64 %13
  %25 = getelementptr %"class.std::complex", ptr %24, i64 %23
  %.sroa.04.0.copyload = load <2 x float>, ptr %25, align 4, !tbaa !9
  %26 = call noundef float @_Z5cabs1St7complexIfE(<2 x float> %.sroa.04.0.copyload)
  %27 = fcmp oeq float %26, 0.000000e+00
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %.lr.ph103
  %29 = zext i32 %20 to i64
  %.not = icmp eq i64 %indvars.iv107, %29
  br i1 %.not, label %._crit_edge126, label %30

._crit_edge126:                                   ; preds = %28
  %.pre = add nsw i64 %13, %11
  br label %.lr.ph

30:                                               ; preds = %28
  %31 = load i64, ptr %25, align 4, !tbaa !9
  store i64 %31, ptr %5, align 8, !tbaa !9
  %32 = add nsw i64 %13, %11
  %33 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %32
  %34 = load i64, ptr %33, align 4, !tbaa !9
  store i64 %34, ptr %25, align 4, !tbaa !9
  store i64 %31, ptr %33, align 4, !tbaa !9
  br label %.lr.ph

.lr.ph:                                           ; preds = %30, %._crit_edge126
  %.pre-phi = phi i64 [ %.pre, %._crit_edge126 ], [ %32, %30 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @_ZNSt7complexIfEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef 1.000000e+00, float noundef 0.000000e+00)
  %35 = call <2 x float> @_ZStngIfESt7complexIT_ERKS2_(ptr noundef nonnull align 4 dereferenceable(8) %7)
  store <2 x float> %35, ptr %6, align 8
  %36 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %.pre-phi
  %37 = call <2 x float> @_ZStdvIfESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %36)
  store <2 x float> %37, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %38 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %indvars.iv107
  %39 = getelementptr inbounds %"class.std::complex", ptr %38, i64 %13
  %40 = trunc i64 %10 to i32
  call void @_Z5cscaliSt7complexIfEPS0_i(i32 noundef %40, <2 x float> %37, ptr noundef nonnull %39, i32 noundef 1)
  %invariant.gep130 = getelementptr %"class.std::complex", ptr %0, i64 %23
  br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.lr.ph
  %invariant.gep128 = getelementptr %"class.std::complex", ptr %0, i64 %11
  br label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.lr.ph.split.us ], [ %indvars.iv107, %.lr.ph ]
  %41 = mul nsw i64 %indvars.iv116, %8
  %gep131 = getelementptr %"class.std::complex", ptr %invariant.gep130, i64 %41
  %42 = load i64, ptr %gep131, align 4, !tbaa !9
  store i64 %42, ptr %5, align 8, !tbaa !9
  %.sroa.01.0.copyload.us.cast = bitcast i64 %42 to <2 x float>
  %43 = getelementptr inbounds %"class.std::complex", ptr %38, i64 %41
  call void @_Z5caxpyiSt7complexIfEPS0_iS1_i(i32 noundef %40, <2 x float> %.sroa.01.0.copyload.us.cast, ptr noundef nonnull %39, i32 noundef 1, ptr noundef nonnull %43, i32 noundef 1)
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count124
  br i1 %exitcond122.not, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !10

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %.lr.ph.split
  %indvars.iv109 = phi i64 [ %indvars.iv107, %.lr.ph.split.preheader ], [ %indvars.iv.next110, %.lr.ph.split ]
  %44 = mul nsw i64 %indvars.iv109, %8
  %gep = getelementptr %"class.std::complex", ptr %invariant.gep130, i64 %44
  %45 = load i64, ptr %gep, align 4, !tbaa !9
  store i64 %45, ptr %5, align 8, !tbaa !9
  %gep129 = getelementptr %"class.std::complex", ptr %invariant.gep128, i64 %44
  %46 = load i64, ptr %gep129, align 4, !tbaa !9
  store i64 %46, ptr %gep, align 4, !tbaa !9
  store i64 %45, ptr %gep129, align 4, !tbaa !9
  %47 = bitcast i64 %45 to <2 x float>
  %48 = getelementptr inbounds %"class.std::complex", ptr %38, i64 %44
  call void @_Z5caxpyiSt7complexIfEPS0_iS1_i(i32 noundef %40, <2 x float> %47, ptr noundef nonnull %39, i32 noundef 1, ptr noundef nonnull %48, i32 noundef 1)
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count124
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph.split, !llvm.loop !10

.loopexit:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us, %.lr.ph103
  %.1 = phi i32 [ %18, %.lr.ph103 ], [ %.0102, %.lr.ph.split.us ], [ %.0102, %.lr.ph.split ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count124
  br i1 %exitcond125.not, label %._crit_edge, label %.lr.ph103, !llvm.loop !12

._crit_edge:                                      ; preds = %.loopexit, %4
  %.0.lcssa = phi i32 [ 0, %4 ], [ %.1, %.loopexit ]
  %49 = add nsw i32 %2, -1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i32, ptr %3, i64 %50
  store i32 %2, ptr %51, align 4, !tbaa !5
  %52 = add i32 %1, 1
  %53 = mul i32 %49, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %"class.std::complex", ptr %0, i64 %54
  %.sroa.0.0.copyload = load <2 x float>, ptr %55, align 4, !tbaa !9
  %56 = call noundef float @_Z5cabs1St7complexIfE(<2 x float> %.sroa.0.0.copyload)
  %57 = fcmp oeq float %56, 0.000000e+00
  %.2 = select i1 %57, i32 %2, i32 %.0.lcssa
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i32 %.2
}

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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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 uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass