; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_MatNd)

; 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._MatNd = type { ptr, i32, i32, i32, i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [71 x i8], align 1
@__func__.MatNd_addDiag = external hidden unnamed_addr constant [14 x i8], align 1

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

declare void @print_trace() #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_addDiag(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  br label %6

6:                                                ; preds = %2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct._MatNd, ptr %7, i32 0, i32 1
  %9 = load i32, ptr %8, align 8, !tbaa !9
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct._MatNd, ptr %10, i32 0, i32 2
  %12 = load i32, ptr %11, align 4, !tbaa !13
  %13 = icmp eq i32 %9, %12
  br i1 %13, label %27, label %14

14:                                               ; preds = %6
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_addDiag, i32 noundef 1160, ptr noundef @.str.87) #5
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._MatNd, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._MatNd, ptr %21, i32 0, i32 2
  %23 = load i32, ptr %22, align 4, !tbaa !13
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.88, i32 noundef %20, i32 noundef %23) #5
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.4) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

27:                                               ; preds = %6
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._MatNd, ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !13
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %45, label %35

35:                                               ; preds = %30
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_addDiag, i32 noundef 1163, ptr noundef @.str.89) #5
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._MatNd, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.90, i32 noundef %41) #5
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.4) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

45:                                               ; preds = %30
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._MatNd, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._MatNd, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !9
  %54 = icmp eq i32 %50, %53
  br i1 %54, label %55, label %88

55:                                               ; preds = %47
  store i32 0, ptr %5, align 4, !tbaa !14
  br label %56

56:                                               ; preds = %84, %55
  %57 = load i32, ptr %5, align 4, !tbaa !14
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._MatNd, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !9
  %61 = icmp ult i32 %57, %60
  br i1 %61, label %62, label %87

62:                                               ; preds = %56
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._MatNd, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  %66 = load i32, ptr %5, align 4, !tbaa !14
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %65, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !16
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._MatNd, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = load i32, ptr %5, align 4, !tbaa !14
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._MatNd, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = mul i32 %73, %76
  %78 = load i32, ptr %5, align 4, !tbaa !14
  %79 = add i32 %77, %78
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %72, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !16
  %83 = fadd double %82, %69
  store double %83, ptr %81, align 8, !tbaa !16
  br label %84

84:                                               ; preds = %62
  %85 = load i32, ptr %5, align 4, !tbaa !14
  %86 = add i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !14
  br label %56, !llvm.loop !18

87:                                               ; preds = %56
  br label %144

88:                                               ; preds = %47
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._MatNd, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !9
  %92 = icmp eq i32 %91, 1
  br i1 %92, label %93, label %124

93:                                               ; preds = %88
  store i32 0, ptr %5, align 4, !tbaa !14
  br label %94

94:                                               ; preds = %120, %93
  %95 = load i32, ptr %5, align 4, !tbaa !14
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MatNd, ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !9
  %99 = icmp ult i32 %95, %98
  br i1 %99, label %100, label %123

100:                                              ; preds = %94
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._MatNd, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = getelementptr inbounds double, ptr %103, i64 0
  %105 = load double, ptr %104, align 8, !tbaa !16
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._MatNd, ptr %106, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = load i32, ptr %5, align 4, !tbaa !14
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._MatNd, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !13
  %113 = mul i32 %109, %112
  %114 = load i32, ptr %5, align 4, !tbaa !14
  %115 = add i32 %113, %114
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds double, ptr %108, i64 %116
  %118 = load double, ptr %117, align 8, !tbaa !16
  %119 = fadd double %118, %105
  store double %119, ptr %117, align 8, !tbaa !16
  br label %120

120:                                              ; preds = %100
  %121 = load i32, ptr %5, align 4, !tbaa !14
  %122 = add i32 %121, 1
  store i32 %122, ptr %5, align 4, !tbaa !14
  br label %94, !llvm.loop !20

123:                                              ; preds = %94
  br label %143

124:                                              ; preds = %88
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.91, ptr noundef @.str.1, ptr noundef @__func__.MatNd_addDiag, i32 noundef 1183) #5
  %128 = load ptr, ptr @stderr, align 8, !tbaa !5
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._MatNd, ptr %129, i32 0, i32 1
  %131 = load i32, ptr %130, align 8, !tbaa !9
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._MatNd, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 8, !tbaa !9
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct._MatNd, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !13
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.92, i32 noundef %131, i32 noundef %134, i32 noundef %137) #5
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.4) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

141:                                              ; No predecessors!
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142, %123
  br label %144

144:                                              ; preds = %143, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [71 x i8], align 1
@__func__.MatNd_addDiag = external hidden unnamed_addr constant [14 x i8], align 1

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

declare void @print_trace() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_addDiag(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %7 = icmp eq i32 %4, %6
  br i1 %7, label %17, label %8

8:                                                ; preds = %2
  %9 = load ptr, ptr @stderr, align 8, !tbaa !13
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_addDiag, i32 noundef 1160, ptr noundef nonnull @.str.87) #4
  %11 = load ptr, ptr @stderr, align 8, !tbaa !13
  %12 = load i32, ptr %3, align 8, !tbaa !5
  %13 = load i32, ptr %5, align 4, !tbaa !12
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.88, i32 noundef %12, i32 noundef %13) #4
  %15 = load ptr, ptr @stderr, align 8, !tbaa !13
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.4) #4
  tail call void @print_trace() #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

17:                                               ; preds = %2
  %18 = getelementptr inbounds i8, ptr %1, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !12
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %29, label %21

21:                                               ; preds = %17
  %22 = load ptr, ptr @stderr, align 8, !tbaa !13
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_addDiag, i32 noundef 1163, ptr noundef nonnull @.str.89) #4
  %24 = load ptr, ptr @stderr, align 8, !tbaa !13
  %25 = load i32, ptr %18, align 4, !tbaa !12
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.90, i32 noundef %25) #4
  %27 = load ptr, ptr @stderr, align 8, !tbaa !13
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.4) #4
  tail call void @print_trace() #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

29:                                               ; preds = %17
  %30 = getelementptr inbounds i8, ptr %1, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !5
  %32 = icmp eq i32 %31, %4
  br i1 %32, label %.preheader, label %53

.preheader:                                       ; preds = %29
  %.not37 = icmp eq i32 %4, 0
  br i1 %.not37, label %.loopexit, label %.lr.ph36

.lr.ph36:                                         ; preds = %.preheader
  %33 = load ptr, ptr %1, align 8, !tbaa !14
  %34 = load ptr, ptr %0, align 8, !tbaa !14
  %.031 = add i32 %4, 1
  %wide.trip.count43 = zext i32 %4 to i64
  %xtraiter49 = and i64 %wide.trip.count43, 1
  %35 = icmp eq i32 %4, 1
  br i1 %35, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph36.new

.lr.ph36.new:                                     ; preds = %.lr.ph36
  %unroll_iter51 = and i64 %wide.trip.count43, 4294967294
  br label %36

36:                                               ; preds = %36, %.lr.ph36.new
  %indvars.iv40 = phi i64 [ 0, %.lr.ph36.new ], [ %indvars.iv.next41.1, %36 ]
  %niter52 = phi i64 [ 0, %.lr.ph36.new ], [ %niter52.next.1, %36 ]
  %37 = getelementptr inbounds double, ptr %33, i64 %indvars.iv40
  %38 = load double, ptr %37, align 8, !tbaa !15
  %39 = trunc nuw i64 %indvars.iv40 to i32
  %40 = mul i32 %.031, %39
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %34, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !15
  %44 = fadd double %38, %43
  store double %44, ptr %42, align 8, !tbaa !15
  %indvars.iv.next41 = or disjoint i64 %indvars.iv40, 1
  %45 = getelementptr inbounds double, ptr %33, i64 %indvars.iv.next41
  %46 = load double, ptr %45, align 8, !tbaa !15
  %47 = trunc nuw i64 %indvars.iv.next41 to i32
  %48 = mul i32 %.031, %47
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds double, ptr %34, i64 %49
  %51 = load double, ptr %50, align 8, !tbaa !15
  %52 = fadd double %46, %51
  store double %52, ptr %50, align 8, !tbaa !15
  %indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 2
  %niter52.next.1 = add i64 %niter52, 2
  %niter52.ncmp.1 = icmp eq i64 %niter52.next.1, %unroll_iter51
  br i1 %niter52.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %36, !llvm.loop !17

53:                                               ; preds = %29
  %54 = icmp eq i32 %31, 1
  br i1 %54, label %.preheader32, label %74

.preheader32:                                     ; preds = %53
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader32
  %55 = load ptr, ptr %1, align 8, !tbaa !14
  %56 = load ptr, ptr %0, align 8, !tbaa !14
  %.130 = add i32 %4, 1
  %wide.trip.count = zext i32 %4 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %57 = icmp eq i32 %4, 1
  br i1 %57, label %.loopexit.loopexit47.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %58

58:                                               ; preds = %58, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %58 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %58 ]
  %59 = load double, ptr %55, align 8, !tbaa !15
  %60 = trunc nuw i64 %indvars.iv to i32
  %61 = mul i32 %.130, %60
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %56, i64 %62
  %64 = load double, ptr %63, align 8, !tbaa !15
  %65 = fadd double %59, %64
  store double %65, ptr %63, align 8, !tbaa !15
  %66 = load double, ptr %55, align 8, !tbaa !15
  %67 = trunc i64 %indvars.iv to i32
  %68 = or disjoint i32 %67, 1
  %69 = mul i32 %.130, %68
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds double, ptr %56, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = fadd double %66, %72
  store double %73, ptr %71, align 8, !tbaa !15
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit47.unr-lcssa.loopexit, label %58, !llvm.loop !19

74:                                               ; preds = %53
  %75 = load ptr, ptr @stderr, align 8, !tbaa !13
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.91, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_addDiag, i32 noundef 1183) #4
  %77 = load ptr, ptr @stderr, align 8, !tbaa !13
  %78 = load i32, ptr %30, align 8, !tbaa !5
  %79 = load i32, ptr %3, align 8, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !12
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.92, i32 noundef %78, i32 noundef %79, i32 noundef %80) #4
  %82 = load ptr, ptr @stderr, align 8, !tbaa !13
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.4) #4
  tail call void @print_trace() #5
  tail call void @exit(i32 noundef 1) #6
  unreachable

.loopexit.loopexit.unr-lcssa:                     ; preds = %36, %.lr.ph36
  %indvars.iv40.unr = phi i64 [ 0, %.lr.ph36 ], [ %indvars.iv.next41.1, %36 ]
  %lcmp.mod50.not = icmp eq i64 %xtraiter49, 0
  br i1 %lcmp.mod50.not, label %.loopexit, label %.loopexit.loopexit.epilog-lcssa

.loopexit.loopexit.epilog-lcssa:                  ; preds = %.loopexit.loopexit.unr-lcssa
  %84 = getelementptr inbounds double, ptr %33, i64 %indvars.iv40.unr
  %85 = load double, ptr %84, align 8, !tbaa !15
  %86 = trunc nuw i64 %indvars.iv40.unr to i32
  %87 = mul i32 %.031, %86
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %34, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !15
  %91 = fadd double %85, %90
  store double %91, ptr %89, align 8, !tbaa !15
  br label %.loopexit

.loopexit.loopexit47.unr-lcssa.loopexit:          ; preds = %58
  %92 = trunc nuw i64 %indvars.iv.next.1 to i32
  br label %.loopexit.loopexit47.unr-lcssa

.loopexit.loopexit47.unr-lcssa:                   ; preds = %.loopexit.loopexit47.unr-lcssa.loopexit, %.lr.ph
  %indvars.iv.unr = phi i32 [ 0, %.lr.ph ], [ %92, %.loopexit.loopexit47.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.loopexit.loopexit47.epilog-lcssa

.loopexit.loopexit47.epilog-lcssa:                ; preds = %.loopexit.loopexit47.unr-lcssa
  %93 = load double, ptr %55, align 8, !tbaa !15
  %94 = mul i32 %.130, %indvars.iv.unr
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %56, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !15
  %98 = fadd double %93, %97
  store double %98, ptr %96, align 8, !tbaa !15
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit47.epilog-lcssa, %.loopexit.loopexit47.unr-lcssa, %.loopexit.loopexit.epilog-lcssa, %.loopexit.loopexit.unr-lcssa, %.preheader32, %.preheader
  ret void
}

attributes #0 = { 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 #1 = { "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 = { 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 = { 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 = { cold nounwind }
attributes #5 = { nounwind }
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, !10, i64 8}
!6 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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