; LLVM IR from bbrister/SIFT3D :: sift3d (sift)

; 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._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }
%struct._Keypoint_store = type { ptr, %struct._Slab, i32, i32, i32 }
%struct._Slab = type { ptr, i64, i64 }
%struct._Keypoint = type { [9 x float], %struct._Mat_rm, double, double, double, double, i32, i32 }

; 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

declare i32 @init_Mat_rm(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @cleanup_Mat_rm(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @write_Keypoint_store(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct._Mat_rm, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 2, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 3, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  store i32 4, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 5, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 9, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._Keypoint_store, ptr %23, i32 0, i32 1
  %25 = getelementptr inbounds %struct._Slab, ptr %24, i32 0, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = trunc i64 %26 to i32
  store i32 %27, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 14, ptr %18, align 4, !tbaa !9
  %28 = load i32, ptr %17, align 4, !tbaa !9
  %29 = call i32 @init_Mat_rm(ptr noundef %6, i32 noundef %28, i32 noundef 14, i32 noundef 0, i32 noundef 0)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %2
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %171

32:                                               ; preds = %2
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %161, %32
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = load i32, ptr %17, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %37, label %164

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._Keypoint_store, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct._Keypoint, ptr %40, i64 %42
  store ptr %43, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %44 = load ptr, ptr %20, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._Keypoint, ptr %44, i32 0, i32 1
  store ptr %45, ptr %21, align 8, !tbaa !5
  %46 = load ptr, ptr %20, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct._Keypoint, ptr %46, i32 0, i32 2
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %53 = load i32, ptr %52, align 8, !tbaa !21
  %54 = mul nsw i32 %51, %53
  %55 = add nsw i32 0, %54
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %50, i64 %56
  store double %48, ptr %57, align 8, !tbaa !22
  %58 = load ptr, ptr %20, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._Keypoint, ptr %58, i32 0, i32 3
  %60 = load double, ptr %59, align 8, !tbaa !23
  %61 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %65 = load i32, ptr %64, align 8, !tbaa !21
  %66 = mul nsw i32 %63, %65
  %67 = add nsw i32 1, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds double, ptr %62, i64 %68
  store double %60, ptr %69, align 8, !tbaa !22
  %70 = load ptr, ptr %20, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._Keypoint, ptr %70, i32 0, i32 4
  %72 = load double, ptr %71, align 8, !tbaa !24
  %73 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %77 = load i32, ptr %76, align 8, !tbaa !21
  %78 = mul nsw i32 %75, %77
  %79 = add nsw i32 2, %78
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds double, ptr %74, i64 %80
  store double %72, ptr %81, align 8, !tbaa !22
  %82 = load ptr, ptr %20, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._Keypoint, ptr %82, i32 0, i32 6
  %84 = load i32, ptr %83, align 8, !tbaa !25
  %85 = sitofp i32 %84 to double
  %86 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !20
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !21
  %91 = mul nsw i32 %88, %90
  %92 = add nsw i32 3, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %87, i64 %93
  store double %85, ptr %94, align 8, !tbaa !22
  %95 = load ptr, ptr %20, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._Keypoint, ptr %95, i32 0, i32 5
  %97 = load double, ptr %96, align 8, !tbaa !26
  %98 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = load i32, ptr %7, align 4, !tbaa !9
  %101 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %102 = load i32, ptr %101, align 8, !tbaa !21
  %103 = mul nsw i32 %100, %102
  %104 = add nsw i32 4, %103
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %99, i64 %105
  store double %97, ptr %106, align 8, !tbaa !22
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %157, %37
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = load ptr, ptr %21, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct._Mat_rm, ptr %109, i32 0, i32 3
  %111 = load i32, ptr %110, align 4, !tbaa !27
  %112 = icmp slt i32 %108, %111
  br i1 %112, label %113, label %160

113:                                              ; preds = %107
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %153, %113
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = load ptr, ptr %21, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._Mat_rm, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 8, !tbaa !21
  %119 = icmp slt i32 %115, %118
  br i1 %119, label %120, label %156

120:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %121 = load i32, ptr %9, align 4, !tbaa !9
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = load ptr, ptr %21, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._Mat_rm, ptr %123, i32 0, i32 2
  %125 = load i32, ptr %124, align 8, !tbaa !21
  %126 = mul nsw i32 %122, %125
  %127 = add nsw i32 %121, %126
  %128 = add nsw i32 5, %127
  store i32 %128, ptr %22, align 4, !tbaa !9
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._Mat_rm, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = load ptr, ptr %21, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._Mat_rm, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 8, !tbaa !21
  %137 = mul nsw i32 %133, %136
  %138 = add nsw i32 %132, %137
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds float, ptr %131, i64 %139
  %141 = load float, ptr %140, align 4, !tbaa !28
  %142 = fpext float %141 to double
  %143 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !20
  %145 = load i32, ptr %22, align 4, !tbaa !9
  %146 = load i32, ptr %7, align 4, !tbaa !9
  %147 = getelementptr inbounds %struct._Mat_rm, ptr %6, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !21
  %149 = mul nsw i32 %146, %148
  %150 = add nsw i32 %145, %149
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %144, i64 %151
  store double %142, ptr %152, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %153

153:                                              ; preds = %120
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %9, align 4, !tbaa !9
  br label %114, !llvm.loop !30

156:                                              ; preds = %114
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %8, align 4, !tbaa !9
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %8, align 4, !tbaa !9
  br label %107, !llvm.loop !32

160:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %7, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %7, align 4, !tbaa !9
  br label %33, !llvm.loop !33

164:                                              ; preds = %33
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = call i32 @write_Mat_rm(ptr noundef %165, ptr noundef %6)
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %164
  br label %170

169:                                              ; preds = %164
  call void @cleanup_Mat_rm(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %171

170:                                              ; preds = %168
  call void @cleanup_Mat_rm(ptr noundef %6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %171

171:                                              ; preds = %170, %169, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #3
  %172 = load i32, ptr %3, align 4
  ret i32 %172
}

declare i32 @write_Mat_rm(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !14, i64 16}
!12 = !{!"_Keypoint_store", !6, i64 0, !13, i64 8, !10, i64 32, !10, i64 36, !10, i64 40}
!13 = !{!"_Slab", !6, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!12, !6, i64 0}
!16 = !{!17, !19, i64 72}
!17 = !{!"_Keypoint", !7, i64 0, !18, i64 40, !19, i64 72, !19, i64 80, !19, i64 88, !19, i64 96, !10, i64 104, !10, i64 108}
!18 = !{!"_Mat_rm", !7, i64 0, !14, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!19 = !{!"double", !7, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!18, !10, i64 16}
!22 = !{!19, !19, i64 0}
!23 = !{!17, !19, i64 80}
!24 = !{!17, !19, i64 88}
!25 = !{!17, !10, i64 104}
!26 = !{!17, !19, i64 96}
!27 = !{!18, !10, i64 20}
!28 = !{!29, !29, i64 0}
!29 = !{!"float", !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = distinct !{!33, !31}


; 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._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }
%struct._Keypoint = type { [9 x float], %struct._Mat_rm, double, double, double, double, i32, i32 }

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

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

declare i32 @init_Mat_rm(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @cleanup_Mat_rm(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @write_Keypoint_store(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = alloca %struct._Mat_rm, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #3
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = trunc i64 %5 to i32
  %7 = call i32 @init_Mat_rm(ptr noundef nonnull %3, i32 noundef %6, i32 noundef 14, i32 noundef 0, i32 noundef 0) #3
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %.preheader39, label %80

.preheader39:                                     ; preds = %2
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader39
  %9 = load ptr, ptr %1, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %3, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !14
  %12 = sext i32 %11 to i64
  %wide.trip.count54 = and i64 %5, 2147483647
  br label %13

13:                                               ; preds = %.lr.ph, %._crit_edge42
  %indvars.iv51 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next52, %._crit_edge42 ]
  %14 = getelementptr inbounds %struct._Keypoint, ptr %9, i64 %indvars.iv51
  %15 = getelementptr inbounds i8, ptr %14, i64 40
  %16 = getelementptr inbounds i8, ptr %14, i64 72
  %17 = load double, ptr %16, align 8, !tbaa !16
  %18 = load ptr, ptr %3, align 8, !tbaa !19
  %19 = mul nsw i64 %indvars.iv51, %12
  %20 = getelementptr inbounds double, ptr %18, i64 %19
  store double %17, ptr %20, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %14, i64 80
  %22 = load double, ptr %21, align 8, !tbaa !21
  %23 = load ptr, ptr %3, align 8, !tbaa !19
  %24 = getelementptr double, ptr %23, i64 %19
  %25 = getelementptr i8, ptr %24, i64 8
  store double %22, ptr %25, align 8, !tbaa !20
  %26 = getelementptr inbounds i8, ptr %14, i64 88
  %27 = load double, ptr %26, align 8, !tbaa !22
  %28 = load ptr, ptr %3, align 8, !tbaa !19
  %29 = getelementptr double, ptr %28, i64 %19
  %30 = getelementptr i8, ptr %29, i64 16
  store double %27, ptr %30, align 8, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %14, i64 104
  %32 = load i32, ptr %31, align 8, !tbaa !23
  %33 = sitofp i32 %32 to double
  %34 = load ptr, ptr %3, align 8, !tbaa !19
  %35 = getelementptr double, ptr %34, i64 %19
  %36 = getelementptr i8, ptr %35, i64 24
  store double %33, ptr %36, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %14, i64 96
  %38 = load double, ptr %37, align 8, !tbaa !24
  %39 = load ptr, ptr %3, align 8, !tbaa !19
  %40 = getelementptr double, ptr %39, i64 %19
  %41 = getelementptr i8, ptr %40, i64 32
  store double %38, ptr %41, align 8, !tbaa !20
  %42 = getelementptr inbounds i8, ptr %14, i64 60
  %43 = load i32, ptr %42, align 4, !tbaa !25
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.preheader.lr.ph, label %._crit_edge42

.preheader.lr.ph:                                 ; preds = %13
  %45 = getelementptr inbounds i8, ptr %14, i64 56
  %46 = load i32, ptr %45, align 8, !tbaa !14
  %47 = icmp sgt i32 %46, 0
  %48 = add i64 %19, 5
  br i1 %47, label %.preheader.us.preheader, label %._crit_edge42

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %49 = zext nneg i32 %46 to i64
  %wide.trip.count49 = zext nneg i32 %43 to i64
  %wide.trip.count = zext nneg i32 %46 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %50 = icmp eq i32 %46, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv46 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next47, %._crit_edge.us ]
  %51 = mul nuw nsw i64 %indvars.iv46, %49
  br i1 %50, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %52 = add nuw nsw i64 %51, %indvars.iv
  %53 = load ptr, ptr %15, align 8, !tbaa !19
  %54 = getelementptr inbounds float, ptr %53, i64 %52
  %55 = load float, ptr %54, align 4, !tbaa !26
  %56 = fpext float %55 to double
  %57 = load ptr, ptr %3, align 8, !tbaa !19
  %58 = add i64 %48, %52
  %sext = shl i64 %58, 32
  %59 = ashr exact i64 %sext, 29
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  store double %56, ptr %60, align 8, !tbaa !20
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %61 = add nuw nsw i64 %51, %indvars.iv.next
  %62 = load ptr, ptr %15, align 8, !tbaa !19
  %63 = getelementptr inbounds float, ptr %62, i64 %61
  %64 = load float, ptr %63, align 4, !tbaa !26
  %65 = fpext float %64 to double
  %66 = load ptr, ptr %3, align 8, !tbaa !19
  %67 = add i64 %48, %61
  %sext.1 = shl i64 %67, 32
  %68 = ashr exact i64 %sext.1, 29
  %69 = getelementptr inbounds i8, ptr %66, i64 %68
  store double %65, ptr %69, align 8, !tbaa !20
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !28

._crit_edge.us.unr-lcssa:                         ; preds = %.preheader.us.new, %.preheader.us
  %indvars.iv.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next.1, %.preheader.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %._crit_edge.us.epilog-lcssa

._crit_edge.us.epilog-lcssa:                      ; preds = %._crit_edge.us.unr-lcssa
  %70 = add nuw nsw i64 %51, %indvars.iv.unr
  %71 = load ptr, ptr %15, align 8, !tbaa !19
  %72 = getelementptr inbounds float, ptr %71, i64 %70
  %73 = load float, ptr %72, align 4, !tbaa !26
  %74 = fpext float %73 to double
  %75 = load ptr, ptr %3, align 8, !tbaa !19
  %76 = add i64 %48, %70
  %sext.epil = shl i64 %76, 32
  %77 = ashr exact i64 %sext.epil, 29
  %78 = getelementptr inbounds i8, ptr %75, i64 %77
  store double %74, ptr %78, align 8, !tbaa !20
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.unr-lcssa, %._crit_edge.us.epilog-lcssa
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next47, %wide.trip.count49
  br i1 %exitcond50.not, label %._crit_edge42, label %.preheader.us, !llvm.loop !30

._crit_edge42:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %13
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count54
  br i1 %exitcond55.not, label %._crit_edge, label %13, !llvm.loop !31

._crit_edge:                                      ; preds = %._crit_edge42, %.preheader39
  %79 = call i32 @write_Mat_rm(ptr noundef %0, ptr noundef nonnull %3) #3
  %.not38 = icmp ne i32 %79, 0
  call void @cleanup_Mat_rm(ptr noundef nonnull %3) #3
  %. = sext i1 %.not38 to i32
  br label %80

80:                                               ; preds = %._crit_edge, %2
  %.0 = phi i32 [ -1, %2 ], [ %., %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #3
  ret i32 %.0
}

declare i32 @write_Mat_rm(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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, !11, i64 16}
!6 = !{!"_Keypoint_store", !7, i64 0, !10, i64 8, !12, i64 32, !12, i64 36, !12, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Slab", !7, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"long", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !12, i64 16}
!15 = !{!"_Mat_rm", !8, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!16 = !{!17, !18, i64 72}
!17 = !{!"_Keypoint", !8, i64 0, !15, i64 40, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !12, i64 104, !12, i64 108}
!18 = !{!"double", !8, i64 0}
!19 = !{!8, !8, i64 0}
!20 = !{!18, !18, i64 0}
!21 = !{!17, !18, i64 80}
!22 = !{!17, !18, i64 88}
!23 = !{!17, !12, i64 104}
!24 = !{!17, !18, i64 96}
!25 = !{!15, !12, i64 20}
!26 = !{!27, !27, i64 0}
!27 = !{!"float", !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}


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