; 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 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1

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

13:                                               ; preds = %3
  %14 = load i32, ptr %7, align 4, !tbaa !9
  %15 = icmp slt i32 %14, 1
  br label %16

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

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

27:                                               ; preds = %16
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  %30 = xor i1 %29, true
  %31 = xor i1 %30, true
  %32 = zext i1 %31 to i32
  %33 = sext i32 %32 to i64
  %34 = call i64 @llvm.expect.i64(i64 %33, i64 0)
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %27
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.1) #6
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %136

39:                                               ; preds = %27
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.rc_matrix_t, ptr %40, i32 0, i32 3
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %57

44:                                               ; preds = %39
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.rc_matrix_t, ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !13
  %49 = icmp eq i32 %45, %48
  br i1 %49, label %50, label %57

50:                                               ; preds = %44
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.rc_matrix_t, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = icmp eq i32 %51, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %136

57:                                               ; preds = %50, %44, %39
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call i32 @rc_matrix_free(ptr noundef %58)
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = mul i64 %61, 8
  %63 = call noalias ptr @malloc(i64 noundef %62) #7
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.rc_matrix_t, ptr %64, i32 0, i32 2
  store ptr %63, ptr %65, align 8, !tbaa !15
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.rc_matrix_t, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = icmp eq ptr %68, null
  %70 = xor i1 %69, true
  %71 = xor i1 %70, true
  %72 = zext i1 %71 to i32
  %73 = sext i32 %72 to i64
  %74 = call i64 @llvm.expect.i64(i64 %73, i64 0)
  %75 = icmp ne i64 %74, 0
  br i1 %75, label %76, label %81

76:                                               ; preds = %57
  call void @perror(ptr noundef @.str.2)
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.3, i32 noundef %78, i32 noundef %79) #6
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %136

81:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %82 = load i32, ptr %6, align 4, !tbaa !9
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = mul nsw i32 %82, %83
  %85 = sext i32 %84 to i64
  %86 = mul i64 %85, 8
  %87 = call noalias ptr @malloc(i64 noundef %86) #7
  store ptr %87, ptr %10, align 8, !tbaa !5
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = icmp eq ptr %88, null
  %90 = xor i1 %89, true
  %91 = xor i1 %90, true
  %92 = zext i1 %91 to i32
  %93 = sext i32 %92 to i64
  %94 = call i64 @llvm.expect.i64(i64 %93, i64 0)
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %104

96:                                               ; preds = %81
  call void @perror(ptr noundef @.str.2)
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.3, i32 noundef %98, i32 noundef %99) #6
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.rc_matrix_t, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  call void @free(ptr noundef %103) #6
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %135

104:                                              ; preds = %81
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %123, %104
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %126

109:                                              ; preds = %105
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = mul nsw i32 %111, %112
  %114 = sext i32 %113 to i64
  %115 = mul i64 %114, 8
  %116 = getelementptr inbounds i8, ptr %110, i64 %115
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.rc_matrix_t, ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !15
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds ptr, ptr %119, i64 %121
  store ptr %116, ptr %122, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %109
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %8, align 4, !tbaa !9
  br label %105, !llvm.loop !16

126:                                              ; preds = %105
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.rc_matrix_t, ptr %128, i32 0, i32 0
  store i32 %127, ptr %129, align 8, !tbaa !13
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.rc_matrix_t, ptr %131, i32 0, i32 1
  store i32 %130, ptr %132, align 4, !tbaa !14
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.rc_matrix_t, ptr %133, i32 0, i32 3
  store i32 1, ptr %134, align 8, !tbaa !11
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %135

135:                                              ; preds = %126, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %136

136:                                              ; preds = %135, %76, %56, %36, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %137 = load i32, ptr %4, align 4
  ret i32 %137
}

; 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: nounwind uwtable
declare dso_local i32 @rc_matrix_free(ptr noundef) #0

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare void @perror(ptr noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

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 = { nounwind 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 = { "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 = { nounwind allocsize(0) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"rc_matrix_t", !10, i64 0, !10, i64 4, !6, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 0}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !6, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; 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 [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @rc_matrix_alloc(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp slt i32 %1, 1
  %5 = icmp slt i32 %2, 1
  %6 = or i1 %4, %5
  br i1 %6, label %7, label %10, !prof !5

7:                                                ; preds = %3
  %8 = load ptr, ptr @stderr, align 8, !tbaa !6
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #4
  br label %75

10:                                               ; preds = %3
  %11 = icmp eq ptr %0, null
  br i1 %11, label %12, label %15, !prof !5

12:                                               ; preds = %10
  %13 = load ptr, ptr @stderr, align 8, !tbaa !6
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.1) #4
  br label %75

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !10
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %19, label %26

19:                                               ; preds = %15
  %20 = load i32, ptr %0, align 8, !tbaa !13
  %21 = icmp eq i32 %20, %1
  br i1 %21, label %22, label %26

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = icmp eq i32 %24, %2
  br i1 %25, label %75, label %26

26:                                               ; preds = %22, %19, %15
  %27 = tail call i32 @rc_matrix_free(ptr noundef nonnull %0)
  %28 = zext nneg i32 %1 to i64
  %29 = shl nuw nsw i64 %28, 3
  %30 = tail call noalias ptr @malloc(i64 noundef %29) #5
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %30, ptr %31, align 8, !tbaa !15
  %32 = icmp eq ptr %30, null
  br i1 %32, label %33, label %36, !prof !5

33:                                               ; preds = %26
  tail call void @perror(ptr noundef nonnull @.str.2) #6
  %34 = load ptr, ptr @stderr, align 8, !tbaa !6
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.3, i32 noundef %1, i32 noundef %2) #4
  br label %75

36:                                               ; preds = %26
  %37 = mul nuw nsw i32 %2, %1
  %38 = zext nneg i32 %37 to i64
  %39 = shl nuw nsw i64 %38, 3
  %40 = tail call noalias ptr @malloc(i64 noundef %39) #5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %45, label %.lr.ph.preheader, !prof !5

.lr.ph.preheader:                                 ; preds = %36
  %42 = zext nneg i32 %2 to i64
  %43 = add nsw i64 %28, -1
  %xtraiter = and i64 %28, 3
  %44 = icmp ult i64 %43, 3
  br i1 %44, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %28, 2147483644
  br label %.lr.ph

45:                                               ; preds = %36
  tail call void @perror(ptr noundef nonnull @.str.2) #6
  %46 = load ptr, ptr @stderr, align 8, !tbaa !6
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.3, i32 noundef %1, i32 noundef %2) #4
  %48 = load ptr, ptr %31, align 8, !tbaa !15
  tail call void @free(ptr noundef %48) #7
  br label %75

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %49 = mul nuw nsw i64 %indvars.iv, %42
  %50 = shl nuw nsw i64 %49, 3
  %51 = getelementptr inbounds i8, ptr %40, i64 %50
  %52 = load ptr, ptr %31, align 8, !tbaa !15
  %53 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv
  store ptr %51, ptr %53, align 8, !tbaa !6
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %54 = mul nuw nsw i64 %indvars.iv.next, %42
  %55 = shl nuw nsw i64 %54, 3
  %56 = getelementptr inbounds i8, ptr %40, i64 %55
  %57 = load ptr, ptr %31, align 8, !tbaa !15
  %58 = getelementptr inbounds ptr, ptr %57, i64 %indvars.iv.next
  store ptr %56, ptr %58, align 8, !tbaa !6
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %59 = mul nuw nsw i64 %indvars.iv.next.1, %42
  %60 = shl nuw nsw i64 %59, 3
  %61 = getelementptr inbounds i8, ptr %40, i64 %60
  %62 = load ptr, ptr %31, align 8, !tbaa !15
  %63 = getelementptr inbounds ptr, ptr %62, i64 %indvars.iv.next.1
  store ptr %61, ptr %63, align 8, !tbaa !6
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %64 = mul nuw nsw i64 %indvars.iv.next.2, %42
  %65 = shl nuw nsw i64 %64, 3
  %66 = getelementptr inbounds i8, ptr %40, i64 %65
  %67 = load ptr, ptr %31, align 8, !tbaa !15
  %68 = getelementptr inbounds ptr, ptr %67, i64 %indvars.iv.next.2
  store ptr %66, ptr %68, align 8, !tbaa !6
  %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 %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !16

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %69 = mul nuw nsw i64 %indvars.iv.epil, %42
  %70 = shl nuw nsw i64 %69, 3
  %71 = getelementptr inbounds i8, ptr %40, i64 %70
  %72 = load ptr, ptr %31, align 8, !tbaa !15
  %73 = getelementptr inbounds ptr, ptr %72, i64 %indvars.iv.epil
  store ptr %71, ptr %73, align 8, !tbaa !6
  %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 %._crit_edge, label %.lr.ph.epil, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.unr-lcssa
  store i32 %1, ptr %0, align 8, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %2, ptr %74, align 4, !tbaa !14
  store i32 1, ptr %16, align 8, !tbaa !10
  br label %75

75:                                               ; preds = %45, %._crit_edge, %22, %33, %12, %7
  %.1 = phi i32 [ -1, %7 ], [ -1, %12 ], [ -1, %33 ], [ 0, %22 ], [ -1, %45 ], [ 0, %._crit_edge ]
  ret i32 %.1
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #6 = { cold }
attributes #7 = { 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 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !12, i64 16}
!11 = !{!"rc_matrix_t", !12, i64 0, !12, i64 4, !7, i64 8, !12, i64 16}
!12 = !{!"int", !8, i64 0}
!13 = !{!11, !12, i64 0}
!14 = !{!11, !12, i64 4}
!15 = !{!11, !7, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}


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