; LLVM IR from sympiler/nasoq :: src/common/Util.ll (ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd)

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

@.str.31 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd = external hidden unnamed_addr constant [128 x i8], align 1

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd(i64 noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8, double noundef %9) #5 {
  %11 = alloca i1, align 1
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %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
  %20 = alloca ptr, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  store i64 %0, ptr %12, align 8, !tbaa !5
  store i64 %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !9
  store ptr %3, ptr %15, align 8, !tbaa !9
  store ptr %4, ptr %16, align 8, !tbaa !9
  store ptr %5, ptr %17, align 8, !tbaa !9
  store ptr %6, ptr %18, align 8, !tbaa !9
  store ptr %7, ptr %19, align 8, !tbaa !9
  store ptr %8, ptr %20, align 8, !tbaa !9
  store double %9, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !13
  br label %29

29:                                               ; preds = %53, %10
  %30 = load i32, ptr %23, align 4, !tbaa !13
  %31 = sext i32 %30 to i64
  %32 = load i64, ptr %12, align 8, !tbaa !5
  %33 = icmp ult i64 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %56

35:                                               ; preds = %29
  %36 = load ptr, ptr %14, align 8, !tbaa !9
  %37 = load i32, ptr %23, align 4, !tbaa !13
  %38 = add nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %36, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = load ptr, ptr %14, align 8, !tbaa !9
  %43 = load i32, ptr %23, align 4, !tbaa !13
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr %42, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = sub nsw i32 %41, %46
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %35
  %50 = load i32, ptr %22, align 4, !tbaa !13
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %22, align 4, !tbaa !13
  br label %52

52:                                               ; preds = %49, %35
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %23, align 4, !tbaa !13
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %23, align 4, !tbaa !13
  br label %29, !llvm.loop !15

56:                                               ; preds = %34
  %57 = load i32, ptr %22, align 4, !tbaa !13
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %56
  store i1 false, ptr %11, align 1
  store i32 1, ptr %24, align 4
  br label %217

60:                                               ; preds = %56
  %61 = load i64, ptr %13, align 8, !tbaa !5
  %62 = load i32, ptr %22, align 4, !tbaa !13
  %63 = sext i32 %62 to i64
  %64 = add i64 %61, %63
  %65 = load ptr, ptr %17, align 8, !tbaa !9
  store i64 %64, ptr %65, align 8, !tbaa !5
  %66 = load i64, ptr %12, align 8, !tbaa !5
  %67 = add i64 %66, 1
  %68 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %67, i64 4)
  %69 = extractvalue { i64, i1 } %68, 1
  %70 = extractvalue { i64, i1 } %68, 0
  %71 = select i1 %69, i64 -1, i64 %70
  %72 = call noalias noundef nonnull ptr @_Znam(i64 noundef %71) #7
  call void @llvm.memset.p0.i64(ptr align 4 %72, i8 0, i64 %71, i1 false)
  %73 = load ptr, ptr %18, align 8, !tbaa !9
  store ptr %72, ptr %73, align 8, !tbaa !9
  %74 = load ptr, ptr %17, align 8, !tbaa !9
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %75, i64 4)
  %77 = extractvalue { i64, i1 } %76, 1
  %78 = extractvalue { i64, i1 } %76, 0
  %79 = select i1 %77, i64 -1, i64 %78
  %80 = call noalias noundef nonnull ptr @_Znam(i64 noundef %79) #7
  %81 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %80, ptr %81, align 8, !tbaa !9
  %82 = load ptr, ptr %17, align 8, !tbaa !9
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %83, i64 8)
  %85 = extractvalue { i64, i1 } %84, 1
  %86 = extractvalue { i64, i1 } %84, 0
  %87 = select i1 %85, i64 -1, i64 %86
  %88 = call noalias noundef nonnull ptr @_Znam(i64 noundef %87) #7
  %89 = load ptr, ptr %20, align 8, !tbaa !9
  store ptr %88, ptr %89, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !13
  %90 = load ptr, ptr %18, align 8, !tbaa !9
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = getelementptr inbounds i32, ptr %91, i64 0
  store i32 0, ptr %92, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !13
  br label %93

93:                                               ; preds = %200, %60
  %94 = load i32, ptr %27, align 4, !tbaa !13
  %95 = sext i32 %94 to i64
  %96 = load i64, ptr %12, align 8, !tbaa !5
  %97 = icmp ult i64 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 5, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %203

99:                                               ; preds = %93
  %100 = load ptr, ptr %14, align 8, !tbaa !9
  %101 = load i32, ptr %27, align 4, !tbaa !13
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %100, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = load ptr, ptr %14, align 8, !tbaa !9
  %107 = load i32, ptr %27, align 4, !tbaa !13
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %106, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !13
  %111 = sub nsw i32 %105, %110
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %140

113:                                              ; preds = %99
  %114 = load double, ptr %21, align 8, !tbaa !11
  %115 = load ptr, ptr %20, align 8, !tbaa !9
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = load ptr, ptr %14, align 8, !tbaa !9
  %118 = load i32, ptr %27, align 4, !tbaa !13
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %117, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !13
  %122 = load i32, ptr %26, align 4, !tbaa !13
  %123 = add nsw i32 %121, %122
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %116, i64 %124
  store double %114, ptr %125, align 8, !tbaa !11
  %126 = load i32, ptr %27, align 4, !tbaa !13
  %127 = load ptr, ptr %19, align 8, !tbaa !9
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = load ptr, ptr %14, align 8, !tbaa !9
  %130 = load i32, ptr %27, align 4, !tbaa !13
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !13
  %134 = load i32, ptr %26, align 4, !tbaa !13
  %135 = add nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %128, i64 %136
  store i32 %126, ptr %137, align 4, !tbaa !13
  %138 = load i32, ptr %26, align 4, !tbaa !13
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %26, align 4, !tbaa !13
  br label %185

140:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %141 = load ptr, ptr %14, align 8, !tbaa !9
  %142 = load i32, ptr %27, align 4, !tbaa !13
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i32, ptr %141, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !13
  store i32 %145, ptr %28, align 4, !tbaa !13
  br label %146

146:                                              ; preds = %181, %140
  %147 = load i32, ptr %28, align 4, !tbaa !13
  %148 = load ptr, ptr %14, align 8, !tbaa !9
  %149 = load i32, ptr %27, align 4, !tbaa !13
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %148, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !13
  %154 = icmp slt i32 %147, %153
  br i1 %154, label %156, label %155

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

156:                                              ; preds = %146
  %157 = load ptr, ptr %16, align 8, !tbaa !9
  %158 = load i32, ptr %28, align 4, !tbaa !13
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds double, ptr %157, i64 %159
  %161 = load double, ptr %160, align 8, !tbaa !11
  %162 = load ptr, ptr %20, align 8, !tbaa !9
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = load i32, ptr %28, align 4, !tbaa !13
  %165 = load i32, ptr %26, align 4, !tbaa !13
  %166 = add nsw i32 %164, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %163, i64 %167
  store double %161, ptr %168, align 8, !tbaa !11
  %169 = load ptr, ptr %15, align 8, !tbaa !9
  %170 = load i32, ptr %28, align 4, !tbaa !13
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %169, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !13
  %174 = load ptr, ptr %19, align 8, !tbaa !9
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  %176 = load i32, ptr %28, align 4, !tbaa !13
  %177 = load i32, ptr %26, align 4, !tbaa !13
  %178 = add nsw i32 %176, %177
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %175, i64 %179
  store i32 %173, ptr %180, align 4, !tbaa !13
  br label %181

181:                                              ; preds = %156
  %182 = load i32, ptr %28, align 4, !tbaa !13
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %28, align 4, !tbaa !13
  br label %146, !llvm.loop !17

184:                                              ; preds = %155
  br label %185

185:                                              ; preds = %184, %113
  %186 = load ptr, ptr %14, align 8, !tbaa !9
  %187 = load i32, ptr %27, align 4, !tbaa !13
  %188 = add nsw i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %186, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !13
  %192 = load i32, ptr %26, align 4, !tbaa !13
  %193 = add nsw i32 %191, %192
  %194 = load ptr, ptr %18, align 8, !tbaa !9
  %195 = load ptr, ptr %194, align 8, !tbaa !9
  %196 = load i32, ptr %27, align 4, !tbaa !13
  %197 = add nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %195, i64 %198
  store i32 %193, ptr %199, align 4, !tbaa !13
  br label %200

200:                                              ; preds = %185
  %201 = load i32, ptr %27, align 4, !tbaa !13
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %27, align 4, !tbaa !13
  br label %93, !llvm.loop !18

203:                                              ; preds = %98
  %204 = load ptr, ptr %18, align 8, !tbaa !9
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  %206 = load i64, ptr %12, align 8, !tbaa !5
  %207 = getelementptr inbounds i32, ptr %205, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !13
  %209 = sext i32 %208 to i64
  %210 = load ptr, ptr %17, align 8, !tbaa !9
  %211 = load i64, ptr %210, align 8, !tbaa !5
  %212 = icmp eq i64 %209, %211
  br i1 %212, label %213, label %214

213:                                              ; preds = %203
  br label %216

214:                                              ; preds = %203
  call void @__assert_fail(ptr noundef @.str.34, ptr noundef @.str.31, i32 noundef 387, ptr noundef @__PRETTY_FUNCTION__._ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd) #8
  unreachable

215:                                              ; No predecessors!
  br label %216

216:                                              ; preds = %215, %213
  store i1 true, ptr %11, align 1
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %217

217:                                              ; preds = %216, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  %218 = load i1, ptr %11, align 1
  ret i1 %218
}

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


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

@.str.31 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [20 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd = external hidden unnamed_addr constant [128 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd(i64 noundef %0, i64 noundef %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %5, ptr nocapture noundef nonnull align 8 dereferenceable(8) %6, ptr nocapture noundef nonnull align 8 dereferenceable(8) %7, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %8, double noundef %9) local_unnamed_addr #3 {
  %.not = icmp eq i64 %0, 0
  br i1 %.not, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %10
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %min.iters.check = icmp ult i64 %0, 8
  br i1 %min.iters.check, label %.lr.ph.preheader92, label %vector.ph

.lr.ph.preheader92:                               ; preds = %middle.block, %.lr.ph.preheader
  %.ph = phi i32 [ %.pre, %.lr.ph.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.06570.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %23, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %0, -8
  %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load91, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
  %vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
  %11 = or disjoint i64 %index, 1
  %12 = getelementptr inbounds i32, ptr %2, i64 %11
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <4 x i32>, ptr %12, align 4, !tbaa !5
  %wide.load91 = load <4 x i32>, ptr %13, align 4, !tbaa !5
  %14 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %15 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load91, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %16 = icmp eq <4 x i32> %wide.load, %14
  %17 = icmp eq <4 x i32> %wide.load91, %15
  %18 = zext <4 x i1> %16 to <4 x i32>
  %19 = zext <4 x i1> %17 to <4 x i32>
  %20 = add <4 x i32> %vec.phi, %18
  %21 = add <4 x i32> %vec.phi90, %19
  %index.next = add nuw i64 %index, 8
  %22 = icmp eq i64 %index.next, %n.vec
  br i1 %22, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %21, %20
  %23 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %vector.recur.extract = extractelement <4 x i32> %wide.load91, i64 3
  %cmp.n = icmp eq i64 %n.vec, %0
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader92

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %spec.select.lcssa = phi i32 [ %23, %middle.block ], [ %spec.select, %.lr.ph ]
  %24 = icmp ne i32 %spec.select.lcssa, 0
  br i1 %24, label %.lr.ph77, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.lr.ph.preheader92, %.lr.ph
  %25 = phi i32 [ %27, %.lr.ph ], [ %.ph, %.lr.ph.preheader92 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader92 ]
  %.06570 = phi i32 [ %spec.select, %.lr.ph ], [ %.06570.ph, %.lr.ph.preheader92 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp eq i32 %27, %25
  %29 = zext i1 %28 to i32
  %spec.select = add nuw nsw i32 %.06570, %29
  %exitcond.not = icmp eq i64 %indvars.iv.next, %0
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

.lr.ph77:                                         ; preds = %._crit_edge
  %30 = zext nneg i32 %spec.select.lcssa to i64
  %31 = add i64 %30, %1
  store i64 %31, ptr %5, align 8, !tbaa !14
  %32 = shl i64 %0, 2
  %33 = add i64 %32, 4
  %34 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %33) #5
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %34, i8 0, i64 %33, i1 false)
  store ptr %34, ptr %6, align 8, !tbaa !16
  %35 = icmp ugt i64 %31, 4611686018427387903
  %36 = shl i64 %31, 2
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #5
  store ptr %38, ptr %7, align 8, !tbaa !16
  %39 = icmp ugt i64 %31, 2305843009213693951
  %40 = shl i64 %31, 3
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %41) #5
  store ptr %42, ptr %8, align 8, !tbaa !16
  %43 = load ptr, ptr %6, align 8, !tbaa !16
  store i32 0, ptr %43, align 4, !tbaa !5
  %44 = load ptr, ptr %7, align 8
  br label %49

._crit_edge78:                                    ; preds = %.loopexit
  %45 = getelementptr inbounds i32, ptr %43, i64 %0
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp eq i64 %31, %47
  br i1 %48, label %._crit_edge.thread, label %78

49:                                               ; preds = %.lr.ph77, %.loopexit
  %indvars.iv84 = phi i64 [ 0, %.lr.ph77 ], [ %indvars.iv.next85, %.loopexit ]
  %.06274 = phi i32 [ 0, %.lr.ph77 ], [ %.1, %.loopexit ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %50 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next85
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv84
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp eq i32 %51, %53
  br i1 %54, label %58, label %.preheader

.preheader:                                       ; preds = %49
  %55 = icmp slt i32 %53, %51
  br i1 %55, label %.lr.ph73.preheader, label %.loopexit

.lr.ph73.preheader:                               ; preds = %.preheader
  %56 = sext i32 %53 to i64
  %57 = sext i32 %.06274 to i64
  br label %.lr.ph73

58:                                               ; preds = %49
  %59 = add nsw i32 %51, %.06274
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %42, i64 %60
  store double %9, ptr %61, align 8, !tbaa !18
  %62 = getelementptr inbounds i32, ptr %44, i64 %60
  %63 = trunc nuw nsw i64 %indvars.iv84 to i32
  store i32 %63, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %.06274, 1
  %.pre88 = load i32, ptr %50, align 4, !tbaa !5
  br label %.loopexit

.lr.ph73:                                         ; preds = %.lr.ph73.preheader, %.lr.ph73
  %indvars.iv81 = phi i64 [ %56, %.lr.ph73.preheader ], [ %indvars.iv.next82, %.lr.ph73 ]
  %65 = getelementptr inbounds double, ptr %4, i64 %indvars.iv81
  %66 = load double, ptr %65, align 8, !tbaa !18
  %67 = add nsw i64 %indvars.iv81, %57
  %68 = getelementptr inbounds double, ptr %42, i64 %67
  store double %66, ptr %68, align 8, !tbaa !18
  %69 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv81
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %44, i64 %67
  store i32 %70, ptr %71, align 4, !tbaa !5
  %indvars.iv.next82 = add nsw i64 %indvars.iv81, 1
  %72 = load i32, ptr %50, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next82, %73
  br i1 %74, label %.lr.ph73, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph73, %.preheader, %58
  %75 = phi i32 [ %.pre88, %58 ], [ %51, %.preheader ], [ %72, %.lr.ph73 ]
  %.1 = phi i32 [ %64, %58 ], [ %.06274, %.preheader ], [ %.06274, %.lr.ph73 ]
  %76 = add nsw i32 %75, %.1
  %77 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv.next85
  store i32 %76, ptr %77, align 4, !tbaa !5
  %exitcond87.not = icmp eq i64 %indvars.iv.next85, %0
  br i1 %exitcond87.not, label %._crit_edge78, label %49, !llvm.loop !21

78:                                               ; preds = %._crit_edge78
  tail call void @__assert_fail(ptr noundef nonnull @.str.34, ptr noundef nonnull @.str.31, i32 noundef 387, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5nasoq12expandMatrixEmmPKiS1_PKdRmRPiS6_RPdd) #6
  unreachable

._crit_edge.thread:                               ; preds = %10, %._crit_edge78, %._crit_edge
  %79 = phi i1 [ %24, %._crit_edge78 ], [ false, %._crit_edge ], [ false, %10 ]
  ret i1 %79
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { noreturn 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { builtin allocsize(0) }
attributes #6 = { noreturn 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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


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