; LLVM IR from sp-nitech/SPTK :: third_party/SWIPE (swipe)

; 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.sptk::swipe::vector" = type { i32, ptr }
%"struct.sptk::swipe::intvector" = type { i32, ptr }
%"struct.sptk::swipe::matrix" = type { i32, i32, ptr }

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

declare { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @_ZN4sptk5swipe5freevENS0_6vectorE(i32, ptr) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32, ptr, i32, ptr, double noundef, i32 noundef, i32 noundef) #3

declare noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32, ptr, double noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64, ptr, i64, ptr, i32, ptr, ptr noundef byval(%"struct.sptk::swipe::vector") align 8, ptr noundef byval(%"struct.sptk::swipe::vector") align 8, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8, double noundef, double noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

declare void @_ZN4sptk5swipe5freemENS0_6matrixE(i64, ptr) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5swipe6SfirstENS0_6matrixENS0_6vectorES2_S2_S2_NS0_9intvectorES3_dddi(i64 %0, ptr %1, i32 %2, ptr %3, i32 %4, ptr %5, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %6, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %7, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8 %8, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8 %9, double noundef %10, double noundef %11, double noundef %12, i32 noundef %13) #3 {
  %15 = alloca %"struct.sptk::swipe::matrix", align 8
  %16 = alloca %"struct.sptk::swipe::vector", align 8
  %17 = alloca %"struct.sptk::swipe::vector", align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.sptk::swipe::matrix", align 8
  %25 = alloca %"struct.sptk::swipe::vector", align 8
  %26 = alloca %"struct.sptk::swipe::vector", align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"struct.sptk::swipe::vector", align 8
  %30 = alloca i32, align 4
  %31 = alloca %"struct.sptk::swipe::vector", align 8
  %32 = alloca %"struct.sptk::swipe::vector", align 8
  %33 = alloca %"struct.sptk::swipe::matrix", align 8
  %34 = alloca %"struct.sptk::swipe::matrix", align 8
  %35 = alloca %"struct.sptk::swipe::vector", align 8
  %36 = alloca %"struct.sptk::swipe::vector", align 8
  %37 = alloca %"struct.sptk::swipe::vector", align 8
  %38 = alloca %"struct.sptk::swipe::intvector", align 8
  %39 = alloca %"struct.sptk::swipe::matrix", align 8
  %40 = alloca %"struct.sptk::swipe::vector", align 8
  %41 = alloca %"struct.sptk::swipe::vector", align 8
  %42 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 0
  store i64 %0, ptr %42, align 8
  %43 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 1
  store ptr %1, ptr %43, align 8
  %44 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 0
  store i32 %2, ptr %44, align 8
  %45 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 1
  store ptr %3, ptr %45, align 8
  %46 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 0
  store i32 %4, ptr %46, align 8
  %47 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 1
  store ptr %5, ptr %47, align 8
  store double %10, ptr %18, align 8, !tbaa !5
  store double %11, ptr %19, align 8, !tbaa !5
  store double %12, ptr %20, align 8, !tbaa !5
  store i32 %13, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %48 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = load i32, ptr %21, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = sdiv i32 %53, 2
  store i32 %54, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !14
  %55 = load double, ptr %18, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = load i32, ptr %21, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %57, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = load i32, ptr %23, align 4, !tbaa !9
  %63 = getelementptr inbounds { i32, ptr }, ptr %25, i32 0, i32 0
  %64 = load i32, ptr %63, align 8
  %65 = getelementptr inbounds { i32, ptr }, ptr %25, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8
  %67 = getelementptr inbounds { i32, ptr }, ptr %26, i32 0, i32 0
  %68 = load i32, ptr %67, align 8
  %69 = getelementptr inbounds { i32, ptr }, ptr %26, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8
  %71 = call { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32 %64, ptr %66, i32 %68, ptr %70, double noundef %55, i32 noundef %61, i32 noundef %62)
  %72 = getelementptr inbounds { i64, ptr }, ptr %24, i32 0, i32 0
  %73 = extractvalue { i64, ptr } %71, 0
  store i64 %73, ptr %72, align 8
  %74 = getelementptr inbounds { i64, ptr }, ptr %24, i32 0, i32 1
  %75 = extractvalue { i64, ptr } %71, 1
  store ptr %75, ptr %74, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !14
  %76 = getelementptr inbounds { i32, ptr }, ptr %29, i32 0, i32 0
  %77 = load i32, ptr %76, align 8
  %78 = getelementptr inbounds { i32, ptr }, ptr %29, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8
  %80 = call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %77, ptr %79, double noundef 2.000000e+00)
  store i32 %80, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %81 = load i32, ptr %28, align 4, !tbaa !9
  %82 = load i32, ptr %27, align 4, !tbaa !9
  %83 = sub nsw i32 %81, %82
  store i32 %83, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #5
  %84 = load i32, ptr %30, align 4, !tbaa !9
  %85 = call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %84)
  %86 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 0
  %87 = extractvalue { i32, ptr } %85, 0
  store i32 %87, ptr %86, align 8
  %88 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 1
  %89 = extractvalue { i32, ptr } %85, 1
  store ptr %89, ptr %88, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #5
  %90 = load i32, ptr %30, align 4, !tbaa !9
  %91 = call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %90)
  %92 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 0
  %93 = extractvalue { i32, ptr } %91, 0
  store i32 %93, ptr %92, align 8
  %94 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 1
  %95 = extractvalue { i32, ptr } %91, 1
  store ptr %95, ptr %94, align 8
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %126, %14
  %97 = load i32, ptr %22, align 4, !tbaa !9
  %98 = load i32, ptr %28, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %129

100:                                              ; preds = %96
  %101 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !16
  %103 = load i32, ptr %22, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds double, ptr %102, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = load i32, ptr %22, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds double, ptr %108, i64 %110
  store double %106, ptr %111, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %7, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !16
  %114 = load i32, ptr %22, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !5
  %118 = fsub double %117, 1.000000e+00
  %119 = call double @llvm.fabs.f64(double %118)
  %120 = fsub double 1.000000e+00, %119
  %121 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !16
  %123 = load i32, ptr %22, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds double, ptr %122, i64 %124
  store double %120, ptr %125, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %100
  %127 = load i32, ptr %22, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %22, align 4, !tbaa !9
  br label %96, !llvm.loop !18

129:                                              ; preds = %96
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %31, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !14
  %130 = load double, ptr %20, align 8, !tbaa !5
  %131 = load double, ptr %19, align 8, !tbaa !5
  %132 = load i32, ptr %27, align 4, !tbaa !9
  %133 = load i32, ptr %30, align 4, !tbaa !9
  %134 = load i32, ptr %23, align 4, !tbaa !9
  %135 = getelementptr inbounds { i64, ptr }, ptr %33, i32 0, i32 0
  %136 = load i64, ptr %135, align 8
  %137 = getelementptr inbounds { i64, ptr }, ptr %33, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8
  %139 = getelementptr inbounds { i64, ptr }, ptr %34, i32 0, i32 0
  %140 = load i64, ptr %139, align 8
  %141 = getelementptr inbounds { i64, ptr }, ptr %34, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8
  %143 = getelementptr inbounds { i32, ptr }, ptr %35, i32 0, i32 0
  %144 = load i32, ptr %143, align 8
  %145 = getelementptr inbounds { i32, ptr }, ptr %35, i32 0, i32 1
  %146 = load ptr, ptr %145, align 8
  call void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %136, ptr %138, i64 %140, ptr %142, i32 %144, ptr %146, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %36, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %37, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8 %38, double noundef %130, double noundef %131, i32 noundef %132, i32 noundef %133, i32 noundef %134)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !20
  %147 = getelementptr inbounds { i64, ptr }, ptr %39, i32 0, i32 0
  %148 = load i64, ptr %147, align 8
  %149 = getelementptr inbounds { i64, ptr }, ptr %39, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8
  call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %148, ptr %150)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %31, i64 16, i1 false), !tbaa.struct !14
  %151 = getelementptr inbounds { i32, ptr }, ptr %40, i32 0, i32 0
  %152 = load i32, ptr %151, align 8
  %153 = getelementptr inbounds { i32, ptr }, ptr %40, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %152, ptr %154)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !14
  %155 = getelementptr inbounds { i32, ptr }, ptr %41, i32 0, i32 0
  %156 = load i32, ptr %155, align 8
  %157 = getelementptr inbounds { i32, ptr }, ptr %41, i32 0, i32 1
  %158 = load ptr, ptr %157, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %156, ptr %158)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  ret void
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !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, !13, i64 8}
!12 = !{!"_ZTSN4sptk5swipe9intvectorE", !10, i64 0, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{i64 0, i64 4, !9, i64 8, i64 8, !15}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !13, i64 8}
!17 = !{!"_ZTSN4sptk5swipe6vectorE", !10, i64 0, !13, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 8, !15}


; 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.sptk::swipe::vector" = type { i32, ptr }
%"struct.sptk::swipe::intvector" = type { i32, ptr }

declare { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef) local_unnamed_addr #0

declare void @_ZN4sptk5swipe5freevENS0_6vectorE(i32, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32, ptr, i32, ptr, double noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32, ptr, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64, ptr, i64, ptr, i32, ptr, ptr noundef byval(%"struct.sptk::swipe::vector") align 8, ptr noundef byval(%"struct.sptk::swipe::vector") align 8, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8, double noundef, double noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2

declare void @_ZN4sptk5swipe5freemENS0_6matrixE(i64, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5swipe6SfirstENS0_6matrixENS0_6vectorES2_S2_S2_NS0_9intvectorES3_dddi(i64 %0, ptr %1, i32 %2, ptr %3, i32 %4, ptr nocapture readonly %5, ptr nocapture noundef readonly byval(%"struct.sptk::swipe::vector") align 8 %6, ptr nocapture noundef readonly byval(%"struct.sptk::swipe::vector") align 8 %7, ptr nocapture noundef readonly byval(%"struct.sptk::swipe::intvector") align 8 %8, ptr nocapture noundef readonly byval(%"struct.sptk::swipe::intvector") align 8 %9, double noundef %10, double noundef %11, double noundef %12, i32 noundef %13) local_unnamed_addr #1 {
  %15 = ptrtoint ptr %5 to i64
  %16 = alloca %"struct.sptk::swipe::vector", align 8
  %17 = alloca %"struct.sptk::swipe::vector", align 8
  %18 = getelementptr inbounds i8, ptr %8, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = sext i32 %13 to i64
  %21 = getelementptr inbounds i32, ptr %19, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = sdiv i32 %22, 2
  %.sroa.027.0.copyload = load i32, ptr %6, align 8, !tbaa !11
  %.sroa.229.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.229.0.copyload = load ptr, ptr %.sroa.229.0..sroa_idx, align 8, !tbaa !12
  %24 = tail call { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32 %2, ptr %3, i32 %.sroa.027.0.copyload, ptr %.sroa.229.0.copyload, double noundef %10, i32 noundef %22, i32 noundef %23)
  %.sroa.020.0.copyload = load i32, ptr %7, align 8, !tbaa !11
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.222.0.copyload = load ptr, ptr %.sroa.222.0..sroa_idx, align 8, !tbaa !12
  %.sroa.222.0.copyload57 = ptrtoint ptr %.sroa.222.0.copyload to i64
  %25 = tail call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %.sroa.020.0.copyload, ptr %.sroa.222.0.copyload, double noundef 2.000000e+00)
  %26 = tail call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %25)
  %27 = extractvalue { i32, ptr } %26, 1
  %28 = ptrtoint ptr %27 to i64
  %29 = tail call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %25)
  %30 = extractvalue { i32, ptr } %29, 1
  %31 = ptrtoint ptr %30 to i64
  %32 = icmp sgt i32 %25, 0
  br i1 %32, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %14
  %wide.trip.count = zext nneg i32 %25 to i64
  %min.iters.check = icmp ult i32 %25, 12
  br i1 %min.iters.check, label %.lr.ph.preheader65, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %33 = sub i64 %28, %31
  %diff.check = icmp ult i64 %33, 16
  %34 = sub i64 %31, %15
  %diff.check56 = icmp ult i64 %34, 16
  %conflict.rdx = or i1 %diff.check, %diff.check56
  %35 = sub i64 %.sroa.222.0.copyload57, %31
  %diff.check58 = icmp ult i64 %35, 16
  %conflict.rdx59 = or i1 %conflict.rdx, %diff.check58
  %36 = sub i64 %28, %15
  %diff.check60 = icmp ult i64 %36, 16
  %conflict.rdx61 = or i1 %conflict.rdx59, %diff.check60
  %37 = sub i64 %28, %.sroa.222.0.copyload57
  %diff.check62 = icmp ult i64 %37, 16
  %conflict.rdx63 = or i1 %conflict.rdx61, %diff.check62
  br i1 %conflict.rdx63, label %.lr.ph.preheader65, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483646
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %38 = getelementptr inbounds double, ptr %5, i64 %index
  %wide.load = load <2 x double>, ptr %38, align 8, !tbaa !13
  %39 = getelementptr inbounds double, ptr %30, i64 %index
  store <2 x double> %wide.load, ptr %39, align 8, !tbaa !13
  %40 = getelementptr inbounds double, ptr %.sroa.222.0.copyload, i64 %index
  %wide.load64 = load <2 x double>, ptr %40, align 8, !tbaa !13
  %41 = fadd <2 x double> %wide.load64, <double -1.000000e+00, double -1.000000e+00>
  %42 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %41)
  %43 = fsub <2 x double> <double 1.000000e+00, double 1.000000e+00>, %42
  %44 = getelementptr inbounds double, ptr %27, i64 %index
  store <2 x double> %43, ptr %44, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %45 = icmp eq i64 %index.next, %n.vec
  br i1 %45, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader65

.lr.ph.preheader65:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader65
  %46 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.ph
  %47 = load double, ptr %46, align 8, !tbaa !13
  %48 = getelementptr inbounds double, ptr %30, i64 %indvars.iv.ph
  store double %47, ptr %48, align 8, !tbaa !13
  %49 = getelementptr inbounds double, ptr %.sroa.222.0.copyload, i64 %indvars.iv.ph
  %50 = load double, ptr %49, align 8, !tbaa !13
  %51 = fadd double %50, -1.000000e+00
  %52 = tail call double @llvm.fabs.f64(double %51)
  %53 = fsub double 1.000000e+00, %52
  %54 = getelementptr inbounds double, ptr %27, i64 %indvars.iv.ph
  store double %53, ptr %54, align 8, !tbaa !13
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader65
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader65 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %55 = add nsw i64 %wide.trip.count, -1
  %56 = icmp eq i64 %indvars.iv.ph, %55
  br i1 %56, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %57 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %58 = load double, ptr %57, align 8, !tbaa !13
  %59 = getelementptr inbounds double, ptr %30, i64 %indvars.iv
  store double %58, ptr %59, align 8, !tbaa !13
  %60 = getelementptr inbounds double, ptr %.sroa.222.0.copyload, i64 %indvars.iv
  %61 = load double, ptr %60, align 8, !tbaa !13
  %62 = fadd double %61, -1.000000e+00
  %63 = tail call double @llvm.fabs.f64(double %62)
  %64 = fsub double 1.000000e+00, %63
  %65 = getelementptr inbounds double, ptr %27, i64 %indvars.iv
  store double %64, ptr %65, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next
  %67 = load double, ptr %66, align 8, !tbaa !13
  %68 = getelementptr inbounds double, ptr %30, i64 %indvars.iv.next
  store double %67, ptr %68, align 8, !tbaa !13
  %69 = getelementptr inbounds double, ptr %.sroa.222.0.copyload, i64 %indvars.iv.next
  %70 = load double, ptr %69, align 8, !tbaa !13
  %71 = fadd double %70, -1.000000e+00
  %72 = tail call double @llvm.fabs.f64(double %71)
  %73 = fsub double 1.000000e+00, %72
  %74 = getelementptr inbounds double, ptr %27, i64 %indvars.iv.next
  store double %73, ptr %74, align 8, !tbaa !13
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %14
  %75 = extractvalue { i32, ptr } %29, 0
  %76 = extractvalue { i32, ptr } %26, 0
  %77 = extractvalue { i64, ptr } %24, 1
  %78 = extractvalue { i64, ptr } %24, 0
  store i32 %75, ptr %16, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %30, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !12
  store i32 %76, ptr %17, align 8, !tbaa !11
  %.sroa.617.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %27, ptr %.sroa.617.0..sroa_idx, align 8, !tbaa !12
  tail call void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %0, ptr %1, i64 %78, ptr %77, i32 %.sroa.027.0.copyload, ptr %.sroa.229.0.copyload, ptr noundef nonnull byval(%"struct.sptk::swipe::vector") align 8 %16, ptr noundef nonnull byval(%"struct.sptk::swipe::vector") align 8 %17, ptr noundef nonnull byval(%"struct.sptk::swipe::intvector") align 8 %9, double noundef %12, double noundef %11, i32 noundef 0, i32 noundef %25, i32 noundef %23)
  tail call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %78, ptr %77)
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %76, ptr %27)
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %75, ptr %30)
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #3

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

!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, !10, i64 8}
!6 = !{!"_ZTSN4sptk5swipe9intvectorE", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !16, !17}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass