; LLVM IR from sp-nitech/SPTK :: src/filter/median_filter.ll (ZN4sptk12MedianFilterC2EiiPNS_20InputSourceInterfaceEbbd)

; 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.sptk::MedianFilter" = type <{ %"class.sptk::InputSourceInterface", i32, i32, ptr, i8, i8, [6 x i8], double, i8, [7 x i8], %"class.std::vector", %"class.std::vector", %"class.std::deque", i32, [4 x i8] }>
%"class.sptk::InputSourceInterface" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::vector<double>, std::allocator<std::vector<double>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::vector<double>, std::allocator<std::vector<double>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::vector<double>, std::allocator<std::vector<double>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::vector<double>, std::allocator<std::vector<double>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZTVN4sptk12MedianFilterE = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk12MedianFilterC2EiiPNS_20InputSourceInterfaceEbbd(ptr noundef nonnull align 8 dereferenceable(180) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i1 noundef zeroext %4, i1 noundef zeroext %5, double noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca double, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  %20 = zext i1 %4 to i8
  store i8 %20, ptr %12, align 1, !tbaa !11
  %21 = zext i1 %5 to i8
  store i8 %21, ptr %13, align 1, !tbaa !11
  store double %6, ptr %14, align 8, !tbaa !13
  %22 = load ptr, ptr %8, align 8
  call void @_ZN4sptk20InputSourceInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  store ptr getelementptr inbounds inrange(-16, 40) ({ [7 x ptr] }, ptr @_ZTVN4sptk12MedianFilterE, i32 0, i32 0, i32 2), ptr %22, align 8, !tbaa !15
  %23 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 1
  %24 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %24, ptr %23, align 8, !tbaa !17
  %25 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 2
  %26 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %26, ptr %25, align 4, !tbaa !30
  %27 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 3
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %28, ptr %27, align 8, !tbaa !31
  %29 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 4
  %30 = load i8, ptr %12, align 1, !tbaa !11, !range !32, !noundef !33
  %31 = trunc i8 %30 to i1
  %32 = zext i1 %31 to i8
  store i8 %32, ptr %29, align 8, !tbaa !34
  %33 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 5
  %34 = load i8, ptr %13, align 1, !tbaa !11, !range !32, !noundef !33
  %35 = trunc i8 %34 to i1
  %36 = zext i1 %35 to i8
  store i8 %36, ptr %33, align 1, !tbaa !35
  %37 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 7
  %38 = load double, ptr %14, align 8, !tbaa !13
  store double %38, ptr %37, align 8, !tbaa !36
  %39 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 8
  store i8 1, ptr %39, align 8, !tbaa !37
  %40 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 10
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  %41 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 11
  call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %41) #4
  %42 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 12
  invoke void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %42)
          to label %43 unwind label %75

43:                                               ; preds = %7
  %44 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 1
  %45 = load i32, ptr %44, align 8, !tbaa !17
  %46 = icmp slt i32 %45, 0
  br i1 %46, label %73, label %47

47:                                               ; preds = %43
  %48 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !30
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %73, label %51

51:                                               ; preds = %47
  %52 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !31
  %54 = icmp eq ptr null, %53
  br i1 %54, label %73, label %55

55:                                               ; preds = %51
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = load ptr, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds ptr, ptr %57, i64 3
  %59 = load ptr, ptr %58, align 8
  %60 = invoke noundef zeroext i1 %59(ptr noundef nonnull align 8 dereferenceable(8) %56)
          to label %61 unwind label %79

61:                                               ; preds = %55
  br i1 %60, label %62, label %73

62:                                               ; preds = %61
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = load ptr, ptr %63, align 8, !tbaa !15
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8
  %67 = invoke noundef i32 %66(ptr noundef nonnull align 8 dereferenceable(8) %63)
          to label %68 unwind label %79

68:                                               ; preds = %62
  %69 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !17
  %71 = add nsw i32 %70, 1
  %72 = icmp ne i32 %67, %71
  br i1 %72, label %73, label %83

73:                                               ; preds = %68, %61, %51, %47, %43
  %74 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 8
  store i8 0, ptr %74, align 8, !tbaa !37
  br label %138

75:                                               ; preds = %7
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %15, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %16, align 4
  br label %140

79:                                               ; preds = %107, %83, %62, %55
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %15, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %16, align 4
  br label %139

83:                                               ; preds = %68
  %84 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 10
  %85 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 1
  %86 = load i32, ptr %85, align 8, !tbaa !17
  %87 = add nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %88)
          to label %89 unwind label %79

89:                                               ; preds = %83
  %90 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 11
  %91 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 4
  %92 = load i8, ptr %91, align 8, !tbaa !34, !range !32, !noundef !33
  %93 = trunc i8 %92 to i1
  br i1 %93, label %94, label %99

94:                                               ; preds = %89
  %95 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 2
  %96 = load i32, ptr %95, align 4, !tbaa !30
  %97 = add nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  br label %107

99:                                               ; preds = %89
  %100 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !30
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 10
  %105 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #4
  %106 = mul i64 %103, %105
  br label %107

107:                                              ; preds = %99, %94
  %108 = phi i64 [ %98, %94 ], [ %106, %99 ]
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %108)
          to label %109 unwind label %79

109:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %110 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 2
  %111 = load i32, ptr %110, align 4, !tbaa !30
  %112 = sdiv i32 %111, 2
  store i32 %112, ptr %17, align 4, !tbaa !9
  %113 = load i32, ptr %17, align 4, !tbaa !9
  %114 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 13
  store i32 %113, ptr %114, align 8, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %130, %109
  %116 = load i32, ptr %18, align 4, !tbaa !9
  %117 = load i32, ptr %17, align 4, !tbaa !9
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 2, ptr %19, align 4
  br label %133

120:                                              ; preds = %115
  %121 = invoke noundef zeroext i1 @_ZN4sptk12MedianFilter7ForwardEv(ptr noundef nonnull align 8 dereferenceable(180) %22)
          to label %122 unwind label %125

122:                                              ; preds = %120
  br i1 %121, label %129, label %123

123:                                              ; preds = %122
  %124 = getelementptr inbounds %"class.sptk::MedianFilter", ptr %22, i32 0, i32 8
  store i8 0, ptr %124, align 8, !tbaa !37
  store i32 1, ptr %19, align 4
  br label %133

125:                                              ; preds = %120
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %15, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %139

129:                                              ; preds = %122
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %18, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !9
  br label %115, !llvm.loop !39

133:                                              ; preds = %123, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %134 = load i32, ptr %19, align 4
  switch i32 %134, label %136 [
    i32 2, label %135
  ]

135:                                              ; preds = %133
  store i32 0, ptr %19, align 4
  br label %136

136:                                              ; preds = %135, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  %137 = load i32, ptr %19, align 4
  switch i32 %137, label %146 [
    i32 0, label %138
    i32 1, label %138
  ]

138:                                              ; preds = %136, %136, %73
  ret void

139:                                              ; preds = %125, %79
  call void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %42) #4
  br label %140

140:                                              ; preds = %139, %75
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %41) #4
  call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  call void @_ZN4sptk20InputSourceInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #4
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %15, align 8
  %143 = load i32, ptr %16, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145

146:                                              ; preds = %136
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk20InputSourceInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4sptk12MedianFilter7ForwardEv(ptr noundef nonnull align 8 dereferenceable(180)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk20InputSourceInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

attributes #0 = { 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 #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" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !10, i64 8}
!18 = !{!"_ZTSN4sptk12MedianFilterE", !19, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !12, i64 24, !12, i64 25, !14, i64 32, !12, i64 40, !20, i64 48, !20, i64 72, !24, i64 96, !10, i64 176}
!19 = !{!"_ZTSN4sptk20InputSourceInterfaceE"}
!20 = !{!"_ZTSSt6vectorIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSSt5dequeISt6vectorIdSaIdEESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE11_Deque_implE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !28, i64 8, !29, i64 16, !29, i64 48}
!28 = !{!"long", !7, i64 0}
!29 = !{!"_ZTSSt15_Deque_iteratorISt6vectorIdSaIdEERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!30 = !{!18, !10, i64 12}
!31 = !{!18, !6, i64 16}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!18, !12, i64 24}
!35 = !{!18, !12, i64 25}
!36 = !{!18, !14, i64 32}
!37 = !{!18, !12, i64 40}
!38 = !{!18, !10, i64 176}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


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

@_ZTVN4sptk12MedianFilterE = external dso_local unnamed_addr constant { [7 x ptr] }, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk12MedianFilterC2EiiPNS_20InputSourceInterfaceEbbd(ptr noundef nonnull align 8 dereferenceable(180) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i1 noundef zeroext %4, i1 noundef zeroext %5, double noundef %6) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %8 = zext i1 %4 to i8
  %9 = zext i1 %5 to i8
  tail call void @_ZN4sptk20InputSourceInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #3
  store ptr getelementptr inbounds inrange(-16, 40) (i8, ptr @_ZTVN4sptk12MedianFilterE, i64 16), ptr %0, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %1, ptr %10, align 8, !tbaa !8
  %11 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %11, align 4, !tbaa !26
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %12, align 8, !tbaa !27
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  store i8 %8, ptr %13, align 8, !tbaa !28
  %14 = getelementptr inbounds i8, ptr %0, i64 25
  store i8 %9, ptr %14, align 1, !tbaa !29
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  store double %6, ptr %15, align 8, !tbaa !30
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 1, ptr %16, align 8, !tbaa !31
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #3
  %18 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  invoke void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %20 unwind label %41

20:                                               ; preds = %7
  %21 = load i32, ptr %10, align 8, !tbaa !8
  %22 = icmp slt i32 %21, 0
  %23 = load i32, ptr %11, align 4
  %24 = icmp slt i32 %23, 0
  %or.cond = select i1 %22, i1 true, i1 %24
  %25 = load ptr, ptr %12, align 8
  %26 = icmp eq ptr %25, null
  %or.cond24 = select i1 %or.cond, i1 true, i1 %26
  br i1 %or.cond24, label %.loopexit.sink.split, label %27

27:                                               ; preds = %20
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load ptr, ptr %29, align 8
  %31 = invoke noundef zeroext i1 %30(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %32 unwind label %43

32:                                               ; preds = %27
  br i1 %31, label %33, label %.loopexit.sink.split

33:                                               ; preds = %32
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  %36 = load ptr, ptr %35, align 8
  %37 = invoke noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %38 unwind label %43

38:                                               ; preds = %33
  %39 = load i32, ptr %10, align 8, !tbaa !8
  %40 = add nsw i32 %39, 1
  %.not = icmp eq i32 %37, %40
  br i1 %.not, label %45, label %.loopexit.sink.split

41:                                               ; preds = %7
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %70

43:                                               ; preds = %56, %45, %33, %27
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %69

45:                                               ; preds = %38
  %46 = sext i32 %37 to i64
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %46)
          to label %47 unwind label %43

47:                                               ; preds = %45
  %48 = load i8, ptr %13, align 8, !tbaa !28, !range !32, !noundef !33
  %49 = trunc nuw i8 %48 to i1
  %50 = load i32, ptr %11, align 4, !tbaa !26
  %51 = add nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  br i1 %49, label %56, label %53

53:                                               ; preds = %47
  %54 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #3
  %55 = mul i64 %54, %52
  br label %56

56:                                               ; preds = %47, %53
  %57 = phi i64 [ %55, %53 ], [ %52, %47 ]
  invoke void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %57)
          to label %58 unwind label %43

58:                                               ; preds = %56
  %59 = load i32, ptr %11, align 4, !tbaa !26
  %60 = sdiv i32 %59, 2
  %61 = getelementptr inbounds i8, ptr %0, i64 176
  store i32 %60, ptr %61, align 8, !tbaa !34
  %62 = icmp sgt i32 %59, 1
  br i1 %62, label %.lr.ph, label %.loopexit

63:                                               ; preds = %66
  %64 = add nuw nsw i32 %.01525, 1
  %exitcond.not = icmp eq i32 %64, %60
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !35

.lr.ph:                                           ; preds = %58, %63
  %.01525 = phi i32 [ %64, %63 ], [ 0, %58 ]
  %65 = invoke noundef zeroext i1 @_ZN4sptk12MedianFilter7ForwardEv(ptr noundef nonnull align 8 dereferenceable(180) %0)
          to label %66 unwind label %67

66:                                               ; preds = %.lr.ph
  br i1 %65, label %63, label %.loopexit.sink.split

67:                                               ; preds = %.lr.ph
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %69

.loopexit.sink.split:                             ; preds = %66, %20, %32, %38
  store i8 0, ptr %16, align 8, !tbaa !31
  br label %.loopexit

.loopexit:                                        ; preds = %63, %.loopexit.sink.split, %58
  ret void

69:                                               ; preds = %67, %43
  %.pn = phi { ptr, i32 } [ %68, %67 ], [ %44, %43 ]
  tail call void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %19) #3
  br label %70

70:                                               ; preds = %69, %41
  %.pn.pn = phi { ptr, i32 } [ %.pn, %69 ], [ %42, %41 ]
  tail call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  tail call void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #3
  tail call void @_ZN4sptk20InputSourceInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #3
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk20InputSourceInterfaceC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4sptk12MedianFilter7ForwardEv(ptr noundef nonnull align 8 dereferenceable(180)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeISt6vectorIdSaIdEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIdSaIdEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4sptk20InputSourceInterfaceD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

attributes #0 = { 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 #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" }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 8}
!9 = !{!"_ZTSN4sptk12MedianFilterE", !10, i64 0, !11, i64 8, !11, i64 12, !13, i64 16, !14, i64 24, !14, i64 25, !15, i64 32, !14, i64 40, !16, i64 48, !16, i64 72, !20, i64 96, !11, i64 176}
!10 = !{!"_ZTSN4sptk20InputSourceInterfaceE"}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"bool", !12, i64 0}
!15 = !{!"double", !12, i64 0}
!16 = !{!"_ZTSSt6vectorIdSaIdEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!20 = !{!"_ZTSSt5dequeISt6vectorIdSaIdEESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSNSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE11_Deque_implE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseISt6vectorIdSaIdEESaIS2_EE16_Deque_impl_dataE", !13, i64 0, !24, i64 8, !25, i64 16, !25, i64 48}
!24 = !{!"long", !12, i64 0}
!25 = !{!"_ZTSSt15_Deque_iteratorISt6vectorIdSaIdEERS2_PS2_E", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!26 = !{!9, !11, i64 12}
!27 = !{!9, !13, i64 16}
!28 = !{!9, !14, i64 24}
!29 = !{!9, !14, i64 25}
!30 = !{!9, !15, i64 32}
!31 = !{!9, !14, i64 40}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!9, !11, i64 176}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass