; LLVM IR from sd12832/High-Performance-Computing-Files :: d2q9-bgk-serial (write_values)

; 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.t_param = type { i32, i32, i32, i32, double, double, double }
%struct.t_speed = type { [9 x double] }

@.str.7 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @write_values(ptr noundef byval(%struct.t_param) align 8 %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store ptr %3, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store double 0x3FD5555555555555, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %18 = call noalias ptr @fopen(ptr noundef @.str.26, ptr noundef @.str.27)
  store ptr %18, ptr %8, align 8, !tbaa !5
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  call void @die(ptr noundef @.str.28, i32 noundef 621, ptr noundef @.str.7)
  br label %22

22:                                               ; preds = %21, %4
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %23

23:                                               ; preds = %265, %22
  %24 = load i32, ptr %9, align 4, !tbaa !11
  %25 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %28, label %268

28:                                               ; preds = %23
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %261, %28
  %30 = load i32, ptr %10, align 4, !tbaa !11
  %31 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !15
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %34, label %264

34:                                               ; preds = %29
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load i32, ptr %9, align 4, !tbaa !11
  %37 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !15
  %39 = mul nsw i32 %36, %38
  %40 = load i32, ptr %10, align 4, !tbaa !11
  %41 = add nsw i32 %39, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %35, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %50

46:                                               ; preds = %34
  store double 0.000000e+00, ptr %17, align 8, !tbaa !9
  store double 0.000000e+00, ptr %16, align 8, !tbaa !9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 4
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = fmul double %48, 0x3FD5555555555555
  store double %49, ptr %14, align 8, !tbaa !9
  br label %242

50:                                               ; preds = %34
  store double 0.000000e+00, ptr %13, align 8, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %71, %50
  %52 = load i32, ptr %11, align 4, !tbaa !11
  %53 = icmp slt i32 %52, 9
  br i1 %53, label %54, label %74

54:                                               ; preds = %51
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = load i32, ptr %9, align 4, !tbaa !11
  %57 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %58 = load i32, ptr %57, align 8, !tbaa !15
  %59 = mul nsw i32 %56, %58
  %60 = load i32, ptr %10, align 4, !tbaa !11
  %61 = add nsw i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.t_speed, ptr %55, i64 %62
  %64 = getelementptr inbounds %struct.t_speed, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %11, align 4, !tbaa !11
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [9 x double], ptr %64, i64 0, i64 %66
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = load double, ptr %13, align 8, !tbaa !9
  %70 = fadd double %69, %68
  store double %70, ptr %13, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %54
  %72 = load i32, ptr %11, align 4, !tbaa !11
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %11, align 4, !tbaa !11
  br label %51, !llvm.loop !17

74:                                               ; preds = %51
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !11
  %77 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %78 = load i32, ptr %77, align 8, !tbaa !15
  %79 = mul nsw i32 %76, %78
  %80 = load i32, ptr %10, align 4, !tbaa !11
  %81 = add nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.t_speed, ptr %75, i64 %82
  %84 = getelementptr inbounds %struct.t_speed, ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds [9 x double], ptr %84, i64 0, i64 1
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !11
  %89 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !15
  %91 = mul nsw i32 %88, %90
  %92 = load i32, ptr %10, align 4, !tbaa !11
  %93 = add nsw i32 %91, %92
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %struct.t_speed, ptr %87, i64 %94
  %96 = getelementptr inbounds %struct.t_speed, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds [9 x double], ptr %96, i64 0, i64 5
  %98 = load double, ptr %97, align 8, !tbaa !9
  %99 = fadd double %86, %98
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !11
  %102 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %103 = load i32, ptr %102, align 8, !tbaa !15
  %104 = mul nsw i32 %101, %103
  %105 = load i32, ptr %10, align 4, !tbaa !11
  %106 = add nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.t_speed, ptr %100, i64 %107
  %109 = getelementptr inbounds %struct.t_speed, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds [9 x double], ptr %109, i64 0, i64 8
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = fadd double %99, %111
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load i32, ptr %9, align 4, !tbaa !11
  %115 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %116 = load i32, ptr %115, align 8, !tbaa !15
  %117 = mul nsw i32 %114, %116
  %118 = load i32, ptr %10, align 4, !tbaa !11
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.t_speed, ptr %113, i64 %120
  %122 = getelementptr inbounds %struct.t_speed, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds [9 x double], ptr %122, i64 0, i64 3
  %124 = load double, ptr %123, align 8, !tbaa !9
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = load i32, ptr %9, align 4, !tbaa !11
  %127 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !15
  %129 = mul nsw i32 %126, %128
  %130 = load i32, ptr %10, align 4, !tbaa !11
  %131 = add nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds %struct.t_speed, ptr %125, i64 %132
  %134 = getelementptr inbounds %struct.t_speed, ptr %133, i32 0, i32 0
  %135 = getelementptr inbounds [9 x double], ptr %134, i64 0, i64 6
  %136 = load double, ptr %135, align 8, !tbaa !9
  %137 = fadd double %124, %136
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i32, ptr %9, align 4, !tbaa !11
  %140 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %141 = load i32, ptr %140, align 8, !tbaa !15
  %142 = mul nsw i32 %139, %141
  %143 = load i32, ptr %10, align 4, !tbaa !11
  %144 = add nsw i32 %142, %143
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds %struct.t_speed, ptr %138, i64 %145
  %147 = getelementptr inbounds %struct.t_speed, ptr %146, i32 0, i32 0
  %148 = getelementptr inbounds [9 x double], ptr %147, i64 0, i64 7
  %149 = load double, ptr %148, align 8, !tbaa !9
  %150 = fadd double %137, %149
  %151 = fsub double %112, %150
  %152 = load double, ptr %13, align 8, !tbaa !9
  %153 = fdiv double %151, %152
  store double %153, ptr %15, align 8, !tbaa !9
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !11
  %156 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %157 = load i32, ptr %156, align 8, !tbaa !15
  %158 = mul nsw i32 %155, %157
  %159 = load i32, ptr %10, align 4, !tbaa !11
  %160 = add nsw i32 %158, %159
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds %struct.t_speed, ptr %154, i64 %161
  %163 = getelementptr inbounds %struct.t_speed, ptr %162, i32 0, i32 0
  %164 = getelementptr inbounds [9 x double], ptr %163, i64 0, i64 2
  %165 = load double, ptr %164, align 8, !tbaa !9
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load i32, ptr %9, align 4, !tbaa !11
  %168 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %169 = load i32, ptr %168, align 8, !tbaa !15
  %170 = mul nsw i32 %167, %169
  %171 = load i32, ptr %10, align 4, !tbaa !11
  %172 = add nsw i32 %170, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds %struct.t_speed, ptr %166, i64 %173
  %175 = getelementptr inbounds %struct.t_speed, ptr %174, i32 0, i32 0
  %176 = getelementptr inbounds [9 x double], ptr %175, i64 0, i64 5
  %177 = load double, ptr %176, align 8, !tbaa !9
  %178 = fadd double %165, %177
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = load i32, ptr %9, align 4, !tbaa !11
  %181 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %182 = load i32, ptr %181, align 8, !tbaa !15
  %183 = mul nsw i32 %180, %182
  %184 = load i32, ptr %10, align 4, !tbaa !11
  %185 = add nsw i32 %183, %184
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds %struct.t_speed, ptr %179, i64 %186
  %188 = getelementptr inbounds %struct.t_speed, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds [9 x double], ptr %188, i64 0, i64 6
  %190 = load double, ptr %189, align 8, !tbaa !9
  %191 = fadd double %178, %190
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = load i32, ptr %9, align 4, !tbaa !11
  %194 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %195 = load i32, ptr %194, align 8, !tbaa !15
  %196 = mul nsw i32 %193, %195
  %197 = load i32, ptr %10, align 4, !tbaa !11
  %198 = add nsw i32 %196, %197
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds %struct.t_speed, ptr %192, i64 %199
  %201 = getelementptr inbounds %struct.t_speed, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds [9 x double], ptr %201, i64 0, i64 4
  %203 = load double, ptr %202, align 8, !tbaa !9
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = load i32, ptr %9, align 4, !tbaa !11
  %206 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %207 = load i32, ptr %206, align 8, !tbaa !15
  %208 = mul nsw i32 %205, %207
  %209 = load i32, ptr %10, align 4, !tbaa !11
  %210 = add nsw i32 %208, %209
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds %struct.t_speed, ptr %204, i64 %211
  %213 = getelementptr inbounds %struct.t_speed, ptr %212, i32 0, i32 0
  %214 = getelementptr inbounds [9 x double], ptr %213, i64 0, i64 7
  %215 = load double, ptr %214, align 8, !tbaa !9
  %216 = fadd double %203, %215
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = load i32, ptr %9, align 4, !tbaa !11
  %219 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %220 = load i32, ptr %219, align 8, !tbaa !15
  %221 = mul nsw i32 %218, %220
  %222 = load i32, ptr %10, align 4, !tbaa !11
  %223 = add nsw i32 %221, %222
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds %struct.t_speed, ptr %217, i64 %224
  %226 = getelementptr inbounds %struct.t_speed, ptr %225, i32 0, i32 0
  %227 = getelementptr inbounds [9 x double], ptr %226, i64 0, i64 8
  %228 = load double, ptr %227, align 8, !tbaa !9
  %229 = fadd double %216, %228
  %230 = fsub double %191, %229
  %231 = load double, ptr %13, align 8, !tbaa !9
  %232 = fdiv double %230, %231
  store double %232, ptr %16, align 8, !tbaa !9
  %233 = load double, ptr %15, align 8, !tbaa !9
  %234 = load double, ptr %15, align 8, !tbaa !9
  %235 = load double, ptr %16, align 8, !tbaa !9
  %236 = load double, ptr %16, align 8, !tbaa !9
  %237 = fmul double %235, %236
  %238 = call double @llvm.fmuladd.f64(double %233, double %234, double %237)
  %239 = call double @sqrt(double noundef %238) #5
  store double %239, ptr %17, align 8, !tbaa !9
  %240 = load double, ptr %13, align 8, !tbaa !9
  %241 = fmul double %240, 0x3FD5555555555555
  store double %241, ptr %14, align 8, !tbaa !9
  br label %242

242:                                              ; preds = %74, %46
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = load i32, ptr %10, align 4, !tbaa !11
  %245 = load i32, ptr %9, align 4, !tbaa !11
  %246 = load double, ptr %15, align 8, !tbaa !9
  %247 = load double, ptr %16, align 8, !tbaa !9
  %248 = load double, ptr %17, align 8, !tbaa !9
  %249 = load double, ptr %14, align 8, !tbaa !9
  %250 = load ptr, ptr %6, align 8, !tbaa !5
  %251 = load i32, ptr %9, align 4, !tbaa !11
  %252 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 0
  %253 = load i32, ptr %252, align 8, !tbaa !15
  %254 = mul nsw i32 %251, %253
  %255 = load i32, ptr %10, align 4, !tbaa !11
  %256 = add nsw i32 %254, %255
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds i32, ptr %250, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !11
  %260 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %243, ptr noundef @.str.29, i32 noundef %244, i32 noundef %245, double noundef %246, double noundef %247, double noundef %248, double noundef %249, i32 noundef %259) #5
  br label %261

261:                                              ; preds = %242
  %262 = load i32, ptr %10, align 4, !tbaa !11
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %10, align 4, !tbaa !11
  br label %29, !llvm.loop !19

264:                                              ; preds = %29
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %9, align 4, !tbaa !11
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %9, align 4, !tbaa !11
  br label %23, !llvm.loop !20

268:                                              ; preds = %23
  %269 = load ptr, ptr %8, align 8, !tbaa !5
  %270 = call i32 @fclose(ptr noundef %269)
  %271 = call noalias ptr @fopen(ptr noundef @.str.30, ptr noundef @.str.27)
  store ptr %271, ptr %8, align 8, !tbaa !5
  %272 = load ptr, ptr %8, align 8, !tbaa !5
  %273 = icmp eq ptr %272, null
  br i1 %273, label %274, label %275

274:                                              ; preds = %268
  call void @die(ptr noundef @.str.28, i32 noundef 667, ptr noundef @.str.7)
  br label %275

275:                                              ; preds = %274, %268
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %276

276:                                              ; preds = %290, %275
  %277 = load i32, ptr %9, align 4, !tbaa !11
  %278 = getelementptr inbounds %struct.t_param, ptr %0, i32 0, i32 2
  %279 = load i32, ptr %278, align 8, !tbaa !21
  %280 = icmp slt i32 %277, %279
  br i1 %280, label %281, label %293

281:                                              ; preds = %276
  %282 = load ptr, ptr %8, align 8, !tbaa !5
  %283 = load i32, ptr %9, align 4, !tbaa !11
  %284 = load ptr, ptr %7, align 8, !tbaa !5
  %285 = load i32, ptr %9, align 4, !tbaa !11
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds double, ptr %284, i64 %286
  %288 = load double, ptr %287, align 8, !tbaa !9
  %289 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %282, ptr noundef @.str.31, i32 noundef %283, double noundef %288) #5
  br label %290

290:                                              ; preds = %281
  %291 = load i32, ptr %9, align 4, !tbaa !11
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %9, align 4, !tbaa !11
  br label %276, !llvm.loop !22

293:                                              ; preds = %276
  %294 = load ptr, ptr %8, align 8, !tbaa !5
  %295 = call i32 @fclose(ptr noundef %294)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  ret i32 0
}

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

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @die(ptr noundef, i32 noundef, ptr noundef) #1

declare i32 @fclose(ptr noundef) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "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 "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 #5 = { nounwind }

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

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


; 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.t_param = type { i32, i32, i32, i32, double, double, double }
%struct.t_speed = type { [9 x double] }

@.str.7 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @write_values(ptr nocapture noundef readonly byval(%struct.t_param) align 8 %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #0 {
  %5 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.27)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %4
  tail call void @die(ptr noundef nonnull @.str.28, i32 noundef 621, ptr noundef nonnull @.str.7)
  br label %8

8:                                                ; preds = %7, %4
  %9 = getelementptr inbounds i8, ptr %0, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader84.lr.ph, label %._crit_edge89

.preheader84.lr.ph:                               ; preds = %8
  %12 = load i32, ptr %0, align 8, !tbaa !11
  %13 = icmp sgt i32 %12, 0
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load double, ptr %14, align 8
  br i1 %13, label %.preheader84.us.preheader, label %._crit_edge89

.preheader84.us.preheader:                        ; preds = %.preheader84.lr.ph
  %16 = zext nneg i32 %12 to i64
  %wide.trip.count97 = zext nneg i32 %10 to i64
  br label %.preheader84.us

.preheader84.us:                                  ; preds = %.preheader84.us.preheader, %._crit_edge.us
  %indvars.iv94 = phi i64 [ 0, %.preheader84.us.preheader ], [ %indvars.iv.next95, %._crit_edge.us ]
  %17 = mul nuw nsw i64 %indvars.iv94, %16
  %18 = trunc nuw nsw i64 %indvars.iv94 to i32
  br label %19

19:                                               ; preds = %.preheader84.us, %23
  %indvars.iv = phi i64 [ 0, %.preheader84.us ], [ %indvars.iv.next, %23 ]
  %20 = add nuw nsw i64 %17, %indvars.iv
  %21 = getelementptr inbounds i32, ptr %2, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !12
  %.not.us = icmp eq i32 %22, 0
  br i1 %.not.us, label %.preheader.us, label %23

23:                                               ; preds = %19, %.preheader.us
  %.078.in.us = phi double [ %55, %.preheader.us ], [ %15, %19 ]
  %.0.us = phi double [ %sqrt.us, %.preheader.us ], [ 0.000000e+00, %19 ]
  %24 = phi <2 x double> [ %71, %.preheader.us ], [ zeroinitializer, %19 ]
  %.078.us = fmul double %.078.in.us, 0x3FD5555555555555
  %25 = trunc nuw nsw i64 %indvars.iv to i32
  %26 = extractelement <2 x double> %24, i64 0
  %27 = extractelement <2 x double> %24, i64 1
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.29, i32 noundef %25, i32 noundef %18, double noundef %26, double noundef %27, double noundef %.0.us, double noundef %.078.us, i32 noundef %22) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %16
  br i1 %exitcond.not, label %._crit_edge.us, label %19, !llvm.loop !13

.preheader.us:                                    ; preds = %19
  %29 = getelementptr inbounds %struct.t_speed, ptr %1, i64 %20
  %30 = load double, ptr %29, align 8, !tbaa !15
  %31 = fadd double %30, 0.000000e+00
  %32 = getelementptr inbounds i8, ptr %29, i64 8
  %33 = load double, ptr %32, align 8, !tbaa !15
  %34 = fadd double %31, %33
  %35 = getelementptr inbounds i8, ptr %29, i64 16
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = fadd double %34, %36
  %38 = getelementptr inbounds i8, ptr %29, i64 24
  %39 = getelementptr inbounds i8, ptr %29, i64 40
  %40 = load double, ptr %39, align 8, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %29, i64 48
  %42 = getelementptr inbounds i8, ptr %29, i64 64
  %43 = load double, ptr %42, align 8, !tbaa !15
  %44 = load <2 x double>, ptr %38, align 8, !tbaa !15
  %45 = extractelement <2 x double> %44, i64 0
  %46 = fadd double %37, %45
  %47 = extractelement <2 x double> %44, i64 1
  %48 = fadd double %46, %47
  %49 = fadd double %48, %40
  %50 = load <2 x double>, ptr %41, align 8, !tbaa !15
  %51 = extractelement <2 x double> %50, i64 0
  %52 = fadd double %49, %51
  %53 = extractelement <2 x double> %50, i64 1
  %54 = fadd double %52, %53
  %55 = fadd double %54, %43
  %56 = insertelement <2 x double> poison, double %33, i64 0
  %57 = insertelement <2 x double> %56, double %40, i64 1
  %58 = insertelement <2 x double> poison, double %40, i64 0
  %59 = insertelement <2 x double> %58, double %36, i64 1
  %60 = fadd <2 x double> %57, %59
  %61 = insertelement <2 x double> poison, double %43, i64 0
  %62 = shufflevector <2 x double> %61, <2 x double> %50, <2 x i32> <i32 0, i32 2>
  %63 = fadd <2 x double> %60, %62
  %64 = fadd <2 x double> %50, %44
  %65 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %66 = insertelement <2 x double> %65, double %43, i64 1
  %67 = fadd <2 x double> %64, %66
  %68 = fsub <2 x double> %63, %67
  %69 = insertelement <2 x double> poison, double %55, i64 0
  %70 = shufflevector <2 x double> %69, <2 x double> poison, <2 x i32> zeroinitializer
  %71 = fdiv <2 x double> %68, %70
  %72 = fmul <2 x double> %71, %71
  %73 = extractelement <2 x double> %72, i64 1
  %74 = extractelement <2 x double> %71, i64 0
  %75 = tail call double @llvm.fmuladd.f64(double %74, double %74, double %73)
  %sqrt.us = tail call double @llvm.sqrt.f64(double %75)
  br label %23

._crit_edge.us:                                   ; preds = %23
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97
  br i1 %exitcond98.not, label %._crit_edge89, label %.preheader84.us, !llvm.loop !16

._crit_edge89:                                    ; preds = %._crit_edge.us, %.preheader84.lr.ph, %8
  %76 = tail call i32 @fclose(ptr noundef %5)
  %77 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.27)
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %._crit_edge89
  tail call void @die(ptr noundef nonnull @.str.28, i32 noundef 667, ptr noundef nonnull @.str.7)
  br label %80

80:                                               ; preds = %79, %._crit_edge89
  %81 = getelementptr inbounds i8, ptr %0, i64 8
  %82 = load i32, ptr %81, align 8, !tbaa !17
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %80
  %wide.trip.count102 = zext nneg i32 %82 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv99 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next100, %.lr.ph ]
  %84 = getelementptr inbounds double, ptr %3, i64 %indvars.iv99
  %85 = load double, ptr %84, align 8, !tbaa !15
  %86 = trunc nuw nsw i64 %indvars.iv99 to i32
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.31, i32 noundef %86, double noundef %85) #4
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
  br i1 %exitcond103.not, label %._crit_edge, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %80
  %88 = tail call i32 @fclose(ptr noundef %77)
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @die(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nofree 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 = { 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, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !14}
!17 = !{!6, !7, i64 8}
!18 = distinct !{!18, !14}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass