; LLVM IR from simbody/simbody :: SimTKmath/Optimizers/src/c-cmaes (cmaes)

; 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.cmaes_readpara_t = type { ptr, i16, i32, i32, ptr, ptr, i32, ptr, ptr, double, double, double, %struct.anon, double, double, double, double, i32, i32, double, double, ptr, double, double, double, double, double, %struct.anon.0, double, ptr, [99 x i8], ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.anon = type { i32, double }
%struct.anon.0 = type { i32, double, double }

@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.225 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.236 = external hidden unnamed_addr constant [2 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
declare hidden void @ERRORMESSAGE(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @cmaes_readpara_WriteToFile(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %11 = call i64 @time(ptr noundef null) #5
  store i64 %11, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noalias ptr @fopen(ptr noundef %12, ptr noundef @.str.49)
  store ptr %13, ptr %9, align 8, !tbaa !5
  %14 = load ptr, ptr %9, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %18

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  call void @ERRORMESSAGE(ptr noundef @.str.51, ptr noundef %17, ptr noundef @.str.11, ptr noundef null)
  store i32 1, ptr %10, align 4
  br label %288

18:                                               ; preds = %2
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %28

24:                                               ; preds = %18
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  br label %29

28:                                               ; preds = %18
  br label %29

29:                                               ; preds = %28, %24
  %30 = phi ptr [ %27, %24 ], [ @.str.72, %28 ]
  %31 = call ptr @localtime(ptr noundef %8) #5
  %32 = call ptr @asctime(ptr noundef %31) #5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.232, ptr noundef %30, ptr noundef %32) #5
  store i32 0, ptr %5, align 4, !tbaa !18
  br label %34

34:                                               ; preds = %57, %29
  %35 = load i32, ptr %5, align 4, !tbaa !18
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %37, label %60

37:                                               ; preds = %34
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %39, i32 0, i32 31
  %41 = load ptr, ptr %40, align 8, !tbaa !19
  %42 = load i32, ptr %5, align 4, !tbaa !18
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds ptr, ptr %41, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %46, i32 0, i32 32
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = load i32, ptr %5, align 4, !tbaa !18
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = load i32, ptr %52, align 4, !tbaa !18
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef %45, i32 noundef %53) #5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.114) #5
  br label %57

57:                                               ; preds = %37
  %58 = load i32, ptr %5, align 4, !tbaa !18
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !18
  br label %34, !llvm.loop !21

60:                                               ; preds = %34
  store i32 0, ptr %5, align 4, !tbaa !18
  br label %61

61:                                               ; preds = %125, %60
  %62 = load i32, ptr %5, align 4, !tbaa !18
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %63, i32 0, i32 37
  %65 = load i32, ptr %64, align 8, !tbaa !23
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %67, label %128

67:                                               ; preds = %61
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %68, i32 0, i32 34
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = load i32, ptr %5, align 4, !tbaa !18
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %78

77:                                               ; preds = %67
  br label %125

78:                                               ; preds = %67
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %80, i32 0, i32 33
  %82 = load ptr, ptr %81, align 8, !tbaa !25
  %83 = load i32, ptr %5, align 4, !tbaa !18
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %82, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !26
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef %86, i32 noundef %89) #5
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.114) #5
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %93

93:                                               ; preds = %119, %78
  %94 = load i32, ptr %6, align 4, !tbaa !18
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 4, !tbaa !26
  %98 = icmp slt i32 %94, %97
  br i1 %98, label %99, label %122

99:                                               ; preds = %93
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %101, i32 0, i32 34
  %103 = load ptr, ptr %102, align 8, !tbaa !24
  %104 = load i32, ptr %5, align 4, !tbaa !18
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = load i32, ptr %6, align 4, !tbaa !18
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds double, ptr %108, i64 %110
  %112 = load double, ptr %111, align 8, !tbaa !27
  %113 = load i32, ptr %6, align 4, !tbaa !18
  %114 = srem i32 %113, 5
  %115 = icmp eq i32 %114, 4
  %116 = zext i1 %115 to i64
  %117 = select i1 %115, i32 10, i32 32
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.233, double noundef %112, i32 noundef %117) #5
  br label %119

119:                                              ; preds = %99
  %120 = load i32, ptr %6, align 4, !tbaa !18
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !18
  br label %93, !llvm.loop !28

122:                                              ; preds = %93
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.114) #5
  br label %125

125:                                              ; preds = %122, %77
  %126 = load i32, ptr %5, align 4, !tbaa !18
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %5, align 4, !tbaa !18
  br label %61, !llvm.loop !29

128:                                              ; preds = %61
  store i32 1, ptr %5, align 4, !tbaa !18
  br label %129

129:                                              ; preds = %280, %128
  %130 = load i32, ptr %5, align 4, !tbaa !18
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %131, i32 0, i32 36
  %133 = load i32, ptr %132, align 4, !tbaa !30
  %134 = icmp slt i32 %130, %133
  br i1 %134, label %135, label %283

135:                                              ; preds = %129
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %136, i32 0, i32 31
  %138 = load ptr, ptr %137, align 8, !tbaa !19
  %139 = load i32, ptr %5, align 4, !tbaa !18
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds ptr, ptr %138, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = call i32 @strncmp(ptr noundef %142, ptr noundef @.str.225, i64 noundef 13) #6
  %144 = icmp eq i32 %143, 0
  br i1 %144, label %145, label %155

145:                                              ; preds = %135
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %146, i32 0, i32 12
  %148 = getelementptr inbounds %struct.anon, ptr %147, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !31
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %151, label %154

151:                                              ; preds = %145
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.234) #5
  br label %280

154:                                              ; preds = %145
  br label %155

155:                                              ; preds = %154, %135
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %156, i32 0, i32 31
  %158 = load ptr, ptr %157, align 8, !tbaa !19
  %159 = load i32, ptr %5, align 4, !tbaa !18
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds ptr, ptr %158, i64 %160
  %162 = load ptr, ptr %161, align 8, !tbaa !5
  %163 = call i64 @strlen(ptr noundef %162) #6
  store i64 %163, ptr %7, align 8, !tbaa !9
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %164, i32 0, i32 31
  %166 = load ptr, ptr %165, align 8, !tbaa !19
  %167 = load i32, ptr %5, align 4, !tbaa !18
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds ptr, ptr %166, i64 %168
  %170 = load ptr, ptr %169, align 8, !tbaa !5
  %171 = load i64, ptr %7, align 8, !tbaa !9
  %172 = sub i64 %171, 1
  %173 = getelementptr inbounds i8, ptr %170, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !32
  %175 = sext i8 %174 to i32
  %176 = icmp eq i32 %175, 100
  br i1 %176, label %177, label %195

177:                                              ; preds = %155
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %179, i32 0, i32 31
  %181 = load ptr, ptr %180, align 8, !tbaa !19
  %182 = load i32, ptr %5, align 4, !tbaa !18
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds ptr, ptr %181, i64 %183
  %185 = load ptr, ptr %184, align 8, !tbaa !5
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %186, i32 0, i32 32
  %188 = load ptr, ptr %187, align 8, !tbaa !20
  %189 = load i32, ptr %5, align 4, !tbaa !18
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds ptr, ptr %188, i64 %190
  %192 = load ptr, ptr %191, align 8, !tbaa !5
  %193 = load i32, ptr %192, align 4, !tbaa !18
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef %185, i32 noundef %193) #5
  br label %277

195:                                              ; preds = %155
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %196, i32 0, i32 31
  %198 = load ptr, ptr %197, align 8, !tbaa !19
  %199 = load i32, ptr %5, align 4, !tbaa !18
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds ptr, ptr %198, i64 %200
  %202 = load ptr, ptr %201, align 8, !tbaa !5
  %203 = load i64, ptr %7, align 8, !tbaa !9
  %204 = sub i64 %203, 1
  %205 = getelementptr inbounds i8, ptr %202, i64 %204
  %206 = load i8, ptr %205, align 1, !tbaa !32
  %207 = sext i8 %206 to i32
  %208 = icmp eq i32 %207, 115
  br i1 %208, label %209, label %226

209:                                              ; preds = %195
  %210 = load ptr, ptr %9, align 8, !tbaa !5
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %211, i32 0, i32 31
  %213 = load ptr, ptr %212, align 8, !tbaa !19
  %214 = load i32, ptr %5, align 4, !tbaa !18
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds ptr, ptr %213, i64 %215
  %217 = load ptr, ptr %216, align 8, !tbaa !5
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %218, i32 0, i32 32
  %220 = load ptr, ptr %219, align 8, !tbaa !20
  %221 = load i32, ptr %5, align 4, !tbaa !18
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds ptr, ptr %220, i64 %222
  %224 = load ptr, ptr %223, align 8, !tbaa !5
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef %217, ptr noundef %224) #5
  br label %276

226:                                              ; preds = %195
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %227, i32 0, i32 31
  %229 = load ptr, ptr %228, align 8, !tbaa !19
  %230 = load i32, ptr %5, align 4, !tbaa !18
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds ptr, ptr %229, i64 %231
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  %234 = call i32 @strncmp(ptr noundef @.str.235, ptr noundef %233, i64 noundef 5) #6
  %235 = icmp eq i32 %234, 0
  br i1 %235, label %236, label %257

236:                                              ; preds = %226
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  %238 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %237, ptr noundef @.str.236) #5
  %239 = load ptr, ptr %9, align 8, !tbaa !5
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %240, i32 0, i32 31
  %242 = load ptr, ptr %241, align 8, !tbaa !19
  %243 = load i32, ptr %5, align 4, !tbaa !18
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds ptr, ptr %242, i64 %244
  %246 = load ptr, ptr %245, align 8, !tbaa !5
  %247 = getelementptr inbounds i8, ptr %246, i64 5
  %248 = load ptr, ptr %3, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %248, i32 0, i32 32
  %250 = load ptr, ptr %249, align 8, !tbaa !20
  %251 = load i32, ptr %5, align 4, !tbaa !18
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds ptr, ptr %250, i64 %252
  %254 = load ptr, ptr %253, align 8, !tbaa !5
  %255 = load double, ptr %254, align 8, !tbaa !27
  %256 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %239, ptr noundef %247, double noundef %255) #5
  br label %275

257:                                              ; preds = %226
  %258 = load ptr, ptr %9, align 8, !tbaa !5
  %259 = load ptr, ptr %3, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %259, i32 0, i32 31
  %261 = load ptr, ptr %260, align 8, !tbaa !19
  %262 = load i32, ptr %5, align 4, !tbaa !18
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds ptr, ptr %261, i64 %263
  %265 = load ptr, ptr %264, align 8, !tbaa !5
  %266 = load ptr, ptr %3, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.cmaes_readpara_t, ptr %266, i32 0, i32 32
  %268 = load ptr, ptr %267, align 8, !tbaa !20
  %269 = load i32, ptr %5, align 4, !tbaa !18
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds ptr, ptr %268, i64 %270
  %272 = load ptr, ptr %271, align 8, !tbaa !5
  %273 = load double, ptr %272, align 8, !tbaa !27
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %258, ptr noundef %265, double noundef %273) #5
  br label %275

275:                                              ; preds = %257, %236
  br label %276

276:                                              ; preds = %275, %209
  br label %277

277:                                              ; preds = %276, %177
  %278 = load ptr, ptr %9, align 8, !tbaa !5
  %279 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %278, ptr noundef @.str.114) #5
  br label %280

280:                                              ; preds = %277, %151
  %281 = load i32, ptr %5, align 4, !tbaa !18
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %5, align 4, !tbaa !18
  br label %129, !llvm.loop !33

283:                                              ; preds = %129
  %284 = load ptr, ptr %9, align 8, !tbaa !5
  %285 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %284, ptr noundef @.str.114) #5
  %286 = load ptr, ptr %9, align 8, !tbaa !5
  %287 = call i32 @fclose(ptr noundef %286)
  store i32 0, ptr %10, align 4
  br label %288

288:                                              ; preds = %283, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %289 = load i32, ptr %10, align 4
  switch i32 %289, label %291 [
    i32 0, label %290
    i32 1, label %290
  ]

290:                                              ; preds = %288, %288
  ret void

291:                                              ; preds = %288
  unreachable
}

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

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

declare i32 @fclose(ptr noundef) #2

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @asctime(ptr noundef) #3

; Function Attrs: nounwind
declare ptr @localtime(ptr noundef) #3

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 = { "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 = { 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 #4 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !13, i64 8, !14, i64 12, !14, i64 16, !6, i64 24, !6, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !16, i64 88, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128, !14, i64 136, !14, i64 140, !15, i64 144, !15, i64 152, !6, i64 160, !15, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !17, i64 208, !15, i64 232, !6, i64 240, !7, i64 248, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !14, i64 384, !14, i64 388, !14, i64 392}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"", !14, i64 0, !15, i64 8}
!17 = !{!"", !14, i64 0, !15, i64 8, !15, i64 16}
!18 = !{!14, !14, i64 0}
!19 = !{!12, !6, i64 352}
!20 = !{!12, !6, i64 360}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !14, i64 392}
!24 = !{!12, !6, i64 376}
!25 = !{!12, !6, i64 368}
!26 = !{!12, !14, i64 12}
!27 = !{!15, !15, i64 0}
!28 = distinct !{!28, !22}
!29 = distinct !{!29, !22}
!30 = !{!12, !14, i64 388}
!31 = !{!12, !14, i64 88}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !22}


; 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"

@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.225 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.236 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden void @ERRORMESSAGE(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @cmaes_readpara_WriteToFile(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %4 = tail call i64 @time(ptr noundef null) #5
  store i64 %4, ptr %3, align 8, !tbaa !5
  %5 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.49)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %.critedge

7:                                                ; preds = %2
  tail call void @ERRORMESSAGE(ptr noundef nonnull @.str.51, ptr noundef %1, ptr noundef nonnull @.str.11, ptr noundef null)
  br label %118

.critedge:                                        ; preds = %2
  %8 = load ptr, ptr %0, align 8, !tbaa !9
  %.not = icmp eq ptr %8, null
  %spec.select = select i1 %.not, ptr @.str.72, ptr %8
  %9 = call ptr @localtime(ptr noundef nonnull %3) #5
  %10 = call ptr @asctime(ptr noundef %9) #5
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.232, ptr noundef nonnull %spec.select, ptr noundef %10) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 352
  %13 = load ptr, ptr %12, align 8, !tbaa !17
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %0, i64 360
  %16 = load ptr, ptr %15, align 8, !tbaa !19
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %18 = load i32, ptr %17, align 4, !tbaa !20
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef %14, i32 noundef %18) #5
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.114) #5
  %21 = getelementptr inbounds i8, ptr %0, i64 392
  %22 = load i32, ptr %21, align 8, !tbaa !21
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph79, label %.preheader

.lr.ph79:                                         ; preds = %.critedge
  %24 = getelementptr inbounds i8, ptr %0, i64 376
  %25 = getelementptr inbounds i8, ptr %0, i64 368
  %26 = getelementptr inbounds i8, ptr %0, i64 12
  br label %31

.preheader:                                       ; preds = %62, %.critedge
  %27 = getelementptr inbounds i8, ptr %0, i64 388
  %28 = load i32, ptr %27, align 4, !tbaa !22
  %29 = icmp sgt i32 %28, 1
  br i1 %29, label %.lr.ph81, label %._crit_edge82

.lr.ph81:                                         ; preds = %.preheader
  %30 = getelementptr inbounds i8, ptr %0, i64 88
  br label %66

31:                                               ; preds = %.lr.ph79, %62
  %32 = phi i32 [ %22, %.lr.ph79 ], [ %63, %62 ]
  %indvars.iv84 = phi i64 [ 0, %.lr.ph79 ], [ %indvars.iv.next85, %62 ]
  %33 = load ptr, ptr %24, align 8, !tbaa !23
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv84
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  %36 = load ptr, ptr %35, align 8, !tbaa !18
  %37 = icmp eq ptr %36, null
  br i1 %37, label %62, label %38

38:                                               ; preds = %31
  %39 = load ptr, ptr %25, align 8, !tbaa !24
  %40 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv84
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load i32, ptr %26, align 4, !tbaa !25
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef %41, i32 noundef %42) #5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.114) #5
  %45 = load i32, ptr %26, align 4, !tbaa !25
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %38, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %38 ]
  %47 = load ptr, ptr %24, align 8, !tbaa !23
  %48 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv84
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %51 = getelementptr inbounds double, ptr %50, i64 %indvars.iv
  %52 = load double, ptr %51, align 8, !tbaa !26
  %53 = trunc nuw nsw i64 %indvars.iv to i32
  %54 = urem i32 %53, 5
  %55 = icmp eq i32 %54, 4
  %56 = select i1 %55, i32 10, i32 32
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.233, double noundef %52, i32 noundef %56) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %58 = load i32, ptr %26, align 4, !tbaa !25
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next, %59
  br i1 %60, label %.lr.ph, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %.lr.ph, %38
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.114) #5
  %.pre = load i32, ptr %21, align 8, !tbaa !21
  br label %62

62:                                               ; preds = %31, %._crit_edge
  %63 = phi i32 [ %32, %31 ], [ %.pre, %._crit_edge ]
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next85, %64
  br i1 %65, label %31, label %.preheader, !llvm.loop !29

66:                                               ; preds = %.lr.ph81, %111
  %indvars.iv87 = phi i64 [ 1, %.lr.ph81 ], [ %indvars.iv.next88, %111 ]
  %67 = load ptr, ptr %12, align 8, !tbaa !17
  %68 = getelementptr inbounds ptr, ptr %67, i64 %indvars.iv87
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %69, ptr noundef nonnull dereferenceable(1) @.str.225, i64 noundef 13) #6
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %66
  %73 = load i32, ptr %30, align 8, !tbaa !30
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %111, label %75

75:                                               ; preds = %72, %66
  %76 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %69) #6
  %77 = getelementptr i8, ptr %69, i64 %76
  %78 = getelementptr i8, ptr %77, i64 -1
  %79 = load i8, ptr %78, align 1, !tbaa !31
  switch i8 %79, label %91 [
    i8 100, label %80
    i8 115, label %86
  ]

80:                                               ; preds = %75
  %81 = load ptr, ptr %15, align 8, !tbaa !19
  %82 = getelementptr inbounds ptr, ptr %81, i64 %indvars.iv87
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %84 = load i32, ptr %83, align 4, !tbaa !20
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull %69, i32 noundef %84) #5
  br label %111

86:                                               ; preds = %75
  %87 = load ptr, ptr %15, align 8, !tbaa !19
  %88 = getelementptr inbounds ptr, ptr %87, i64 %indvars.iv87
  %89 = load ptr, ptr %88, align 8, !tbaa !18
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull %69, ptr noundef %89) #5
  br label %111

91:                                               ; preds = %75
  %92 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) @.str.235, ptr noundef nonnull dereferenceable(1) %69, i64 noundef 5) #6
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %105

94:                                               ; preds = %91
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.236) #5
  %96 = load ptr, ptr %12, align 8, !tbaa !17
  %97 = getelementptr inbounds ptr, ptr %96, i64 %indvars.iv87
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = getelementptr inbounds i8, ptr %98, i64 5
  %100 = load ptr, ptr %15, align 8, !tbaa !19
  %101 = getelementptr inbounds ptr, ptr %100, i64 %indvars.iv87
  %102 = load ptr, ptr %101, align 8, !tbaa !18
  %103 = load double, ptr %102, align 8, !tbaa !26
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull %99, double noundef %103) #5
  br label %111

105:                                              ; preds = %91
  %106 = load ptr, ptr %15, align 8, !tbaa !19
  %107 = getelementptr inbounds ptr, ptr %106, i64 %indvars.iv87
  %108 = load ptr, ptr %107, align 8, !tbaa !18
  %109 = load double, ptr %108, align 8, !tbaa !26
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull %69, double noundef %109) #5
  br label %111

111:                                              ; preds = %80, %94, %105, %86, %72
  %.str.114.sink = phi ptr [ @.str.234, %72 ], [ @.str.114, %86 ], [ @.str.114, %105 ], [ @.str.114, %94 ], [ @.str.114, %80 ]
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull %.str.114.sink) #5
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %113 = load i32, ptr %27, align 4, !tbaa !22
  %114 = sext i32 %113 to i64
  %115 = icmp slt i64 %indvars.iv.next88, %114
  br i1 %115, label %66, label %._crit_edge82, !llvm.loop !32

._crit_edge82:                                    ; preds = %111, %.preheader
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.114) #5
  %117 = call i32 @fclose(ptr noundef nonnull %5)
  br label %118

118:                                              ; preds = %._crit_edge82, %7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void
}

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

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

; 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare ptr @asctime(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare ptr @localtime(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress 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 = { 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 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !13, i64 12, !13, i64 16, !11, i64 24, !11, i64 32, !13, i64 40, !11, i64 48, !11, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !15, i64 88, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !13, i64 136, !13, i64 140, !14, i64 144, !14, i64 152, !11, i64 160, !14, i64 168, !14, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !16, i64 208, !14, i64 232, !11, i64 240, !7, i64 248, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !13, i64 384, !13, i64 388, !13, i64 392}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"", !13, i64 0, !14, i64 8}
!16 = !{!"", !13, i64 0, !14, i64 8, !14, i64 16}
!17 = !{!10, !11, i64 352}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !11, i64 360}
!20 = !{!13, !13, i64 0}
!21 = !{!10, !13, i64 392}
!22 = !{!10, !13, i64 388}
!23 = !{!10, !11, i64 376}
!24 = !{!10, !11, i64 368}
!25 = !{!10, !13, i64 12}
!26 = !{!14, !14, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!10, !13, i64 88}
!31 = !{!7, !7, i64 0}
!32 = distinct !{!32, !28}


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