; 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: nounwind
declare double @sqrt(double noundef) #2

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

; 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) #4

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: nounwind
declare double @cos(double noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %0, ptr %1, i64 %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, double noundef %9, double noundef %10, i32 noundef %11, i32 noundef %12, i32 noundef %13) #5 {
  %15 = alloca %"struct.sptk::swipe::matrix", align 8
  %16 = alloca %"struct.sptk::swipe::matrix", align 8
  %17 = alloca %"struct.sptk::swipe::vector", align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca %"struct.sptk::swipe::matrix", align 8
  %31 = alloca %"struct.sptk::swipe::vector", align 8
  %32 = alloca %"struct.sptk::swipe::vector", align 8
  %33 = alloca %"struct.sptk::swipe::vector", align 8
  %34 = alloca %"struct.sptk::swipe::vector", align 8
  %35 = alloca %"struct.sptk::swipe::matrix", align 8
  %36 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 0
  store i64 %0, ptr %36, align 8
  %37 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 1
  store ptr %1, ptr %37, align 8
  %38 = getelementptr inbounds { i64, ptr }, ptr %16, i32 0, i32 0
  store i64 %2, ptr %38, align 8
  %39 = getelementptr inbounds { i64, ptr }, ptr %16, i32 0, i32 1
  store ptr %3, ptr %39, align 8
  %40 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 0
  store i32 %4, ptr %40, align 8
  %41 = getelementptr inbounds { i32, ptr }, ptr %17, i32 0, i32 1
  store ptr %5, ptr %41, align 8
  store double %9, ptr %18, align 8, !tbaa !5
  store double %10, ptr %19, align 8, !tbaa !5
  store i32 %11, ptr %20, align 4, !tbaa !9
  store i32 %12, ptr %21, align 4, !tbaa !9
  store i32 %13, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store double 0.000000e+00, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store double 0.000000e+00, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %42 = load i32, ptr %22, align 4, !tbaa !9
  %43 = sitofp i32 %42 to double
  %44 = load double, ptr %19, align 8, !tbaa !5
  %45 = fdiv double %43, %44
  store double %45, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %46 = load i32, ptr %21, align 4, !tbaa !9
  %47 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %16, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !11
  %49 = call { i64, ptr } @_ZN4sptk5swipe5zeromEii(i32 noundef %46, i32 noundef %48)
  %50 = getelementptr inbounds { i64, ptr }, ptr %30, i32 0, i32 0
  %51 = extractvalue { i64, ptr } %49, 0
  store i64 %51, ptr %50, align 8
  %52 = getelementptr inbounds { i64, ptr }, ptr %30, i32 0, i32 1
  %53 = extractvalue { i64, ptr } %49, 1
  store ptr %53, ptr %52, align 8
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %303, %14
  %55 = load i32, ptr %23, align 4, !tbaa !9
  %56 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %30, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %59, label %306

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  %60 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !14
  %62 = call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %61)
  %63 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 0
  %64 = extractvalue { i32, ptr } %62, 0
  store i32 %64, ptr %63, align 8
  %65 = getelementptr inbounds { i32, ptr }, ptr %31, i32 0, i32 1
  %66 = extractvalue { i32, ptr } %62, 1
  store ptr %66, ptr %65, align 8
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %91, %59
  %68 = load i32, ptr %24, align 4, !tbaa !9
  %69 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !14
  %71 = icmp slt i32 %68, %70
  br i1 %71, label %72, label %94

72:                                               ; preds = %67
  %73 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = load i32, ptr %24, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %74, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %6, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = load i32, ptr %23, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !5
  %85 = fdiv double %78, %84
  %86 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !16
  %88 = load i32, ptr %24, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %87, i64 %89
  store double %85, ptr %90, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %72
  %92 = load i32, ptr %24, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %24, align 4, !tbaa !9
  br label %67, !llvm.loop !17

94:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  %95 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !14
  %97 = call { i32, ptr } @_ZN4sptk5swipe5zerovEi(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
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %176, %94
  %103 = load i32, ptr %24, align 4, !tbaa !9
  %104 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !19
  %106 = icmp slt i32 %103, %105
  br i1 %106, label %107, label %179

107:                                              ; preds = %102
  %108 = getelementptr inbounds %"struct.sptk::swipe::intvector", ptr %8, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !21
  %110 = load i32, ptr %24, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %109, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = icmp eq i32 %113, 1
  br i1 %114, label %115, label %175

115:                                              ; preds = %107
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %171, %115
  %117 = load i32, ptr %25, align 4, !tbaa !9
  %118 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !14
  %120 = icmp slt i32 %117, %119
  br i1 %120, label %121, label %174

121:                                              ; preds = %116
  %122 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !16
  %124 = load i32, ptr %25, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds double, ptr %123, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !5
  %128 = load i32, ptr %24, align 4, !tbaa !9
  %129 = sitofp i32 %128 to double
  %130 = fsub double %127, %129
  %131 = fsub double %130, 1.000000e+00
  %132 = call double @llvm.fabs.f64(double %131)
  store double %132, ptr %28, align 8, !tbaa !5
  %133 = load double, ptr %28, align 8, !tbaa !5
  %134 = fcmp olt double %133, 2.500000e-01
  br i1 %134, label %135, label %149

135:                                              ; preds = %121
  %136 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !16
  %138 = load i32, ptr %25, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds double, ptr %137, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !5
  %142 = fmul double 0x401921FB54442D18, %141
  %143 = call double @cos(double noundef %142) #6
  %144 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !16
  %146 = load i32, ptr %25, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds double, ptr %145, i64 %147
  store double %143, ptr %148, align 8, !tbaa !5
  br label %170

149:                                              ; preds = %121
  %150 = load double, ptr %28, align 8, !tbaa !5
  %151 = fcmp olt double %150, 7.500000e-01
  br i1 %151, label %152, label %169

152:                                              ; preds = %149
  %153 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %31, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8, !tbaa !16
  %155 = load i32, ptr %25, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds double, ptr %154, i64 %156
  %158 = load double, ptr %157, align 8, !tbaa !5
  %159 = fmul double 0x401921FB54442D18, %158
  %160 = call double @cos(double noundef %159) #6
  %161 = fdiv double %160, 2.000000e+00
  %162 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %163 = load ptr, ptr %162, align 8, !tbaa !16
  %164 = load i32, ptr %25, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %163, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !5
  %168 = fadd double %167, %161
  store double %168, ptr %166, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %152, %149
  br label %170

170:                                              ; preds = %169, %135
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %25, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %25, align 4, !tbaa !9
  br label %116, !llvm.loop !22

174:                                              ; preds = %116
  br label %175

175:                                              ; preds = %174, %107
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %24, align 4, !tbaa !9
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %24, align 4, !tbaa !9
  br label %102, !llvm.loop !23

179:                                              ; preds = %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %31, i64 16, i1 false), !tbaa.struct !24
  %180 = getelementptr inbounds { i32, ptr }, ptr %33, i32 0, i32 0
  %181 = load i32, ptr %180, align 8
  %182 = getelementptr inbounds { i32, ptr }, ptr %33, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %181, ptr %183)
  store double 0.000000e+00, ptr %28, align 8, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %228, %179
  %185 = load i32, ptr %24, align 4, !tbaa !9
  %186 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 0
  %187 = load i32, ptr %186, align 8, !tbaa !14
  %188 = icmp slt i32 %185, %187
  br i1 %188, label %189, label %231

189:                                              ; preds = %184
  %190 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %17, i32 0, i32 1
  %191 = load ptr, ptr %190, align 8, !tbaa !16
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds double, ptr %191, i64 %193
  %195 = load double, ptr %194, align 8, !tbaa !5
  %196 = fdiv double 1.000000e+00, %195
  %197 = call double @sqrt(double noundef %196) #6
  %198 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %199 = load ptr, ptr %198, align 8, !tbaa !16
  %200 = load i32, ptr %24, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds double, ptr %199, i64 %201
  %203 = load double, ptr %202, align 8, !tbaa !5
  %204 = fmul double %203, %197
  store double %204, ptr %202, align 8, !tbaa !5
  %205 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !16
  %207 = load i32, ptr %24, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds double, ptr %206, i64 %208
  %210 = load double, ptr %209, align 8, !tbaa !5
  %211 = fcmp ogt double %210, 0.000000e+00
  br i1 %211, label %212, label %227

212:                                              ; preds = %189
  %213 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %214 = load ptr, ptr %213, align 8, !tbaa !16
  %215 = load i32, ptr %24, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds double, ptr %214, i64 %216
  %218 = load double, ptr %217, align 8, !tbaa !5
  %219 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %220 = load ptr, ptr %219, align 8, !tbaa !16
  %221 = load i32, ptr %24, align 4, !tbaa !9
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds double, ptr %220, i64 %222
  %224 = load double, ptr %223, align 8, !tbaa !5
  %225 = load double, ptr %28, align 8, !tbaa !5
  %226 = call double @llvm.fmuladd.f64(double %218, double %224, double %225)
  store double %226, ptr %28, align 8, !tbaa !5
  br label %227

227:                                              ; preds = %212, %189
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %24, align 4, !tbaa !9
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %24, align 4, !tbaa !9
  br label %184, !llvm.loop !26

231:                                              ; preds = %184
  %232 = load double, ptr %28, align 8, !tbaa !5
  %233 = call double @sqrt(double noundef %232) #6
  store double %233, ptr %28, align 8, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %234

234:                                              ; preds = %248, %231
  %235 = load i32, ptr %24, align 4, !tbaa !9
  %236 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 0
  %237 = load i32, ptr %236, align 8, !tbaa !14
  %238 = icmp slt i32 %235, %237
  br i1 %238, label %239, label %251

239:                                              ; preds = %234
  %240 = load double, ptr %28, align 8, !tbaa !5
  %241 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %242 = load ptr, ptr %241, align 8, !tbaa !16
  %243 = load i32, ptr %24, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds double, ptr %242, i64 %244
  %246 = load double, ptr %245, align 8, !tbaa !5
  %247 = fdiv double %246, %240
  store double %247, ptr %245, align 8, !tbaa !5
  br label %248

248:                                              ; preds = %239
  %249 = load i32, ptr %24, align 4, !tbaa !9
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %24, align 4, !tbaa !9
  br label %234, !llvm.loop !27

251:                                              ; preds = %234
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %252

252:                                              ; preds = %295, %251
  %253 = load i32, ptr %24, align 4, !tbaa !9
  %254 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %16, i32 0, i32 0
  %255 = load i32, ptr %254, align 8, !tbaa !11
  %256 = icmp slt i32 %253, %255
  br i1 %256, label %257, label %298

257:                                              ; preds = %252
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %258

258:                                              ; preds = %291, %257
  %259 = load i32, ptr %25, align 4, !tbaa !9
  %260 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %16, i32 0, i32 1
  %261 = load i32, ptr %260, align 4, !tbaa !28
  %262 = icmp slt i32 %259, %261
  br i1 %262, label %263, label %294

263:                                              ; preds = %258
  %264 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %32, i32 0, i32 1
  %265 = load ptr, ptr %264, align 8, !tbaa !16
  %266 = load i32, ptr %25, align 4, !tbaa !9
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds double, ptr %265, i64 %267
  %269 = load double, ptr %268, align 8, !tbaa !5
  %270 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %16, i32 0, i32 2
  %271 = load ptr, ptr %270, align 8, !tbaa !29
  %272 = load i32, ptr %24, align 4, !tbaa !9
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds ptr, ptr %271, i64 %273
  %275 = load ptr, ptr %274, align 8, !tbaa !25
  %276 = load i32, ptr %25, align 4, !tbaa !9
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds double, ptr %275, i64 %277
  %279 = load double, ptr %278, align 8, !tbaa !5
  %280 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %30, i32 0, i32 2
  %281 = load ptr, ptr %280, align 8, !tbaa !29
  %282 = load i32, ptr %23, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds ptr, ptr %281, i64 %283
  %285 = load ptr, ptr %284, align 8, !tbaa !25
  %286 = load i32, ptr %24, align 4, !tbaa !9
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds double, ptr %285, i64 %287
  %289 = load double, ptr %288, align 8, !tbaa !5
  %290 = call double @llvm.fmuladd.f64(double %269, double %279, double %289)
  store double %290, ptr %288, align 8, !tbaa !5
  br label %291

291:                                              ; preds = %263
  %292 = load i32, ptr %25, align 4, !tbaa !9
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %25, align 4, !tbaa !9
  br label %258, !llvm.loop !30

294:                                              ; preds = %258
  br label %295

295:                                              ; preds = %294
  %296 = load i32, ptr %24, align 4, !tbaa !9
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %24, align 4, !tbaa !9
  br label %252, !llvm.loop !31

298:                                              ; preds = %252
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %32, i64 16, i1 false), !tbaa.struct !24
  %299 = getelementptr inbounds { i32, ptr }, ptr %34, i32 0, i32 0
  %300 = load i32, ptr %299, align 8
  %301 = getelementptr inbounds { i32, ptr }, ptr %34, i32 0, i32 1
  %302 = load ptr, ptr %301, align 8
  call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %300, ptr %302)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  br label %303

303:                                              ; preds = %298
  %304 = load i32, ptr %23, align 4, !tbaa !9
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %23, align 4, !tbaa !9
  br label %54, !llvm.loop !32

306:                                              ; preds = %54
  store i32 0, ptr %25, align 4, !tbaa !9
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %307

307:                                              ; preds = %397, %306
  %308 = load i32, ptr %24, align 4, !tbaa !9
  %309 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %15, i32 0, i32 1
  %310 = load i32, ptr %309, align 4, !tbaa !28
  %311 = icmp slt i32 %308, %310
  br i1 %311, label %312, label %400

312:                                              ; preds = %307
  %313 = load double, ptr %26, align 8, !tbaa !5
  %314 = load double, ptr %27, align 8, !tbaa !5
  %315 = fsub double %313, %314
  store double %315, ptr %28, align 8, !tbaa !5
  br label %316

316:                                              ; preds = %319, %312
  %317 = load double, ptr %28, align 8, !tbaa !5
  %318 = fcmp oge double %317, 0.000000e+00
  br i1 %318, label %319, label %328

319:                                              ; preds = %316
  %320 = load i32, ptr %25, align 4, !tbaa !9
  %321 = add nsw i32 %320, 1
  store i32 %321, ptr %25, align 4, !tbaa !9
  %322 = load double, ptr %29, align 8, !tbaa !5
  %323 = load double, ptr %27, align 8, !tbaa !5
  %324 = fadd double %323, %322
  store double %324, ptr %27, align 8, !tbaa !5
  %325 = load double, ptr %29, align 8, !tbaa !5
  %326 = load double, ptr %28, align 8, !tbaa !5
  %327 = fsub double %326, %325
  store double %327, ptr %28, align 8, !tbaa !5
  br label %316, !llvm.loop !33

328:                                              ; preds = %316
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %329

329:                                              ; preds = %390, %328
  %330 = load i32, ptr %23, align 4, !tbaa !9
  %331 = load i32, ptr %21, align 4, !tbaa !9
  %332 = icmp slt i32 %330, %331
  br i1 %332, label %333, label %393

333:                                              ; preds = %329
  %334 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %30, i32 0, i32 2
  %335 = load ptr, ptr %334, align 8, !tbaa !29
  %336 = load i32, ptr %23, align 4, !tbaa !9
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds ptr, ptr %335, i64 %337
  %339 = load ptr, ptr %338, align 8, !tbaa !25
  %340 = load i32, ptr %25, align 4, !tbaa !9
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds double, ptr %339, i64 %341
  %343 = load double, ptr %342, align 8, !tbaa !5
  %344 = load double, ptr %28, align 8, !tbaa !5
  %345 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %30, i32 0, i32 2
  %346 = load ptr, ptr %345, align 8, !tbaa !29
  %347 = load i32, ptr %23, align 4, !tbaa !9
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds ptr, ptr %346, i64 %348
  %350 = load ptr, ptr %349, align 8, !tbaa !25
  %351 = load i32, ptr %25, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds double, ptr %350, i64 %352
  %354 = load double, ptr %353, align 8, !tbaa !5
  %355 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %30, i32 0, i32 2
  %356 = load ptr, ptr %355, align 8, !tbaa !29
  %357 = load i32, ptr %23, align 4, !tbaa !9
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds ptr, ptr %356, i64 %358
  %360 = load ptr, ptr %359, align 8, !tbaa !25
  %361 = load i32, ptr %25, align 4, !tbaa !9
  %362 = sub nsw i32 %361, 1
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds double, ptr %360, i64 %363
  %365 = load double, ptr %364, align 8, !tbaa !5
  %366 = fsub double %354, %365
  %367 = fmul double %344, %366
  %368 = load double, ptr %29, align 8, !tbaa !5
  %369 = fdiv double %367, %368
  %370 = fadd double %343, %369
  %371 = getelementptr inbounds %"struct.sptk::swipe::vector", ptr %7, i32 0, i32 1
  %372 = load ptr, ptr %371, align 8, !tbaa !16
  %373 = load i32, ptr %23, align 4, !tbaa !9
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds double, ptr %372, i64 %374
  %376 = load double, ptr %375, align 8, !tbaa !5
  %377 = getelementptr inbounds %"struct.sptk::swipe::matrix", ptr %15, i32 0, i32 2
  %378 = load ptr, ptr %377, align 8, !tbaa !29
  %379 = load i32, ptr %20, align 4, !tbaa !9
  %380 = load i32, ptr %23, align 4, !tbaa !9
  %381 = add nsw i32 %379, %380
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds ptr, ptr %378, i64 %382
  %384 = load ptr, ptr %383, align 8, !tbaa !25
  %385 = load i32, ptr %24, align 4, !tbaa !9
  %386 = sext i32 %385 to i64
  %387 = getelementptr inbounds double, ptr %384, i64 %386
  %388 = load double, ptr %387, align 8, !tbaa !5
  %389 = call double @llvm.fmuladd.f64(double %370, double %376, double %388)
  store double %389, ptr %387, align 8, !tbaa !5
  br label %390

390:                                              ; preds = %333
  %391 = load i32, ptr %23, align 4, !tbaa !9
  %392 = add nsw i32 %391, 1
  store i32 %392, ptr %23, align 4, !tbaa !9
  br label %329, !llvm.loop !34

393:                                              ; preds = %329
  %394 = load double, ptr %18, align 8, !tbaa !5
  %395 = load double, ptr %26, align 8, !tbaa !5
  %396 = fadd double %395, %394
  store double %396, ptr %26, align 8, !tbaa !5
  br label %397

397:                                              ; preds = %393
  %398 = load i32, ptr %24, align 4, !tbaa !9
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %24, align 4, !tbaa !9
  br label %307, !llvm.loop !35

400:                                              ; preds = %307
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %30, i64 16, i1 false), !tbaa.struct !36
  %401 = getelementptr inbounds { i64, ptr }, ptr %35, i32 0, i32 0
  %402 = load i64, ptr %401, align 8
  %403 = getelementptr inbounds { i64, ptr }, ptr %35, i32 0, i32 1
  %404 = load ptr, ptr %403, align 8
  call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %402, ptr %404)
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  ret void
}

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

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

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

declare void @_ZN4sptk5swipe5freemENS0_6matrixE(i64, ptr) #1

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 = { nounwind "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 speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !10, i64 0}
!12 = !{!"_ZTSN4sptk5swipe6matrixE", !10, i64 0, !10, i64 4, !13, i64 8}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTSN4sptk5swipe6vectorE", !10, i64 0, !13, i64 8}
!16 = !{!15, !13, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN4sptk5swipe9intvectorE", !10, i64 0, !13, i64 8}
!21 = !{!20, !13, i64 8}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = !{i64 0, i64 4, !9, i64 8, i64 8, !25}
!25 = !{!13, !13, i64 0}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = !{!12, !10, i64 4}
!29 = !{!12, !13, i64 8}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}
!32 = distinct !{!32, !18}
!33 = distinct !{!33, !18}
!34 = distinct !{!34, !18}
!35 = distinct !{!35, !18}
!36 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 8, !25}


; 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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4sptk5swipe4SaddENS0_6matrixES1_NS0_6vectorES2_S2_NS0_9intvectorEddiii(i64 %0, ptr nocapture readonly %1, i64 %2, ptr nocapture readonly %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, double noundef %9, double noundef %10, i32 noundef %11, i32 noundef %12, i32 noundef %13) local_unnamed_addr #3 {
  %.sroa.1.0.extract.shift = lshr i64 %0, 32
  %.sroa.1.0.extract.trunc = trunc nuw i64 %.sroa.1.0.extract.shift to i32
  %.sroa.0102.0.extract.trunc = trunc i64 %2 to i32
  %.sroa.3104.0.extract.shift = lshr i64 %2, 32
  %15 = sitofp i32 %13 to double
  %16 = fdiv double %15, %10
  %17 = tail call { i64, ptr } @_ZN4sptk5swipe5zeromEii(i32 noundef %12, i32 noundef %.sroa.0102.0.extract.trunc)
  %18 = extractvalue { i64, ptr } %17, 0
  %19 = extractvalue { i64, ptr } %17, 1
  %.sroa.023.0.extract.trunc = trunc i64 %18 to i32
  %20 = icmp sgt i32 %.sroa.023.0.extract.trunc, 0
  br i1 %20, label %.lr.ph150, label %.preheader123

.lr.ph150:                                        ; preds = %14
  %.sroa.3104.0.extract.trunc = trunc nuw i64 %.sroa.3104.0.extract.shift to i32
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  %22 = getelementptr inbounds i8, ptr %8, i64 8
  %23 = icmp slt i32 %.sroa.0102.0.extract.trunc, 1
  %24 = icmp slt i32 %.sroa.3104.0.extract.trunc, 1
  %wide.trip.count210 = and i64 %18, 2147483647
  %wide.trip.count205 = and i64 %2, 2147483647
  %brmerge = select i1 %23, i1 true, i1 %24
  %25 = icmp eq i64 %.sroa.3104.0.extract.shift, 1
  %unroll_iter = and i64 %.sroa.3104.0.extract.shift, 2147483646
  %26 = and i64 %2, 4294967296
  %lcmp.mod251.not = icmp eq i64 %26, 0
  br label %57

.preheader123:                                    ; preds = %._crit_edge147, %14
  %27 = icmp sgt i32 %.sroa.1.0.extract.trunc, 0
  br i1 %27, label %.lr.ph166, label %._crit_edge167

.lr.ph166:                                        ; preds = %.preheader123
  %28 = icmp sgt i32 %12, 0
  %29 = getelementptr inbounds i8, ptr %7, i64 8
  %30 = load ptr, ptr %29, align 8
  br i1 %28, label %.lr.ph166.split.us.preheader, label %._crit_edge167

.lr.ph166.split.us.preheader:                     ; preds = %.lr.ph166
  %31 = sext i32 %11 to i64
  %wide.trip.count215 = zext nneg i32 %12 to i64
  %invariant.gep = getelementptr ptr, ptr %1, i64 %31
  br label %.lr.ph166.split.us

.lr.ph166.split.us:                               ; preds = %.lr.ph166.split.us.preheader, %._crit_edge161.us
  %indvars.iv217 = phi i64 [ 0, %.lr.ph166.split.us.preheader ], [ %indvars.iv.next218, %._crit_edge161.us ]
  %.2111164.us = phi i32 [ 0, %.lr.ph166.split.us.preheader ], [ %.3112.lcssa.us, %._crit_edge161.us ]
  %.0113163.us = phi double [ 0.000000e+00, %.lr.ph166.split.us.preheader ], [ %56, %._crit_edge161.us ]
  %.0114162.us = phi double [ 0.000000e+00, %.lr.ph166.split.us.preheader ], [ %.1115.lcssa.us, %._crit_edge161.us ]
  %32 = fsub double %.0113163.us, %.0114162.us
  %33 = fcmp ult double %32, 0.000000e+00
  br i1 %33, label %.preheader.us, label %.lr.ph155.us

.lr.ph155.us:                                     ; preds = %.lr.ph166.split.us, %.lr.ph155.us
  %.3112153.us = phi i32 [ %34, %.lr.ph155.us ], [ %.2111164.us, %.lr.ph166.split.us ]
  %.1115152.us = phi double [ %35, %.lr.ph155.us ], [ %.0114162.us, %.lr.ph166.split.us ]
  %.2118151.us = phi double [ %36, %.lr.ph155.us ], [ %32, %.lr.ph166.split.us ]
  %34 = add nsw i32 %.3112153.us, 1
  %35 = fadd double %16, %.1115152.us
  %36 = fsub double %.2118151.us, %16
  %37 = fcmp ult double %36, 0.000000e+00
  br i1 %37, label %.preheader.us, label %.lr.ph155.us, !llvm.loop !5

38:                                               ; preds = %.preheader.us, %38
  %indvars.iv212 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next213, %38 ]
  %39 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv212
  %40 = load ptr, ptr %39, align 8, !tbaa !7
  %41 = getelementptr inbounds double, ptr %40, i64 %55
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = getelementptr i8, ptr %41, i64 -8
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = fsub double %42, %44
  %46 = fmul double %.2118.lcssa.us, %45
  %47 = fdiv double %46, %16
  %48 = fadd double %42, %47
  %49 = getelementptr inbounds double, ptr %30, i64 %indvars.iv212
  %50 = load double, ptr %49, align 8, !tbaa !11
  %gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv212
  %51 = load ptr, ptr %gep, align 8, !tbaa !7
  %52 = getelementptr inbounds double, ptr %51, i64 %indvars.iv217
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = tail call double @llvm.fmuladd.f64(double %48, double %50, double %53)
  store double %54, ptr %52, align 8, !tbaa !11
  %indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
  %exitcond216.not = icmp eq i64 %indvars.iv.next213, %wide.trip.count215
  br i1 %exitcond216.not, label %._crit_edge161.us, label %38, !llvm.loop !13

.preheader.us:                                    ; preds = %.lr.ph155.us, %.lr.ph166.split.us
  %.2118.lcssa.us = phi double [ %32, %.lr.ph166.split.us ], [ %36, %.lr.ph155.us ]
  %.1115.lcssa.us = phi double [ %.0114162.us, %.lr.ph166.split.us ], [ %35, %.lr.ph155.us ]
  %.3112.lcssa.us = phi i32 [ %.2111164.us, %.lr.ph166.split.us ], [ %34, %.lr.ph155.us ]
  %55 = sext i32 %.3112.lcssa.us to i64
  br label %38

._crit_edge161.us:                                ; preds = %38
  %56 = fadd double %.0113163.us, %9
  %indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1
  %exitcond221.not = icmp eq i64 %indvars.iv.next218, %.sroa.1.0.extract.shift
  br i1 %exitcond221.not, label %._crit_edge167, label %.lr.ph166.split.us, !llvm.loop !14

57:                                               ; preds = %.lr.ph150, %._crit_edge147
  %indvars.iv207 = phi i64 [ 0, %.lr.ph150 ], [ %indvars.iv.next208, %._crit_edge147 ]
  %58 = shl i64 %indvars.iv207, 3
  %59 = tail call { i32, ptr } @_ZN4sptk5swipe5makevEi(i32 noundef %4)
  %60 = extractvalue { i32, ptr } %59, 0
  %61 = extractvalue { i32, ptr } %59, 1
  %62 = icmp sgt i32 %60, 0
  br i1 %62, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %57
  %63 = load ptr, ptr %21, align 8, !tbaa !15
  %64 = getelementptr inbounds double, ptr %63, i64 %indvars.iv207
  %wide.trip.count = zext nneg i32 %60 to i64
  %min.iters.check235 = icmp eq i32 %60, 1
  br i1 %min.iters.check235, label %scalar.ph234.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %65 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr %61, i64 %65
  %scevgep228 = getelementptr i8, ptr %5, i64 %65
  %66 = getelementptr i8, ptr %63, i64 %58
  %scevgep229 = getelementptr i8, ptr %66, i64 8
  %bound0 = icmp ult ptr %61, %scevgep228
  %bound1 = icmp ugt ptr %scevgep, %5
  %found.conflict = and i1 %bound0, %bound1
  %bound0230 = icmp ult ptr %61, %scevgep229
  %bound1231 = icmp ult ptr %64, %scevgep
  %found.conflict232 = and i1 %bound0230, %bound1231
  %conflict.rdx = or i1 %found.conflict, %found.conflict232
  br i1 %conflict.rdx, label %scalar.ph234.preheader, label %vector.ph236

vector.ph236:                                     ; preds = %vector.memcheck
  %n.vec238 = and i64 %wide.trip.count, 2147483646
  %67 = load double, ptr %64, align 8, !tbaa !11, !alias.scope !18
  %broadcast.splatinsert243 = insertelement <2 x double> poison, double %67, i64 0
  %broadcast.splat244 = shufflevector <2 x double> %broadcast.splatinsert243, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body240

vector.body240:                                   ; preds = %vector.body240, %vector.ph236
  %index241 = phi i64 [ 0, %vector.ph236 ], [ %index.next245, %vector.body240 ]
  %68 = getelementptr inbounds double, ptr %5, i64 %index241
  %wide.load242 = load <2 x double>, ptr %68, align 8, !tbaa !11, !alias.scope !21
  %69 = fdiv <2 x double> %wide.load242, %broadcast.splat244
  %70 = getelementptr inbounds double, ptr %61, i64 %index241
  store <2 x double> %69, ptr %70, align 8, !tbaa !11, !alias.scope !23, !noalias !25
  %index.next245 = add nuw i64 %index241, 2
  %71 = icmp eq i64 %index.next245, %n.vec238
  br i1 %71, label %middle.block233, label %vector.body240, !llvm.loop !26

middle.block233:                                  ; preds = %vector.body240
  %cmp.n246 = icmp eq i64 %n.vec238, %wide.trip.count
  br i1 %cmp.n246, label %._crit_edge, label %scalar.ph234.preheader

scalar.ph234.preheader:                           ; preds = %middle.block233, %vector.memcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec238, %middle.block233 ]
  %72 = sub nsw i64 %wide.trip.count, %indvars.iv.ph
  %xtraiter = and i64 %72, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph234.prol.loopexit, label %scalar.ph234.prol

scalar.ph234.prol:                                ; preds = %scalar.ph234.preheader, %scalar.ph234.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph234.prol ], [ %indvars.iv.ph, %scalar.ph234.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph234.prol ], [ 0, %scalar.ph234.preheader ]
  %73 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.prol
  %74 = load double, ptr %73, align 8, !tbaa !11
  %75 = load double, ptr %64, align 8, !tbaa !11
  %76 = fdiv double %74, %75
  %77 = getelementptr inbounds double, ptr %61, i64 %indvars.iv.prol
  store double %76, ptr %77, align 8, !tbaa !11
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph234.prol.loopexit, label %scalar.ph234.prol, !llvm.loop !29

scalar.ph234.prol.loopexit:                       ; preds = %scalar.ph234.prol, %scalar.ph234.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph234.preheader ], [ %indvars.iv.next.prol, %scalar.ph234.prol ]
  %78 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %79 = icmp ugt i64 %78, -4
  br i1 %79, label %._crit_edge, label %scalar.ph234

scalar.ph234:                                     ; preds = %scalar.ph234.prol.loopexit, %scalar.ph234
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph234 ], [ %indvars.iv.unr, %scalar.ph234.prol.loopexit ]
  %80 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %81 = load double, ptr %80, align 8, !tbaa !11
  %82 = load double, ptr %64, align 8, !tbaa !11
  %83 = fdiv double %81, %82
  %84 = getelementptr inbounds double, ptr %61, i64 %indvars.iv
  store double %83, ptr %84, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %85 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = load double, ptr %64, align 8, !tbaa !11
  %88 = fdiv double %86, %87
  %89 = getelementptr inbounds double, ptr %61, i64 %indvars.iv.next
  store double %88, ptr %89, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %90 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next.1
  %91 = load double, ptr %90, align 8, !tbaa !11
  %92 = load double, ptr %64, align 8, !tbaa !11
  %93 = fdiv double %91, %92
  %94 = getelementptr inbounds double, ptr %61, i64 %indvars.iv.next.1
  store double %93, ptr %94, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %95 = getelementptr inbounds double, ptr %5, i64 %indvars.iv.next.2
  %96 = load double, ptr %95, align 8, !tbaa !11
  %97 = load double, ptr %64, align 8, !tbaa !11
  %98 = fdiv double %96, %97
  %99 = getelementptr inbounds double, ptr %61, i64 %indvars.iv.next.2
  store double %98, ptr %99, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph234, !llvm.loop !31

._crit_edge:                                      ; preds = %scalar.ph234.prol.loopexit, %scalar.ph234, %middle.block233, %57
  %100 = tail call { i32, ptr } @_ZN4sptk5swipe5zerovEi(i32 noundef %4)
  %.fr = freeze { i32, ptr } %100
  %101 = extractvalue { i32, ptr } %.fr, 0
  %102 = extractvalue { i32, ptr } %.fr, 1
  %103 = load i32, ptr %8, align 8, !tbaa !32
  %104 = icmp sgt i32 %103, 0
  br i1 %104, label %.lr.ph133, label %._crit_edge134

.lr.ph133:                                        ; preds = %._crit_edge
  %105 = load ptr, ptr %22, align 8, !tbaa !34
  %106 = icmp sgt i32 %101, 0
  br i1 %106, label %.lr.ph133.split.us.preheader, label %._crit_edge134.thread

._crit_edge134.thread:                            ; preds = %.lr.ph133
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %60, ptr %61)
  br label %.preheader126

.lr.ph133.split.us.preheader:                     ; preds = %.lr.ph133
  %wide.trip.count185 = zext nneg i32 %103 to i64
  %wide.trip.count180 = zext nneg i32 %101 to i64
  br label %.lr.ph133.split.us

.lr.ph133.split.us:                               ; preds = %.lr.ph133.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv182 = phi i64 [ 0, %.lr.ph133.split.us.preheader ], [ %indvars.iv.next183, %..loopexit_crit_edge.us ]
  %107 = getelementptr inbounds i32, ptr %105, i64 %indvars.iv182
  %108 = load i32, ptr %107, align 4, !tbaa !35
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %.preheader125.us, label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %130, %.lr.ph133.split.us
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %exitcond186.not = icmp eq i64 %indvars.iv.next183, %wide.trip.count185
  br i1 %exitcond186.not, label %._crit_edge134, label %.lr.ph133.split.us, !llvm.loop !36

110:                                              ; preds = %.preheader125.us, %130
  %indvars.iv177 = phi i64 [ 0, %.preheader125.us ], [ %indvars.iv.next178, %130 ]
  %111 = getelementptr inbounds double, ptr %61, i64 %indvars.iv177
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = fsub double %112, %132
  %114 = fadd double %113, -1.000000e+00
  %115 = tail call double @llvm.fabs.f64(double %114)
  %116 = fcmp olt double %115, 2.500000e-01
  br i1 %116, label %126, label %117

117:                                              ; preds = %110
  %118 = fcmp olt double %115, 7.500000e-01
  br i1 %118, label %119, label %130

119:                                              ; preds = %117
  %120 = fmul double %112, 0x401921FB54442D18
  %121 = tail call double @cos(double noundef %120) #4
  %122 = fmul double %121, 5.000000e-01
  %123 = getelementptr inbounds double, ptr %102, i64 %indvars.iv177
  %124 = load double, ptr %123, align 8, !tbaa !11
  %125 = fadd double %124, %122
  store double %125, ptr %123, align 8, !tbaa !11
  br label %130

126:                                              ; preds = %110
  %127 = fmul double %112, 0x401921FB54442D18
  %128 = tail call double @cos(double noundef %127) #4
  %129 = getelementptr inbounds double, ptr %102, i64 %indvars.iv177
  store double %128, ptr %129, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %126, %119, %117
  %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
  %exitcond181.not = icmp eq i64 %indvars.iv.next178, %wide.trip.count180
  br i1 %exitcond181.not, label %..loopexit_crit_edge.us, label %110, !llvm.loop !37

.preheader125.us:                                 ; preds = %.lr.ph133.split.us
  %131 = trunc nuw nsw i64 %indvars.iv182 to i32
  %132 = uitofp nneg i32 %131 to double
  br label %110

._crit_edge134:                                   ; preds = %..loopexit_crit_edge.us, %._crit_edge
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %60, ptr %61)
  %133 = icmp sgt i32 %101, 0
  br i1 %133, label %.lr.ph138.preheader, label %.preheader126

.lr.ph138.preheader:                              ; preds = %._crit_edge134
  %wide.trip.count190 = zext nneg i32 %101 to i64
  br label %.lr.ph138

.lr.ph138:                                        ; preds = %.lr.ph138.preheader, %.lr.ph138
  %indvars.iv187 = phi i64 [ 0, %.lr.ph138.preheader ], [ %indvars.iv.next188, %.lr.ph138 ]
  %.0116135 = phi double [ 0.000000e+00, %.lr.ph138.preheader ], [ %.1117, %.lr.ph138 ]
  %134 = getelementptr inbounds double, ptr %5, i64 %indvars.iv187
  %135 = load double, ptr %134, align 8, !tbaa !11
  %136 = fdiv double 1.000000e+00, %135
  %137 = tail call double @sqrt(double noundef %136) #4
  %138 = getelementptr inbounds double, ptr %102, i64 %indvars.iv187
  %139 = load double, ptr %138, align 8, !tbaa !11
  %140 = fmul double %137, %139
  store double %140, ptr %138, align 8, !tbaa !11
  %141 = fcmp ogt double %140, 0.000000e+00
  %142 = tail call double @llvm.fmuladd.f64(double %140, double %140, double %.0116135)
  %.1117 = select i1 %141, double %142, double %.0116135
  %indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
  %exitcond191.not = icmp eq i64 %indvars.iv.next188, %wide.trip.count190
  br i1 %exitcond191.not, label %._crit_edge139, label %.lr.ph138, !llvm.loop !38

._crit_edge139:                                   ; preds = %.lr.ph138
  %143 = tail call double @sqrt(double noundef %.1117) #4
  br i1 %133, label %.lr.ph142.preheader, label %.preheader126

.lr.ph142.preheader:                              ; preds = %._crit_edge139
  %wide.trip.count195 = zext nneg i32 %101 to i64
  %min.iters.check = icmp eq i32 %101, 1
  br i1 %min.iters.check, label %.lr.ph142.preheader249, label %vector.ph

.lr.ph142.preheader249:                           ; preds = %middle.block, %.lr.ph142.preheader
  %indvars.iv192.ph = phi i64 [ 0, %.lr.ph142.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph142

vector.ph:                                        ; preds = %.lr.ph142.preheader
  %n.vec = and i64 %wide.trip.count190, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %143, 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 ]
  %144 = getelementptr inbounds double, ptr %102, i64 %index
  %wide.load = load <2 x double>, ptr %144, align 8, !tbaa !11
  %145 = fdiv <2 x double> %wide.load, %broadcast.splat
  store <2 x double> %145, ptr %144, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 2
  %146 = icmp eq i64 %index.next, %n.vec
  br i1 %146, label %middle.block, label %vector.body, !llvm.loop !39

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count190
  br i1 %cmp.n, label %.preheader126, label %.lr.ph142.preheader249

.preheader126:                                    ; preds = %.lr.ph142, %middle.block, %._crit_edge134.thread, %._crit_edge134, %._crit_edge139
  br i1 %brmerge, label %._crit_edge147, label %.preheader124.lr.ph.split.us

.preheader124.lr.ph.split.us:                     ; preds = %.preheader126
  %147 = getelementptr inbounds ptr, ptr %19, i64 %indvars.iv207
  %148 = load ptr, ptr %147, align 8, !tbaa !7
  br label %.preheader124.us

.preheader124.us:                                 ; preds = %._crit_edge145.us, %.preheader124.lr.ph.split.us
  %indvars.iv202 = phi i64 [ %indvars.iv.next203, %._crit_edge145.us ], [ 0, %.preheader124.lr.ph.split.us ]
  %149 = getelementptr inbounds ptr, ptr %3, i64 %indvars.iv202
  %150 = load ptr, ptr %149, align 8, !tbaa !7
  %151 = getelementptr inbounds double, ptr %148, i64 %indvars.iv202
  %.promoted.us = load double, ptr %151, align 8, !tbaa !11
  br i1 %25, label %._crit_edge145.us.unr-lcssa, label %.preheader124.us.new

.preheader124.us.new:                             ; preds = %.preheader124.us, %.preheader124.us.new
  %indvars.iv197 = phi i64 [ %indvars.iv.next198.1, %.preheader124.us.new ], [ 0, %.preheader124.us ]
  %152 = phi double [ %162, %.preheader124.us.new ], [ %.promoted.us, %.preheader124.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader124.us.new ], [ 0, %.preheader124.us ]
  %153 = getelementptr inbounds double, ptr %102, i64 %indvars.iv197
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = getelementptr inbounds double, ptr %150, i64 %indvars.iv197
  %156 = load double, ptr %155, align 8, !tbaa !11
  %157 = tail call double @llvm.fmuladd.f64(double %154, double %156, double %152)
  store double %157, ptr %151, align 8, !tbaa !11
  %indvars.iv.next198 = or disjoint i64 %indvars.iv197, 1
  %158 = getelementptr inbounds double, ptr %102, i64 %indvars.iv.next198
  %159 = load double, ptr %158, align 8, !tbaa !11
  %160 = getelementptr inbounds double, ptr %150, i64 %indvars.iv.next198
  %161 = load double, ptr %160, align 8, !tbaa !11
  %162 = tail call double @llvm.fmuladd.f64(double %159, double %161, double %157)
  store double %162, ptr %151, align 8, !tbaa !11
  %indvars.iv.next198.1 = add nuw nsw i64 %indvars.iv197, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge145.us.unr-lcssa, label %.preheader124.us.new, !llvm.loop !40

._crit_edge145.us.unr-lcssa:                      ; preds = %.preheader124.us.new, %.preheader124.us
  %indvars.iv197.unr = phi i64 [ 0, %.preheader124.us ], [ %indvars.iv.next198.1, %.preheader124.us.new ]
  %.unr = phi double [ %.promoted.us, %.preheader124.us ], [ %162, %.preheader124.us.new ]
  br i1 %lcmp.mod251.not, label %._crit_edge145.us, label %._crit_edge145.us.epilog-lcssa

._crit_edge145.us.epilog-lcssa:                   ; preds = %._crit_edge145.us.unr-lcssa
  %163 = getelementptr inbounds double, ptr %102, i64 %indvars.iv197.unr
  %164 = load double, ptr %163, align 8, !tbaa !11
  %165 = getelementptr inbounds double, ptr %150, i64 %indvars.iv197.unr
  %166 = load double, ptr %165, align 8, !tbaa !11
  %167 = tail call double @llvm.fmuladd.f64(double %164, double %166, double %.unr)
  store double %167, ptr %151, align 8, !tbaa !11
  br label %._crit_edge145.us

._crit_edge145.us:                                ; preds = %._crit_edge145.us.unr-lcssa, %._crit_edge145.us.epilog-lcssa
  %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1
  %exitcond206.not = icmp eq i64 %indvars.iv.next203, %wide.trip.count205
  br i1 %exitcond206.not, label %._crit_edge147, label %.preheader124.us, !llvm.loop !41

.lr.ph142:                                        ; preds = %.lr.ph142.preheader249, %.lr.ph142
  %indvars.iv192 = phi i64 [ %indvars.iv.next193, %.lr.ph142 ], [ %indvars.iv192.ph, %.lr.ph142.preheader249 ]
  %168 = getelementptr inbounds double, ptr %102, i64 %indvars.iv192
  %169 = load double, ptr %168, align 8, !tbaa !11
  %170 = fdiv double %169, %143
  store double %170, ptr %168, align 8, !tbaa !11
  %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
  %exitcond196.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count195
  br i1 %exitcond196.not, label %.preheader126, label %.lr.ph142, !llvm.loop !42

._crit_edge147:                                   ; preds = %._crit_edge145.us, %.preheader126
  tail call void @_ZN4sptk5swipe5freevENS0_6vectorE(i32 %101, ptr %102)
  %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1
  %exitcond211.not = icmp eq i64 %indvars.iv.next208, %wide.trip.count210
  br i1 %exitcond211.not, label %.preheader123, label %57, !llvm.loop !43

._crit_edge167:                                   ; preds = %._crit_edge161.us, %.lr.ph166, %.preheader123
  tail call void @_ZN4sptk5swipe5freemENS0_6matrixE(i64 %18, ptr %19)
  ret void
}

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

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

; 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

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 nofree nounwind willreturn memory(write) "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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = !{!16, !8, i64 8}
!16 = !{!"_ZTSN4sptk5swipe6vectorE", !17, i64 0, !8, i64 8}
!17 = !{!"int", !9, i64 0}
!18 = !{!19}
!19 = distinct !{!19, !20}
!20 = distinct !{!20, !"LVerDomain"}
!21 = !{!22}
!22 = distinct !{!22, !20}
!23 = !{!24}
!24 = distinct !{!24, !20}
!25 = !{!22, !19}
!26 = distinct !{!26, !6, !27, !28}
!27 = !{!"llvm.loop.isvectorized", i32 1}
!28 = !{!"llvm.loop.unroll.runtime.disable"}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.unroll.disable"}
!31 = distinct !{!31, !6, !27}
!32 = !{!33, !17, i64 0}
!33 = !{!"_ZTSN4sptk5swipe9intvectorE", !17, i64 0, !8, i64 8}
!34 = !{!33, !8, i64 8}
!35 = !{!17, !17, i64 0}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !27, !28}
!40 = distinct !{!40, !6}
!41 = distinct !{!41, !6}
!42 = distinct !{!42, !6, !28, !27}
!43 = distinct !{!43, !6}


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