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

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

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@opterr = external global i32, align 4
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@optarg = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %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 i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %struct.rc_vector_t, align 8
  %14 = alloca %struct.rc_vector_t, align 8
  %15 = alloca %struct.rc_matrix_t, align 8
  %16 = alloca %struct.rc_matrix_t, align 8
  %17 = alloca %struct.rc_matrix_t, align 8
  %18 = alloca %struct.rc_matrix_t, align 8
  %19 = alloca %struct.rc_matrix_t, align 8
  %20 = alloca %struct.rc_matrix_t, align 8
  %21 = alloca %struct.rc_matrix_t, align 8
  %22 = alloca %struct.rc_matrix_t, align 8
  %23 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  call void @llvm.memset.p0.i64(ptr align 8 %17, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @llvm.memset.p0.i64(ptr align 8 %18, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  call void @llvm.memset.p0.i64(ptr align 8 %21, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  call void @llvm.memset.p0.i64(ptr align 8 %22, i8 0, i64 24, i1 false)
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 3
  br i1 %25, label %26, label %28

26:                                               ; preds = %2
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

28:                                               ; preds = %2
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp slt i32 %29, 2
  br i1 %30, label %31, label %33

31:                                               ; preds = %28
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

33:                                               ; preds = %28
  store i32 0, ptr @opterr, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %66, %33
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = call i32 @getopt(i32 noundef %35, ptr noundef %36, ptr noundef @.str.2) #6
  store i32 %37, ptr %7, align 4, !tbaa !5
  %38 = icmp ne i32 %37, -1
  br i1 %38, label %39, label %67

39:                                               ; preds = %34
  %40 = load i32, ptr %7, align 4, !tbaa !5
  switch i32 %40, label %64 [
    i32 100, label %41
    i32 115, label %47
    i32 104, label %63
  ]

41:                                               ; preds = %39
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %41
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

46:                                               ; preds = %41
  store i32 140, ptr %6, align 4, !tbaa !5
  br label %66

47:                                               ; preds = %39
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

52:                                               ; preds = %47
  %53 = load ptr, ptr @optarg, align 8, !tbaa !9
  %54 = call i32 @atoi(ptr noundef %53) #7
  store i32 %54, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 500
  br i1 %56, label %60, label %57

57:                                               ; preds = %52
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = icmp slt i32 %58, 1
  br i1 %59, label %60, label %62

60:                                               ; preds = %57, %52
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

62:                                               ; preds = %57
  br label %66

63:                                               ; preds = %39
  call void @__print_usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

64:                                               ; preds = %39
  %65 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @__print_usage()
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

66:                                               ; preds = %62, %46
  br label %34, !llvm.loop !11

67:                                               ; preds = %34
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %69 = call i64 @rc_nanos_thread_time()
  store i64 %69, ptr %10, align 8, !tbaa !13
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = call i32 @rc_matrix_random(ptr noundef %15, i32 noundef %70, i32 noundef %71)
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = call i32 @rc_vector_zeros(ptr noundef %13, i32 noundef %73)
  %75 = call i64 @rc_nanos_thread_time()
  store i64 %75, ptr %11, align 8, !tbaa !13
  %76 = load i64, ptr %11, align 8, !tbaa !13
  %77 = load i64, ptr %10, align 8, !tbaa !13
  %78 = sub i64 %76, %77
  %79 = sub i64 %78, 2100
  %80 = udiv i64 %79, 1000
  %81 = trunc i64 %80 to i32
  store i32 %81, ptr %8, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %82)
  %84 = call i64 @rc_nanos_thread_time()
  store i64 %84, ptr %10, align 8, !tbaa !13
  %85 = call i32 @rc_matrix_duplicate(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef %16)
  %86 = call i64 @rc_nanos_thread_time()
  store i64 %86, ptr %11, align 8, !tbaa !13
  %87 = load i64, ptr %11, align 8, !tbaa !13
  %88 = load i64, ptr %10, align 8, !tbaa !13
  %89 = sub i64 %87, %88
  %90 = sub i64 %89, 2100
  %91 = udiv i64 %90, 1000
  %92 = trunc i64 %91 to i32
  store i32 %92, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %93)
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = call i32 @rc_matrix_alloc(ptr noundef %17, i32 noundef %95, i32 noundef %96)
  %98 = call i64 @rc_nanos_thread_time()
  store i64 %98, ptr %10, align 8, !tbaa !13
  %99 = call i32 @rc_matrix_multiply(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef byval(%struct.rc_matrix_t) align 8 %16, ptr noundef %17)
  %100 = call i64 @rc_nanos_thread_time()
  store i64 %100, ptr %11, align 8, !tbaa !13
  %101 = load i64, ptr %11, align 8, !tbaa !13
  %102 = load i64, ptr %10, align 8, !tbaa !13
  %103 = sub i64 %101, %102
  %104 = sub i64 %103, 2100
  %105 = udiv i64 %104, 1000
  %106 = trunc i64 %105 to i32
  store i32 %106, ptr %8, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %107)
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = mul i64 2, %110
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = mul i64 %111, %113
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul i64 %114, %116
  %118 = mul i64 %117, 1000000000
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = udiv i64 %118, %120
  store i64 %121, ptr %12, align 8, !tbaa !13
  %122 = load i64, ptr %12, align 8, !tbaa !13
  %123 = udiv i64 %122, 1000000
  %124 = trunc i64 %123 to i32
  store i32 %124, ptr %9, align 4, !tbaa !5
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %125)
  %127 = call i64 @rc_nanos_thread_time()
  store i64 %127, ptr %10, align 8, !tbaa !13
  %128 = call double @rc_matrix_determinant(ptr noundef byval(%struct.rc_matrix_t) align 8 %15)
  %129 = call i64 @rc_nanos_thread_time()
  store i64 %129, ptr %11, align 8, !tbaa !13
  %130 = load i64, ptr %11, align 8, !tbaa !13
  %131 = load i64, ptr %10, align 8, !tbaa !13
  %132 = sub i64 %130, %131
  %133 = sub i64 %132, 2100
  %134 = udiv i64 %133, 1000
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %8, align 4, !tbaa !5
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %136)
  %138 = call i64 @rc_nanos_thread_time()
  store i64 %138, ptr %10, align 8, !tbaa !13
  %139 = call i32 @rc_algebra_invert_matrix(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef %16)
  %140 = call i64 @rc_nanos_thread_time()
  store i64 %140, ptr %11, align 8, !tbaa !13
  %141 = load i64, ptr %11, align 8, !tbaa !13
  %142 = load i64, ptr %10, align 8, !tbaa !13
  %143 = sub i64 %141, %142
  %144 = sub i64 %143, 2100
  %145 = udiv i64 %144, 1000
  %146 = trunc i64 %145 to i32
  store i32 %146, ptr %8, align 4, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %147)
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = call i32 @rc_matrix_alloc(ptr noundef %18, i32 noundef %149, i32 noundef %150)
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = load i32, ptr %6, align 4, !tbaa !5
  %154 = call i32 @rc_matrix_alloc(ptr noundef %19, i32 noundef %152, i32 noundef %153)
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = call i32 @rc_matrix_alloc(ptr noundef %20, i32 noundef %155, i32 noundef %156)
  %158 = call i64 @rc_nanos_thread_time()
  store i64 %158, ptr %10, align 8, !tbaa !13
  %159 = call i32 @rc_algebra_lup_decomp(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  %160 = call i64 @rc_nanos_thread_time()
  store i64 %160, ptr %11, align 8, !tbaa !13
  %161 = load i64, ptr %11, align 8, !tbaa !13
  %162 = load i64, ptr %10, align 8, !tbaa !13
  %163 = sub i64 %161, %162
  %164 = sub i64 %163, 2100
  %165 = udiv i64 %164, 1000
  %166 = trunc i64 %165 to i32
  store i32 %166, ptr %8, align 4, !tbaa !5
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %167)
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = call i32 @rc_matrix_alloc(ptr noundef %21, i32 noundef %169, i32 noundef %170)
  %172 = load i32, ptr %6, align 4, !tbaa !5
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = call i32 @rc_matrix_alloc(ptr noundef %22, i32 noundef %172, i32 noundef %173)
  %175 = call i64 @rc_nanos_thread_time()
  store i64 %175, ptr %10, align 8, !tbaa !13
  %176 = call i32 @rc_algebra_qr_decomp(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef %21, ptr noundef %22)
  %177 = call i64 @rc_nanos_thread_time()
  store i64 %177, ptr %11, align 8, !tbaa !13
  %178 = load i64, ptr %11, align 8, !tbaa !13
  %179 = load i64, ptr %10, align 8, !tbaa !13
  %180 = sub i64 %178, %179
  %181 = sub i64 %180, 2100
  %182 = udiv i64 %181, 1000
  %183 = trunc i64 %182 to i32
  store i32 %183, ptr %8, align 4, !tbaa !5
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %184)
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = call i32 @rc_vector_alloc(ptr noundef %14, i32 noundef %186)
  %188 = call i64 @rc_nanos_thread_time()
  store i64 %188, ptr %10, align 8, !tbaa !13
  %189 = call i32 @rc_algebra_lin_system_solve(ptr noundef byval(%struct.rc_matrix_t) align 8 %15, ptr noundef byval(%struct.rc_vector_t) align 8 %13, ptr noundef %14)
  %190 = call i64 @rc_nanos_thread_time()
  store i64 %190, ptr %11, align 8, !tbaa !13
  %191 = load i64, ptr %11, align 8, !tbaa !13
  %192 = load i64, ptr %10, align 8, !tbaa !13
  %193 = sub i64 %191, %192
  %194 = sub i64 %193, 2100
  %195 = udiv i64 %194, 1000
  %196 = trunc i64 %195 to i32
  store i32 %196, ptr %8, align 4, !tbaa !5
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %197)
  %199 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %200

200:                                              ; preds = %67, %64, %63, %60, %50, %44, %31, %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %201 = load i32, ptr %3, align 4
  ret i32 %201
}

; 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 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare hidden void @__print_usage() #0

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

declare i64 @rc_nanos_thread_time() #3

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

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

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

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

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

declare double @rc_matrix_determinant(ptr noundef byval(%struct.rc_matrix_t) align 8) #3

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

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

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

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

declare i32 @rc_algebra_lin_system_solve(ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_vector_t) align 8, 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 = { inlinehint nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


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

@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@opterr = external local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [34 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.rc_vector_t, align 8
  %4 = alloca %struct.rc_vector_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_matrix_t, align 8
  %11 = alloca %struct.rc_matrix_t, align 8
  %12 = alloca %struct.rc_matrix_t, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  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) #7
  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) #7
  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) #7
  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) #7
  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) #7
  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) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %10, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %12, i8 0, i64 24, i1 false)
  %13 = icmp sgt i32 %0, 3
  br i1 %13, label %14, label %16

14:                                               ; preds = %2
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  tail call void @__print_usage()
  br label %114

16:                                               ; preds = %2
  %17 = icmp slt i32 %0, 2
  br i1 %17, label %18, label %20

18:                                               ; preds = %16
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  tail call void @__print_usage()
  br label %114

