; 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 @_ZN4sptk5swipe4SnthENS0_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 %"struct.sptk::swipe::vector", align 8
  %29 = alloca i32, align 4
  %30 = alloca %"struct.sptk::swipe::vector", align 8
  %31 = alloca i32, align 4
  %32 = alloca %"struct.sptk::swipe::vector", align 8
  %33 = alloca %"struct.sptk::swipe::vector", align 8
  %34 = alloca i32, align 4
  %35 = alloca %"struct.sptk::swipe::matrix", align 8
  %36 = alloca %"struct.sptk::swipe::matrix", align 8
  %37 = alloca %"struct.sptk::swipe::vector", align 8
  %38 = alloca %"struct.sptk::swipe::vector", align 8
  %39 = alloca %"struct.sptk::swipe::vector", align 8
  %40 = alloca %"struct.sptk::swipe::intvector", align 8
  %41 = alloca %"struct.sptk::swipe::matrix", align 8
  %42 = alloca %"struct.sptk::swipe::vector", align 8
  %43 = alloca %"struct.sptk::swipe::vector", align 8
  %44 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 0
  store i64 %0, ptr %44, align 8
  %45 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 1
  store ptr %1, ptr %45, align 8
  %46 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 0
  store i32 %2, ptr %46, align 8
  %47 = getelementptr inbounds { i32, ptr }, ptr %16, i32 0, i32 1
  store ptr %3, ptr %47, align 8
  %48 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 0
  store i32 %4, ptr %48, align 8
  %49 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 1
  store ptr %5, ptr %49, 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
  %50 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = load i32, ptr %21, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %51, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = sdiv i32 %55, 2
  store i32 %56, 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
  %57 = load double, ptr %18, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = load i32, ptr %21, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr %59, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = load i32, ptr %23, align 4, !tbaa !9
  %65 = getelementptr inbounds { i32, ptr }, ptr %25, i32 0, i32 0
  %66 = load i32, ptr %65, align 8
  %67 = getelementptr inbounds { i32, ptr }, ptr %25, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8
  %69 = getelementptr inbounds { i32, ptr }, ptr %26, i32 0, i32 0
  %70 = load i32, ptr %69, align 8
  %71 = getelementptr inbounds { i32, ptr }, ptr %26, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8
  %73 = call { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32 %66, ptr %68, i32 %70, ptr %72, double noundef %57, i32 noundef %63, i32 noundef %64)
  %74 = getelementptr inbounds { i64, ptr }, ptr %24, i32 0, i32 0
  %75 = extractvalue { i64, ptr } %73, 0
  store i64 %75, ptr %74, align 8
  %76 = getelementptr inbounds { i64, ptr }, ptr %24, i32 0, i32 1
  %77 = extractvalue { i64, ptr } %73, 1
  store ptr %77, ptr %76, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !14
  %78 = load i32, ptr %21, align 4, !tbaa !9
  %79 = sitofp i32 %78 to double
  %80 = getelementptr inbounds { i32, ptr }, ptr %28, i32 0, i32 0
  %81 = load i32, ptr %80, align 8
  %82 = getelementptr inbounds { i32, ptr }, ptr %28, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8
  %84 = call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %81, ptr %83, double noundef %79)
  store i32 %84, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !14
  %85 = load i32, ptr %21, align 4, !tbaa !9
  %86 = add nsw i32 %85, 2
  %87 = sitofp i32 %86 to double
  %88 = getelementptr inbounds { i32, ptr }, ptr %30, i32 0, i32 0
  %89 = load i32, ptr %88, align 8
  %90 = getelementptr inbounds { i32, ptr }, ptr %30, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8
  %92 = call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %89, ptr %91, double noundef %87)
  store i32 %92, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %93 = load i32, ptr %29, align 4, !tbaa !9
  %94 = load i32, ptr %27, align 4, !tbaa !9
  %95 = sub nsw i32 %93, %94
  store i32 %95, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #5
  %96 = load i32, ptr %31, align 4, !tbaa !9
  %97 = call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %96)
  %98 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 0
  %99 = extractvalue { i32, ptr } %97, 0
  store i32 %99, ptr %98, align 8
  %100 = getelementptr inbounds { i32, ptr }, ptr %32, i32 0, i32 1
  %101 = extractvalue { i32, ptr } %97, 1
  store ptr %101, ptr %100, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #5
  %102 = load i32, ptr %31, align 4, !tbaa !9
  %103 = call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %102)
  %104 = getelementptr inbounds { i32, ptr }, ptr %33, i32 0, i32 0
  %105 = extractvalue { i32, ptr } %103, 0
  store i32 %105, ptr %104, align 8
  %106 = getelementptr inbounds { i32, ptr }, ptr %33, i32 0, i32 1
  %107 = extractvalue { i32, ptr } %103, 1
  store ptr %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 0, ptr %34, align 4, !tbaa !9
  %108 = load i32, ptr %27, align 4, !tbaa !9
  store i32 %108, ptr %22, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %144, %14
  %110 = load i32, ptr %22, align 4, !tbaa !9
  %111 = load i32, ptr %29, align 4, !tbaa !9
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %113, label %147

113:                                              ; preds = %109
  %114 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !16
  %116 = load i32, ptr %22, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds double, ptr %115, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %33, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !16
  %122 = load i32, ptr %34, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds double, ptr %121, i64 %123
  store double %119, ptr %124, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %7, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !16
  %127 = load i32, ptr %22, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !5
  %131 = load i32, ptr %21, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  %133 = sitofp i32 %132 to double
  %134 = fsub double %130, %133
  %135 = call double @llvm.fabs.f64(double %134)
  %136 = fsub double 1.000000e+00, %135
  %137 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = load i32, ptr %34, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %138, i64 %140
  store double %136, ptr %141, align 8, !tbaa !5
  %142 = load i32, ptr %34, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %34, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %113
  %145 = load i32, ptr %22, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %22, align 4, !tbaa !9
  br label %109, !llvm.loop !18

147:                                              ; preds = %109
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %33, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %39, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !14
  %148 = load double, ptr %20, align 8, !tbaa !5
  %149 = load double, ptr %19, align 8, !tbaa !5
  %150 = load i32, ptr %27, align 4, !tbaa !9
  %151 = load i32, ptr %31, align 4, !tbaa !9
  %152 = load i32, ptr %23, align 4, !tbaa !9
  %153 = getelementptr inbounds { i64, ptr }, ptr %35, i32 0, i32 0
  %154 = load i64, ptr %153, align 8
  %155 = getelementptr inbounds { i64, ptr }, ptr %35, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8
  %157 = getelementptr inbounds { i64, ptr }, ptr %36, i32 0, i32 0
  %158 = load i64, ptr %157, align 8
  %159 = getelementptr inbounds { i64, ptr }, ptr %36, i32 0, i32 1
  %160 = load ptr, ptr %159, align 8
  %161 = getelementptr inbounds { i32, ptr }, ptr %37, i32 0, i32 0
  %162 = load i32, ptr %161, align 8
  %163 = getelementptr inbounds { i32, ptr }, ptr %37, i32 0, i32 1
  %164 = load ptr, ptr %163, align 8
  call void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %154, ptr %156, i64 %158, ptr %160, i32 %162, ptr %164, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %38, ptr noundef byval(%"struct.sptk::swipe::vector") align 8 %39, ptr noundef byval(%"struct.sptk::swipe::intvector") align 8 %40, double noundef %148, double noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %24, i64 16, i1 false), !tbaa.struct !20
  %165 = getelementptr inbounds { i64, ptr }, ptr %41, i32 0, i32 0
  %166 = load i64, ptr %165, align 8
  %167 = getelementptr inbounds { i64, ptr }, ptr %41, i32 0, i32 1
  %168 = load ptr, ptr %167, align 8
  call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %166, ptr %168)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %42, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !14
  %169 = getelementptr inbounds { i32, ptr }, ptr %42, i32 0, i32 0
  %170 = load i32, ptr %169, align 8
  %171 = getelementptr inbounds { i32, ptr }, ptr %42, i32 0, i32 1
  %172 = load ptr, ptr %171, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %170, ptr %172)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %43, ptr align 8 %33, i64 16, i1 false), !tbaa.struct !14
  %173 = getelementptr inbounds { i32, ptr }, ptr %43, i32 0, i32 0
  %174 = load i32, ptr %173, align 8
  %175 = getelementptr inbounds { i32, ptr }, ptr %43, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %174, ptr %176)
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #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 @_ZN4sptk5swipe4SnthENS0_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.034.0.copyload = load i32, ptr %6, align 8, !tbaa !11
  %.sroa.236.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.236.0.copyload = load ptr, ptr %.sroa.236.0..sroa_idx, align 8, !tbaa !12
  %24 = tail call { i64, ptr } @_ZN4sptk5swipe8loudnessENS0_6vectorES1_dii(i32 %2, ptr %3, i32 %.sroa.034.0.copyload, ptr %.sroa.236.0.copyload, double noundef %10, i32 noundef %22, i32 noundef %23)
  %.sroa.028.0.copyload = load i32, ptr %7, align 8, !tbaa !11
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.230.0.copyload = load ptr, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !12
  %.sroa.230.0.copyload70 = ptrtoint ptr %.sroa.230.0.copyload to i64
  %25 = sitofp i32 %13 to double
  %26 = tail call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %.sroa.028.0.copyload, ptr %.sroa.230.0.copyload, double noundef %25)
  %27 = add nsw i32 %13, 2
  %28 = sitofp i32 %27 to double
  %29 = tail call noundef i32 @_ZN4sptk5swipe7bisectvENS0_6vectorEd(i32 %.sroa.028.0.copyload, ptr %.sroa.230.0.copyload, double noundef %28)
  %30 = sub i32 %29, %26
  %31 = tail call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %30)
  %32 = extractvalue { i32, ptr } %31, 1
  %33 = ptrtoint ptr %32 to i64
  %34 = tail call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %30)
  %35 = extractvalue { i32, ptr } %34, 1
  %36 = ptrtoint ptr %35 to i64
  %37 = icmp slt i32 %26, %29
  br i1 %37, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14
  %38 = add nsw i32 %13, 1
  %39 = sitofp i32 %38 to double
  %40 = sext i32 %26 to i64
  %wide.trip.count = zext i32 %30 to i64
  %min.iters.check = icmp ult i32 %30, 16
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %41 = sub i64 %33, %36
  %diff.check = icmp ult i64 %41, 16
  %42 = shl nsw i64 %40, 3
  %43 = add i64 %42, %15
  %44 = sub i64 %36, %43
  %diff.check69 = icmp ult i64 %44, 16
  %conflict.rdx = or i1 %diff.check, %diff.check69
  %45 = add i64 %42, %.sroa.230.0.copyload70
  %46 = sub i64 %45, %36
  %diff.check71 = icmp ult i64 %46, 16
  %conflict.rdx72 = or i1 %conflict.rdx, %diff.check71
  %47 = add i64 %42, %15
  %48 = sub i64 %33, %47
  %diff.check73 = icmp ult i64 %48, 16
  %conflict.rdx74 = or i1 %conflict.rdx72, %diff.check73
  %49 = add i64 %42, %.sroa.230.0.copyload70
  %50 = sub i64 %33, %49
  %diff.check75 = icmp ult i64 %50, 16
  %conflict.rdx76 = or i1 %conflict.rdx74, %diff.check75
  br i1 %conflict.rdx76, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 4294967294
  %ind.end = add nsw i64 %n.vec, %40
  %broadcast.splatinsert = insertelement <2 x double> poison, double %39, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %40
  %51 = getelementptr inbounds double, ptr %5, i64 %offset.idx
  %wide.load = load <2 x double>, ptr %51, align 8, !tbaa !13
  %52 = getelementptr inbounds double, ptr %35, i64 %index
  store <2 x double> %wide.load, ptr %52, align 8, !tbaa !13
  %53 = getelementptr inbounds double, ptr %.sroa.230.0.copyload, i64 %offset.idx
  %wide.load78 = load <2 x double>, ptr %53, align 8, !tbaa !13
  %54 = fsub <2 x double> %wide.load78, %broadcast.splat
  %55 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %54)
  %56 = fsub <2 x double> <double 1.000000e+00, double 1.000000e+00>, %55
  %57 = getelementptr inbounds double, ptr %32, i64 %index
  store <2 x double> %56, ptr %57, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, 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 %scalar.ph.preheader

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

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %59 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.ph
  %60 = load double, ptr %59, align 8, !tbaa !13
  %61 = getelementptr inbounds double, ptr %35, i64 %indvars.iv64.ph
  store double %60, ptr %61, align 8, !tbaa !13
  %62 = getelementptr inbounds double, ptr %.sroa.230.0.copyload, i64 %indvars.iv.ph
  %63 = load double, ptr %62, align 8, !tbaa !13
  %64 = fsub double %63, %39
  %65 = tail call double @llvm.fabs.f64(double %64)
  %66 = fsub double 1.000000e+00, %65
  %67 = getelementptr inbounds double, ptr %32, i64 %indvars.iv64.ph
  store double %66, ptr %67, align 8, !tbaa !13
  %indvars.iv.next65.prol = or disjoint i64 %indvars.iv64.ph, 1
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv64.unr = phi i64 [ %indvars.iv64.ph, %scalar.ph.preheader ], [ %indvars.iv.next65.prol, %scalar.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %68 = add nsw i64 %wide.trip.count, -1
  %69 = icmp eq i64 %indvars.iv64.ph, %68
  br i1 %69, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv64 = phi i64 [ %indvars.iv.next65.1, %scalar.ph ], [ %indvars.iv64.unr, %scalar.ph.prol.loopexit ]
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %70 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %71 = load double, ptr %70, align 8, !tbaa !13
  %72 = getelementptr inbounds double, ptr %35, i64 %indvars.iv64
  store double %71, ptr %72, align 8, !tbaa !13
  %73 = getelementptr inbounds double, ptr %.sroa.230.0.copyload, i64 %indvars.iv
  %74 = load double, ptr %73, align 8, !tbaa !13
  %75 = fsub double %74, %39
  %76 = tail call double @llvm.fabs.f64(double %75)
  %77 = fsub double 1.000000e+00, %76
  %78 = getelementptr inbounds double, ptr %32, i64 %indvars.iv64
  store double %77, ptr %78, align 8, !tbaa !13
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %79 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next
  %80 = load double, ptr %79, align 8, !tbaa !13
  %81 = getelementptr inbounds double, ptr %35, i64 %indvars.iv.next65
  store double %80, ptr %81, align 8, !tbaa !13
  %82 = getelementptr inbounds double, ptr %.sroa.230.0.copyload, i64 %indvars.iv.next
  %83 = load double, ptr %82, align 8, !tbaa !13
  %84 = fsub double %83, %39
  %85 = tail call double @llvm.fabs.f64(double %84)
  %86 = fsub double 1.000000e+00, %85
  %87 = getelementptr inbounds double, ptr %32, i64 %indvars.iv.next65
  store double %86, ptr %87, align 8, !tbaa !13
  %indvars.iv.next65.1 = add nuw nsw i64 %indvars.iv64, 2
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next65.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %scalar.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %14
  %88 = extractvalue { i32, ptr } %34, 0
  %89 = extractvalue { i32, ptr } %31, 0
  %90 = extractvalue { i64, ptr } %24, 1
  %91 = extractvalue { i64, ptr } %24, 0
  store i32 %88, ptr %16, align 8, !tbaa !11
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %35, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !12
  store i32 %89, ptr %17, align 8, !tbaa !11
  %.sroa.619.0..sroa_idx = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %32, ptr %.sroa.619.0..sroa_idx, align 8, !tbaa !12
  tail call void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %0, ptr %1, i64 %91, ptr %90, i32 %.sroa.034.0.copyload, ptr %.sroa.236.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 %26, i32 noundef %30, i32 noundef %23)
  tail call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %91, ptr %90)
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %89, ptr %32)
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %88, ptr %35)
  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,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass