; LLVM IR from beagleboard/librobotcontrol :: examples/src (rc_test_kalman)

; 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_kalman_t = type { %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_vector_t, %struct.rc_vector_t, i32, i64 }
%struct.rc_matrix_t = type { i32, i32, ptr, i32 }
%struct.rc_vector_t = type { i32, ptr, i32 }

@running = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.rc_kalman_t, align 8
  %4 = alloca %struct.rc_matrix_t, align 8
  %5 = alloca %struct.rc_matrix_t, align 8
  %6 = alloca %struct.rc_matrix_t, align 8
  %7 = alloca %struct.rc_matrix_t, align 8
  %8 = alloca %struct.rc_matrix_t, align 8
  %9 = alloca %struct.rc_matrix_t, align 8
  %10 = alloca %struct.rc_vector_t, align 8
  %11 = alloca %struct.rc_vector_t, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 232, ptr %3) #5
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 232, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  %13 = call i32 @rc_matrix_zeros(ptr noundef %4, i32 noundef 2, i32 noundef 2)
  %14 = call i32 @rc_matrix_zeros(ptr noundef %5, i32 noundef 2, i32 noundef 1)
  %15 = call i32 @rc_matrix_zeros(ptr noundef %6, i32 noundef 1, i32 noundef 2)
  %16 = call i32 @rc_matrix_zeros(ptr noundef %7, i32 noundef 2, i32 noundef 2)
  %17 = call i32 @rc_matrix_zeros(ptr noundef %8, i32 noundef 1, i32 noundef 1)
  %18 = call i32 @rc_matrix_zeros(ptr noundef %9, i32 noundef 2, i32 noundef 2)
  %19 = call i32 @rc_vector_zeros(ptr noundef %10, i32 noundef 1)
  %20 = call i32 @rc_vector_zeros(ptr noundef %11, i32 noundef 1)
  %21 = getelementptr inbounds %struct.rc_matrix_t, ptr %4, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds ptr, ptr %22, i64 0
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = getelementptr inbounds double, ptr %24, i64 0
  store double 1.000000e+00, ptr %25, align 8, !tbaa !12
  %26 = getelementptr inbounds %struct.rc_matrix_t, ptr %4, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = getelementptr inbounds ptr, ptr %27, i64 0
  %29 = load ptr, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds double, ptr %29, i64 1
  store double 5.000000e-02, ptr %30, align 8, !tbaa !12
  %31 = getelementptr inbounds %struct.rc_matrix_t, ptr %4, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds ptr, ptr %32, i64 1
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds double, ptr %34, i64 0
  store double 0.000000e+00, ptr %35, align 8, !tbaa !12
  %36 = getelementptr inbounds %struct.rc_matrix_t, ptr %4, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds ptr, ptr %37, i64 1
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds double, ptr %39, i64 1
  store double 1.000000e+00, ptr %40, align 8, !tbaa !12
  %41 = getelementptr inbounds %struct.rc_matrix_t, ptr %5, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds ptr, ptr %42, i64 0
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds double, ptr %44, i64 0
  store double 0x3F547AE147AE147C, ptr %45, align 8, !tbaa !12
  %46 = getelementptr inbounds %struct.rc_matrix_t, ptr %5, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds ptr, ptr %47, i64 0
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds double, ptr %49, i64 1
  store double 5.000000e-02, ptr %50, align 8, !tbaa !12
  %51 = getelementptr inbounds %struct.rc_matrix_t, ptr %6, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds ptr, ptr %52, i64 0
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = getelementptr inbounds double, ptr %54, i64 0
  store double 1.000000e+00, ptr %55, align 8, !tbaa !12
  %56 = getelementptr inbounds %struct.rc_matrix_t, ptr %6, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = getelementptr inbounds ptr, ptr %57, i64 0
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = getelementptr inbounds double, ptr %59, i64 1
  store double 0.000000e+00, ptr %60, align 8, !tbaa !12
  %61 = getelementptr inbounds %struct.rc_matrix_t, ptr %7, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds ptr, ptr %62, i64 0
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = getelementptr inbounds double, ptr %64, i64 0
  store double 1.000000e-01, ptr %65, align 8, !tbaa !12
  %66 = getelementptr inbounds %struct.rc_matrix_t, ptr %7, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %67, i64 1
  %69 = load ptr, ptr %68, align 8, !tbaa !11
  %70 = getelementptr inbounds double, ptr %69, i64 1
  store double 1.000000e-04, ptr %70, align 8, !tbaa !12
  %71 = getelementptr inbounds %struct.rc_matrix_t, ptr %8, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = getelementptr inbounds ptr, ptr %72, i64 0
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = getelementptr inbounds double, ptr %74, i64 0
  store double 1.000000e+00, ptr %75, align 8, !tbaa !12
  %76 = getelementptr inbounds %struct.rc_matrix_t, ptr %9, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds ptr, ptr %77, i64 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = getelementptr inbounds double, ptr %79, i64 0
  store double 1.000000e-04, ptr %80, align 8, !tbaa !12
  %81 = getelementptr inbounds %struct.rc_matrix_t, ptr %9, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = getelementptr inbounds ptr, ptr %82, i64 1
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds double, ptr %84, i64 1
  store double 1.000000e-04, ptr %85, align 8, !tbaa !12
  %86 = call i32 @rc_kalman_alloc_lin(ptr noundef %3, ptr noundef byval(%struct.rc_matrix_t) align 8 %4, ptr noundef byval(%struct.rc_matrix_t) align 8 %5, ptr noundef byval(%struct.rc_matrix_t) align 8 %6, ptr noundef byval(%struct.rc_matrix_t) align 8 %7, ptr noundef byval(%struct.rc_matrix_t) align 8 %8, ptr noundef byval(%struct.rc_matrix_t) align 8 %9)
  %87 = icmp eq i32 %86, -1
  br i1 %87, label %88, label %89

88:                                               ; preds = %0
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %12, align 4
  br label %160

89:                                               ; preds = %0
  %90 = call ptr @signal(i32 noundef 2, ptr noundef @__signal_handler) #5
  store i32 1, ptr @running, align 4, !tbaa !14
  store i32 20, ptr %2, align 4, !tbaa !14
  %91 = getelementptr inbounds %struct.rc_vector_t, ptr %10, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !15
  %93 = getelementptr inbounds double, ptr %92, i64 0
  store double 1.000000e+00, ptr %93, align 8, !tbaa !12
  br label %94

94:                                               ; preds = %125, %89
  %95 = load i32, ptr @running, align 4, !tbaa !14
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %149

97:                                               ; preds = %94
  %98 = load i32, ptr %2, align 4, !tbaa !14
  %99 = sitofp i32 %98 to double
  %100 = fcmp ogt double %99, 4.000000e+01
  br i1 %100, label %101, label %121

101:                                              ; preds = %97
  store i32 0, ptr %2, align 4, !tbaa !14
  %102 = getelementptr inbounds %struct.rc_vector_t, ptr %10, i32 0, i32 1
  %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 !12
  %106 = fcmp olt double %105, 1.000000e+00
  br i1 %106, label %107, label %111

107:                                              ; preds = %101
  %108 = getelementptr inbounds %struct.rc_vector_t, ptr %10, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !15
  %110 = getelementptr inbounds double, ptr %109, i64 0
  store double 1.000000e+00, ptr %110, align 8, !tbaa !12
  br label %115

111:                                              ; preds = %101
  %112 = getelementptr inbounds %struct.rc_vector_t, ptr %10, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !15
  %114 = getelementptr inbounds double, ptr %113, i64 0
  store double -1.000000e+00, ptr %114, align 8, !tbaa !12
  br label %115

115:                                              ; preds = %111, %107
  %116 = getelementptr inbounds %struct.rc_vector_t, ptr %11, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !15
  %118 = getelementptr inbounds double, ptr %117, i64 0
  %119 = load double, ptr %118, align 8, !tbaa !12
  %120 = fadd double %119, 5.000000e-01
  store double %120, ptr %118, align 8, !tbaa !12
  br label %121