20:                                               ; preds = %16
  store i32 0, ptr @opterr, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %.backedge, %20
  %.056 = phi i32 [ 0, %20 ], [ %.056.be, %.backedge ]
  %22 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2) #7
  switch i32 %22, label %36 [
    i32 -1, label %38
    i32 100, label %23
    i32 115, label %26
    i32 104, label %35
  ]

23:                                               ; preds = %21
  %.not61 = icmp eq i32 %.056, 0
  br i1 %.not61, label %.backedge, label %24

.backedge:                                        ; preds = %23, %29
  %.056.be = phi i32 [ %31, %29 ], [ 140, %23 ]
  br label %21, !llvm.loop !9

24:                                               ; preds = %23
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void @__print_usage()
  br label %114

26:                                               ; preds = %21
  %.not60 = icmp eq i32 %.056, 0
  br i1 %.not60, label %29, label %27

27:                                               ; preds = %26
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void @__print_usage()
  br label %114

29:                                               ; preds = %26
  %30 = load ptr, ptr @optarg, align 8, !tbaa !11
  %31 = tail call i32 @atoi(ptr nocapture noundef %30) #8
  %32 = add i32 %31, -501
  %or.cond = icmp ult i32 %32, -500
  br i1 %or.cond, label %33, label %.backedge

33:                                               ; preds = %29
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  tail call void @__print_usage()
  br label %114

35:                                               ; preds = %21
  tail call void @__print_usage()
  br label %114

36:                                               ; preds = %21
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  tail call void @__print_usage()
  br label %114

38:                                               ; preds = %21
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %40 = tail call i64 @rc_nanos_thread_time() #7
  %41 = call i32 @rc_matrix_random(ptr noundef nonnull %5, i32 noundef %.056, i32 noundef %.056) #7
  %42 = call i32 @rc_vector_zeros(ptr noundef nonnull %3, i32 noundef %.056) #7
  %43 = call i64 @rc_nanos_thread_time() #7
  %reass.sub = sub i64 %43, %40
  %44 = add i64 %reass.sub, -2100
  %45 = udiv i64 %44, 1000
  %46 = trunc i64 %45 to i32
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %46)
  %48 = call i64 @rc_nanos_thread_time() #7
  %49 = call i32 @rc_matrix_duplicate(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull %6) #7
  %50 = call i64 @rc_nanos_thread_time() #7
  %reass.sub74 = sub i64 %50, %48
  %51 = add i64 %reass.sub74, -2100
  %52 = udiv i64 %51, 1000
  %53 = trunc i64 %52 to i32
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %53)
  %55 = call i32 @rc_matrix_alloc(ptr noundef nonnull %7, i32 noundef %.056, i32 noundef %.056) #7
  %56 = call i64 @rc_nanos_thread_time() #7
  %57 = call i32 @rc_matrix_multiply(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 %7) #7
  %58 = call i64 @rc_nanos_thread_time() #7
  %reass.sub75 = sub i64 %58, %56
  %59 = add i64 %reass.sub75, -2100
  %60 = udiv i64 %59, 1000
  %61 = trunc i64 %60 to i32
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %61)
  %63 = zext nneg i32 %.056 to i64
  %64 = mul nuw nsw i64 %63, 2000000000
  %65 = mul nuw nsw i64 %64, %63
  %66 = mul nuw nsw i64 %65, %63
  %sext = shl i64 %60, 32
  %67 = ashr exact i64 %sext, 32
  %68 = udiv i64 %66, %67
  %69 = udiv i64 %68, 1000000
  %70 = trunc i64 %69 to i32
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %70)
  %72 = call i64 @rc_nanos_thread_time() #7
  %73 = call double @rc_matrix_determinant(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5) #7
  %74 = call i64 @rc_nanos_thread_time() #7
  %reass.sub76 = sub i64 %74, %72
  %75 = add i64 %reass.sub76, -2100
  %76 = udiv i64 %75, 1000
  %77 = trunc i64 %76 to i32
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %77)
  %79 = call i64 @rc_nanos_thread_time() #7
  %80 = call i32 @rc_algebra_invert_matrix(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull %6) #7
  %81 = call i64 @rc_nanos_thread_time() #7
  %reass.sub77 = sub i64 %81, %79
  %82 = add i64 %reass.sub77, -2100
  %83 = udiv i64 %82, 1000
  %84 = trunc i64 %83 to i32
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %84)
  %86 = call i32 @rc_matrix_alloc(ptr noundef nonnull %8, i32 noundef %.056, i32 noundef %.056) #7
  %87 = call i32 @rc_matrix_alloc(ptr noundef nonnull %9, i32 noundef %.056, i32 noundef %.056) #7
  %88 = call i32 @rc_matrix_alloc(ptr noundef nonnull %10, i32 noundef %.056, i32 noundef %.056) #7
  %89 = call i64 @rc_nanos_thread_time() #7
  %90 = call i32 @rc_algebra_lup_decomp(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10) #7
  %91 = call i64 @rc_nanos_thread_time() #7
  %reass.sub78 = sub i64 %91, %89
  %92 = add i64 %reass.sub78, -2100
  %93 = udiv i64 %92, 1000
  %94 = trunc i64 %93 to i32
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %94)
  %96 = call i32 @rc_matrix_alloc(ptr noundef nonnull %11, i32 noundef %.056, i32 noundef %.056) #7
  %97 = call i32 @rc_matrix_alloc(ptr noundef nonnull %12, i32 noundef %.056, i32 noundef %.056) #7
  %98 = call i64 @rc_nanos_thread_time() #7
  %99 = call i32 @rc_algebra_qr_decomp(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull %11, ptr noundef nonnull %12) #7
  %100 = call i64 @rc_nanos_thread_time() #7
  %reass.sub79 = sub i64 %100, %98
  %101 = add i64 %reass.sub79, -2100
  %102 = udiv i64 %101, 1000
  %103 = trunc i64 %102 to i32
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %103)
  %105 = call i32 @rc_vector_alloc(ptr noundef nonnull %4, i32 noundef %.056) #7
  %106 = call i64 @rc_nanos_thread_time() #7
  %107 = call i32 @rc_algebra_lin_system_solve(ptr noundef nonnull byval(%struct.rc_matrix_t) align 8 %5, ptr noundef nonnull byval(%struct.rc_vector_t) align 8 %3, ptr noundef nonnull %4) #7
  %108 = call i64 @rc_nanos_thread_time() #7
  %reass.sub80 = sub i64 %108, %106
  %109 = add i64 %reass.sub80, -2100
  %110 = udiv i64 %109, 1000
  %111 = trunc i64 %110 to i32
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %111)
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  br label %114

114:                                              ; preds = %38, %36, %35, %33, %27, %24, %18, %14
  %.0 = phi i32 [ -1, %14 ], [ -1, %18 ], [ -1, %36 ], [ 0, %35 ], [ -1, %27 ], [ -1, %33 ], [ -1, %24 ], [ 0, %38 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret i32 %.0
}

; 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

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

; Function Attrs: nounwind uwtable
declare hidden void @__print_usage() local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #5

declare i64 @rc_nanos_thread_time() local_unnamed_addr #6

declare i32 @rc_matrix_random(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

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

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

declare i32 @rc_matrix_alloc(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

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

declare double @rc_matrix_determinant(ptr noundef byval(%struct.rc_matrix_t) align 8) local_unnamed_addr #6

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

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

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

declare i32 @rc_vector_alloc(ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @rc_algebra_lin_system_solve(ptr noundef byval(%struct.rc_matrix_t) align 8, ptr noundef byval(%struct.rc_vector_t) align 8, ptr noundef) local_unnamed_addr #6

; 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 = { 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 #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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass