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

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

@_ZL4size = external hidden global i32, align 4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_Z11convolutioniiP12ImageContentPPf(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store float 0.000000e+00, ptr %10, align 4, !tbaa !11
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %35, label %17

17:                                               ; preds = %4
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %35, label %21

21:                                               ; preds = %17
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %24 = add nsw i32 %22, %23
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  %26 = call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %25)
  %27 = icmp sge i32 %24, %26
  br i1 %27, label %35, label %28

28:                                               ; preds = %21
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %31 = add nsw i32 %29, %30
  %32 = load ptr, ptr %8, align 8, !tbaa !9
  %33 = call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %32)
  %34 = icmp sge i32 %31, %33
  br i1 %34, label %35, label %37

35:                                               ; preds = %28, %21, %17, %4
  %36 = load float, ptr %10, align 4, !tbaa !11
  store float %36, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %93

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %38 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %39 = sub nsw i32 0, %38
  store i32 %39, ptr %12, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %88, %37
  %41 = load i32, ptr %12, align 4, !tbaa !5
  %42 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %91

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %46 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %47 = sub nsw i32 0, %46
  store i32 %47, ptr %13, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %84, %45
  %49 = load i32, ptr %13, align 4, !tbaa !5
  %50 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %51 = icmp sle i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %87

53:                                               ; preds = %48
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  %55 = getelementptr inbounds %class.ImageContent, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !13
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = add nsw i32 %57, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %56, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds float, ptr %62, i64 %66
  %68 = load float, ptr %67, align 4, !tbaa !11
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %72 = add nsw i32 %70, %71
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %69, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %75, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !11
  %82 = load float, ptr %10, align 4, !tbaa !11
  %83 = call float @llvm.fmuladd.f32(float %68, float %81, float %82)
  store float %83, ptr %10, align 4, !tbaa !11
  br label %84

84:                                               ; preds = %53
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !5
  br label %48, !llvm.loop !15

87:                                               ; preds = %52
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %12, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %12, align 4, !tbaa !5
  br label %40, !llvm.loop !17

91:                                               ; preds = %44
  %92 = load float, ptr %10, align 4, !tbaa !11
  store float %92, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %93

93:                                               ; preds = %91, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %94 = load float, ptr %5, align 4
  ret float %94
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 16}
!14 = !{!"_ZTS12ImageContent", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


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

@_ZL4size = external hidden local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_Z11convolutioniiP12ImageContentPPf(i32 noundef %0, i32 noundef %1, ptr noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #2 {
  %5 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, %0
  %7 = icmp sgt i32 %5, %1
  %or.cond = or i1 %6, %7
  br i1 %or.cond, label %.loopexit, label %8

8:                                                ; preds = %4
  %9 = add nsw i32 %5, %0
  %10 = tail call noundef i32 @_ZNK12ImageContent1xEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not = icmp slt i32 %9, %10
  br i1 %.not, label %11, label %.loopexit

11:                                               ; preds = %8
  %12 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %13 = add nsw i32 %12, %1
  %14 = tail call noundef i32 @_ZNK12ImageContent1yEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %.not29 = icmp slt i32 %13, %14
  br i1 %.not29, label %15, label %.loopexit

15:                                               ; preds = %11
  %16 = load i32, ptr @_ZL4size, align 4, !tbaa !5
  %.not3035 = icmp slt i32 %16, 0
  br i1 %.not3035, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %15
  %17 = sub nsw i32 0, %16
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = sext i32 %17 to i64
  %21 = sext i32 %1 to i64
  %22 = zext nneg i32 %16 to i64
  %23 = add nuw i32 %16, 1
  %24 = sext i32 %0 to i64
  %invariant.gep = getelementptr ptr, ptr %19, i64 %21
  %invariant.gep45 = getelementptr ptr, ptr %3, i64 %22
  %gep.prol = getelementptr ptr, ptr %invariant.gep, i64 %20
  %gep46.prol = getelementptr ptr, ptr %invariant.gep45, i64 %20
  %indvars.iv.next.prol = add nsw i64 %20, 1
  %25 = icmp eq i32 %16, 0
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %indvars.iv40 = phi i64 [ %20, %.preheader.lr.ph ], [ %indvars.iv.next41, %._crit_edge ]
  %.02236 = phi float [ 0.000000e+00, %.preheader.lr.ph ], [ %.lcssa, %._crit_edge ]
  %26 = load ptr, ptr %gep.prol, align 8, !tbaa !12
  %27 = getelementptr float, ptr %26, i64 %indvars.iv40
  %28 = getelementptr float, ptr %27, i64 %24
  %29 = load float, ptr %28, align 4, !tbaa !13
  %30 = load ptr, ptr %gep46.prol, align 8, !tbaa !12
  %31 = getelementptr float, ptr %30, i64 %indvars.iv40
  %32 = getelementptr float, ptr %31, i64 %22
  %33 = load float, ptr %32, align 4, !tbaa !13
  %34 = tail call float @llvm.fmuladd.f32(float %29, float %33, float %.02236)
  br i1 %25, label %._crit_edge, label %.preheader.new

._crit_edge:                                      ; preds = %.preheader.new, %.preheader
  %.lcssa = phi float [ %34, %.preheader ], [ %52, %.preheader.new ]
  %indvars.iv.next41 = add nsw i64 %indvars.iv40, 1
  %lftr.wideiv43 = trunc i64 %indvars.iv.next41 to i32
  %exitcond44.not = icmp eq i32 %23, %lftr.wideiv43
  br i1 %exitcond44.not, label %.loopexit, label %.preheader, !llvm.loop !15

.preheader.new:                                   ; preds = %.preheader, %.preheader.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.preheader.new ], [ %indvars.iv.next.prol, %.preheader ]
  %.133 = phi float [ %52, %.preheader.new ], [ %34, %.preheader ]
  %gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv
  %35 = load ptr, ptr %gep, align 8, !tbaa !12
  %36 = getelementptr float, ptr %35, i64 %indvars.iv40
  %37 = getelementptr float, ptr %36, i64 %24
  %38 = load float, ptr %37, align 4, !tbaa !13
  %gep46 = getelementptr ptr, ptr %invariant.gep45, i64 %indvars.iv
  %39 = load ptr, ptr %gep46, align 8, !tbaa !12
  %40 = getelementptr float, ptr %39, i64 %indvars.iv40
  %41 = getelementptr float, ptr %40, i64 %22
  %42 = load float, ptr %41, align 4, !tbaa !13
  %43 = tail call float @llvm.fmuladd.f32(float %38, float %42, float %.133)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %gep.1 = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv.next
  %44 = load ptr, ptr %gep.1, align 8, !tbaa !12
  %45 = getelementptr float, ptr %44, i64 %indvars.iv40
  %46 = getelementptr float, ptr %45, i64 %24
  %47 = load float, ptr %46, align 4, !tbaa !13
  %gep46.1 = getelementptr ptr, ptr %invariant.gep45, i64 %indvars.iv.next
  %48 = load ptr, ptr %gep46.1, align 8, !tbaa !12
  %49 = getelementptr float, ptr %48, i64 %indvars.iv40
  %50 = getelementptr float, ptr %49, i64 %22
  %51 = load float, ptr %50, align 4, !tbaa !13
  %52 = tail call float @llvm.fmuladd.f32(float %47, float %51, float %43)
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
  %exitcond.not.1 = icmp eq i32 %23, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %._crit_edge, label %.preheader.new, !llvm.loop !17

.loopexit:                                        ; preds = %._crit_edge, %15, %4, %8, %11
  %.023 = phi float [ 0.000000e+00, %11 ], [ 0.000000e+00, %8 ], [ 0.000000e+00, %4 ], [ 0.000000e+00, %15 ], [ %.lcssa, %._crit_edge ]
  ret float %.023
}

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

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

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


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