; LLVM IR from beagleboard/librobotcontrol :: library/src/math (matrix)

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

%struct.rc_matrix_t = type { i32, i32, ptr, i32 }

@stderr = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [60 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rc_matrix_alloc(ptr noundef, i32 noundef, i32 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: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rc_matrix_multiply(ptr noundef byval(%struct.rc_matrix_t) align 8 %0, ptr noundef byval(%struct.rc_matrix_t) align 8 %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %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
  store ptr %2, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %10 = getelementptr inbounds %struct.rc_matrix_t, ptr %0, i32 0, i32 3
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = icmp ne i32 %11, 1
  br i1 %12, label %17, label %13

13:                                               ; preds = %3
  %14 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 3
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = icmp ne i32 %15, 1
  br label %17

17:                                               ; preds = %13, %3
  %18 = phi i1 [ true, %3 ], [ %16, %13 ]
  %19 = xor i1 %18, true
  %20 = xor i1 %19, true
  %21 = zext i1 %20 to i32
  %22 = sext i32 %21 to i64
  %23 = call i64 @llvm.expect.i64(i64 %22, i64 0)
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %17
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.21) #5
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %142

28:                                               ; preds = %17
  %29 = getelementptr inbounds %struct.rc_matrix_t, ptr %0, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !12
  %31 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = icmp ne i32 %30, %32
  %34 = xor i1 %33, true
  %35 = xor i1 %34, true
  %36 = zext i1 %35 to i32
  %37 = sext i32 %36 to i64
  %38 = call i64 @llvm.expect.i64(i64 %37, i64 0)
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %28
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.22) #5
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %142

43:                                               ; preds = %28
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.rc_matrix_t, ptr %0, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !13
  %47 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 1
  %48 = load i32, ptr %47, align 4, !tbaa !12
  %49 = call i32 @rc_matrix_alloc(ptr noundef %44, i32 noundef %46, i32 noundef %48)
  %50 = icmp ne i32 %49, 0
  %51 = xor i1 %50, true
  %52 = xor i1 %51, true
  %53 = zext i1 %52 to i32
  %54 = sext i32 %53 to i64
  %55 = call i64 @llvm.expect.i64(i64 %54, i64 0)
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %43
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.23) #5
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %142

60:                                               ; preds = %43
  %61 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !13
  %63 = sext i32 %62 to i64
  %64 = mul i64 %63, 8
  %65 = alloca i8, i64 %64, align 16
  store ptr %65, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = icmp eq ptr %66, null
  %68 = xor i1 %67, true
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i32
  %71 = sext i32 %70 to i64
  %72 = call i64 @llvm.expect.i64(i64 %71, i64 0)
  %73 = icmp ne i64 %72, 0
  br i1 %73, label %74, label %77

74:                                               ; preds = %60
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.24) #5
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %142

77:                                               ; preds = %60
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %78

78:                                               ; preds = %138, %77
  %79 = load i32, ptr %6, align 4, !tbaa !14
  %80 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !12
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %141

83:                                               ; preds = %78
  store i32 0, ptr %7, align 4, !tbaa !14
  br label %84

84:                                               ; preds = %104, %83
  %85 = load i32, ptr %7, align 4, !tbaa !14
  %86 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = icmp slt i32 %85, %87
  br i1 %88, label %89, label %107

89:                                               ; preds = %84
  %90 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !15
  %92 = load i32, ptr %7, align 4, !tbaa !14
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !14
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !16
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i32, ptr %7, align 4, !tbaa !14
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %100, i64 %102
  store double %99, ptr %103, align 8, !tbaa !16
  br label %104

104:                                              ; preds = %89
  %105 = load i32, ptr %7, align 4, !tbaa !14
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !14
  br label %84, !llvm.loop !18

107:                                              ; preds = %84
  store i32 0, ptr %7, align 4, !tbaa !14
  br label %108

108:                                              ; preds = %134, %107
  %109 = load i32, ptr %7, align 4, !tbaa !14
  %110 = getelementptr inbounds %struct.rc_matrix_t, ptr %0, i32 0, i32 0
  %111 = load i32, ptr %110, align 8, !tbaa !13
  %112 = icmp slt i32 %109, %111
  br i1 %112, label %113, label %137

113:                                              ; preds = %108
  %114 = getelementptr inbounds %struct.rc_matrix_t, ptr %0, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !15
  %116 = load i32, ptr %7, align 4, !tbaa !14
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.rc_matrix_t, ptr %1, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !13
  %123 = call double @__vectorized_mult_accumulate(ptr noundef %119, ptr noundef %120, i32 noundef %122)
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.rc_matrix_t, ptr %124, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !15
  %127 = load i32, ptr %7, align 4, !tbaa !14
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %126, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  %131 = load i32, ptr %6, align 4, !tbaa !14
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds double, ptr %130, i64 %132
  store double %123, ptr %133, align 8, !tbaa !16
  br label %134

134:                                              ; preds = %113
  %135 = load i32, ptr %7, align 4, !tbaa !14
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %7, align 4, !tbaa !14
  br label %108, !llvm.loop !20

137:                                              ; preds = %108
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %6, align 4, !tbaa !14
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %6, align 4, !tbaa !14
  br label %78, !llvm.loop !21

141:                                              ; preds = %78
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %142

142:                                              ; preds = %141, %74, %57, %40, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %143 = load i32, ptr %4, align 4
  ret i32 %143
}

declare double @__vectorized_mult_accumulate(ptr noundef, ptr noundef, i32 noundef) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { 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 #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 = { 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/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"rc_matrix_t", !11, i64 0, !11, i64 4, !6, i64 8, !11, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}


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

%struct.rc_matrix_t = type { i32, i32, ptr, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rc_matrix_alloc(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @rc_matrix_multiply(ptr nocapture noundef readonly byval(%struct.rc_matrix_t) align 8 %0, ptr nocapture noundef readonly byval(%struct.rc_matrix_t) align 8 %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp ne i32 %5, 1
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load i32, ptr %7, align 8
  %9 = icmp ne i32 %8, 1
  %10 = select i1 %6, i1 true, i1 %9, !prof !11
  br i1 %10, label %.loopexit.sink.split, label %11, !prof !11

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !12
  %14 = load i32, ptr %1, align 8, !tbaa !13
  %.not = icmp eq i32 %13, %14
  br i1 %.not, label %15, label %.loopexit.sink.split, !prof !14

15:                                               ; preds = %11
  %16 = load i32, ptr %0, align 8, !tbaa !13
  %17 = getelementptr inbounds i8, ptr %1, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !12
  %19 = tail call i32 @rc_matrix_alloc(ptr noundef %2, i32 noundef %16, i32 noundef %18)
  %.not19 = icmp eq i32 %19, 0
  br i1 %.not19, label %20, label %.loopexit.sink.split, !prof !14

20:                                               ; preds = %15
  %21 = sext i32 %13 to i64
  %22 = shl nsw i64 %21, 3
  %23 = alloca i8, i64 %22, align 16
  %24 = icmp sgt i32 %18, 0
  br i1 %24, label %.preheader20.lr.ph, label %.loopexit

.preheader20.lr.ph:                               ; preds = %20
  %25 = icmp sgt i32 %13, 0
  %26 = getelementptr inbounds i8, ptr %1, i64 8
  %27 = load ptr, ptr %26, align 8
  %28 = icmp sgt i32 %16, 0
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = load ptr, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %2, i64 8
  br i1 %28, label %.preheader20.lr.ph.split.us, label %.preheader20.lr.ph.split

.preheader20.lr.ph.split.us:                      ; preds = %.preheader20.lr.ph
  %wide.trip.count63 = zext nneg i32 %18 to i64
  br i1 %25, label %.preheader20.us.us.preheader, label %.preheader20.us.preheader

.preheader20.us.preheader:                        ; preds = %.preheader20.lr.ph.split.us
  %wide.trip.count43 = zext nneg i32 %16 to i64
  br label %.preheader20.us

.preheader20.us.us.preheader:                     ; preds = %.preheader20.lr.ph.split.us
  %wide.trip.count53 = zext nneg i32 %13 to i64
  %wide.trip.count58 = zext nneg i32 %16 to i64
  %xtraiter72 = and i64 %wide.trip.count53, 3
  %32 = icmp ult i32 %13, 4
  %unroll_iter75 = and i64 %wide.trip.count53, 2147483644
  %lcmp.mod74.not = icmp eq i64 %xtraiter72, 0
  br label %.preheader20.us.us

.preheader20.us.us:                               ; preds = %.preheader20.us.us.preheader, %._crit_edge.us.us
  %indvars.iv60 = phi i64 [ 0, %.preheader20.us.us.preheader ], [ %indvars.iv.next61, %._crit_edge.us.us ]
  br i1 %32, label %..preheader_crit_edge.us.us.preheader.unr-lcssa, label %.preheader20.us.us.new

..preheader_crit_edge.us.us:                      ; preds = %..preheader_crit_edge.us.us.preheader, %..preheader_crit_edge.us.us
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %..preheader_crit_edge.us.us ], [ 0, %..preheader_crit_edge.us.us.preheader ]
  %33 = getelementptr inbounds ptr, ptr %30, i64 %indvars.iv55
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = call double @__vectorized_mult_accumulate(ptr noundef %34, ptr noundef nonnull %23, i32 noundef %13) #3
  %36 = load ptr, ptr %31, align 8, !tbaa !16
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv55
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = getelementptr inbounds double, ptr %38, i64 %indvars.iv60
  store double %35, ptr %39, align 8, !tbaa !17
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count58
  br i1 %exitcond59.not, label %._crit_edge.us.us, label %..preheader_crit_edge.us.us, !llvm.loop !19

.preheader20.us.us.new:                           ; preds = %.preheader20.us.us, %.preheader20.us.us.new
  %indvars.iv50 = phi i64 [ %indvars.iv.next51.3, %.preheader20.us.us.new ], [ 0, %.preheader20.us.us ]
  %niter76 = phi i64 [ %niter76.next.3, %.preheader20.us.us.new ], [ 0, %.preheader20.us.us ]
  %40 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv50
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds double, ptr %41, i64 %indvars.iv60
  %43 = load double, ptr %42, align 8, !tbaa !17
  %44 = getelementptr inbounds double, ptr %23, i64 %indvars.iv50
  store double %43, ptr %44, align 16, !tbaa !17
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %45 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next51
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %47 = getelementptr inbounds double, ptr %46, i64 %indvars.iv60
  %48 = load double, ptr %47, align 8, !tbaa !17
  %49 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next51
  store double %48, ptr %49, align 8, !tbaa !17
  %indvars.iv.next51.1 = or disjoint i64 %indvars.iv50, 2
  %50 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next51.1
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  %52 = getelementptr inbounds double, ptr %51, i64 %indvars.iv60
  %53 = load double, ptr %52, align 8, !tbaa !17
  %54 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next51.1
  store double %53, ptr %54, align 16, !tbaa !17
  %indvars.iv.next51.2 = or disjoint i64 %indvars.iv50, 3
  %55 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next51.2
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = getelementptr inbounds double, ptr %56, i64 %indvars.iv60
  %58 = load double, ptr %57, align 8, !tbaa !17
  %59 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next51.2
  store double %58, ptr %59, align 8, !tbaa !17
  %indvars.iv.next51.3 = add nuw nsw i64 %indvars.iv50, 4
  %niter76.next.3 = add i64 %niter76, 4
  %niter76.ncmp.3 = icmp eq i64 %niter76.next.3, %unroll_iter75
  br i1 %niter76.ncmp.3, label %..preheader_crit_edge.us.us.preheader.unr-lcssa, label %.preheader20.us.us.new, !llvm.loop !21

..preheader_crit_edge.us.us.preheader.unr-lcssa:  ; preds = %.preheader20.us.us.new, %.preheader20.us.us
  %indvars.iv50.unr = phi i64 [ 0, %.preheader20.us.us ], [ %indvars.iv.next51.3, %.preheader20.us.us.new ]
  br i1 %lcmp.mod74.not, label %..preheader_crit_edge.us.us.preheader, label %.epil.preheader71

.epil.preheader71:                                ; preds = %..preheader_crit_edge.us.us.preheader.unr-lcssa, %.epil.preheader71
  %indvars.iv50.epil = phi i64 [ %indvars.iv.next51.epil, %.epil.preheader71 ], [ %indvars.iv50.unr, %..preheader_crit_edge.us.us.preheader.unr-lcssa ]
  %epil.iter73 = phi i64 [ %epil.iter73.next, %.epil.preheader71 ], [ 0, %..preheader_crit_edge.us.us.preheader.unr-lcssa ]
  %60 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv50.epil
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %62 = getelementptr inbounds double, ptr %61, i64 %indvars.iv60
  %63 = load double, ptr %62, align 8, !tbaa !17
  %64 = getelementptr inbounds double, ptr %23, i64 %indvars.iv50.epil
  store double %63, ptr %64, align 8, !tbaa !17
  %indvars.iv.next51.epil = add nuw nsw i64 %indvars.iv50.epil, 1
  %epil.iter73.next = add i64 %epil.iter73, 1
  %epil.iter73.cmp.not = icmp eq i64 %epil.iter73.next, %xtraiter72
  br i1 %epil.iter73.cmp.not, label %..preheader_crit_edge.us.us.preheader, label %.epil.preheader71, !llvm.loop !22

..preheader_crit_edge.us.us.preheader:            ; preds = %.epil.preheader71, %..preheader_crit_edge.us.us.preheader.unr-lcssa
  br label %..preheader_crit_edge.us.us

._crit_edge.us.us:                                ; preds = %..preheader_crit_edge.us.us
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %.loopexit, label %.preheader20.us.us, !llvm.loop !24

.preheader20.us:                                  ; preds = %.preheader20.us.preheader, %._crit_edge.us
  %indvars.iv45 = phi i64 [ 0, %.preheader20.us.preheader ], [ %indvars.iv.next46, %._crit_edge.us ]
  br label %65

65:                                               ; preds = %.preheader20.us, %65
  %indvars.iv40 = phi i64 [ 0, %.preheader20.us ], [ %indvars.iv.next41, %65 ]
  %66 = getelementptr inbounds ptr, ptr %30, i64 %indvars.iv40
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = call double @__vectorized_mult_accumulate(ptr noundef %67, ptr noundef nonnull %23, i32 noundef %13) #3
  %69 = load ptr, ptr %31, align 8, !tbaa !16
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv40
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds double, ptr %71, i64 %indvars.iv45
  store double %68, ptr %72, align 8, !tbaa !17
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %exitcond44.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count43
  br i1 %exitcond44.not, label %._crit_edge.us, label %65, !llvm.loop !19

._crit_edge.us:                                   ; preds = %65
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count63
  br i1 %exitcond49.not, label %.loopexit, label %.preheader20.us, !llvm.loop !24

.preheader20.lr.ph.split:                         ; preds = %.preheader20.lr.ph
  br i1 %25, label %.preheader20.us25.preheader, label %.loopexit

.preheader20.us25.preheader:                      ; preds = %.preheader20.lr.ph.split
  %wide.trip.count38 = zext nneg i32 %18 to i64
  %wide.trip.count = zext nneg i32 %13 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %73 = icmp ult i32 %13, 4
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader20.us25

.preheader20.us25:                                ; preds = %.preheader20.us25.preheader, %..preheader_crit_edge.us30
  %indvars.iv35 = phi i64 [ 0, %.preheader20.us25.preheader ], [ %indvars.iv.next36, %..preheader_crit_edge.us30 ]
  br i1 %73, label %..preheader_crit_edge.us30.unr-lcssa, label %.preheader20.us25.new

.preheader20.us25.new:                            ; preds = %.preheader20.us25, %.preheader20.us25.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.preheader20.us25.new ], [ 0, %.preheader20.us25 ]
  %niter = phi i64 [ %niter.next.3, %.preheader20.us25.new ], [ 0, %.preheader20.us25 ]
  %74 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv
  %75 = load ptr, ptr %74, align 8, !tbaa !15
  %76 = getelementptr inbounds double, ptr %75, i64 %indvars.iv35
  %77 = load double, ptr %76, align 8, !tbaa !17
  %78 = getelementptr inbounds double, ptr %23, i64 %indvars.iv
  store double %77, ptr %78, align 16, !tbaa !17
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %79 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next
  %80 = load ptr, ptr %79, align 8, !tbaa !15
  %81 = getelementptr inbounds double, ptr %80, i64 %indvars.iv35
  %82 = load double, ptr %81, align 8, !tbaa !17
  %83 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next
  store double %82, ptr %83, align 8, !tbaa !17
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %84 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next.1
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = getelementptr inbounds double, ptr %85, i64 %indvars.iv35
  %87 = load double, ptr %86, align 8, !tbaa !17
  %88 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next.1
  store double %87, ptr %88, align 16, !tbaa !17
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %89 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.next.2
  %90 = load ptr, ptr %89, align 8, !tbaa !15
  %91 = getelementptr inbounds double, ptr %90, i64 %indvars.iv35
  %92 = load double, ptr %91, align 8, !tbaa !17
  %93 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.next.2
  store double %92, ptr %93, align 8, !tbaa !17
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %..preheader_crit_edge.us30.unr-lcssa, label %.preheader20.us25.new, !llvm.loop !21

..preheader_crit_edge.us30.unr-lcssa:             ; preds = %.preheader20.us25.new, %.preheader20.us25
  %indvars.iv.unr = phi i64 [ 0, %.preheader20.us25 ], [ %indvars.iv.next.3, %.preheader20.us25.new ]
  br i1 %lcmp.mod.not, label %..preheader_crit_edge.us30, label %.epil.preheader

.epil.preheader:                                  ; preds = %..preheader_crit_edge.us30.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %..preheader_crit_edge.us30.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %..preheader_crit_edge.us30.unr-lcssa ]
  %94 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv.epil
  %95 = load ptr, ptr %94, align 8, !tbaa !15
  %96 = getelementptr inbounds double, ptr %95, i64 %indvars.iv35
  %97 = load double, ptr %96, align 8, !tbaa !17
  %98 = getelementptr inbounds double, ptr %23, i64 %indvars.iv.epil
  store double %97, ptr %98, align 8, !tbaa !17
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %..preheader_crit_edge.us30, label %.epil.preheader, !llvm.loop !25

..preheader_crit_edge.us30:                       ; preds = %.epil.preheader, %..preheader_crit_edge.us30.unr-lcssa
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %exitcond39.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count38
  br i1 %exitcond39.not, label %.loopexit, label %.preheader20.us25, !llvm.loop !24

.loopexit.sink.split:                             ; preds = %15, %11, %3
  %.str.23.sink = phi ptr [ @.str.21, %3 ], [ @.str.22, %11 ], [ @.str.23, %15 ]
  %99 = load ptr, ptr @stderr, align 8, !tbaa !15
  %100 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef nonnull %.str.23.sink) #4
  br label %.loopexit

.loopexit:                                        ; preds = %..preheader_crit_edge.us30, %._crit_edge.us, %._crit_edge.us.us, %.loopexit.sink.split, %.preheader20.lr.ph.split, %20
  %.0 = phi i32 [ 0, %20 ], [ 0, %.preheader20.lr.ph.split ], [ -1, %.loopexit.sink.split ], [ 0, %._crit_edge.us.us ], [ 0, %._crit_edge.us ], [ 0, %..preheader_crit_edge.us30 ]
  ret i32 %.0
}

declare double @__vectorized_mult_accumulate(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { nofree 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 #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 = { nounwind }
attributes #4 = { cold 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, !7, i64 16}
!6 = !{!"rc_matrix_t", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !7, i64 0}
!14 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!15 = !{!10, !10, i64 0}
!16 = !{!6, !10, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !23}


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