; LLVM IR from sympiler/nasoq :: src/common/Norm.ll (ZN5nasoq11norm_sparseEiPmPiPdii)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq11norm_sparseEiPmPiPdii(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #4 {
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #9
  store i8 1, ptr %19, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %24 = load i32, ptr %8, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %25, i64 8)
  %27 = extractvalue { i64, i1 } %26, 1
  %28 = extractvalue { i64, i1 } %26, 0
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #10
  call void @llvm.memset.p0.i64(ptr align 8 %30, i8 0, i64 %29, i1 false)
  store ptr %30, ptr %20, align 8, !tbaa !9
  %31 = load i32, ptr %13, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %36, label %33

33:                                               ; preds = %6
  %34 = load i32, ptr %13, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 1
  br i1 %35, label %36, label %38

36:                                               ; preds = %33, %6
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  store double -1.000000e+00, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %236

38:                                               ; preds = %33
  store double 0.000000e+00, ptr %14, align 8, !tbaa !13
  %39 = load i32, ptr %12, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %41, label %117

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %113, %41
  %43 = load i32, ptr %22, align 4, !tbaa !5
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 2, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %116

47:                                               ; preds = %42
  %48 = load ptr, ptr %9, align 8, !tbaa !9
  %49 = load i32, ptr %22, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i64, ptr %48, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !15
  %53 = trunc i64 %52 to i32
  store i32 %53, ptr %16, align 4, !tbaa !5
  %54 = load ptr, ptr %9, align 8, !tbaa !9
  %55 = load i32, ptr %22, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i64, ptr %54, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = trunc i64 %59 to i32
  store i32 %60, ptr %17, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %109, %47
  %62 = load i32, ptr %16, align 4, !tbaa !5
  %63 = load i32, ptr %17, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %112

65:                                               ; preds = %61
  %66 = load ptr, ptr %10, align 8, !tbaa !9
  %67 = load i32, ptr %16, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %66, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %18, align 4, !tbaa !5
  %71 = load ptr, ptr %11, align 8, !tbaa !9
  %72 = load i32, ptr %16, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %71, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !13
  %76 = call noundef double @_ZSt3absd(double noundef %75)
  store double %76, ptr %15, align 8, !tbaa !13
  %77 = load i32, ptr %18, align 4, !tbaa !5
  %78 = load i32, ptr %22, align 4, !tbaa !5
  %79 = icmp eq i32 %77, %78
  br i1 %79, label %80, label %88

80:                                               ; preds = %65
  %81 = load double, ptr %15, align 8, !tbaa !13
  %82 = load ptr, ptr %20, align 8, !tbaa !9
  %83 = load i32, ptr %18, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %82, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !13
  %87 = fadd double %86, %81
  store double %87, ptr %85, align 8, !tbaa !13
  br label %108

88:                                               ; preds = %65
  %89 = load i32, ptr %18, align 4, !tbaa !5
  %90 = load i32, ptr %22, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %92, label %107

92:                                               ; preds = %88
  %93 = load double, ptr %15, align 8, !tbaa !13
  %94 = load ptr, ptr %20, align 8, !tbaa !9
  %95 = load i32, ptr %18, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds double, ptr %94, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !13
  %99 = fadd double %98, %93
  store double %99, ptr %97, align 8, !tbaa !13
  %100 = load double, ptr %15, align 8, !tbaa !13
  %101 = load ptr, ptr %20, align 8, !tbaa !9
  %102 = load i32, ptr %22, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %101, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !13
  %106 = fadd double %105, %100
  store double %106, ptr %104, align 8, !tbaa !13
  br label %107

107:                                              ; preds = %92, %88
  br label %108

108:                                              ; preds = %107, %80
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %16, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %16, align 4, !tbaa !5
  br label %61, !llvm.loop !17

112:                                              ; preds = %61
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %22, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %22, align 4, !tbaa !5
  br label %42, !llvm.loop !19

116:                                              ; preds = %46
  br label %197

117:                                              ; preds = %38
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = icmp slt i32 %118, 0
  br i1 %119, label %120, label %196

120:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %192, %120
  %122 = load i32, ptr %23, align 4, !tbaa !5
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %195

126:                                              ; preds = %121
  %127 = load ptr, ptr %9, align 8, !tbaa !9
  %128 = load i32, ptr %23, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i64, ptr %127, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !15
  %132 = trunc i64 %131 to i32
  store i32 %132, ptr %16, align 4, !tbaa !5
  %133 = load ptr, ptr %9, align 8, !tbaa !9
  %134 = load i32, ptr %23, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i64, ptr %133, i64 %136
  %138 = load i64, ptr %137, align 8, !tbaa !15
  %139 = trunc i64 %138 to i32
  store i32 %139, ptr %17, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %188, %126
  %141 = load i32, ptr %16, align 4, !tbaa !5
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %191

144:                                              ; preds = %140
  %145 = load ptr, ptr %10, align 8, !tbaa !9
  %146 = load i32, ptr %16, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %145, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  store i32 %149, ptr %18, align 4, !tbaa !5
  %150 = load ptr, ptr %11, align 8, !tbaa !9
  %151 = load i32, ptr %16, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %150, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !13
  %155 = call noundef double @_ZSt3absd(double noundef %154)
  store double %155, ptr %15, align 8, !tbaa !13
  %156 = load i32, ptr %18, align 4, !tbaa !5
  %157 = load i32, ptr %23, align 4, !tbaa !5
  %158 = icmp eq i32 %156, %157
  br i1 %158, label %159, label %167

159:                                              ; preds = %144
  %160 = load double, ptr %15, align 8, !tbaa !13
  %161 = load ptr, ptr %20, align 8, !tbaa !9
  %162 = load i32, ptr %18, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds double, ptr %161, i64 %163
  %165 = load double, ptr %164, align 8, !tbaa !13
  %166 = fadd double %165, %160
  store double %166, ptr %164, align 8, !tbaa !13
  br label %187

167:                                              ; preds = %144
  %168 = load i32, ptr %18, align 4, !tbaa !5
  %169 = load i32, ptr %23, align 4, !tbaa !5
  %170 = icmp sgt i32 %168, %169
  br i1 %170, label %171, label %186

171:                                              ; preds = %167
  %172 = load double, ptr %15, align 8, !tbaa !13
  %173 = load ptr, ptr %20, align 8, !tbaa !9
  %174 = load i32, ptr %18, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %173, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !13
  %178 = fadd double %177, %172
  store double %178, ptr %176, align 8, !tbaa !13
  %179 = load double, ptr %15, align 8, !tbaa !13
  %180 = load ptr, ptr %20, align 8, !tbaa !9
  %181 = load i32, ptr %23, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds double, ptr %180, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !13
  %185 = fadd double %184, %179
  store double %185, ptr %183, align 8, !tbaa !13
  br label %186

186:                                              ; preds = %171, %167
  br label %187

187:                                              ; preds = %186, %159
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %16, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %16, align 4, !tbaa !5
  br label %140, !llvm.loop !20

191:                                              ; preds = %140
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %23, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %23, align 4, !tbaa !5
  br label %121, !llvm.loop !21

195:                                              ; preds = %125
  br label %196

196:                                              ; preds = %195, %117
  br label %197

197:                                              ; preds = %196, %116
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = icmp ne i32 %198, 0
  br i1 %199, label %203, label %200

200:                                              ; preds = %197
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = icmp eq i32 %201, 0
  br i1 %202, label %203, label %230

203:                                              ; preds = %200, %197
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %226, %203
  %205 = load i32, ptr %18, align 4, !tbaa !5
  %206 = load i32, ptr %8, align 4, !tbaa !5
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %208, label %229

208:                                              ; preds = %204
  %209 = load ptr, ptr %20, align 8, !tbaa !9
  %210 = load i32, ptr %18, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %209, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !13
  store double %213, ptr %15, align 8, !tbaa !13
  %214 = load double, ptr %15, align 8, !tbaa !13
  %215 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %214)
  br i1 %215, label %220, label %216

216:                                              ; preds = %208
  %217 = load double, ptr %15, align 8, !tbaa !13
  %218 = load double, ptr %14, align 8, !tbaa !13
  %219 = fcmp ogt double %217, %218
  br i1 %219, label %220, label %225

220:                                              ; preds = %216, %208
  %221 = load double, ptr %14, align 8, !tbaa !13
  %222 = call noundef zeroext i1 @_ZSt8isfinited(double noundef %221)
  br i1 %222, label %223, label %225

223:                                              ; preds = %220
  %224 = load double, ptr %15, align 8, !tbaa !13
  store double %224, ptr %14, align 8, !tbaa !13
  br label %225

225:                                              ; preds = %223, %220, %216
  br label %226

226:                                              ; preds = %225
  %227 = load i32, ptr %18, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %18, align 4, !tbaa !5
  br label %204, !llvm.loop !22

229:                                              ; preds = %204
  br label %230

230:                                              ; preds = %229, %200
  %231 = load ptr, ptr %20, align 8, !tbaa !9
  %232 = icmp eq ptr %231, null
  br i1 %232, label %234, label %233

233:                                              ; preds = %230
  call void @_ZdaPv(ptr noundef %231) #11
  br label %234

234:                                              ; preds = %233, %230
  %235 = load double, ptr %14, align 8, !tbaa !13
  store double %235, ptr %7, align 8
  store i32 1, ptr %21, align 4
  br label %236

236:                                              ; preds = %234, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  %237 = load double, ptr %7, align 8
  ret double %237
}

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #8

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { 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 = !{!"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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSt8isfinited(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN5nasoq11norm_sparseEiPmPiPdii(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = zext i32 %0 to i64
  %8 = icmp slt i32 %0, 0
  %9 = shl nuw nsw i64 %7, 3
  %10 = select i1 %8, i64 -1, i64 %9
  %11 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %10) #7
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %11, i8 0, i64 %10, i1 false)
  %or.cond = icmp ugt i32 %5, 1
  br i1 %or.cond, label %12, label %14

12:                                               ; preds = %6
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  br label %83

14:                                               ; preds = %6
  %15 = icmp sgt i32 %4, 0
  br i1 %15, label %.preheader90, label %43

.preheader90:                                     ; preds = %14
  %16 = icmp sgt i32 %0, 0
  br i1 %16, label %.lr.ph101, label %.loopexit

.loopexit89:                                      ; preds = %42, %.lr.ph101
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %7
  br i1 %exitcond122.not, label %.loopexit91, label %.lr.ph101, !llvm.loop !5

.lr.ph101:                                        ; preds = %.preheader90, %.loopexit89
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %.loopexit89 ], [ 0, %.preheader90 ]
  %17 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv118
  %18 = load i64, ptr %17, align 8, !tbaa !7
  %19 = trunc i64 %18 to i32
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %20 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next119
  %21 = load i64, ptr %20, align 8, !tbaa !7
  %22 = trunc i64 %21 to i32
  %23 = icmp slt i32 %19, %22
  br i1 %23, label %.lr.ph99, label %.loopexit89

.lr.ph99:                                         ; preds = %.lr.ph101
  %sext128 = shl i64 %18, 32
  %24 = ashr exact i64 %sext128, 32
  br label %25

25:                                               ; preds = %.lr.ph99, %42
  %indvars.iv113 = phi i64 [ %24, %.lr.ph99 ], [ %indvars.iv.next114, %42 ]
  %26 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv113
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = getelementptr inbounds double, ptr %3, i64 %indvars.iv113
  %29 = load double, ptr %28, align 8, !tbaa !13
  %30 = tail call noundef double @_ZSt3absd(double noundef %29)
  %31 = zext i32 %27 to i64
  %32 = icmp eq i64 %indvars.iv118, %31
  %33 = sext i32 %27 to i64
  br i1 %32, label %.sink.split, label %34

34:                                               ; preds = %25
  %35 = icmp sgt i64 %indvars.iv118, %33
  br i1 %35, label %36, label %42

36:                                               ; preds = %34
  %37 = getelementptr inbounds double, ptr %11, i64 %33
  %38 = load double, ptr %37, align 8, !tbaa !13
  %39 = fadd double %30, %38
  store double %39, ptr %37, align 8, !tbaa !13
  br label %.sink.split

.sink.split:                                      ; preds = %25, %36
  %.pn139 = phi i64 [ %indvars.iv118, %36 ], [ %33, %25 ]
  %.sink = getelementptr inbounds double, ptr %11, i64 %.pn139
  %40 = load double, ptr %.sink, align 8, !tbaa !13
  %41 = fadd double %30, %40
  store double %41, ptr %.sink, align 8, !tbaa !13
  br label %42

42:                                               ; preds = %.sink.split, %34
  %indvars.iv.next114 = add nsw i64 %indvars.iv113, 1
  %lftr.wideiv116 = trunc i64 %indvars.iv.next114 to i32
  %exitcond117.not = icmp eq i32 %lftr.wideiv116, %22
  br i1 %exitcond117.not, label %.loopexit89, label %25, !llvm.loop !15

43:                                               ; preds = %14
  %44 = icmp ne i32 %4, 0
  %45 = icmp sgt i32 %0, 0
  %or.cond105 = and i1 %44, %45
  br i1 %or.cond105, label %.lr.ph97, label %.loopexit91

.loopexit92:                                      ; preds = %71, %.lr.ph97
  %exitcond112.not = icmp eq i64 %indvars.iv.next110, %7
  br i1 %exitcond112.not, label %.loopexit91, label %.lr.ph97, !llvm.loop !16

.lr.ph97:                                         ; preds = %43, %.loopexit92
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.loopexit92 ], [ 0, %43 ]
  %46 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv109
  %47 = load i64, ptr %46, align 8, !tbaa !7
  %48 = trunc i64 %47 to i32
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %49 = getelementptr inbounds i64, ptr %1, i64 %indvars.iv.next110
  %50 = load i64, ptr %49, align 8, !tbaa !7
  %51 = trunc i64 %50 to i32
  %52 = icmp slt i32 %48, %51
  br i1 %52, label %.lr.ph, label %.loopexit92

.lr.ph:                                           ; preds = %.lr.ph97
  %sext = shl i64 %47, 32
  %53 = ashr exact i64 %sext, 32
  br label %54

54:                                               ; preds = %.lr.ph, %71
  %indvars.iv = phi i64 [ %53, %.lr.ph ], [ %indvars.iv.next, %71 ]
  %55 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %57 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %58 = load double, ptr %57, align 8, !tbaa !13
  %59 = tail call noundef double @_ZSt3absd(double noundef %58)
  %60 = zext i32 %56 to i64
  %61 = icmp eq i64 %indvars.iv109, %60
  %62 = sext i32 %56 to i64
  br i1 %61, label %.sink.split134, label %63

63:                                               ; preds = %54
  %64 = icmp slt i64 %indvars.iv109, %62
  br i1 %64, label %65, label %71

65:                                               ; preds = %63
  %66 = getelementptr inbounds double, ptr %11, i64 %62
  %67 = load double, ptr %66, align 8, !tbaa !13
  %68 = fadd double %59, %67
  store double %68, ptr %66, align 8, !tbaa !13
  br label %.sink.split134

.sink.split134:                                   ; preds = %54, %65
  %.pn = phi i64 [ %indvars.iv109, %65 ], [ %62, %54 ]
  %.sink138 = getelementptr inbounds double, ptr %11, i64 %.pn
  %69 = load double, ptr %.sink138, align 8, !tbaa !13
  %70 = fadd double %59, %69
  store double %70, ptr %.sink138, align 8, !tbaa !13
  br label %71

71:                                               ; preds = %.sink.split134, %63
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %51
  br i1 %exitcond.not, label %.loopexit92, label %54, !llvm.loop !17

.loopexit91:                                      ; preds = %.loopexit92, %.loopexit89, %43
  %72 = icmp ne i32 %4, 0
  %73 = icmp eq i32 %5, 0
  %or.cond3 = or i1 %72, %73
  %74 = icmp sgt i32 %0, 0
  %or.cond106 = and i1 %or.cond3, %74
  br i1 %or.cond106, label %.lr.ph104, label %.loopexit

.lr.ph104:                                        ; preds = %.loopexit91, %82
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %82 ], [ 0, %.loopexit91 ]
  %.078103 = phi double [ %.1, %82 ], [ 0.000000e+00, %.loopexit91 ]
  %75 = getelementptr inbounds double, ptr %11, i64 %indvars.iv123
  %76 = load double, ptr %75, align 8, !tbaa !13
  %77 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %76)
  %78 = fcmp ogt double %76, %.078103
  %or.cond88 = select i1 %77, i1 true, i1 %78
  br i1 %or.cond88, label %79, label %82

79:                                               ; preds = %.lr.ph104
  %80 = tail call noundef zeroext i1 @_ZSt8isfinited(double noundef %.078103)
  br i1 %80, label %81, label %82

81:                                               ; preds = %79
  br label %82

82:                                               ; preds = %.lr.ph104, %79, %81
  %.1 = phi double [ %76, %81 ], [ %.078103, %79 ], [ %.078103, %.lr.ph104 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %7
  br i1 %exitcond127.not, label %.loopexit, label %.lr.ph104, !llvm.loop !18

.loopexit:                                        ; preds = %82, %.preheader90, %.loopexit91
  %.2 = phi double [ 0.000000e+00, %.loopexit91 ], [ 0.000000e+00, %.preheader90 ], [ %.1, %82 ]
  tail call void @_ZdaPv(ptr noundef nonnull %11) #8
  br label %83

83:                                               ; preds = %.loopexit, %12
  %.077 = phi double [ -1.000000e+00, %12 ], [ %.2, %.loopexit ]
  ret double %.077
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #6

attributes #0 = { 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 #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !9, i64 0}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}


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