121:                                              ; preds = %115, %97
  %122 = call i32 @rc_kalman_update_lin(ptr noundef %3, ptr noundef byval(%struct.rc_vector_t) align 8 %10, ptr noundef byval(%struct.rc_vector_t) align 8 %11)
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %121
  store i32 0, ptr @running, align 4, !tbaa !14
  br label %125

125:                                              ; preds = %124, %121
  %126 = getelementptr inbounds %struct.rc_kalman_t, ptr %3, i32 0, i32 7
  %127 = getelementptr inbounds %struct.rc_vector_t, ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %129 = getelementptr inbounds double, ptr %128, i64 0
  %130 = load double, ptr %129, align 8, !tbaa !12
  %131 = getelementptr inbounds %struct.rc_kalman_t, ptr %3, i32 0, i32 7
  %132 = getelementptr inbounds %struct.rc_vector_t, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !17
  %134 = getelementptr inbounds double, ptr %133, i64 1
  %135 = load double, ptr %134, align 8, !tbaa !12
  %136 = getelementptr inbounds %struct.rc_vector_t, ptr %10, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = getelementptr inbounds double, ptr %137, i64 0
  %139 = load double, ptr %138, align 8, !tbaa !12
  %140 = getelementptr inbounds %struct.rc_vector_t, ptr %11, i32 0, i32 1
  %141 = load ptr, ptr %140, align 8, !tbaa !15
  %142 = getelementptr inbounds double, ptr %141, i64 0
  %143 = load double, ptr %142, align 8, !tbaa !12
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %130, double noundef %135, double noundef %139, double noundef %143)
  %145 = load ptr, ptr @stdout, align 8, !tbaa !11
  %146 = call i32 @fflush(ptr noundef %145)
  %147 = load i32, ptr %2, align 4, !tbaa !14
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %2, align 4, !tbaa !14
  call void @rc_usleep(i32 noundef 50000)
  br label %94, !llvm.loop !20

149:                                              ; preds = %94
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %151 = call i32 @rc_matrix_free(ptr noundef %4)
  %152 = call i32 @rc_matrix_free(ptr noundef %5)
  %153 = call i32 @rc_matrix_free(ptr noundef %6)
  %154 = call i32 @rc_matrix_free(ptr noundef %7)
  %155 = call i32 @rc_matrix_free(ptr noundef %8)
  %156 = call i32 @rc_matrix_free(ptr noundef %9)
  %157 = call i32 @rc_vector_free(ptr noundef %10)
  %158 = call i32 @rc_vector_free(ptr noundef %11)
  %159 = call i32 @rc_kalman_free(ptr noundef %3)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  br label %160

160:                                              ; preds = %149, %88
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 232, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %161 = load i32, ptr %1, align 4
  ret i32 %161
}

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

declare i32 @rc_matrix_zeros(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @rc_vector_zeros(ptr noundef, i32 noundef) #3

declare i32 @rc_kalman_alloc_lin(ptr noundef, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8) #3

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @__signal_handler(i32 noundef) #0

declare i32 @rc_kalman_update_lin(ptr noundef, ptr noundef byval(%struct.rc_vector_t) align 8, ptr noundef byval(%struct.rc_vector_t) align 8) #3

declare i32 @printf(ptr noundef, ...) #3

declare i32 @fflush(ptr noundef) #3

declare void @rc_usleep(i32 noundef) #3

declare i32 @rc_matrix_free(ptr noundef) #3

declare i32 @rc_vector_free(ptr noundef) #3

declare i32 @rc_kalman_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 nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 "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, !10, i64 8}
!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 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"rc_vector_t", !7, i64 0, !10, i64 8, !7, i64 16}
!17 = !{!18, !10, i64 176}
!18 = !{!"rc_kalman_t", !6, i64 0, !6, i64 24, !6, i64 48, !6, i64 72, !6, i64 96, !6, i64 120, !6, i64 144, !16, i64 168, !16, i64 192, !7, i64 216, !19, i64 224}
!19 = !{!"long", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

%struct.rc_kalman_t = type { %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_matrix_t, %struct.rc_vector_t, %struct.rc_vector_t, i32, i64 }
%struct.rc_matrix_t = type { i32, i32, ptr, i32 }
%struct.rc_vector_t = type { i32, ptr, i32 }

@running = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.rc_kalman_t, align 8
  %2 = alloca %struct.rc_matrix_t, align 8
  %3 = alloca %struct.rc_matrix_t, align 8
  %4 = alloca %struct.rc_matrix_t, align 8
  %5 = alloca %struct.rc_matrix_t, align 8
  %6 = alloca %struct.rc_matrix_t, align 8
  %7 = alloca %struct.rc_matrix_t, align 8
  %8 = alloca %struct.rc_vector_t, align 8
  %9 = alloca %struct.rc_vector_t, align 8
  call void @llvm.lifetime.start.p0(i64 232, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(232) %1, i8 0, i64 232, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  %10 = call i32 @rc_matrix_zeros(ptr noundef nonnull %2, i32 noundef 2, i32 noundef 2) #6
  %11 = call i32 @rc_matrix_zeros(ptr noundef nonnull %3, i32 noundef 2, i32 noundef 1) #6
  %12 = call i32 @rc_matrix_zeros(ptr noundef nonnull %4, i32 noundef 1, i32 noundef 2) #6
  %13 = call i32 @rc_matrix_zeros(ptr noundef nonnull %5, i32 noundef 2, i32 noundef 2) #6
  %14 = call i32 @rc_matrix_zeros(ptr noundef nonnull %6, i32 noundef 1, i32 noundef 1) #6
  %15 = call i32 @rc_matrix_zeros(ptr noundef nonnull %7, i32 noundef 2, i32 noundef 2) #6
  %16 = call i32 @rc_vector_zeros(ptr noundef nonnull %8, i32 noundef 1) #6
  %17 = call i32 @rc_vector_zeros(ptr noundef nonnull %9, i32 noundef 1) #6
  %18 = getelementptr inbounds i8, ptr %2, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+00, double 5.000000e-02>, ptr %20, align 8, !tbaa !12
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  store <2 x double> <double 0.000000e+00, double 1.000000e+00>, ptr %22, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %3, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  store <2 x double> <double 0x3F547AE147AE147C, double 5.000000e-02>, ptr %25, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %4, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %28, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %5, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  store double 1.000000e-01, ptr %31, align 8, !tbaa !12
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  store double 1.000000e-04, ptr %34, align 8, !tbaa !12
  %35 = getelementptr inbounds i8, ptr %6, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  store double 1.000000e+00, ptr %37, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %7, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  store double 1.000000e-04, ptr %40, align 8, !tbaa !12
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  store double 1.000000e-04, ptr %43, align 8, !tbaa !12
  %44 = call i32 @rc_kalman_alloc_lin(ptr noundef nonnull %1, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %2, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %3, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %4, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %6, ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %7) #6
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %88, label %46

46:                                               ; preds = %0
  %47 = call ptr @signal(i32 noundef 2, ptr noundef nonnull @__signal_handler) #6
  store i32 1, ptr @running, align 4, !tbaa !14
  %48 = getelementptr inbounds i8, ptr %8, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  store double 1.000000e+00, ptr %49, align 8, !tbaa !12
  %50 = getelementptr inbounds i8, ptr %9, i64 8
  %51 = getelementptr inbounds i8, ptr %1, i64 176
  br label %52

52:                                               ; preds = %46, %64
  %.05 = phi i32 [ 20, %46 ], [ %76, %64 ]
  %53 = icmp sgt i32 %.05, 40
  br i1 %53, label %54, label %61

54:                                               ; preds = %52
  %55 = load ptr, ptr %48, align 8, !tbaa !15
  %56 = load double, ptr %55, align 8, !tbaa !12
  %57 = fcmp olt double %56, 1.000000e+00
  %. = select i1 %57, double 1.000000e+00, double -1.000000e+00
  store double %., ptr %55, align 8, !tbaa !12
  %58 = load ptr, ptr %50, align 8, !tbaa !15
  %59 = load double, ptr %58, align 8, !tbaa !12
  %60 = fadd double %59, 5.000000e-01
  store double %60, ptr %58, align 8, !tbaa !12
  br label %61

61:                                               ; preds = %54, %52
  %.1 = phi i32 [ 0, %54 ], [ %.05, %52 ]
  %62 = call i32 @rc_kalman_update_lin(ptr noundef nonnull %1, ptr noundef nonnull byval(%struct.rc_vector_t) align 8 %8, ptr noundef nonnull byval(%struct.rc_vector_t) align 8 %9) #6
  %.not4 = icmp eq i32 %62, 0
  br i1 %.not4, label %64, label %63

63:                                               ; preds = %61
  store i32 0, ptr @running, align 4, !tbaa !14
  br label %64

64:                                               ; preds = %63, %61
  %65 = load ptr, ptr %51, align 8, !tbaa !17
  %66 = load double, ptr %65, align 8, !tbaa !12
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  %68 = load double, ptr %67, align 8, !tbaa !12
  %69 = load ptr, ptr %48, align 8, !tbaa !15
  %70 = load double, ptr %69, align 8, !tbaa !12
  %71 = load ptr, ptr %50, align 8, !tbaa !15
  %72 = load double, ptr %71, align 8, !tbaa !12
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %66, double noundef %68, double noundef %70, double noundef %72)
  %74 = load ptr, ptr @stdout, align 8, !tbaa !11
  %75 = call i32 @fflush(ptr noundef %74)
  %76 = add nsw i32 %.1, 1
  call void @rc_usleep(i32 noundef 50000) #6
  %.pr = load i32, ptr @running, align 4, !tbaa !14
  %.not = icmp eq i32 %.pr, 0
  br i1 %.not, label %77, label %52, !llvm.loop !20

77:                                               ; preds = %64
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %79 = call i32 @rc_matrix_free(ptr noundef nonnull %2) #6
  %80 = call i32 @rc_matrix_free(ptr noundef nonnull %3) #6
  %81 = call i32 @rc_matrix_free(ptr noundef nonnull %4) #6
  %82 = call i32 @rc_matrix_free(ptr noundef nonnull %5) #6
  %83 = call i32 @rc_matrix_free(ptr noundef nonnull %6) #6
  %84 = call i32 @rc_matrix_free(ptr noundef nonnull %7) #6
  %85 = call i32 @rc_vector_free(ptr noundef nonnull %8) #6
  %86 = call i32 @rc_vector_free(ptr noundef nonnull %9) #6
  %87 = call i32 @rc_kalman_free(ptr noundef nonnull %1) #6
  br label %88

88:                                               ; preds = %0, %77
  %.03 = phi i32 [ 0, %77 ], [ -1, %0 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 232, ptr nonnull %1) #6
  ret i32 %.03
}

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

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

declare i32 @rc_matrix_zeros(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @rc_vector_zeros(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @rc_kalman_alloc_lin(ptr noundef, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_matrix_t) align 8) local_unnamed_addr #3

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @__signal_handler(i32 noundef) #0

declare i32 @rc_kalman_update_lin(ptr noundef, ptr noundef byval(%struct.rc_vector_t) align 8, ptr noundef byval(%struct.rc_vector_t) align 8) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #5

declare void @rc_usleep(i32 noundef) local_unnamed_addr #3

declare i32 @rc_matrix_free(ptr noundef) local_unnamed_addr #3

declare i32 @rc_vector_free(ptr noundef) local_unnamed_addr #3

declare i32 @rc_kalman_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 "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 = { 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 #6 = { 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 = !{!"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 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"rc_vector_t", !7, i64 0, !10, i64 8, !7, i64 16}
!17 = !{!18, !10, i64 176}
!18 = !{!"rc_kalman_t", !6, i64 0, !6, i64 24, !6, i64 48, !6, i64 72, !6, i64 96, !6, i64 120, !6, i64 144, !16, i64 168, !16, i64 192, !7, i64 216, !19, i64 224}
!19 = !{!"long", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass