; LLVM IR from ox-vgg/vise :: src/search_engine/relja_retrival/external/KMCode_relja/descriptor (Corner)

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

%class.ImageContent = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%class.Corner = type { i32, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, i32, float, i32, i32 }

@patch_mask = external dso_local global ptr, align 8

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15smoothHistogramPfi(ptr noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z10interpPeakfff(float noundef, float noundef, float noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr noundef nonnull align 4 dereferenceable(88) %0, ptr noundef %1, ptr noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, 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 [36 x float], align 16
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %29, label %26

26:                                               ; preds = %3
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %26, %3
  br label %213

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 144, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store float 0.000000e+00, ptr %21, align 4, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %31)
  %33 = lshr i32 %32, 1
  store i32 %33, ptr %10, align 4, !tbaa !11
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %34)
  %36 = lshr i32 %35, 1
  store i32 %36, ptr %11, align 4, !tbaa !11
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %37)
  store i32 %38, ptr %12, align 4, !tbaa !11
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %39)
  store i32 %40, ptr %13, align 4, !tbaa !11
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %48, %30
  %42 = load i32, ptr %7, align 4, !tbaa !11
  %43 = icmp slt i32 %42, 36
  br i1 %43, label %44, label %51

44:                                               ; preds = %41
  %45 = load i32, ptr %7, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %46
  store float 0.000000e+00, ptr %47, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %7, align 4, !tbaa !11
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %7, align 4, !tbaa !11
  br label %41, !llvm.loop !13

51:                                               ; preds = %41
  store i32 1, ptr %8, align 4, !tbaa !11
  br label %52

52:                                               ; preds = %139, %51
  %53 = load i32, ptr %8, align 4, !tbaa !11
  %54 = load i32, ptr %12, align 4, !tbaa !11
  %55 = sub nsw i32 %54, 1
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %57, label %142

57:                                               ; preds = %52
  store i32 1, ptr %9, align 4, !tbaa !11
  br label %58

58:                                               ; preds = %135, %57
  %59 = load i32, ptr %9, align 4, !tbaa !11
  %60 = load i32, ptr %13, align 4, !tbaa !11
  %61 = sub nsw i32 %60, 1
  %62 = icmp sle i32 %59, %61
  br i1 %62, label %63, label %138

63:                                               ; preds = %58
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %class.ImageContent, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = load i32, ptr %8, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds float, ptr %70, i64 %72
  %74 = load float, ptr %73, align 4, !tbaa !9
  store float %74, ptr %18, align 4, !tbaa !9
  %75 = load float, ptr %18, align 4, !tbaa !9
  %76 = fpext float %75 to double
  %77 = fcmp ogt double %76, 1.000000e+00
  br i1 %77, label %78, label %134

78:                                               ; preds = %63
  %79 = load ptr, ptr @patch_mask, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.ImageContent, ptr %79, i32 0, i32 4
  %81 = load ptr, ptr %80, align 8, !tbaa !15
  %82 = load i32, ptr %8, align 4, !tbaa !11
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds float, ptr %85, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !9
  %90 = fcmp ogt float %89, 0.000000e+00
  br i1 %90, label %91, label %134

91:                                               ; preds = %78
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %class.ImageContent, ptr %92, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = load i32, ptr %8, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds ptr, ptr %94, i64 %96
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds float, ptr %98, i64 %100
  %102 = load float, ptr %101, align 4, !tbaa !9
  store float %102, ptr %19, align 4, !tbaa !9
  %103 = load float, ptr %19, align 4, !tbaa !9
  %104 = fpext float %103 to double
  %105 = fadd double %104, 0x400921FB54442D18
  %106 = fadd double %105, 1.000000e-03
  %107 = fmul double 3.600000e+01, %106
  %108 = fdiv double %107, 0x401921FB54442D18
  %109 = fptosi double %108 to i32
  store i32 %109, ptr %14, align 4, !tbaa !11
  %110 = load i32, ptr %14, align 4, !tbaa !11
  %111 = icmp slt i32 %110, 35
  br i1 %111, label %112, label %114

112:                                              ; preds = %91
  %113 = load i32, ptr %14, align 4, !tbaa !11
  br label %115

114:                                              ; preds = %91
  br label %115

115:                                              ; preds = %114, %112
  %116 = phi i32 [ %113, %112 ], [ 35, %114 ]
  store i32 %116, ptr %14, align 4, !tbaa !11
  %117 = load float, ptr %18, align 4, !tbaa !9
  %118 = load ptr, ptr @patch_mask, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.ImageContent, ptr %118, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !15
  %121 = load i32, ptr %8, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i32, ptr %9, align 4, !tbaa !11
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds float, ptr %124, i64 %126
  %128 = load float, ptr %127, align 4, !tbaa !9
  %129 = load i32, ptr %14, align 4, !tbaa !11
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %130
  %132 = load float, ptr %131, align 4, !tbaa !9
  %133 = call float @llvm.fmuladd.f32(float %117, float %128, float %132)
  store float %133, ptr %131, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %115, %78, %63
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %9, align 4, !tbaa !11
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %9, align 4, !tbaa !11
  br label %58, !llvm.loop !17

138:                                              ; preds = %58
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %8, align 4, !tbaa !11
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %8, align 4, !tbaa !11
  br label %52, !llvm.loop !18

142:                                              ; preds = %52
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %143

143:                                              ; preds = %148, %142
  %144 = load i32, ptr %7, align 4, !tbaa !11
  %145 = icmp slt i32 %144, 6
  br i1 %145, label %146, label %151

146:                                              ; preds = %143
  %147 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 0
  call void @_Z15smoothHistogramPfi(ptr noundef %147, i32 noundef 36)
  br label %148

148:                                              ; preds = %146
  %149 = load i32, ptr %7, align 4, !tbaa !11
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %7, align 4, !tbaa !11
  br label %143, !llvm.loop !19

151:                                              ; preds = %143
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 -1, ptr %22, align 4, !tbaa !11
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %152

152:                                              ; preds = %169, %151
  %153 = load i32, ptr %7, align 4, !tbaa !11
  %154 = icmp slt i32 %153, 36
  br i1 %154, label %155, label %172

155:                                              ; preds = %152
  %156 = load i32, ptr %7, align 4, !tbaa !11
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %157
  %159 = load float, ptr %158, align 4, !tbaa !9
  %160 = load float, ptr %21, align 4, !tbaa !9
  %161 = fcmp ogt float %159, %160
  br i1 %161, label %162, label %168

162:                                              ; preds = %155
  %163 = load i32, ptr %7, align 4, !tbaa !11
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %164
  %166 = load float, ptr %165, align 4, !tbaa !9
  store float %166, ptr %21, align 4, !tbaa !9
  %167 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %167, ptr %22, align 4, !tbaa !11
  br label %168

168:                                              ; preds = %162, %155
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %7, align 4, !tbaa !11
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %7, align 4, !tbaa !11
  br label %152, !llvm.loop !20

172:                                              ; preds = %152
  %173 = load i32, ptr %22, align 4, !tbaa !11
  %174 = icmp eq i32 %173, 0
  br i1 %174, label %175, label %176

175:                                              ; preds = %172
  br label %179

176:                                              ; preds = %172
  %177 = load i32, ptr %22, align 4, !tbaa !11
  %178 = sub nsw i32 %177, 1
  br label %179

179:                                              ; preds = %176, %175
  %180 = phi i32 [ 35, %175 ], [ %178, %176 ]
  store i32 %180, ptr %15, align 4, !tbaa !11
  %181 = load i32, ptr %22, align 4, !tbaa !11
  %182 = icmp eq i32 %181, 35
  br i1 %182, label %183, label %184

183:                                              ; preds = %179
  br label %187

184:                                              ; preds = %179
  %185 = load i32, ptr %22, align 4, !tbaa !11
  %186 = add nsw i32 %185, 1
  br label %187

187:                                              ; preds = %184, %183
  %188 = phi i32 [ 0, %183 ], [ %186, %184 ]
  store i32 %188, ptr %16, align 4, !tbaa !11
  %189 = load i32, ptr %15, align 4, !tbaa !11
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %190
  %192 = load float, ptr %191, align 4, !tbaa !9
  %193 = load i32, ptr %22, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %194
  %196 = load float, ptr %195, align 4, !tbaa !9
  %197 = load i32, ptr %16, align 4, !tbaa !11
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [36 x float], ptr %17, i64 0, i64 %198
  %200 = load float, ptr %199, align 4, !tbaa !9
  %201 = call noundef float @_Z10interpPeakfff(float noundef %192, float noundef %196, float noundef %200)
  store float %201, ptr %20, align 4, !tbaa !9
  %202 = load i32, ptr %22, align 4, !tbaa !11
  %203 = sitofp i32 %202 to double
  %204 = fadd double %203, 5.000000e-01
  %205 = load float, ptr %20, align 4, !tbaa !9
  %206 = fpext float %205 to double
  %207 = fadd double %204, %206
  %208 = fmul double 0x401921FB54442D18, %207
  %209 = fdiv double %208, 3.600000e+01
  %210 = fsub double %209, 0x400921FB54442D18
  %211 = fptrunc double %210 to float
  %212 = getelementptr inbounds %class.Corner, ptr %23, i32 0, i32 19
  store float %211, ptr %212, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 144, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %213

213:                                              ; preds = %187, %29
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { inlinehint mustprogress 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 = { mustprogress 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 #4 = { mustprogress 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 }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS12ImageContent", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = !{!22, !10, i64 76}
!22 = !{!"_ZTS6Corner", !12, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !12, i64 68, !12, i64 72, !10, i64 76, !12, i64 80, !12, i64 84}


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

@patch_mask = external dso_local local_unnamed_addr global ptr, align 8

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z15smoothHistogramPfi(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z10interpPeakfff(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6Corner16computeHistAngleEP12ImageContentS1_(ptr nocapture noundef nonnull writeonly align 4 dereferenceable(88) %0, ptr noundef %1, ptr noundef readonly %2) local_unnamed_addr #3 align 2 {
  %4 = alloca [36 x float], align 16
  %5 = icmp eq ptr %2, null
  %6 = icmp eq ptr %1, null
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %181, label %.preheader61

.preheader61:                                     ; preds = %3
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #6
  %7 = tail call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %8 = tail call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %9 = tail call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %10 = tail call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(144) %4, i8 0, i64 144, i1 false), !tbaa !5
  %11 = add i32 %9, -1
  %12 = icmp sgt i32 %9, 2
  br i1 %12, label %.preheader60.lr.ph, label %.preheader59

.preheader60.lr.ph:                               ; preds = %.preheader61
  %.not.not63 = icmp sgt i32 %10, 1
  %13 = load ptr, ptr @patch_mask, align 8
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  %15 = getelementptr inbounds i8, ptr %2, i64 16
  br i1 %.not.not63, label %.preheader60.lr.ph.split.us, label %.preheader59

.preheader60.lr.ph.split.us:                      ; preds = %.preheader60.lr.ph
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %wide.trip.count76 = zext nneg i32 %11 to i64
  %wide.trip.count = zext nneg i32 %10 to i64
  br label %.preheader60.us

.preheader60.us:                                  ; preds = %._crit_edge.us, %.preheader60.lr.ph.split.us
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %._crit_edge.us ], [ 1, %.preheader60.lr.ph.split.us ]
  %18 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv73
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  br label %20

20:                                               ; preds = %.preheader60.us, %48
  %indvars.iv = phi i64 [ 1, %.preheader60.us ], [ %indvars.iv.next, %48 ]
  %21 = getelementptr inbounds float, ptr %19, i64 %indvars.iv
  %22 = load float, ptr %21, align 4, !tbaa !5
  %23 = fcmp ogt float %22, 1.000000e+00
  br i1 %23, label %24, label %48

24:                                               ; preds = %20
  %25 = load ptr, ptr %14, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv73
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds float, ptr %27, i64 %indvars.iv
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = fcmp ogt float %29, 0.000000e+00
  br i1 %30, label %31, label %48

31:                                               ; preds = %24
  %32 = load ptr, ptr %15, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv73
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = getelementptr inbounds float, ptr %34, i64 %indvars.iv
  %36 = load float, ptr %35, align 4, !tbaa !5
  %37 = fpext float %36 to double
  %38 = fadd double %37, 0x400921FB54442D18
  %39 = fadd double %38, 1.000000e-03
  %40 = fmul double %39, 3.600000e+01
  %41 = fdiv double %40, 0x401921FB54442D18
  %42 = fptosi double %41 to i32
  %43 = tail call i32 @llvm.smin.i32(i32 %42, i32 35)
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [36 x float], ptr %4, i64 0, i64 %44
  %46 = load float, ptr %45, align 4, !tbaa !5
  %47 = tail call float @llvm.fmuladd.f32(float %22, float %29, float %46)
  store float %47, ptr %45, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %31, %24, %20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %20, !llvm.loop !14

._crit_edge.us:                                   ; preds = %48
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count76
  br i1 %exitcond77.not, label %.preheader59, label %.preheader60.us, !llvm.loop !16

.preheader59:                                     ; preds = %._crit_edge.us, %.preheader60.lr.ph, %.preheader61
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  call void @_Z15smoothHistogramPfi(ptr noundef nonnull %4, i32 noundef 36)
  %49 = load float, ptr %4, align 16, !tbaa !5
  %50 = fcmp ule float %49, 0.000000e+00
  %.150 = select i1 %50, float 0.000000e+00, float %49
  %.1 = sext i1 %50 to i32
  %51 = getelementptr inbounds i8, ptr %4, i64 4
  %52 = load float, ptr %51, align 4, !tbaa !5
  %53 = fcmp ogt float %52, %.150
  %.150.1 = select i1 %53, float %52, float %.150
  %.1.1 = select i1 %53, i32 1, i32 %.1
  %54 = getelementptr inbounds i8, ptr %4, i64 8
  %55 = load float, ptr %54, align 8, !tbaa !5
  %56 = fcmp ogt float %55, %.150.1
  %.150.2 = select i1 %56, float %55, float %.150.1
  %.1.2 = select i1 %56, i32 2, i32 %.1.1
  %57 = getelementptr inbounds i8, ptr %4, i64 12
  %58 = load float, ptr %57, align 4, !tbaa !5
  %59 = fcmp ogt float %58, %.150.2
  %.150.3 = select i1 %59, float %58, float %.150.2
  %.1.3 = select i1 %59, i32 3, i32 %.1.2
  %60 = getelementptr inbounds i8, ptr %4, i64 16
  %61 = load float, ptr %60, align 16, !tbaa !5
  %62 = fcmp ogt float %61, %.150.3
  %.150.4 = select i1 %62, float %61, float %.150.3
  %.1.4 = select i1 %62, i32 4, i32 %.1.3
  %63 = getelementptr inbounds i8, ptr %4, i64 20
  %64 = load float, ptr %63, align 4, !tbaa !5
  %65 = fcmp ogt float %64, %.150.4
  %.150.5 = select i1 %65, float %64, float %.150.4
  %.1.5 = select i1 %65, i32 5, i32 %.1.4
  %66 = getelementptr inbounds i8, ptr %4, i64 24
  %67 = load float, ptr %66, align 8, !tbaa !5
  %68 = fcmp ogt float %67, %.150.5
  %.150.6 = select i1 %68, float %67, float %.150.5
  %.1.6 = select i1 %68, i32 6, i32 %.1.5
  %69 = getelementptr inbounds i8, ptr %4, i64 28
  %70 = load float, ptr %69, align 4, !tbaa !5
  %71 = fcmp ogt float %70, %.150.6
  %.150.7 = select i1 %71, float %70, float %.150.6
  %.1.7 = select i1 %71, i32 7, i32 %.1.6
  %72 = getelementptr inbounds i8, ptr %4, i64 32
  %73 = load float, ptr %72, align 16, !tbaa !5
  %74 = fcmp ogt float %73, %.150.7
  %.150.8 = select i1 %74, float %73, float %.150.7
  %.1.8 = select i1 %74, i32 8, i32 %.1.7
  %75 = getelementptr inbounds i8, ptr %4, i64 36
  %76 = load float, ptr %75, align 4, !tbaa !5
  %77 = fcmp ogt float %76, %.150.8
  %.150.9 = select i1 %77, float %76, float %.150.8
  %.1.9 = select i1 %77, i32 9, i32 %.1.8
  %78 = getelementptr inbounds i8, ptr %4, i64 40
  %79 = load float, ptr %78, align 8, !tbaa !5
  %80 = fcmp ogt float %79, %.150.9
  %.150.10 = select i1 %80, float %79, float %.150.9
  %.1.10 = select i1 %80, i32 10, i32 %.1.9
  %81 = getelementptr inbounds i8, ptr %4, i64 44
  %82 = load float, ptr %81, align 4, !tbaa !5
  %83 = fcmp ogt float %82, %.150.10
  %.150.11 = select i1 %83, float %82, float %.150.10
  %.1.11 = select i1 %83, i32 11, i32 %.1.10
  %84 = getelementptr inbounds i8, ptr %4, i64 48
  %85 = load float, ptr %84, align 16, !tbaa !5
  %86 = fcmp ogt float %85, %.150.11
  %.150.12 = select i1 %86, float %85, float %.150.11
  %.1.12 = select i1 %86, i32 12, i32 %.1.11
  %87 = getelementptr inbounds i8, ptr %4, i64 52
  %88 = load float, ptr %87, align 4, !tbaa !5
  %89 = fcmp ogt float %88, %.150.12
  %.150.13 = select i1 %89, float %88, float %.150.12
  %.1.13 = select i1 %89, i32 13, i32 %.1.12
  %90 = getelementptr inbounds i8, ptr %4, i64 56
  %91 = load float, ptr %90, align 8, !tbaa !5
  %92 = fcmp ogt float %91, %.150.13
  %.150.14 = select i1 %92, float %91, float %.150.13
  %.1.14 = select i1 %92, i32 14, i32 %.1.13
  %93 = getelementptr inbounds i8, ptr %4, i64 60
  %94 = load float, ptr %93, align 4, !tbaa !5
  %95 = fcmp ogt float %94, %.150.14
  %.150.15 = select i1 %95, float %94, float %.150.14
  %.1.15 = select i1 %95, i32 15, i32 %.1.14
  %96 = getelementptr inbounds i8, ptr %4, i64 64
  %97 = load float, ptr %96, align 16, !tbaa !5
  %98 = fcmp ogt float %97, %.150.15
  %.150.16 = select i1 %98, float %97, float %.150.15
  %.1.16 = select i1 %98, i32 16, i32 %.1.15
  %99 = getelementptr inbounds i8, ptr %4, i64 68
  %100 = load float, ptr %99, align 4, !tbaa !5
  %101 = fcmp ogt float %100, %.150.16
  %.150.17 = select i1 %101, float %100, float %.150.16
  %.1.17 = select i1 %101, i32 17, i32 %.1.16
  %102 = getelementptr inbounds i8, ptr %4, i64 72
  %103 = load float, ptr %102, align 8, !tbaa !5
  %104 = fcmp ogt float %103, %.150.17
  %.150.18 = select i1 %104, float %103, float %.150.17
  %.1.18 = select i1 %104, i32 18, i32 %.1.17
  %105 = getelementptr inbounds i8, ptr %4, i64 76
  %106 = load float, ptr %105, align 4, !tbaa !5
  %107 = fcmp ogt float %106, %.150.18
  %.150.19 = select i1 %107, float %106, float %.150.18
  %.1.19 = select i1 %107, i32 19, i32 %.1.18
  %108 = getelementptr inbounds i8, ptr %4, i64 80
  %109 = load float, ptr %108, align 16, !tbaa !5
  %110 = fcmp ogt float %109, %.150.19
  %.150.20 = select i1 %110, float %109, float %.150.19
  %.1.20 = select i1 %110, i32 20, i32 %.1.19
  %111 = getelementptr inbounds i8, ptr %4, i64 84
  %112 = load float, ptr %111, align 4, !tbaa !5
  %113 = fcmp ogt float %112, %.150.20
  %.150.21 = select i1 %113, float %112, float %.150.20
  %.1.21 = select i1 %113, i32 21, i32 %.1.20
  %114 = getelementptr inbounds i8, ptr %4, i64 88
  %115 = load float, ptr %114, align 8, !tbaa !5
  %116 = fcmp ogt float %115, %.150.21
  %.150.22 = select i1 %116, float %115, float %.150.21
  %.1.22 = select i1 %116, i32 22, i32 %.1.21
  %117 = getelementptr inbounds i8, ptr %4, i64 92
  %118 = load float, ptr %117, align 4, !tbaa !5
  %119 = fcmp ogt float %118, %.150.22
  %.150.23 = select i1 %119, float %118, float %.150.22
  %.1.23 = select i1 %119, i32 23, i32 %.1.22
  %120 = getelementptr inbounds i8, ptr %4, i64 96
  %121 = load float, ptr %120, align 16, !tbaa !5
  %122 = fcmp ogt float %121, %.150.23
  %.150.24 = select i1 %122, float %121, float %.150.23
  %.1.24 = select i1 %122, i32 24, i32 %.1.23
  %123 = getelementptr inbounds i8, ptr %4, i64 100
  %124 = load float, ptr %123, align 4, !tbaa !5
  %125 = fcmp ogt float %124, %.150.24
  %.150.25 = select i1 %125, float %124, float %.150.24
  %.1.25 = select i1 %125, i32 25, i32 %.1.24
  %126 = getelementptr inbounds i8, ptr %4, i64 104
  %127 = load float, ptr %126, align 8, !tbaa !5
  %128 = fcmp ogt float %127, %.150.25
  %.150.26 = select i1 %128, float %127, float %.150.25
  %.1.26 = select i1 %128, i32 26, i32 %.1.25
  %129 = getelementptr inbounds i8, ptr %4, i64 108
  %130 = load float, ptr %129, align 4, !tbaa !5
  %131 = fcmp ogt float %130, %.150.26
  %.150.27 = select i1 %131, float %130, float %.150.26
  %.1.27 = select i1 %131, i32 27, i32 %.1.26
  %132 = getelementptr inbounds i8, ptr %4, i64 112
  %133 = load float, ptr %132, align 16, !tbaa !5
  %134 = fcmp ogt float %133, %.150.27
  %.150.28 = select i1 %134, float %133, float %.150.27
  %.1.28 = select i1 %134, i32 28, i32 %.1.27
  %135 = getelementptr inbounds i8, ptr %4, i64 116
  %136 = load float, ptr %135, align 4, !tbaa !5
  %137 = fcmp ogt float %136, %.150.28
  %.150.29 = select i1 %137, float %136, float %.150.28
  %.1.29 = select i1 %137, i32 29, i32 %.1.28
  %138 = getelementptr inbounds i8, ptr %4, i64 120
  %139 = load float, ptr %138, align 8, !tbaa !5
  %140 = fcmp ogt float %139, %.150.29
  %.150.30 = select i1 %140, float %139, float %.150.29
  %.1.30 = select i1 %140, i32 30, i32 %.1.29
  %141 = getelementptr inbounds i8, ptr %4, i64 124
  %142 = load float, ptr %141, align 4, !tbaa !5
  %143 = fcmp ogt float %142, %.150.30
  %.150.31 = select i1 %143, float %142, float %.150.30
  %.1.31 = select i1 %143, i32 31, i32 %.1.30
  %144 = getelementptr inbounds i8, ptr %4, i64 128
  %145 = load float, ptr %144, align 16, !tbaa !5
  %146 = fcmp ogt float %145, %.150.31
  %.150.32 = select i1 %146, float %145, float %.150.31
  %.1.32 = select i1 %146, i32 32, i32 %.1.31
  %147 = getelementptr inbounds i8, ptr %4, i64 132
  %148 = load float, ptr %147, align 4, !tbaa !5
  %149 = fcmp ogt float %148, %.150.32
  %.150.33 = select i1 %149, float %148, float %.150.32
  %.1.33 = select i1 %149, i32 33, i32 %.1.32
  %150 = getelementptr inbounds i8, ptr %4, i64 136
  %151 = load float, ptr %150, align 8, !tbaa !5
  %152 = fcmp ogt float %151, %.150.33
  %.150.34 = select i1 %152, float %151, float %.150.33
  %.1.34 = select i1 %152, i32 34, i32 %.1.33
  %153 = getelementptr inbounds i8, ptr %4, i64 140
  %154 = load float, ptr %153, align 4, !tbaa !5
  %155 = fcmp ogt float %154, %.150.34
  %.1.35 = select i1 %155, i32 35, i32 %.1.34
  %156 = icmp eq i32 %.1.35, 0
  %157 = add nsw i32 %.1.35, -1
  %158 = select i1 %156, i32 35, i32 %157
  %159 = icmp eq i32 %.1.35, 35
  %160 = add nsw i32 %.1.35, 1
  %161 = select i1 %159, i32 0, i32 %160
  %162 = sext i32 %158 to i64
  %163 = getelementptr inbounds [36 x float], ptr %4, i64 0, i64 %162
  %164 = load float, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %.1.35 to i64
  %166 = getelementptr inbounds [36 x float], ptr %4, i64 0, i64 %165
  %167 = load float, ptr %166, align 4, !tbaa !5
  %168 = zext nneg i32 %161 to i64
  %169 = getelementptr inbounds [36 x float], ptr %4, i64 0, i64 %168
  %170 = load float, ptr %169, align 4, !tbaa !5
  %171 = call noundef float @_Z10interpPeakfff(float noundef %164, float noundef %167, float noundef %170)
  %172 = sitofp i32 %.1.35 to double
  %173 = fadd double %172, 5.000000e-01
  %174 = fpext float %171 to double
  %175 = fadd double %173, %174
  %176 = fmul double %175, 0x401921FB54442D18
  %177 = fdiv double %176, 3.600000e+01
  %178 = fadd double %177, 0xC00921FB54442D18
  %179 = fptrunc double %178 to float
  %180 = getelementptr inbounds i8, ptr %0, i64 76
  store float %179, ptr %180, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %4) #6
  br label %181

181:                                              ; preds = %3, %.preheader59
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { inlinehint mustprogress 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 = { mustprogress 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTS12ImageContent", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !6, i64 76}
!18 = !{!"_ZTS6Corner", !11, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !11, i64 68, !11, i64 72, !6, i64 76, !11, i64 80, !11, i64 84}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass