; LLVM IR from ljm941004/HYPERCV_PUBLIC :: modules/process/src/c_src (spectralprocess)

; 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.HyperMat = type { i32, i32, i32, i32, [3 x i8], ptr, ptr }
%struct.SIMPLE_MAT = type { i32, i32, i32, i32, i32, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @spectrum_SAM_match(ptr noundef %0, ptr noundef %1, float noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store float %2, ptr %6, align 4, !tbaa !9
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  br label %27

23:                                               ; preds = %3
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

27:                                               ; preds = %22
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.HyperMat, ptr %28, i32 0, i32 4
  %30 = getelementptr inbounds [3 x i8], ptr %29, i64 0, i64 0
  %31 = call i32 @cmpstr(ptr noundef %30, ptr noundef @.str.3)
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  br label %38

34:                                               ; preds = %27
  %35 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

38:                                               ; preds = %33
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  br label %46

42:                                               ; preds = %38
  %43 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.HyperMat, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !11
  store i32 %49, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.HyperMat, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !15
  store i32 %52, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.HyperMat, ptr %53, i32 0, i32 2
  %55 = load i32, ptr %54, align 8, !tbaa !16
  store i32 %55, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.HyperMat, ptr %56, i32 0, i32 3
  %58 = load i32, ptr %57, align 4, !tbaa !17
  %59 = call i32 @get_elemsize(i32 noundef %58)
  store i32 %59, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %60 = load i32, ptr %8, align 4, !tbaa !14
  %61 = load i32, ptr %7, align 4, !tbaa !14
  %62 = call ptr @create_simple_mat(i32 noundef %60, i32 noundef %61, i32 noundef 1, i32 noundef 1)
  store ptr %62, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %63 = load i32, ptr %9, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = mul i64 4, %64
  %66 = call noalias ptr @malloc(i64 noundef %65) #9
  store ptr %66, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !14
  br label %67

67:                                               ; preds = %140, %46
  %68 = load i32, ptr %15, align 4, !tbaa !14
  %69 = load i32, ptr %8, align 4, !tbaa !14
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %143

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !14
  br label %73

73:                                               ; preds = %136, %72
  %74 = load i32, ptr %17, align 4, !tbaa !14
  %75 = load i32, ptr %7, align 4, !tbaa !14
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %139

78:                                               ; preds = %73
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.HyperMat, ptr %79, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !18
  %82 = load i32, ptr %15, align 4, !tbaa !14
  %83 = load i32, ptr %7, align 4, !tbaa !14
  %84 = mul nsw i32 %82, %83
  %85 = load i32, ptr %9, align 4, !tbaa !14
  %86 = mul nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds float, ptr %81, i64 %87
  %89 = load i32, ptr %17, align 4, !tbaa !14
  %90 = load i32, ptr %9, align 4, !tbaa !14
  %91 = mul nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds float, ptr %88, i64 %92
  store ptr %93, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %94

94:                                               ; preds = %109, %78
  %95 = load i32, ptr %18, align 4, !tbaa !14
  %96 = load i32, ptr %9, align 4, !tbaa !14
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %112

99:                                               ; preds = %94
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = load i32, ptr %18, align 4, !tbaa !14
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds float, ptr %100, i64 %102
  %104 = load float, ptr %103, align 4, !tbaa !9
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = load i32, ptr %18, align 4, !tbaa !14
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds float, ptr %105, i64 %107
  store float %104, ptr %108, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %99
  %110 = load i32, ptr %18, align 4, !tbaa !14
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %18, align 4, !tbaa !14
  br label %94, !llvm.loop !19

112:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !14
  %116 = call float @spectral_angle_mapper(ptr noundef %113, ptr noundef %114, i32 noundef %115)
  store float %116, ptr %19, align 4, !tbaa !9
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %117, i32 0, i32 5
  %119 = load ptr, ptr %118, align 8, !tbaa !21
  %120 = load i32, ptr %15, align 4, !tbaa !14
  %121 = load i32, ptr %7, align 4, !tbaa !14
  %122 = mul nsw i32 %120, %121
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %119, i64 %123
  %125 = load i32, ptr %17, align 4, !tbaa !14
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  store ptr %127, ptr %13, align 8, !tbaa !5
  %128 = load float, ptr %19, align 4, !tbaa !9
  %129 = load float, ptr %6, align 4, !tbaa !9
  %130 = fcmp oge float %128, %129
  br i1 %130, label %131, label %133

131:                                              ; preds = %112
  %132 = load ptr, ptr %13, align 8, !tbaa !5
  store i8 1, ptr %132, align 1, !tbaa !23
  br label %135

133:                                              ; preds = %112
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  store i8 0, ptr %134, align 1, !tbaa !23
  br label %135

135:                                              ; preds = %133, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %17, align 4, !tbaa !14
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %17, align 4, !tbaa !14
  br label %73, !llvm.loop !24

139:                                              ; preds = %77
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %15, align 4, !tbaa !14
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %15, align 4, !tbaa !14
  br label %67, !llvm.loop !25

143:                                              ; preds = %71
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %144) #8
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret ptr %145
}

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

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

declare i32 @cmpstr(ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @get_elemsize(i32 noundef) #4

declare ptr @create_simple_mat(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local float @spectral_angle_mapper(ptr noundef, ptr noundef, i32 noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { inlinehint 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 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 #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !7, i64 16, !6, i64 24, !6, i64 32}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!12, !13, i64 8}
!17 = !{!12, !13, i64 12}
!18 = !{!12, !6, i64 24}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !6, i64 24}
!22 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !6, i64 24}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !20}
!25 = distinct !{!25, !20}


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

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @spectrum_SAM_match(ptr noundef %0, ptr noundef %1, float noundef %2) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %8

4:                                                ; preds = %3
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #7
  unreachable

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = tail call i32 @cmpstr(ptr noundef nonnull %9, ptr noundef nonnull @.str.3) #8
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %16, label %12

12:                                               ; preds = %8
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #7
  unreachable

16:                                               ; preds = %8
  %.not47 = icmp eq ptr %1, null
  br i1 %.not47, label %17, label %21

17:                                               ; preds = %16
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #7
  unreachable

21:                                               ; preds = %16
  %22 = load i32, ptr %0, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %0, i64 12
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = tail call i32 @get_elemsize(i32 noundef %28)
  %30 = tail call ptr @create_simple_mat(i32 noundef %24, i32 noundef %22, i32 noundef 1, i32 noundef 1) #8
  %31 = sext i32 %26 to i64
  %32 = shl nsw i64 %31, 2
  %33 = tail call noalias ptr @malloc(i64 noundef %32) #9
  %34 = ptrtoint ptr %33 to i64
  %35 = icmp sgt i32 %24, 0
  br i1 %35, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %21
  %36 = icmp sgt i32 %22, 0
  %37 = getelementptr inbounds i8, ptr %0, i64 24
  %38 = getelementptr inbounds i8, ptr %30, i64 24
  br i1 %36, label %.preheader.lr.ph.split.us, label %._crit_edge

.preheader.lr.ph.split.us:                        ; preds = %.preheader.lr.ph
  %39 = icmp sgt i32 %26, 0
  br i1 %39, label %.preheader.us.us.preheader, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph.split.us
  %40 = zext nneg i32 %22 to i64
  %wide.trip.count63 = zext nneg i32 %24 to i64
  br label %.preheader.us

.preheader.us.us.preheader:                       ; preds = %.preheader.lr.ph.split.us
  %41 = zext nneg i32 %26 to i64
  %42 = zext nneg i32 %22 to i64
  %wide.trip.count78 = zext nneg i32 %24 to i64
  %43 = mul nuw nsw i64 %42, %41
  %44 = mul i64 %43, -4
  %45 = mul nsw i64 %41, -4
  %min.iters.check = icmp ult i32 %26, 8
  %n.vec = and i64 %41, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %41
  %xtraiter = and i64 %41, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us.us

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %._crit_edge51.split.us.us.us
  %indvars.iv75 = phi i64 [ 0, %.preheader.us.us.preheader ], [ %indvars.iv.next76, %._crit_edge51.split.us.us.us ]
  %46 = mul i64 %44, %indvars.iv75
  %47 = add i64 %46, %34
  %48 = mul nuw nsw i64 %indvars.iv75, %42
  %49 = mul nuw nsw i64 %48, %41
  br label %.lr.ph.us.us.us

.lr.ph.us.us.us:                                  ; preds = %._crit_edge.us.us.us, %.preheader.us.us
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %._crit_edge.us.us.us ], [ 0, %.preheader.us.us ]
  %50 = load ptr, ptr %37, align 8, !tbaa !14
  %51 = getelementptr inbounds float, ptr %50, i64 %49
  %52 = mul nuw nsw i64 %indvars.iv70, %41
  %53 = getelementptr inbounds float, ptr %51, i64 %52
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph.us.us.us
  %54 = ptrtoint ptr %50 to i64
  %55 = mul i64 %45, %indvars.iv70
  %56 = add i64 %47, %55
  %57 = sub i64 %56, %54
  %diff.check = icmp ult i64 %57, 32
  br i1 %diff.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.memcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
  %58 = getelementptr inbounds float, ptr %53, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load = load <4 x float>, ptr %58, align 4, !tbaa !15
  %wide.load82 = load <4 x float>, ptr %59, align 4, !tbaa !15
  %60 = getelementptr inbounds float, ptr %33, i64 %index
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  store <4 x float> %wide.load, ptr %60, align 4, !tbaa !15
  store <4 x float> %wide.load82, ptr %61, align 4, !tbaa !15
  %index.next = add nuw i64 %index, 8
  %62 = icmp eq i64 %index.next, %n.vec
  br i1 %62, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.us.us.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph.us.us.us
  %indvars.iv65.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.us.us.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv65.prol = phi i64 [ %indvars.iv.next66.prol, %scalar.ph.prol ], [ %indvars.iv65.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %63 = getelementptr inbounds float, ptr %53, i64 %indvars.iv65.prol
  %64 = load float, ptr %63, align 4, !tbaa !15
  %65 = getelementptr inbounds float, ptr %33, i64 %indvars.iv65.prol
  store float %64, ptr %65, align 4, !tbaa !15
  %indvars.iv.next66.prol = add nuw nsw i64 %indvars.iv65.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !21

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv65.unr = phi i64 [ %indvars.iv65.ph, %scalar.ph.preheader ], [ %indvars.iv.next66.prol, %scalar.ph.prol ]
  %66 = sub nsw i64 %indvars.iv65.ph, %41
  %67 = icmp ugt i64 %66, -4
  br i1 %67, label %._crit_edge.us.us.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv65 = phi i64 [ %indvars.iv.next66.3, %scalar.ph ], [ %indvars.iv65.unr, %scalar.ph.prol.loopexit ]
  %68 = getelementptr inbounds float, ptr %53, i64 %indvars.iv65
  %69 = load float, ptr %68, align 4, !tbaa !15
  %70 = getelementptr inbounds float, ptr %33, i64 %indvars.iv65
  store float %69, ptr %70, align 4, !tbaa !15
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %71 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next66
  %72 = load float, ptr %71, align 4, !tbaa !15
  %73 = getelementptr inbounds float, ptr %33, i64 %indvars.iv.next66
  store float %72, ptr %73, align 4, !tbaa !15
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %74 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next66.1
  %75 = load float, ptr %74, align 4, !tbaa !15
  %76 = getelementptr inbounds float, ptr %33, i64 %indvars.iv.next66.1
  store float %75, ptr %76, align 4, !tbaa !15
  %indvars.iv.next66.2 = add nuw nsw i64 %indvars.iv65, 3
  %77 = getelementptr inbounds float, ptr %53, i64 %indvars.iv.next66.2
  %78 = load float, ptr %77, align 4, !tbaa !15
  %79 = getelementptr inbounds float, ptr %33, i64 %indvars.iv.next66.2
  store float %78, ptr %79, align 4, !tbaa !15
  %indvars.iv.next66.3 = add nuw nsw i64 %indvars.iv65, 4
  %exitcond69.not.3 = icmp eq i64 %indvars.iv.next66.3, %41
  br i1 %exitcond69.not.3, label %._crit_edge.us.us.us, label %scalar.ph, !llvm.loop !23

._crit_edge.us.us.us:                             ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %80 = tail call float @spectral_angle_mapper(ptr noundef nonnull %33, ptr noundef nonnull %1, i32 noundef %26)
  %81 = load ptr, ptr %38, align 8, !tbaa !24
  %82 = getelementptr inbounds i8, ptr %81, i64 %48
  %83 = getelementptr inbounds i8, ptr %82, i64 %indvars.iv70
  %84 = fcmp oge float %80, %2
  %..us.us.us = zext i1 %84 to i8
  store i8 %..us.us.us, ptr %83, align 1, !tbaa !26
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %42
  br i1 %exitcond74.not, label %._crit_edge51.split.us.us.us, label %.lr.ph.us.us.us, !llvm.loop !27

._crit_edge51.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge, label %.preheader.us.us, !llvm.loop !28

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge51.split.us55
  %indvars.iv60 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next61, %._crit_edge51.split.us55 ]
  %85 = mul nuw nsw i64 %indvars.iv60, %40
  br label %86

86:                                               ; preds = %.preheader.us, %86
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %86 ]
  %87 = tail call float @spectral_angle_mapper(ptr noundef %33, ptr noundef nonnull %1, i32 noundef %26)
  %88 = load ptr, ptr %38, align 8, !tbaa !24
  %89 = getelementptr inbounds i8, ptr %88, i64 %85
  %90 = getelementptr inbounds i8, ptr %89, i64 %indvars.iv
  %91 = fcmp oge float %87, %2
  %..us54 = zext i1 %91 to i8
  store i8 %..us54, ptr %90, align 1, !tbaa !26
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %40
  br i1 %exitcond.not, label %._crit_edge51.split.us55, label %86, !llvm.loop !27

._crit_edge51.split.us55:                         ; preds = %86
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63
  br i1 %exitcond64.not, label %._crit_edge, label %.preheader.us, !llvm.loop !28

._crit_edge:                                      ; preds = %._crit_edge51.split.us55, %._crit_edge51.split.us.us.us, %.preheader.lr.ph, %21
  tail call void @free(ptr noundef %33) #8
  ret ptr %30
}

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @get_elemsize(i32 noundef) local_unnamed_addr #4

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

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

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

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

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 = { 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 = { "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 = { inlinehint 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 = { 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 #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !8, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !10, i64 24}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !18, !19}
!24 = !{!25, !10, i64 24}
!25 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24}
!26 = !{!8, !8, i64 0}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass