; LLVM IR from greensoftwarelab/Energy-Languages :: C/n-body/nbody.gcc-4 (bodies_advance)

; 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.anon = type { [3 x double], double }
%struct.body = type { [3 x double], double, [3 x double], double }

@bodies_advance.r = external hidden global [1000 x %struct.anon], align 16
@bodies_advance.mag = external hidden global [1000 x double], align 16

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

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

; Function Attrs: nounwind uwtable
define dso_local void @bodies_advance(ptr noundef %0, i32 noundef %1, double noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [3 x <2 x double>], align 16
  %13 = alloca <2 x double>, align 16
  %14 = alloca <2 x double>, align 16
  %15 = alloca <2 x double>, align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store double %2, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = sub i32 %16, 1
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = mul i32 %17, %18
  %20 = udiv i32 %19, 2
  store i32 %20, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %74, %3
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = sub i32 %23, 1
  %25 = icmp ult i32 %22, %24
  br i1 %25, label %26, label %77

26:                                               ; preds = %21
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = add i32 %27, 1
  store i32 %28, ptr %9, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %68, %26
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = icmp ult i32 %30, %31
  br i1 %32, label %33, label %73

33:                                               ; preds = %29
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %64, %33
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp ult i32 %35, 3
  br i1 %36, label %37, label %67

37:                                               ; preds = %34
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds %struct.body, ptr %38, i64 %40
  %42 = getelementptr inbounds %struct.body, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds [3 x double], ptr %42, i64 0, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !11
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds %struct.body, ptr %47, i64 %49
  %51 = getelementptr inbounds %struct.body, ptr %50, i32 0, i32 0
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds [3 x double], ptr %51, i64 0, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = fsub double %46, %55
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.anon, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds [3 x double], ptr %60, i64 0, i64 %62
  store double %56, ptr %63, align 8, !tbaa !11
  br label %64

64:                                               ; preds = %37
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = add i32 %65, 1
  store i32 %66, ptr %11, align 4, !tbaa !9
  br label %34, !llvm.loop !13

67:                                               ; preds = %34
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = add i32 %69, 1
  store i32 %70, ptr %9, align 4, !tbaa !9
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = add i32 %71, 1
  store i32 %72, ptr %10, align 4, !tbaa !9
  br label %29, !llvm.loop !15

73:                                               ; preds = %29
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = add i32 %75, 1
  store i32 %76, ptr %8, align 4, !tbaa !9
  br label %21, !llvm.loop !16

77:                                               ; preds = %21
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %172, %77
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = icmp ult i32 %79, %80
  br i1 %81, label %82, label %175

82:                                               ; preds = %78
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %118, %82
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = icmp ult i32 %84, 3
  br i1 %85, label %86, label %121

86:                                               ; preds = %83
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 %88
  %90 = load <2 x double>, ptr %89, align 16, !tbaa !17
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.anon, ptr %93, i32 0, i32 0
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds [3 x double], ptr %94, i64 0, i64 %96
  %98 = call <2 x double> @_mm_loadl_pd(<2 x double> noundef %90, ptr noundef %97)
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 %100
  store <2 x double> %98, ptr %101, align 16, !tbaa !17
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 %103
  %105 = load <2 x double>, ptr %104, align 16, !tbaa !17
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = add i32 %106, 1
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.anon, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds [3 x double], ptr %110, i64 0, i64 %112
  %114 = call <2 x double> @_mm_loadh_pd(<2 x double> noundef %105, ptr noundef %113)
  %115 = load i32, ptr %11, align 4, !tbaa !9
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 %116
  store <2 x double> %114, ptr %117, align 16, !tbaa !17
  br label %118

118:                                              ; preds = %86
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = add i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !9
  br label %83, !llvm.loop !18

121:                                              ; preds = %83
  %122 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 0
  %123 = load <2 x double>, ptr %122, align 16, !tbaa !17
  %124 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 0
  %125 = load <2 x double>, ptr %124, align 16, !tbaa !17
  %126 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 1
  %127 = load <2 x double>, ptr %126, align 16, !tbaa !17
  %128 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 1
  %129 = load <2 x double>, ptr %128, align 16, !tbaa !17
  %130 = fmul <2 x double> %127, %129
  %131 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %123, <2 x double> %125, <2 x double> %130)
  %132 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 2
  %133 = load <2 x double>, ptr %132, align 16, !tbaa !17
  %134 = getelementptr inbounds [3 x <2 x double>], ptr %12, i64 0, i64 2
  %135 = load <2 x double>, ptr %134, align 16, !tbaa !17
  %136 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %133, <2 x double> %135, <2 x double> %131)
  store <2 x double> %136, ptr %13, align 16, !tbaa !17
  %137 = load <2 x double>, ptr %13, align 16, !tbaa !17
  %138 = call <4 x float> @_mm_cvtpd_ps(<2 x double> noundef %137)
  %139 = call <4 x float> @_mm_rsqrt_ps(<4 x float> noundef %138)
  %140 = call <2 x double> @_mm_cvtps_pd(<4 x float> noundef %139)
  store <2 x double> %140, ptr %14, align 16, !tbaa !17
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %158, %121
  %142 = load i32, ptr %9, align 4, !tbaa !9
  %143 = icmp ult i32 %142, 2
  br i1 %143, label %144, label %161

144:                                              ; preds = %141
  %145 = load <2 x double>, ptr %14, align 16, !tbaa !17
  %146 = call <2 x double> @_mm_set1_pd(double noundef 1.500000e+00)
  %147 = call <2 x double> @_mm_set1_pd(double noundef 5.000000e-01)
  %148 = load <2 x double>, ptr %13, align 16, !tbaa !17
  %149 = fmul <2 x double> %147, %148
  %150 = load <2 x double>, ptr %14, align 16, !tbaa !17
  %151 = fmul <2 x double> %149, %150
  %152 = load <2 x double>, ptr %14, align 16, !tbaa !17
  %153 = load <2 x double>, ptr %14, align 16, !tbaa !17
  %154 = fmul <2 x double> %152, %153
  %155 = fmul <2 x double> %151, %154
  %156 = fneg <2 x double> %155
  %157 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %145, <2 x double> %146, <2 x double> %156)
  store <2 x double> %157, ptr %14, align 16, !tbaa !17
  br label %158

158:                                              ; preds = %144
  %159 = load i32, ptr %9, align 4, !tbaa !9
  %160 = add i32 %159, 1
  store i32 %160, ptr %9, align 4, !tbaa !9
  br label %141, !llvm.loop !19

161:                                              ; preds = %141
  %162 = load double, ptr %6, align 8, !tbaa !11
  %163 = call <2 x double> @_mm_set1_pd(double noundef %162)
  %164 = load <2 x double>, ptr %13, align 16, !tbaa !17
  %165 = fdiv <2 x double> %163, %164
  %166 = load <2 x double>, ptr %14, align 16, !tbaa !17
  %167 = fmul <2 x double> %165, %166
  store <2 x double> %167, ptr %15, align 16, !tbaa !17
  %168 = load i32, ptr %8, align 4, !tbaa !9
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds [1000 x double], ptr @bodies_advance.mag, i64 0, i64 %169
  %171 = load <2 x double>, ptr %15, align 16, !tbaa !17
  call void @_mm_store_pd(ptr noundef %170, <2 x double> noundef %171)
  br label %172

172:                                              ; preds = %161
  %173 = load i32, ptr %8, align 4, !tbaa !9
  %174 = add i32 %173, 2
  store i32 %174, ptr %8, align 4, !tbaa !9
  br label %78, !llvm.loop !20

175:                                              ; preds = %78
  store i32 0, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %176

176:                                              ; preds = %262, %175
  %177 = load i32, ptr %8, align 4, !tbaa !9
  %178 = load i32, ptr %5, align 4, !tbaa !9
  %179 = sub i32 %178, 1
  %180 = icmp ult i32 %177, %179
  br i1 %180, label %181, label %265

181:                                              ; preds = %176
  %182 = load i32, ptr %8, align 4, !tbaa !9
  %183 = add i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !9
  br label %184

184:                                              ; preds = %256, %181
  %185 = load i32, ptr %9, align 4, !tbaa !9
  %186 = load i32, ptr %5, align 4, !tbaa !9
  %187 = icmp ult i32 %185, %186
  br i1 %187, label %188, label %261

188:                                              ; preds = %184
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %252, %188
  %190 = load i32, ptr %11, align 4, !tbaa !9
  %191 = icmp ult i32 %190, 3
  br i1 %191, label %192, label %255

192:                                              ; preds = %189
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %194
  %196 = getelementptr inbounds %struct.anon, ptr %195, i32 0, i32 0
  %197 = load i32, ptr %11, align 4, !tbaa !9
  %198 = zext i32 %197 to i64
  %199 = getelementptr inbounds [3 x double], ptr %196, i64 0, i64 %198
  %200 = load double, ptr %199, align 8, !tbaa !11
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = load i32, ptr %9, align 4, !tbaa !9
  %203 = zext i32 %202 to i64
  %204 = getelementptr inbounds %struct.body, ptr %201, i64 %203
  %205 = getelementptr inbounds %struct.body, ptr %204, i32 0, i32 3
  %206 = load double, ptr %205, align 8, !tbaa !21
  %207 = fmul double %200, %206
  %208 = load i32, ptr %10, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = getelementptr inbounds [1000 x double], ptr @bodies_advance.mag, i64 0, i64 %209
  %211 = load double, ptr %210, align 8, !tbaa !11
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = load i32, ptr %8, align 4, !tbaa !9
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds %struct.body, ptr %212, i64 %214
  %216 = getelementptr inbounds %struct.body, ptr %215, i32 0, i32 2
  %217 = load i32, ptr %11, align 4, !tbaa !9
  %218 = zext i32 %217 to i64
  %219 = getelementptr inbounds [3 x double], ptr %216, i64 0, i64 %218
  %220 = load double, ptr %219, align 8, !tbaa !11
  %221 = fneg double %207
  %222 = call double @llvm.fmuladd.f64(double %221, double %211, double %220)
  store double %222, ptr %219, align 8, !tbaa !11
  %223 = load i32, ptr %10, align 4, !tbaa !9
  %224 = zext i32 %223 to i64
  %225 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %224
  %226 = getelementptr inbounds %struct.anon, ptr %225, i32 0, i32 0
  %227 = load i32, ptr %11, align 4, !tbaa !9
  %228 = zext i32 %227 to i64
  %229 = getelementptr inbounds [3 x double], ptr %226, i64 0, i64 %228
  %230 = load double, ptr %229, align 8, !tbaa !11
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = load i32, ptr %8, align 4, !tbaa !9
  %233 = zext i32 %232 to i64
  %234 = getelementptr inbounds %struct.body, ptr %231, i64 %233
  %235 = getelementptr inbounds %struct.body, ptr %234, i32 0, i32 3
  %236 = load double, ptr %235, align 8, !tbaa !21
  %237 = fmul double %230, %236
  %238 = load i32, ptr %10, align 4, !tbaa !9
  %239 = zext i32 %238 to i64
  %240 = getelementptr inbounds [1000 x double], ptr @bodies_advance.mag, i64 0, i64 %239
  %241 = load double, ptr %240, align 8, !tbaa !11
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = load i32, ptr %9, align 4, !tbaa !9
  %244 = zext i32 %243 to i64
  %245 = getelementptr inbounds %struct.body, ptr %242, i64 %244
  %246 = getelementptr inbounds %struct.body, ptr %245, i32 0, i32 2
  %247 = load i32, ptr %11, align 4, !tbaa !9
  %248 = zext i32 %247 to i64
  %249 = getelementptr inbounds [3 x double], ptr %246, i64 0, i64 %248
  %250 = load double, ptr %249, align 8, !tbaa !11
  %251 = call double @llvm.fmuladd.f64(double %237, double %241, double %250)
  store double %251, ptr %249, align 8, !tbaa !11
  br label %252

252:                                              ; preds = %192
  %253 = load i32, ptr %11, align 4, !tbaa !9
  %254 = add i32 %253, 1
  store i32 %254, ptr %11, align 4, !tbaa !9
  br label %189, !llvm.loop !23

255:                                              ; preds = %189
  br label %256

256:                                              ; preds = %255
  %257 = load i32, ptr %9, align 4, !tbaa !9
  %258 = add i32 %257, 1
  store i32 %258, ptr %9, align 4, !tbaa !9
  %259 = load i32, ptr %10, align 4, !tbaa !9
  %260 = add i32 %259, 1
  store i32 %260, ptr %10, align 4, !tbaa !9
  br label %184, !llvm.loop !24

261:                                              ; preds = %184
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %8, align 4, !tbaa !9
  %264 = add i32 %263, 1
  store i32 %264, ptr %8, align 4, !tbaa !9
  br label %176, !llvm.loop !25

265:                                              ; preds = %176
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %266

266:                                              ; preds = %299, %265
  %267 = load i32, ptr %8, align 4, !tbaa !9
  %268 = load i32, ptr %5, align 4, !tbaa !9
  %269 = icmp ult i32 %267, %268
  br i1 %269, label %270, label %302

270:                                              ; preds = %266
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %271

271:                                              ; preds = %295, %270
  %272 = load i32, ptr %11, align 4, !tbaa !9
  %273 = icmp ult i32 %272, 3
  br i1 %273, label %274, label %298

274:                                              ; preds = %271
  %275 = load double, ptr %6, align 8, !tbaa !11
  %276 = load ptr, ptr %4, align 8, !tbaa !5
  %277 = load i32, ptr %8, align 4, !tbaa !9
  %278 = zext i32 %277 to i64
  %279 = getelementptr inbounds %struct.body, ptr %276, i64 %278
  %280 = getelementptr inbounds %struct.body, ptr %279, i32 0, i32 2
  %281 = load i32, ptr %11, align 4, !tbaa !9
  %282 = zext i32 %281 to i64
  %283 = getelementptr inbounds [3 x double], ptr %280, i64 0, i64 %282
  %284 = load double, ptr %283, align 8, !tbaa !11
  %285 = load ptr, ptr %4, align 8, !tbaa !5
  %286 = load i32, ptr %8, align 4, !tbaa !9
  %287 = zext i32 %286 to i64
  %288 = getelementptr inbounds %struct.body, ptr %285, i64 %287
  %289 = getelementptr inbounds %struct.body, ptr %288, i32 0, i32 0
  %290 = load i32, ptr %11, align 4, !tbaa !9
  %291 = zext i32 %290 to i64
  %292 = getelementptr inbounds [3 x double], ptr %289, i64 0, i64 %291
  %293 = load double, ptr %292, align 8, !tbaa !11
  %294 = call double @llvm.fmuladd.f64(double %275, double %284, double %293)
  store double %294, ptr %292, align 8, !tbaa !11
  br label %295

295:                                              ; preds = %274
  %296 = load i32, ptr %11, align 4, !tbaa !9
  %297 = add i32 %296, 1
  store i32 %297, ptr %11, align 4, !tbaa !9
  br label %271, !llvm.loop !26

298:                                              ; preds = %271
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %8, align 4, !tbaa !9
  %301 = add i32 %300, 1
  store i32 %301, ptr %8, align 4, !tbaa !9
  br label %266, !llvm.loop !27

302:                                              ; preds = %266
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x double> @_mm_loadl_pd(<2 x double> noundef, ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x double> @_mm_loadh_pd(<2 x double> noundef, ptr noundef) #2

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x double> @_mm_cvtps_pd(<4 x float> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <4 x float> @_mm_rsqrt_ps(<4 x float> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <4 x float> @_mm_cvtpd_ps(<2 x double> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x double> @_mm_set1_pd(double noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_store_pd(ptr noundef, <2 x double> noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="128" "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 = { alwaysinline nounwind uwtable "min-legal-vector-width"="128" "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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = !{!22, !12, i64 56}
!22 = !{!"body", !7, i64 0, !12, i64 24, !7, i64 32, !12, i64 56}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


; 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.anon = type { [3 x double], double }
%struct.body = type { [3 x double], double, [3 x double], double }

@bodies_advance.r = external hidden local_unnamed_addr global [1000 x %struct.anon], align 16
@bodies_advance.mag = external hidden local_unnamed_addr global [1000 x double], align 16

; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local void @bodies_advance(ptr nocapture noundef %0, i32 noundef %1, double noundef %2) local_unnamed_addr #0 {
  %4 = add i32 %1, -1
  %5 = mul i32 %4, %1
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %.preheader.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %6 = zext i32 %1 to i64
  %wide.trip.count = zext i32 %4 to i64
  br label %.lr.ph

.loopexit102:                                     ; preds = %.preheader101, %.lr.ph
  %.192.lcssa = phi i32 [ %.091106, %.lr.ph ], [ %30, %.preheader101 ]
  %exitcond128.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond128.not, label %.preheader100, label %.lr.ph, !llvm.loop !5

.preheader100:                                    ; preds = %.loopexit102
  %.not121 = icmp ult i32 %5, 2
  tail call void @llvm.assume(i1 %.not121)
  br i1 %.not, label %.preheader.preheader, label %.lr.ph118.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit102
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.loopexit102 ]
  %.091106 = phi i32 [ 0, %.lr.ph.preheader ], [ %.192.lcssa, %.loopexit102 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %7 = icmp ult i64 %indvars.iv.next, %6
  br i1 %7, label %.preheader101.lr.ph, label %.loopexit102

.preheader101.lr.ph:                              ; preds = %.lr.ph
  %8 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv
  %9 = trunc nuw i64 %indvars.iv.next to i32
  %10 = getelementptr inbounds i8, ptr %8, i64 8
  %11 = getelementptr inbounds i8, ptr %8, i64 16
  br label %.preheader101

.preheader101:                                    ; preds = %.preheader101.lr.ph, %.preheader101
  %.084105 = phi i32 [ %9, %.preheader101.lr.ph ], [ %29, %.preheader101 ]
  %.192104 = phi i32 [ %.091106, %.preheader101.lr.ph ], [ %30, %.preheader101 ]
  %12 = zext i32 %.084105 to i64
  %13 = getelementptr inbounds %struct.body, ptr %0, i64 %12
  %14 = zext i32 %.192104 to i64
  %15 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %14
  %16 = load double, ptr %8, align 8, !tbaa !7
  %17 = load double, ptr %13, align 8, !tbaa !7
  %18 = fsub double %16, %17
  store double %18, ptr %15, align 16, !tbaa !7
  %19 = load double, ptr %10, align 8, !tbaa !7
  %20 = getelementptr inbounds i8, ptr %13, i64 8
  %21 = load double, ptr %20, align 8, !tbaa !7
  %22 = fsub double %19, %21
  %23 = getelementptr inbounds i8, ptr %15, i64 8
  store double %22, ptr %23, align 8, !tbaa !7
  %24 = load double, ptr %11, align 8, !tbaa !7
  %25 = getelementptr inbounds i8, ptr %13, i64 16
  %26 = load double, ptr %25, align 8, !tbaa !7
  %27 = fsub double %24, %26
  %28 = getelementptr inbounds i8, ptr %15, i64 16
  store double %27, ptr %28, align 16, !tbaa !7
  %29 = add nuw i32 %.084105, 1
  %30 = add i32 %.192104, 1
  %exitcond.not = icmp eq i32 %29, %1
  br i1 %exitcond.not, label %.loopexit102, label %.preheader101, !llvm.loop !11

.lr.ph118.preheader:                              ; preds = %.preheader100
  %31 = zext i32 %1 to i64
  %wide.trip.count149 = zext i32 %4 to i64
  br label %.lr.ph118

.loopexit:                                        ; preds = %.preheader97, %.lr.ph118
  %.394.lcssa = phi i32 [ %.293116, %.lr.ph118 ], [ %85, %.preheader97 ]
  %indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
  %exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count149
  br i1 %exitcond150.not, label %.preheader96, label %.lr.ph118, !llvm.loop !12

.preheader96:                                     ; preds = %.loopexit
  %.not123 = icmp eq i32 %1, 0
  br i1 %.not123, label %._crit_edge, label %.preheader.preheader

.preheader.preheader:                             ; preds = %3, %.preheader100, %.preheader96
  %wide.trip.count158 = zext i32 %1 to i64
  %32 = insertelement <2 x double> poison, double %2, i64 0
  %33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
  %xtraiter = and i64 %wide.trip.count158, 1
  %34 = icmp eq i32 %1, 1
  br i1 %34, label %._crit_edge.loopexit.unr-lcssa, label %.preheader.preheader.new

.preheader.preheader.new:                         ; preds = %.preheader.preheader
  %unroll_iter = and i64 %wide.trip.count158, 4294967294
  br label %.preheader

.lr.ph118:                                        ; preds = %.lr.ph118.preheader, %.loopexit
  %indvars.iv146 = phi i64 [ 0, %.lr.ph118.preheader ], [ %indvars.iv.next147, %.loopexit ]
  %indvars.iv140 = phi i64 [ 1, %.lr.ph118.preheader ], [ %indvars.iv.next141, %.loopexit ]
  %.293116 = phi i32 [ 0, %.lr.ph118.preheader ], [ %.394.lcssa, %.loopexit ]
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %35 = icmp ult i64 %indvars.iv.next147, %31
  br i1 %35, label %.preheader97.lr.ph, label %.loopexit

.preheader97.lr.ph:                               ; preds = %.lr.ph118
  %36 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv146
  %37 = getelementptr inbounds i8, ptr %36, i64 32
  %38 = getelementptr inbounds i8, ptr %36, i64 56
  %.pre = load double, ptr %38, align 8, !tbaa !13
  %39 = getelementptr inbounds i8, ptr %36, i64 40
  %40 = getelementptr inbounds i8, ptr %36, i64 48
  br label %.preheader97

.preheader97:                                     ; preds = %.preheader97.lr.ph, %.preheader97
  %indvars.iv142 = phi i64 [ %indvars.iv140, %.preheader97.lr.ph ], [ %indvars.iv.next143, %.preheader97 ]
  %.394113 = phi i32 [ %.293116, %.preheader97.lr.ph ], [ %85, %.preheader97 ]
  %41 = zext i32 %.394113 to i64
  %42 = getelementptr inbounds [1000 x %struct.anon], ptr @bodies_advance.r, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv142
  %44 = getelementptr inbounds i8, ptr %43, i64 56
  %45 = getelementptr inbounds [1000 x double], ptr @bodies_advance.mag, i64 0, i64 %41
  %46 = getelementptr inbounds i8, ptr %43, i64 32
  %47 = load double, ptr %42, align 16, !tbaa !7
  %48 = load double, ptr %44, align 8, !tbaa !13
  %49 = load double, ptr %45, align 8, !tbaa !7
  %50 = load double, ptr %37, align 8, !tbaa !7
  %51 = fneg double %47
  %52 = fmul double %48, %51
  %53 = tail call double @llvm.fmuladd.f64(double %52, double %49, double %50)
  store double %53, ptr %37, align 8, !tbaa !7
  %54 = load double, ptr %42, align 16, !tbaa !7
  %55 = fmul double %54, %.pre
  %56 = load double, ptr %45, align 8, !tbaa !7
  %57 = load double, ptr %46, align 8, !tbaa !7
  %58 = tail call double @llvm.fmuladd.f64(double %55, double %56, double %57)
  store double %58, ptr %46, align 8, !tbaa !7
  %59 = getelementptr inbounds i8, ptr %42, i64 8
  %60 = load double, ptr %59, align 8, !tbaa !7
  %61 = load double, ptr %45, align 8, !tbaa !7
  %62 = load double, ptr %39, align 8, !tbaa !7
  %63 = fneg double %60
  %64 = fmul double %48, %63
  %65 = tail call double @llvm.fmuladd.f64(double %64, double %61, double %62)
  store double %65, ptr %39, align 8, !tbaa !7
  %66 = load double, ptr %59, align 8, !tbaa !7
  %67 = fmul double %66, %.pre
  %68 = load double, ptr %45, align 8, !tbaa !7
  %69 = getelementptr inbounds i8, ptr %43, i64 40
  %70 = load double, ptr %69, align 8, !tbaa !7
  %71 = tail call double @llvm.fmuladd.f64(double %67, double %68, double %70)
  store double %71, ptr %69, align 8, !tbaa !7
  %72 = getelementptr inbounds i8, ptr %42, i64 16
  %73 = load double, ptr %72, align 16, !tbaa !7
  %74 = load double, ptr %45, align 8, !tbaa !7
  %75 = load double, ptr %40, align 8, !tbaa !7
  %76 = fneg double %73
  %77 = fmul double %48, %76
  %78 = tail call double @llvm.fmuladd.f64(double %77, double %74, double %75)
  store double %78, ptr %40, align 8, !tbaa !7
  %79 = load double, ptr %72, align 16, !tbaa !7
  %80 = fmul double %79, %.pre
  %81 = load double, ptr %45, align 8, !tbaa !7
  %82 = getelementptr inbounds i8, ptr %43, i64 48
  %83 = load double, ptr %82, align 8, !tbaa !7
  %84 = tail call double @llvm.fmuladd.f64(double %80, double %81, double %83)
  store double %84, ptr %82, align 8, !tbaa !7
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %85 = add i32 %.394113, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next143 to i32
  %exitcond145.not = icmp eq i32 %lftr.wideiv, %1
  br i1 %exitcond145.not, label %.loopexit, label %.preheader97, !llvm.loop !15

.preheader:                                       ; preds = %.preheader, %.preheader.preheader.new
  %indvars.iv155 = phi i64 [ 0, %.preheader.preheader.new ], [ %indvars.iv.next156.1, %.preheader ]
  %niter = phi i64 [ 0, %.preheader.preheader.new ], [ %niter.next.1, %.preheader ]
  %86 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv155
  %87 = getelementptr inbounds i8, ptr %86, i64 32
  %88 = load <2 x double>, ptr %87, align 8, !tbaa !7
  %89 = load <2 x double>, ptr %86, align 8, !tbaa !7
  %90 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %88, <2 x double> %89)
  store <2 x double> %90, ptr %86, align 8, !tbaa !7
  %91 = getelementptr inbounds i8, ptr %86, i64 48
  %92 = load double, ptr %91, align 8, !tbaa !7
  %93 = getelementptr inbounds i8, ptr %86, i64 16
  %94 = load double, ptr %93, align 8, !tbaa !7
  %95 = tail call double @llvm.fmuladd.f64(double %2, double %92, double %94)
  store double %95, ptr %93, align 8, !tbaa !7
  %indvars.iv.next156 = or disjoint i64 %indvars.iv155, 1
  %96 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv.next156
  %97 = getelementptr inbounds i8, ptr %96, i64 32
  %98 = load <2 x double>, ptr %97, align 8, !tbaa !7
  %99 = load <2 x double>, ptr %96, align 8, !tbaa !7
  %100 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %98, <2 x double> %99)
  store <2 x double> %100, ptr %96, align 8, !tbaa !7
  %101 = getelementptr inbounds i8, ptr %96, i64 48
  %102 = load double, ptr %101, align 8, !tbaa !7
  %103 = getelementptr inbounds i8, ptr %96, i64 16
  %104 = load double, ptr %103, align 8, !tbaa !7
  %105 = tail call double @llvm.fmuladd.f64(double %2, double %102, double %104)
  store double %105, ptr %103, align 8, !tbaa !7
  %indvars.iv.next156.1 = add nuw nsw i64 %indvars.iv155, 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_edge.loopexit.unr-lcssa, label %.preheader, !llvm.loop !16

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.preheader, %.preheader.preheader
  %indvars.iv155.unr = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next156.1, %.preheader ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge.loopexit.unr-lcssa
  %106 = getelementptr inbounds %struct.body, ptr %0, i64 %indvars.iv155.unr
  %107 = getelementptr inbounds i8, ptr %106, i64 32
  %108 = load <2 x double>, ptr %107, align 8, !tbaa !7
  %109 = load <2 x double>, ptr %106, align 8, !tbaa !7
  %110 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %108, <2 x double> %109)
  store <2 x double> %110, ptr %106, align 8, !tbaa !7
  %111 = getelementptr inbounds i8, ptr %106, i64 48
  %112 = load double, ptr %111, align 8, !tbaa !7
  %113 = getelementptr inbounds i8, ptr %106, i64 16
  %114 = load double, ptr %113, align 8, !tbaa !7
  %115 = tail call double @llvm.fmuladd.f64(double %2, double %112, double %114)
  store double %115, ptr %113, align 8, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader96
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #2

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

attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: write) uwtable "min-legal-vector-width"="128" "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{!14, !8, i64 56}
!14 = !{!"body", !9, i64 0, !8, i64 24, !9, i64 32, !8, i64 56}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}


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