; LLVM IR from csviragh/robotsim :: src/utilities (param_utils)

; 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.unit_model_params_t = type { %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, [512 x i8] }
%struct.unit_param_double_t = type { [64 x i8], [10 x i8], double }
%struct.flocking_model_params_t = type { [256 x i8], i32, [64 x %struct.fl_param_double_t], i32, [64 x ptr], i32 }
%struct.fl_param_double_t = type { [64 x i8], [10 x i8], double, i32, double, double, double, double, [64 x i8], i8, i8, double, ptr, i32, %struct.anon }
%struct.anon = type { [32 x double], [32 x [7 x i8]] }

@.str.106 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [3 x i8], align 1

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

declare i32 @printf(ptr noundef, ...) #1

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @FillParameterSetsFromFile(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca i1, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !9
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %22 = load ptr, ptr %14, align 8, !tbaa !5
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp eq i32 0, %23
  br i1 %24, label %25, label %61

25:                                               ; preds = %8
  %26 = load ptr, ptr %17, align 8, !tbaa !5
  %27 = load ptr, ptr %16, align 8, !tbaa !5
  %28 = call ptr @strcpy(ptr noundef %26, ptr noundef %27) #5
  %29 = load ptr, ptr %17, align 8, !tbaa !5
  %30 = call ptr @strcat(ptr noundef %29, ptr noundef @.str.106) #5
  %31 = load ptr, ptr %17, align 8, !tbaa !5
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.107, ptr noundef %31)
  %33 = load ptr, ptr %17, align 8, !tbaa !5
  %34 = call noalias ptr @fopen(ptr noundef %33, ptr noundef @.str.108)
  store ptr %34, ptr %18, align 8, !tbaa !5
  %35 = load ptr, ptr %18, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %58

37:                                               ; preds = %25
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.unit_model_params_t, ptr %38, i64 %41
  %43 = getelementptr inbounds %struct.unit_model_params_t, ptr %42, i32 0, i32 16
  %44 = getelementptr inbounds [512 x i8], ptr %43, i64 0, i64 0
  %45 = load ptr, ptr %17, align 8, !tbaa !5
  %46 = call ptr @strcpy(ptr noundef %44, ptr noundef %45) #5
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.unit_model_params_t, ptr %47, i64 %50
  %52 = load ptr, ptr %18, align 8, !tbaa !5
  call void @GetUnitModelParamsFromFile(ptr noundef %51, ptr noundef %52)
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %53, align 4, !tbaa !9
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = call i32 @fclose(ptr noundef %56)
  br label %60

58:                                               ; preds = %25
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.109)
  store i1 false, ptr %9, align 1
  store i32 1, ptr %21, align 4
  br label %272

60:                                               ; preds = %37
  br label %63

61:                                               ; preds = %8
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %62, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %61, %60
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %143, %63
  %65 = load i32, ptr %19, align 4, !tbaa !9
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = sub nsw i32 %66, 1
  %68 = icmp slt i32 %65, %67
  br i1 %68, label %69, label %146

69:                                               ; preds = %64
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = load i32, ptr %19, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %70, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = load ptr, ptr %17, align 8, !tbaa !5
  %77 = call i32 @strcmp(ptr noundef %75, ptr noundef %76) #6
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %69
  br label %143

80:                                               ; preds = %69
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = load i32, ptr %19, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = call i32 @strcmp(ptr noundef %85, ptr noundef @.str.110) #6
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %88, label %142

88:                                               ; preds = %80
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = load i32, ptr %19, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %89, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.107, ptr noundef %94)
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = load i32, ptr %19, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds ptr, ptr %96, i64 %99
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = call noalias ptr @fopen(ptr noundef %101, ptr noundef @.str.108)
  store ptr %102, ptr %18, align 8, !tbaa !5
  %103 = load ptr, ptr %18, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %139

105:                                              ; preds = %88
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.unit_model_params_t, ptr %106, i64 %109
  %111 = getelementptr inbounds %struct.unit_model_params_t, ptr %110, i32 0, i32 16
  %112 = getelementptr inbounds [512 x i8], ptr %111, i64 0, i64 0
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = load i32, ptr %19, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds ptr, ptr %113, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = call ptr @strcpy(ptr noundef %112, ptr noundef %118) #5
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %struct.unit_model_params_t, ptr %120, i64 %123
  %125 = getelementptr inbounds %struct.unit_model_params_t, ptr %124, i32 0, i32 16
  %126 = getelementptr inbounds [512 x i8], ptr %125, i64 0, i64 0
  %127 = call ptr @strcat(ptr noundef %126, ptr noundef @.str.111) #5
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds %struct.unit_model_params_t, ptr %128, i64 %131
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  call void @GetUnitModelParamsFromFile(ptr noundef %132, ptr noundef %133)
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %134, align 4, !tbaa !9
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = call i32 @fclose(ptr noundef %137)
  br label %141

139:                                              ; preds = %88
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.109)
  store i1 false, ptr %9, align 1
  store i32 1, ptr %21, align 4
  br label %272

141:                                              ; preds = %105
  br label %142

142:                                              ; preds = %141, %80
  br label %143

143:                                              ; preds = %142, %79
  %144 = load i32, ptr %19, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %19, align 4, !tbaa !9
  br label %64, !llvm.loop !11

146:                                              ; preds = %64
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = load i32, ptr %147, align 4, !tbaa !9
  %149 = icmp eq i32 0, %148
  br i1 %149, label %150, label %186

150:                                              ; preds = %146
  %151 = load ptr, ptr %17, align 8, !tbaa !5
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = call ptr @strcpy(ptr noundef %151, ptr noundef %152) #5
  %154 = load ptr, ptr %17, align 8, !tbaa !5
  %155 = call ptr @strcat(ptr noundef %154, ptr noundef @.str.112) #5
  %156 = load ptr, ptr %17, align 8, !tbaa !5
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.113, ptr noundef %156)
  %158 = load ptr, ptr %17, align 8, !tbaa !5
  %159 = call noalias ptr @fopen(ptr noundef %158, ptr noundef @.str.108)
  store ptr %159, ptr %18, align 8, !tbaa !5
  %160 = load ptr, ptr %18, align 8, !tbaa !5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %183

162:                                              ; preds = %150
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = load i32, ptr %164, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds %struct.flocking_model_params_t, ptr %163, i64 %166
  %168 = getelementptr inbounds %struct.flocking_model_params_t, ptr %167, i32 0, i32 0
  %169 = getelementptr inbounds [256 x i8], ptr %168, i64 0, i64 0
  %170 = load ptr, ptr %17, align 8, !tbaa !5
  %171 = call ptr @strcpy(ptr noundef %169, ptr noundef %170) #5
  %172 = load ptr, ptr %10, align 8, !tbaa !5
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.flocking_model_params_t, ptr %172, i64 %175
  %177 = load ptr, ptr %18, align 8, !tbaa !5
  call void @GetFlockingModelParamsFromFile(ptr noundef %176, ptr noundef %177)
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %178, align 4, !tbaa !9
  %181 = load ptr, ptr %18, align 8, !tbaa !5
  %182 = call i32 @fclose(ptr noundef %181)
  br label %185

183:                                              ; preds = %150
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.109)
  store i1 false, ptr %9, align 1
  store i32 1, ptr %21, align 4
  br label %272

185:                                              ; preds = %162
  br label %188

186:                                              ; preds = %146
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %187, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %186, %185
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %268, %188
  %190 = load i32, ptr %19, align 4, !tbaa !9
  %191 = load i32, ptr %12, align 4, !tbaa !9
  %192 = sub nsw i32 %191, 1
  %193 = icmp slt i32 %190, %192
  br i1 %193, label %194, label %271

194:                                              ; preds = %189
  %195 = load ptr, ptr %15, align 8, !tbaa !5
  %196 = load i32, ptr %19, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds ptr, ptr %195, i64 %198
  %200 = load ptr, ptr %199, align 8, !tbaa !5
  %201 = load ptr, ptr %17, align 8, !tbaa !5
  %202 = call i32 @strcmp(ptr noundef %200, ptr noundef %201) #6
  %203 = icmp eq i32 %202, 0
  br i1 %203, label %204, label %205

204:                                              ; preds = %194
  br label %268

205:                                              ; preds = %194
  %206 = load ptr, ptr %15, align 8, !tbaa !5
  %207 = load i32, ptr %19, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds ptr, ptr %206, i64 %208
  %210 = load ptr, ptr %209, align 8, !tbaa !5
  %211 = call i32 @strcmp(ptr noundef %210, ptr noundef @.str.114) #6
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %267

213:                                              ; preds = %205
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  %215 = load i32, ptr %19, align 4, !tbaa !9
  %216 = add nsw i32 %215, 1
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds ptr, ptr %214, i64 %217
  %219 = load ptr, ptr %218, align 8, !tbaa !5
  %220 = call i32 (ptr, ...) @printf(ptr noundef @.str.113, ptr noundef %219)
  %221 = load ptr, ptr %15, align 8, !tbaa !5
  %222 = load i32, ptr %19, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds ptr, ptr %221, i64 %224
  %226 = load ptr, ptr %225, align 8, !tbaa !5
  %227 = call noalias ptr @fopen(ptr noundef %226, ptr noundef @.str.108)
  store ptr %227, ptr %18, align 8, !tbaa !5
  %228 = load ptr, ptr %18, align 8, !tbaa !5
  %229 = icmp ne ptr %228, null
  br i1 %229, label %230, label %264

230:                                              ; preds = %213
  %231 = load ptr, ptr %10, align 8, !tbaa !5
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  %233 = load i32, ptr %232, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds %struct.flocking_model_params_t, ptr %231, i64 %234
  %236 = getelementptr inbounds %struct.flocking_model_params_t, ptr %235, i32 0, i32 0
  %237 = getelementptr inbounds [256 x i8], ptr %236, i64 0, i64 0
  %238 = load ptr, ptr %15, align 8, !tbaa !5
  %239 = load i32, ptr %19, align 4, !tbaa !9
  %240 = add nsw i32 %239, 1
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds ptr, ptr %238, i64 %241
  %243 = load ptr, ptr %242, align 8, !tbaa !5
  %244 = call ptr @strcpy(ptr noundef %237, ptr noundef %243) #5
  %245 = load ptr, ptr %10, align 8, !tbaa !5
  %246 = load ptr, ptr %13, align 8, !tbaa !5
  %247 = load i32, ptr %246, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds %struct.flocking_model_params_t, ptr %245, i64 %248
  %250 = getelementptr inbounds %struct.flocking_model_params_t, ptr %249, i32 0, i32 0
  %251 = getelementptr inbounds [256 x i8], ptr %250, i64 0, i64 0
  %252 = call ptr @strcat(ptr noundef %251, ptr noundef @.str.111) #5
  %253 = load ptr, ptr %10, align 8, !tbaa !5
  %254 = load ptr, ptr %13, align 8, !tbaa !5
  %255 = load i32, ptr %254, align 4, !tbaa !9
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds %struct.flocking_model_params_t, ptr %253, i64 %256
  %258 = load ptr, ptr %18, align 8, !tbaa !5
  call void @GetFlockingModelParamsFromFile(ptr noundef %257, ptr noundef %258)
  %259 = load ptr, ptr %13, align 8, !tbaa !5
  %260 = load i32, ptr %259, align 4, !tbaa !9
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %259, align 4, !tbaa !9
  %262 = load ptr, ptr %18, align 8, !tbaa !5
  %263 = call i32 @fclose(ptr noundef %262)
  br label %266

264:                                              ; preds = %213
  %265 = call i32 (ptr, ...) @printf(ptr noundef @.str.109)
  store i1 false, ptr %9, align 1
  store i32 1, ptr %21, align 4
  br label %272

266:                                              ; preds = %230
  br label %267

267:                                              ; preds = %266, %205
  br label %268

268:                                              ; preds = %267, %204
  %269 = load i32, ptr %19, align 4, !tbaa !9
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %19, align 4, !tbaa !9
  br label %189, !llvm.loop !13

271:                                              ; preds = %189
  store i1 true, ptr %9, align 1
  store i32 1, ptr %21, align 4
  br label %272

272:                                              ; preds = %271, %264, %183, %139, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %273 = load i1, ptr %9, align 1
  ret i1 %273
}

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #4

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

declare i32 @fclose(ptr noundef) #1

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 = { "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 willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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.unit_model_params_t = type { %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, %struct.unit_param_double_t, [512 x i8] }
%struct.unit_param_double_t = type { [64 x i8], [10 x i8], double }
%struct.flocking_model_params_t = type { [256 x i8], i32, [64 x %struct.fl_param_double_t], i32, [64 x ptr], i32 }
%struct.fl_param_double_t = type { [64 x i8], [10 x i8], double, i32, double, double, double, double, [64 x i8], i8, i8, double, ptr, i32, %struct.anon }
%struct.anon = type { [32 x double], [32 x [7 x i8]] }

@.str.106 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @FillParameterSetsFromFile(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef %3, ptr nocapture noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, ptr noundef %7) local_unnamed_addr #0 {
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %27

11:                                               ; preds = %8
  %12 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %6) #4
  %13 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.106) #4
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.107, ptr noundef %7)
  %15 = tail call noalias ptr @fopen(ptr noundef %7, ptr noundef nonnull @.str.108)
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %.loopexit.sink.split, label %16

16:                                               ; preds = %11
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds %struct.unit_model_params_t, ptr %1, i64 %18, i32 16
  %20 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) %7) #4
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds %struct.unit_model_params_t, ptr %1, i64 %22
  tail call void @GetUnitModelParamsFromFile(ptr noundef %23, ptr noundef nonnull %15)
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %4, align 4, !tbaa !5
  %26 = tail call i32 @fclose(ptr noundef nonnull %15)
  br label %28

27:                                               ; preds = %8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %27, %16
  %29 = add i32 %2, -1
  %30 = icmp sgt i32 %2, 1
  br i1 %30, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %28
  %wide.trip.count = zext nneg i32 %29 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %60 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv.next
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %32, ptr noundef nonnull dereferenceable(1) %7) #5
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %60, label %35

35:                                               ; preds = %.lr.ph
  %36 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %37, ptr noundef nonnull dereferenceable(1) @.str.110) #5
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %60

40:                                               ; preds = %35
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.107, ptr noundef %32)
  %42 = load ptr, ptr %31, align 8, !tbaa !9
  %43 = tail call noalias ptr @fopen(ptr noundef %42, ptr noundef nonnull @.str.108)
  %.not88 = icmp eq ptr %43, null
  br i1 %.not88, label %.loopexit.sink.split, label %44

44:                                               ; preds = %40
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.unit_model_params_t, ptr %1, i64 %46, i32 16
  %48 = load ptr, ptr %31, align 8, !tbaa !9
  %49 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %47, ptr noundef nonnull dereferenceable(1) %48) #4
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds %struct.unit_model_params_t, ptr %1, i64 %51, i32 16
  %53 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %52, ptr noundef nonnull dereferenceable(1) @.str.111) #4
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %struct.unit_model_params_t, ptr %1, i64 %55
  tail call void @GetUnitModelParamsFromFile(ptr noundef %56, ptr noundef nonnull %43)
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %4, align 4, !tbaa !5
  %59 = tail call i32 @fclose(ptr noundef nonnull %43)
  br label %60

60:                                               ; preds = %35, %44, %.lr.ph
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %60, %28
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %79

63:                                               ; preds = %._crit_edge
  %64 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %6) #4
  %65 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.112) #4
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.113, ptr noundef %7)
  %67 = tail call noalias ptr @fopen(ptr noundef %7, ptr noundef nonnull @.str.108)
  %.not86 = icmp eq ptr %67, null
  br i1 %.not86, label %.loopexit.sink.split, label %68

68:                                               ; preds = %63
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.flocking_model_params_t, ptr %0, i64 %70
  %72 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %71, ptr noundef nonnull dereferenceable(1) %7) #4
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.flocking_model_params_t, ptr %0, i64 %74
  tail call void @GetFlockingModelParamsFromFile(ptr noundef %75, ptr noundef nonnull %67)
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %3, align 4, !tbaa !5
  %78 = tail call i32 @fclose(ptr noundef nonnull %67)
  br label %80

79:                                               ; preds = %._crit_edge
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %79, %68
  br i1 %30, label %.lr.ph93.preheader, label %.loopexit

.lr.ph93.preheader:                               ; preds = %80
  %wide.trip.count98 = zext nneg i32 %29 to i64
  br label %.lr.ph93

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %110
  %indvars.iv95 = phi i64 [ 0, %.lr.ph93.preheader ], [ %indvars.iv.next96, %110 ]
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %81 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv.next96
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  %83 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %82, ptr noundef nonnull dereferenceable(1) %7) #5
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %110, label %85

85:                                               ; preds = %.lr.ph93
  %86 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv95
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %87, ptr noundef nonnull dereferenceable(1) @.str.114) #5
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %110

90:                                               ; preds = %85
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.113, ptr noundef %82)
  %92 = load ptr, ptr %81, align 8, !tbaa !9
  %93 = tail call noalias ptr @fopen(ptr noundef %92, ptr noundef nonnull @.str.108)
  %.not87 = icmp eq ptr %93, null
  br i1 %.not87, label %.loopexit.sink.split, label %94

94:                                               ; preds = %90
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %struct.flocking_model_params_t, ptr %0, i64 %96
  %98 = load ptr, ptr %81, align 8, !tbaa !9
  %99 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %97, ptr noundef nonnull dereferenceable(1) %98) #4
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.flocking_model_params_t, ptr %0, i64 %101
  %103 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %102, ptr noundef nonnull dereferenceable(1) @.str.111) #4
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.flocking_model_params_t, ptr %0, i64 %105
  tail call void @GetFlockingModelParamsFromFile(ptr noundef %106, ptr noundef nonnull %93)
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %3, align 4, !tbaa !5
  %109 = tail call i32 @fclose(ptr noundef nonnull %93)
  br label %110

110:                                              ; preds = %85, %94, %.lr.ph93
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %.loopexit, label %.lr.ph93, !llvm.loop !13

.loopexit.sink.split:                             ; preds = %40, %90, %63, %11
  %111 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.109)
  br label %.loopexit

.loopexit:                                        ; preds = %110, %.loopexit.sink.split, %80
  %.0 = phi i1 [ true, %80 ], [ false, %.loopexit.sink.split ], [ true, %110 ]
  ret i1 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

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

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

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 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass