; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (r8lib)

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @r8_epsilon() #2

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

; Function Attrs: nounwind uwtable
declare dso_local double @r8_max(double noundef, double noundef) #2

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @r8mat_hess(ptr noundef %0, i32 noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = mul i64 %20, 8
  %22 = call noalias ptr @malloc(i64 noundef %21) #6
  store ptr %22, ptr %16, align 8, !tbaa !5
  %23 = call double @r8_epsilon()
  %24 = call double @pow(double noundef %23, double noundef 3.300000e-01) #5
  store double %24, ptr %7, align 8, !tbaa !11
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %43, %3
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %46

29:                                               ; preds = %25
  %30 = load double, ptr %7, align 8, !tbaa !11
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load i32, ptr %14, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds double, ptr %31, i64 %33
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = call double @llvm.fabs.f64(double %35)
  %37 = call double @r8_max(double noundef %36, double noundef 1.000000e+00)
  %38 = fmul double %30, %37
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  %40 = load i32, ptr %14, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %39, i64 %41
  store double %38, ptr %42, align 8, !tbaa !11
  br label %43

43:                                               ; preds = %29
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %14, align 4, !tbaa !9
  br label %25, !llvm.loop !13

46:                                               ; preds = %25
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = mul nsw i32 %47, %48
  %50 = sext i32 %49 to i64
  %51 = mul i64 %50, 8
  %52 = call noalias ptr @malloc(i64 noundef %51) #6
  store ptr %52, ptr %13, align 8, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %129, %46
  %54 = load i32, ptr %14, align 4, !tbaa !9
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %57, label %132

57:                                               ; preds = %53
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %58, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !11
  store double %62, ptr %17, align 8, !tbaa !11
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call double %63(i32 noundef %64, ptr noundef %65)
  store double %66, ptr %8, align 8, !tbaa !11
  %67 = load double, ptr %17, align 8, !tbaa !11
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = load i32, ptr %14, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds double, ptr %68, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = fadd double %67, %72
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %74, i64 %76
  store double %73, ptr %77, align 8, !tbaa !11
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call double %78(i32 noundef %79, ptr noundef %80)
  store double %81, ptr %12, align 8, !tbaa !11
  %82 = load double, ptr %17, align 8, !tbaa !11
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %83, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !11
  %88 = fsub double %82, %87
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %89, i64 %91
  store double %88, ptr %92, align 8, !tbaa !11
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call double %93(i32 noundef %94, ptr noundef %95)
  store double %96, ptr %9, align 8, !tbaa !11
  %97 = load double, ptr %12, align 8, !tbaa !11
  %98 = load double, ptr %8, align 8, !tbaa !11
  %99 = fsub double %97, %98
  %100 = load double, ptr %9, align 8, !tbaa !11
  %101 = load double, ptr %8, align 8, !tbaa !11
  %102 = fsub double %100, %101
  %103 = fadd double %99, %102
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = load i32, ptr %14, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %104, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = fdiv double %103, %108
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %110, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !11
  %115 = fdiv double %109, %114
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = mul nsw i32 %118, %119
  %121 = add nsw i32 %117, %120
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds double, ptr %116, i64 %122
  store double %115, ptr %123, align 8, !tbaa !11
  %124 = load double, ptr %17, align 8, !tbaa !11
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = load i32, ptr %14, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds double, ptr %125, i64 %127
  store double %124, ptr %128, align 8, !tbaa !11
  br label %129

129:                                              ; preds = %57
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %14, align 4, !tbaa !9
  br label %53, !llvm.loop !15

132:                                              ; preds = %53
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %318, %132
  %134 = load i32, ptr %14, align 4, !tbaa !9
  %135 = load i32, ptr %5, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %321

137:                                              ; preds = %133
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds double, ptr %138, i64 %140
  %142 = load double, ptr %141, align 8, !tbaa !11
  store double %142, ptr %17, align 8, !tbaa !11
  %143 = load i32, ptr %14, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %15, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %309, %137
  %146 = load i32, ptr %15, align 4, !tbaa !9
  %147 = load i32, ptr %5, align 4, !tbaa !9
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %149, label %312

149:                                              ; preds = %145
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %150, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !11
  store double %154, ptr %18, align 8, !tbaa !11
  %155 = load double, ptr %17, align 8, !tbaa !11
  %156 = load ptr, ptr %16, align 8, !tbaa !5
  %157 = load i32, ptr %14, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds double, ptr %156, i64 %158
  %160 = load double, ptr %159, align 8, !tbaa !11
  %161 = fadd double %155, %160
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = load i32, ptr %14, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds double, ptr %162, i64 %164
  store double %161, ptr %165, align 8, !tbaa !11
  %166 = load double, ptr %18, align 8, !tbaa !11
  %167 = load ptr, ptr %16, align 8, !tbaa !5
  %168 = load i32, ptr %15, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds double, ptr %167, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !11
  %172 = fadd double %166, %171
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = load i32, ptr %15, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %173, i64 %175
  store double %172, ptr %176, align 8, !tbaa !11
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = load i32, ptr %5, align 4, !tbaa !9
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = call double %177(i32 noundef %178, ptr noundef %179)
  store double %180, ptr %12, align 8, !tbaa !11
  %181 = load double, ptr %17, align 8, !tbaa !11
  %182 = load ptr, ptr %16, align 8, !tbaa !5
  %183 = load i32, ptr %14, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %182, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !11
  %187 = fadd double %181, %186
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = load i32, ptr %14, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %188, i64 %190
  store double %187, ptr %191, align 8, !tbaa !11
  %192 = load double, ptr %18, align 8, !tbaa !11
  %193 = load ptr, ptr %16, align 8, !tbaa !5
  %194 = load i32, ptr %15, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds double, ptr %193, i64 %195
  %197 = load double, ptr %196, align 8, !tbaa !11
  %198 = fsub double %192, %197
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = load i32, ptr %15, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds double, ptr %199, i64 %201
  store double %198, ptr %202, align 8, !tbaa !11
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = load i32, ptr %5, align 4, !tbaa !9
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = call double %203(i32 noundef %204, ptr noundef %205)
  store double %206, ptr %11, align 8, !tbaa !11
  %207 = load double, ptr %17, align 8, !tbaa !11
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  %209 = load i32, ptr %14, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds double, ptr %208, i64 %210
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = fsub double %207, %212
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = load i32, ptr %14, align 4, !tbaa !9
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds double, ptr %214, i64 %216
  store double %213, ptr %217, align 8, !tbaa !11
  %218 = load double, ptr %18, align 8, !tbaa !11
  %219 = load ptr, ptr %16, align 8, !tbaa !5
  %220 = load i32, ptr %15, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds double, ptr %219, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !11
  %224 = fadd double %218, %223
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = load i32, ptr %15, align 4, !tbaa !9
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds double, ptr %225, i64 %227
  store double %224, ptr %228, align 8, !tbaa !11
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = load i32, ptr %5, align 4, !tbaa !9
  %231 = load ptr, ptr %6, align 8, !tbaa !5
  %232 = call double %229(i32 noundef %230, ptr noundef %231)
  store double %232, ptr %10, align 8, !tbaa !11
  %233 = load double, ptr %17, align 8, !tbaa !11
  %234 = load ptr, ptr %16, align 8, !tbaa !5
  %235 = load i32, ptr %14, align 4, !tbaa !9
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds double, ptr %234, i64 %236
  %238 = load double, ptr %237, align 8, !tbaa !11
  %239 = fsub double %233, %238
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = load i32, ptr %14, align 4, !tbaa !9
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds double, ptr %240, i64 %242
  store double %239, ptr %243, align 8, !tbaa !11
  %244 = load double, ptr %18, align 8, !tbaa !11
  %245 = load ptr, ptr %16, align 8, !tbaa !5
  %246 = load i32, ptr %15, align 4, !tbaa !9
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds double, ptr %245, i64 %247
  %249 = load double, ptr %248, align 8, !tbaa !11
  %250 = fsub double %244, %249
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = load i32, ptr %15, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds double, ptr %251, i64 %253
  store double %250, ptr %254, align 8, !tbaa !11
  %255 = load ptr, ptr %4, align 8, !tbaa !5
  %256 = load i32, ptr %5, align 4, !tbaa !9
  %257 = load ptr, ptr %6, align 8, !tbaa !5
  %258 = call double %255(i32 noundef %256, ptr noundef %257)
  store double %258, ptr %9, align 8, !tbaa !11
  %259 = load double, ptr %12, align 8, !tbaa !11
  %260 = load double, ptr %11, align 8, !tbaa !11
  %261 = fsub double %259, %260
  %262 = load double, ptr %9, align 8, !tbaa !11
  %263 = load double, ptr %10, align 8, !tbaa !11
  %264 = fsub double %262, %263
  %265 = fadd double %261, %264
  %266 = load ptr, ptr %16, align 8, !tbaa !5
  %267 = load i32, ptr %14, align 4, !tbaa !9
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds double, ptr %266, i64 %268
  %270 = load double, ptr %269, align 8, !tbaa !11
  %271 = fmul double 4.000000e+00, %270
  %272 = load ptr, ptr %16, align 8, !tbaa !5
  %273 = load i32, ptr %15, align 4, !tbaa !9
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds double, ptr %272, i64 %274
  %276 = load double, ptr %275, align 8, !tbaa !11
  %277 = fmul double %271, %276
  %278 = fdiv double %265, %277
  %279 = load ptr, ptr %13, align 8, !tbaa !5
  %280 = load i32, ptr %15, align 4, !tbaa !9
  %281 = load i32, ptr %14, align 4, !tbaa !9
  %282 = load i32, ptr %5, align 4, !tbaa !9
  %283 = mul nsw i32 %281, %282
  %284 = add nsw i32 %280, %283
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds double, ptr %279, i64 %285
  store double %278, ptr %286, align 8, !tbaa !11
  %287 = load ptr, ptr %13, align 8, !tbaa !5
  %288 = load i32, ptr %15, align 4, !tbaa !9
  %289 = load i32, ptr %14, align 4, !tbaa !9
  %290 = load i32, ptr %5, align 4, !tbaa !9
  %291 = mul nsw i32 %289, %290
  %292 = add nsw i32 %288, %291
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds double, ptr %287, i64 %293
  %295 = load double, ptr %294, align 8, !tbaa !11
  %296 = load ptr, ptr %13, align 8, !tbaa !5
  %297 = load i32, ptr %14, align 4, !tbaa !9
  %298 = load i32, ptr %15, align 4, !tbaa !9
  %299 = load i32, ptr %5, align 4, !tbaa !9
  %300 = mul nsw i32 %298, %299
  %301 = add nsw i32 %297, %300
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds double, ptr %296, i64 %302
  store double %295, ptr %303, align 8, !tbaa !11
  %304 = load double, ptr %18, align 8, !tbaa !11
  %305 = load ptr, ptr %6, align 8, !tbaa !5
  %306 = load i32, ptr %15, align 4, !tbaa !9
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds double, ptr %305, i64 %307
  store double %304, ptr %308, align 8, !tbaa !11
  br label %309

309:                                              ; preds = %149
  %310 = load i32, ptr %15, align 4, !tbaa !9
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %15, align 4, !tbaa !9
  br label %145, !llvm.loop !16

312:                                              ; preds = %145
  %313 = load double, ptr %17, align 8, !tbaa !11
  %314 = load ptr, ptr %6, align 8, !tbaa !5
  %315 = load i32, ptr %14, align 4, !tbaa !9
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds double, ptr %314, i64 %316
  store double %313, ptr %317, align 8, !tbaa !11
  br label %318

318:                                              ; preds = %312
  %319 = load i32, ptr %14, align 4, !tbaa !9
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %14, align 4, !tbaa !9
  br label %133, !llvm.loop !17

321:                                              ; preds = %133
  %322 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %322) #5
  %323 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  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 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  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
  ret ptr %323
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 allocsize(0) }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @r8_epsilon() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local double @r8_max(double noundef, double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @r8mat_hess(ptr nocapture noundef readonly %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = sext i32 %1 to i64
  %5 = shl nsw i64 %4, 3
  %6 = tail call noalias ptr @malloc(i64 noundef %5) #5
  %7 = tail call double @r8_epsilon()
  %8 = tail call double @pow(double noundef %7, double noundef 3.300000e-01) #6
  %9 = icmp sgt i32 %1, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %3
  %10 = mul nsw i32 %1, %1
  %11 = zext nneg i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 3
  %13 = tail call noalias ptr @malloc(i64 noundef %12) #5
  br label %._crit_edge152

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %14 = getelementptr inbounds double, ptr %2, i64 %indvars.iv
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = tail call double @llvm.fabs.f64(double %15)
  %17 = tail call double @r8_max(double noundef %16, double noundef 1.000000e+00)
  %18 = fmul double %8, %17
  %19 = getelementptr inbounds double, ptr %6, i64 %indvars.iv
  store double %18, ptr %19, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %20 = mul nuw nsw i32 %1, %1
  %21 = zext nneg i32 %20 to i64
  %22 = shl nuw nsw i64 %21, 3
  %23 = tail call noalias ptr @malloc(i64 noundef %22) #5
  br i1 %9, label %.lr.ph145, label %._crit_edge152

.lr.ph145:                                        ; preds = %._crit_edge
  %24 = add nuw i32 %1, 1
  %wide.trip.count157 = zext nneg i32 %1 to i64
  br label %26

.preheader:                                       ; preds = %26
  br i1 %9, label %.lr.ph151.preheader, label %._crit_edge152

.lr.ph151.preheader:                              ; preds = %.preheader
  %25 = zext nneg i32 %1 to i64
  br label %.lr.ph151

26:                                               ; preds = %.lr.ph145, %26
  %indvars.iv154 = phi i64 [ 0, %.lr.ph145 ], [ %indvars.iv.next155, %26 ]
  %27 = getelementptr inbounds double, ptr %2, i64 %indvars.iv154
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  %30 = getelementptr inbounds double, ptr %6, i64 %indvars.iv154
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fadd double %28, %31
  store double %32, ptr %27, align 8, !tbaa !5
  %33 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  %34 = fsub double %28, %31
  store double %34, ptr %27, align 8, !tbaa !5
  %35 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  %36 = fsub double %33, %29
  %37 = fsub double %35, %29
  %38 = fadd double %36, %37
  %39 = fdiv double %38, %31
  %40 = fdiv double %39, %31
  %41 = trunc nuw nsw i64 %indvars.iv154 to i32
  %42 = mul i32 %24, %41
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds double, ptr %23, i64 %43
  store double %40, ptr %44, align 8, !tbaa !5
  store double %28, ptr %27, align 8, !tbaa !5
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157
  br i1 %exitcond158.not, label %.preheader, label %26, !llvm.loop !11

.lr.ph151:                                        ; preds = %.lr.ph151.preheader, %._crit_edge149
  %indvars.iv166 = phi i64 [ 0, %.lr.ph151.preheader ], [ %indvars.iv.next167, %._crit_edge149 ]
  %indvars.iv159 = phi i64 [ 1, %.lr.ph151.preheader ], [ %indvars.iv.next160, %._crit_edge149 ]
  %45 = getelementptr inbounds double, ptr %2, i64 %indvars.iv166
  %46 = load double, ptr %45, align 8, !tbaa !5
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %47 = icmp slt i64 %indvars.iv.next167, %4
  br i1 %47, label %.lr.ph148, label %._crit_edge149

.lr.ph148:                                        ; preds = %.lr.ph151
  %48 = getelementptr inbounds double, ptr %6, i64 %indvars.iv166
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = fadd double %46, %49
  %51 = fsub double %46, %49
  %52 = fmul double %49, 4.000000e+00
  %53 = mul nuw nsw i64 %indvars.iv166, %25
  %invariant.gep = getelementptr inbounds double, ptr %23, i64 %53
  %invariant.gep171 = getelementptr inbounds double, ptr %23, i64 %indvars.iv166
  br label %54

54:                                               ; preds = %.lr.ph148, %54
  %indvars.iv161 = phi i64 [ %indvars.iv159, %.lr.ph148 ], [ %indvars.iv.next162, %54 ]
  %55 = getelementptr inbounds double, ptr %2, i64 %indvars.iv161
  %56 = load double, ptr %55, align 8, !tbaa !5
  store double %50, ptr %45, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %6, i64 %indvars.iv161
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = fadd double %56, %58
  store double %59, ptr %55, align 8, !tbaa !5
  %60 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  store double %50, ptr %45, align 8, !tbaa !5
  %61 = fsub double %56, %58
  store double %61, ptr %55, align 8, !tbaa !5
  %62 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  store double %51, ptr %45, align 8, !tbaa !5
  store double %59, ptr %55, align 8, !tbaa !5
  %63 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  store double %51, ptr %45, align 8, !tbaa !5
  store double %61, ptr %55, align 8, !tbaa !5
  %64 = tail call double %0(i32 noundef %1, ptr noundef nonnull %2) #6
  %65 = fsub double %60, %62
  %66 = fsub double %64, %63
  %67 = fadd double %65, %66
  %68 = fmul double %52, %58
  %69 = fdiv double %67, %68
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv161
  store double %69, ptr %gep, align 8, !tbaa !5
  %70 = mul nuw nsw i64 %indvars.iv161, %25
  %gep172 = getelementptr inbounds double, ptr %invariant.gep171, i64 %70
  store double %69, ptr %gep172, align 8, !tbaa !5
  store double %56, ptr %55, align 8, !tbaa !5
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %exitcond165.not = icmp eq i64 %indvars.iv.next162, %25
  br i1 %exitcond165.not, label %._crit_edge149, label %54, !llvm.loop !12

._crit_edge149:                                   ; preds = %54, %.lr.ph151
  store double %46, ptr %45, align 8, !tbaa !5
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %exitcond170.not = icmp eq i64 %indvars.iv.next167, %25
  br i1 %exitcond170.not, label %._crit_edge152, label %.lr.ph151, !llvm.loop !13

._crit_edge152:                                   ; preds = %._crit_edge149, %._crit_edge, %._crit_edge.thread, %.preheader
  %71 = phi ptr [ %23, %.preheader ], [ %23, %._crit_edge ], [ %13, %._crit_edge.thread ], [ %23, %._crit_edge149 ]
  tail call void @free(ptr noundef %6) #6
  ret ptr %71
}

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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