; LLVM IR from microsoft/LightAIMD :: src (dft_matrices)

; 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.molecular_grid_desc = type { ptr, i64, i64, i64, i64, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, ptr, ptr, ptr, ptr, ptr }
%struct.scf_context = type { ptr, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, i64, double, double, double, i64, double, double, i64, double, i64, i64, ptr, ptr, ptr, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, ptr, ptr, ptr, ptr, i64 }
%struct.task_func_build_JK_arg = type { ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, i64, i64 }
%struct.threadpool_context = type { i64, ptr, i64 }

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

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

declare ptr @x_malloc(i64 noundef) #4

declare void @threadpool_add_task(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #4

declare void @threadpool_wait_job_done(ptr noundef) #4

declare void @transpose(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #4

declare void @mat_add(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) #4

declare void @mat_scalar_multiply(ptr noundef, ptr noundef, i64 noundef, i64 noundef, double noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @build_JK_matrices(ptr noundef %0) #5 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca double, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca [6 x double], align 16
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.molecular_grid_desc, ptr %28, i32 0, i32 76
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  store ptr %30, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.scf_context, ptr %31, i32 0, i32 1
  %33 = load i64, ptr %32, align 8, !tbaa !13
  store i64 %33, ptr %4, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %34 = load i64, ptr %4, align 8, !tbaa !15
  %35 = load i64, ptr %4, align 8, !tbaa !15
  %36 = mul i64 %34, %35
  store i64 %36, ptr %5, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.scf_context, ptr %37, i32 0, i32 22
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  store ptr %39, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.molecular_grid_desc, ptr %40, i32 0, i32 26
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  store ptr %42, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.molecular_grid_desc, ptr %43, i32 0, i32 27
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  store ptr %45, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i64, ptr %5, align 8, !tbaa !15
  %48 = mul i64 %47, 8
  call void @llvm.memset.p0.i64(ptr align 8 %46, i8 0, i64 %48, i1 false)
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = load i64, ptr %5, align 8, !tbaa !15
  %51 = mul i64 %50, 8
  call void @llvm.memset.p0.i64(ptr align 8 %49, i8 0, i64 %51, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !15
  br label %52

52:                                               ; preds = %305, %1
  %53 = load i64, ptr %9, align 8, !tbaa !15
  %54 = load i64, ptr %4, align 8, !tbaa !15
  %55 = icmp ult i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %308

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %58 = load i64, ptr %9, align 8, !tbaa !15
  %59 = load i64, ptr %4, align 8, !tbaa !15
  %60 = mul i64 %58, %59
  store i64 %60, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !15
  br label %61

61:                                               ; preds = %301, %57
  %62 = load i64, ptr %12, align 8, !tbaa !15
  %63 = load i64, ptr %9, align 8, !tbaa !15
  %64 = icmp ule i64 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %304

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %67 = load i64, ptr %12, align 8, !tbaa !15
  %68 = load i64, ptr %4, align 8, !tbaa !15
  %69 = mul i64 %67, %68
  store i64 %69, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %70 = load i64, ptr %9, align 8, !tbaa !15
  %71 = load i64, ptr %9, align 8, !tbaa !15
  %72 = add i64 %71, 1
  %73 = mul i64 %70, %72
  %74 = lshr i64 %73, 1
  %75 = load i64, ptr %12, align 8, !tbaa !15
  %76 = add i64 %74, %75
  store i64 %76, ptr %14, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store double 2.000000e+00, ptr %15, align 8, !tbaa !19
  %77 = load i64, ptr %9, align 8, !tbaa !15
  %78 = load i64, ptr %12, align 8, !tbaa !15
  %79 = icmp eq i64 %77, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %66
  store double 1.000000e+00, ptr %15, align 8, !tbaa !19
  br label %81

81:                                               ; preds = %80, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !15
  br label %82

82:                                               ; preds = %297, %81
  %83 = load i64, ptr %16, align 8, !tbaa !15
  %84 = load i64, ptr %4, align 8, !tbaa !15
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %300

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %88 = load i64, ptr %16, align 8, !tbaa !15
  %89 = load i64, ptr %4, align 8, !tbaa !15
  %90 = mul i64 %88, %89
  store i64 %90, ptr %17, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !15
  br label %91

91:                                               ; preds = %293, %87
  %92 = load i64, ptr %18, align 8, !tbaa !15
  %93 = load i64, ptr %16, align 8, !tbaa !15
  %94 = icmp ule i64 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %296

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %97 = load i64, ptr %16, align 8, !tbaa !15
  %98 = load i64, ptr %16, align 8, !tbaa !15
  %99 = add i64 %98, 1
  %100 = mul i64 %97, %99
  %101 = lshr i64 %100, 1
  %102 = load i64, ptr %18, align 8, !tbaa !15
  %103 = add i64 %101, %102
  store i64 %103, ptr %19, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store double 2.000000e+00, ptr %20, align 8, !tbaa !19
  %104 = load i64, ptr %16, align 8, !tbaa !15
  %105 = load i64, ptr %18, align 8, !tbaa !15
  %106 = icmp eq i64 %104, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %96
  store double 1.000000e+00, ptr %20, align 8, !tbaa !19
  br label %108

108:                                              ; preds = %107, %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store double 2.000000e+00, ptr %21, align 8, !tbaa !19
  %109 = load i64, ptr %9, align 8, !tbaa !15
  %110 = load i64, ptr %16, align 8, !tbaa !15
  %111 = icmp eq i64 %109, %110
  br i1 %111, label %112, label %117

112:                                              ; preds = %108
  %113 = load i64, ptr %12, align 8, !tbaa !15
  %114 = load i64, ptr %18, align 8, !tbaa !15
  %115 = icmp eq i64 %113, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  store double 1.000000e+00, ptr %21, align 8, !tbaa !19
  br label %117

117:                                              ; preds = %116, %112, %108
  %118 = load i64, ptr %14, align 8, !tbaa !15
  %119 = load i64, ptr %19, align 8, !tbaa !15
  %120 = icmp uge i64 %118, %119
  br i1 %120, label %121, label %289

121:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.scf_context, ptr %122, i32 0, i32 38
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = load i64, ptr %14, align 8, !tbaa !15
  %126 = getelementptr inbounds double, ptr %124, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !19
  %128 = call double @sqrt(double noundef %127) #6
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.scf_context, ptr %129, i32 0, i32 38
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = load i64, ptr %19, align 8, !tbaa !15
  %133 = getelementptr inbounds double, ptr %131, i64 %132
  %134 = load double, ptr %133, align 8, !tbaa !19
  %135 = call double @sqrt(double noundef %134) #6
  %136 = fmul double %128, %135
  store double %136, ptr %22, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store double 0.000000e+00, ptr %23, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #6
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = load i64, ptr %9, align 8, !tbaa !15
  %139 = load i64, ptr %4, align 8, !tbaa !15
  %140 = mul i64 %138, %139
  %141 = load i64, ptr %12, align 8, !tbaa !15
  %142 = add i64 %140, %141
  %143 = getelementptr inbounds double, ptr %137, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !19
  %145 = fmul double 4.000000e+00, %144
  %146 = call double @llvm.fabs.f64(double %145)
  store double %146, ptr %24, align 8, !tbaa !19
  %147 = getelementptr inbounds double, ptr %24, i64 1
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load i64, ptr %16, align 8, !tbaa !15
  %150 = load i64, ptr %4, align 8, !tbaa !15
  %151 = mul i64 %149, %150
  %152 = load i64, ptr %18, align 8, !tbaa !15
  %153 = add i64 %151, %152
  %154 = getelementptr inbounds double, ptr %148, i64 %153
  %155 = load double, ptr %154, align 8, !tbaa !19
  %156 = fmul double 4.000000e+00, %155
  %157 = call double @llvm.fabs.f64(double %156)
  store double %157, ptr %147, align 8, !tbaa !19
  %158 = getelementptr inbounds double, ptr %24, i64 2
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = load i64, ptr %9, align 8, !tbaa !15
  %161 = load i64, ptr %4, align 8, !tbaa !15
  %162 = mul i64 %160, %161
  %163 = load i64, ptr %16, align 8, !tbaa !15
  %164 = add i64 %162, %163
  %165 = getelementptr inbounds double, ptr %159, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !19
  %167 = call double @llvm.fabs.f64(double %166)
  store double %167, ptr %158, align 8, !tbaa !19
  %168 = getelementptr inbounds double, ptr %24, i64 3
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = load i64, ptr %9, align 8, !tbaa !15
  %171 = load i64, ptr %4, align 8, !tbaa !15
  %172 = mul i64 %170, %171
  %173 = load i64, ptr %18, align 8, !tbaa !15
  %174 = add i64 %172, %173
  %175 = getelementptr inbounds double, ptr %169, i64 %174
  %176 = load double, ptr %175, align 8, !tbaa !19
  %177 = call double @llvm.fabs.f64(double %176)
  store double %177, ptr %168, align 8, !tbaa !19
  %178 = getelementptr inbounds double, ptr %24, i64 4
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = load i64, ptr %12, align 8, !tbaa !15
  %181 = load i64, ptr %4, align 8, !tbaa !15
  %182 = mul i64 %180, %181
  %183 = load i64, ptr %16, align 8, !tbaa !15
  %184 = add i64 %182, %183
  %185 = getelementptr inbounds double, ptr %179, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !19
  %187 = call double @llvm.fabs.f64(double %186)
  store double %187, ptr %178, align 8, !tbaa !19
  %188 = getelementptr inbounds double, ptr %24, i64 5
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = load i64, ptr %12, align 8, !tbaa !15
  %191 = load i64, ptr %4, align 8, !tbaa !15
  %192 = mul i64 %190, %191
  %193 = load i64, ptr %18, align 8, !tbaa !15
  %194 = add i64 %192, %193
  %195 = getelementptr inbounds double, ptr %189, i64 %194
  %196 = load double, ptr %195, align 8, !tbaa !19
  %197 = call double @llvm.fabs.f64(double %196)
  store double %197, ptr %188, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  store i64 0, ptr %25, align 8, !tbaa !15
  br label %198

198:                                              ; preds = %213, %121
  %199 = load i64, ptr %25, align 8, !tbaa !15
  %200 = icmp ult i64 %199, 6
  br i1 %200, label %202, label %201

201:                                              ; preds = %198
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %216

202:                                              ; preds = %198
  %203 = load i64, ptr %25, align 8, !tbaa !15
  %204 = getelementptr inbounds [6 x double], ptr %24, i64 0, i64 %203
  %205 = load double, ptr %204, align 8, !tbaa !19
  %206 = load double, ptr %23, align 8, !tbaa !19
  %207 = fcmp ogt double %205, %206
  br i1 %207, label %208, label %212

208:                                              ; preds = %202
  %209 = load i64, ptr %25, align 8, !tbaa !15
  %210 = getelementptr inbounds [6 x double], ptr %24, i64 0, i64 %209
  %211 = load double, ptr %210, align 8, !tbaa !19
  store double %211, ptr %23, align 8, !tbaa !19
  br label %212

212:                                              ; preds = %208, %202
  br label %213

213:                                              ; preds = %212
  %214 = load i64, ptr %25, align 8, !tbaa !15
  %215 = add i64 %214, 1
  store i64 %215, ptr %25, align 8, !tbaa !15
  br label %198, !llvm.loop !21

216:                                              ; preds = %201
  %217 = load double, ptr %22, align 8, !tbaa !19
  %218 = load double, ptr %23, align 8, !tbaa !19
  %219 = fmul double %217, %218
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.scf_context, ptr %220, i32 0, i32 30
  %222 = load double, ptr %221, align 8, !tbaa !23
  %223 = fcmp olt double %219, %222
  br i1 %223, label %224, label %225

224:                                              ; preds = %216
  store i32 13, ptr %10, align 4
  br label %286

225:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %226 = call ptr @x_malloc(i64 noundef 88)
  store ptr %226, ptr %26, align 8, !tbaa !5
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = load ptr, ptr %26, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %228, i32 0, i32 0
  store ptr %227, ptr %229, align 8, !tbaa !24
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  %231 = load ptr, ptr %26, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %231, i32 0, i32 1
  store ptr %230, ptr %232, align 8, !tbaa !26
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = load ptr, ptr %26, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %234, i32 0, i32 2
  store ptr %233, ptr %235, align 8, !tbaa !27
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = load ptr, ptr %26, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %237, i32 0, i32 3
  store ptr %236, ptr %238, align 8, !tbaa !28
  %239 = load i64, ptr %9, align 8, !tbaa !15
  %240 = load ptr, ptr %26, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %240, i32 0, i32 4
  store i64 %239, ptr %241, align 8, !tbaa !29
  %242 = load i64, ptr %12, align 8, !tbaa !15
  %243 = load ptr, ptr %26, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %243, i32 0, i32 5
  store i64 %242, ptr %244, align 8, !tbaa !30
  %245 = load i64, ptr %16, align 8, !tbaa !15
  %246 = load ptr, ptr %26, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %246, i32 0, i32 6
  store i64 %245, ptr %247, align 8, !tbaa !31
  %248 = load i64, ptr %18, align 8, !tbaa !15
  %249 = load ptr, ptr %26, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %249, i32 0, i32 7
  store i64 %248, ptr %250, align 8, !tbaa !32
  %251 = load double, ptr %15, align 8, !tbaa !19
  %252 = fptoui double %251 to i64
  %253 = load ptr, ptr %26, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %253, i32 0, i32 8
  store i64 %252, ptr %254, align 8, !tbaa !33
  %255 = load double, ptr %20, align 8, !tbaa !19
  %256 = fptoui double %255 to i64
  %257 = load ptr, ptr %26, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %257, i32 0, i32 9
  store i64 %256, ptr %258, align 8, !tbaa !34
  %259 = load double, ptr %21, align 8, !tbaa !19
  %260 = fptoui double %259 to i64
  %261 = load ptr, ptr %26, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.task_func_build_JK_arg, ptr %261, i32 0, i32 10
  store i64 %260, ptr %262, align 8, !tbaa !35
  %263 = load ptr, ptr %3, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.scf_context, ptr %263, i32 0, i32 36
  %265 = load ptr, ptr %264, align 8, !tbaa !36
  %266 = load i64, ptr %11, align 8, !tbaa !15
  %267 = load i64, ptr %4, align 8, !tbaa !15
  %268 = mul i64 %266, %267
  %269 = load i64, ptr %4, align 8, !tbaa !15
  %270 = mul i64 %268, %269
  %271 = load i64, ptr %13, align 8, !tbaa !15
  %272 = load i64, ptr %4, align 8, !tbaa !15
  %273 = mul i64 %271, %272
  %274 = add i64 %270, %273
  %275 = load i64, ptr %17, align 8, !tbaa !15
  %276 = add i64 %274, %275
  %277 = load i64, ptr %18, align 8, !tbaa !15
  %278 = add i64 %276, %277
  %279 = load ptr, ptr %3, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.scf_context, ptr %279, i32 0, i32 36
  %281 = load ptr, ptr %280, align 8, !tbaa !36
  %282 = getelementptr inbounds %struct.threadpool_context, ptr %281, i32 0, i32 0
  %283 = load i64, ptr %282, align 8, !tbaa !37
  %284 = urem i64 %278, %283
  %285 = load ptr, ptr %26, align 8, !tbaa !5
  call void @threadpool_add_task(ptr noundef %265, i64 noundef %284, ptr noundef @task_func_build_JK, ptr noundef %285)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  store i32 0, ptr %10, align 4
  br label %286

286:                                              ; preds = %225, %224
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %287 = load i32, ptr %10, align 4
  switch i32 %287, label %290 [
    i32 0, label %288
  ]

288:                                              ; preds = %286
  br label %289

289:                                              ; preds = %288, %117
  store i32 0, ptr %10, align 4
  br label %290

290:                                              ; preds = %289, %286
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %291 = load i32, ptr %10, align 4
  switch i32 %291, label %344 [
    i32 0, label %292
    i32 13, label %293
  ]

292:                                              ; preds = %290
  br label %293

293:                                              ; preds = %292, %290
  %294 = load i64, ptr %18, align 8, !tbaa !15
  %295 = add i64 %294, 1
  store i64 %295, ptr %18, align 8, !tbaa !15
  br label %91, !llvm.loop !39

296:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %297

297:                                              ; preds = %296
  %298 = load i64, ptr %16, align 8, !tbaa !15
  %299 = add i64 %298, 1
  store i64 %299, ptr %16, align 8, !tbaa !15
  br label %82, !llvm.loop !40

300:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %301

301:                                              ; preds = %300
  %302 = load i64, ptr %12, align 8, !tbaa !15
  %303 = add i64 %302, 1
  store i64 %303, ptr %12, align 8, !tbaa !15
  br label %61, !llvm.loop !41

304:                                              ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %305

305:                                              ; preds = %304
  %306 = load i64, ptr %9, align 8, !tbaa !15
  %307 = add i64 %306, 1
  store i64 %307, ptr %9, align 8, !tbaa !15
  br label %52, !llvm.loop !42

308:                                              ; preds = %56
  %309 = load ptr, ptr %3, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.scf_context, ptr %309, i32 0, i32 36
  %311 = load ptr, ptr %310, align 8, !tbaa !36
  call void @threadpool_wait_job_done(ptr noundef %311)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %312 = load ptr, ptr %3, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.scf_context, ptr %312, i32 0, i32 51
  %314 = load ptr, ptr %313, align 8, !tbaa !43
  store ptr %314, ptr %27, align 8, !tbaa !5
  %315 = load ptr, ptr %7, align 8, !tbaa !5
  %316 = load ptr, ptr %27, align 8, !tbaa !5
  %317 = load i64, ptr %4, align 8, !tbaa !15
  %318 = load i64, ptr %4, align 8, !tbaa !15
  call void @transpose(ptr noundef %315, ptr noundef %316, i64 noundef %317, i64 noundef %318)
  %319 = load ptr, ptr %7, align 8, !tbaa !5
  %320 = load ptr, ptr %27, align 8, !tbaa !5
  %321 = load ptr, ptr %27, align 8, !tbaa !5
  %322 = load i64, ptr %4, align 8, !tbaa !15
  %323 = load i64, ptr %4, align 8, !tbaa !15
  call void @mat_add(ptr noundef %319, ptr noundef %320, ptr noundef %321, i64 noundef %322, i64 noundef %323)
  %324 = load ptr, ptr %27, align 8, !tbaa !5
  %325 = load ptr, ptr %7, align 8, !tbaa !5
  %326 = load i64, ptr %4, align 8, !tbaa !15
  %327 = load i64, ptr %4, align 8, !tbaa !15
  call void @mat_scalar_multiply(ptr noundef %324, ptr noundef %325, i64 noundef %326, i64 noundef %327, double noundef 2.500000e-01)
  %328 = load ptr, ptr %3, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.scf_context, ptr %328, i32 0, i32 51
  %330 = load ptr, ptr %329, align 8, !tbaa !43
  store ptr %330, ptr %27, align 8, !tbaa !5
  %331 = load ptr, ptr %8, align 8, !tbaa !5
  %332 = load ptr, ptr %27, align 8, !tbaa !5
  %333 = load i64, ptr %4, align 8, !tbaa !15
  %334 = load i64, ptr %4, align 8, !tbaa !15
  call void @transpose(ptr noundef %331, ptr noundef %332, i64 noundef %333, i64 noundef %334)
  %335 = load ptr, ptr %8, align 8, !tbaa !5
  %336 = load ptr, ptr %27, align 8, !tbaa !5
  %337 = load ptr, ptr %27, align 8, !tbaa !5
  %338 = load i64, ptr %4, align 8, !tbaa !15
  %339 = load i64, ptr %4, align 8, !tbaa !15
  call void @mat_add(ptr noundef %335, ptr noundef %336, ptr noundef %337, i64 noundef %338, i64 noundef %339)
  %340 = load ptr, ptr %27, align 8, !tbaa !5
  %341 = load ptr, ptr %8, align 8, !tbaa !5
  %342 = load i64, ptr %4, align 8, !tbaa !15
  %343 = load i64, ptr %4, align 8, !tbaa !15
  call void @mat_scalar_multiply(ptr noundef %340, ptr noundef %341, i64 noundef %342, i64 noundef %343, double noundef 5.000000e-01)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void

344:                                              ; preds = %290
  unreachable
}

; Function Attrs: nounwind uwtable
declare hidden void @task_func_build_JK(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { "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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 608}
!10 = !{!"molecular_grid_desc", !6, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !11, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !11, i64 560, !11, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608}
!11 = !{!"long", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !11, i64 8}
!14 = !{!"scf_context", !6, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !12, i64 192, !11, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !11, i64 232, !12, i64 240, !12, i64 248, !11, i64 256, !12, i64 264, !11, i64 272, !11, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !12, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !11, i64 440}
!15 = !{!11, !11, i64 0}
!16 = !{!14, !6, i64 176}
!17 = !{!10, !6, i64 208}
!18 = !{!10, !6, i64 216}
!19 = !{!12, !12, i64 0}
!20 = !{!14, !6, i64 304}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!14, !12, i64 240}
!24 = !{!25, !6, i64 0}
!25 = !{!"task_func_build_JK_arg", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80}
!26 = !{!25, !6, i64 8}
!27 = !{!25, !6, i64 16}
!28 = !{!25, !6, i64 24}
!29 = !{!25, !11, i64 32}
!30 = !{!25, !11, i64 40}
!31 = !{!25, !11, i64 48}
!32 = !{!25, !11, i64 56}
!33 = !{!25, !11, i64 64}
!34 = !{!25, !11, i64 72}
!35 = !{!25, !11, i64 80}
!36 = !{!14, !6, i64 288}
!37 = !{!38, !11, i64 0}
!38 = !{!"threadpool_context", !11, i64 0, !6, i64 8, !7, i64 16}
!39 = distinct !{!39, !22}
!40 = distinct !{!40, !22}
!41 = distinct !{!41, !22}
!42 = distinct !{!42, !22}
!43 = !{!14, !6, i64 408}


; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

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

declare ptr @x_malloc(i64 noundef) local_unnamed_addr #3

declare void @threadpool_add_task(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @threadpool_wait_job_done(ptr noundef) local_unnamed_addr #3

declare void @transpose(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare void @mat_add(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare void @mat_scalar_multiply(ptr noundef, ptr noundef, i64 noundef, i64 noundef, double noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @build_JK_matrices(ptr nocapture noundef readonly %0) local_unnamed_addr #4 {
  %2 = getelementptr inbounds i8, ptr %0, i64 608
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  %5 = load i64, ptr %4, align 8, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %3, i64 176
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %0, i64 208
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %0, i64 216
  %11 = load ptr, ptr %10, align 8, !tbaa !16
  %12 = shl i64 %5, 3
  %13 = mul i64 %12, %5
  tail call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 %13, i1 false)
  tail call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 %13, i1 false)
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %._crit_edge, label %.split.us.lr.ph

.split.us.lr.ph:                                  ; preds = %1
  %14 = getelementptr inbounds i8, ptr %3, i64 304
  %15 = getelementptr inbounds i8, ptr %3, i64 240
  %16 = getelementptr inbounds i8, ptr %3, i64 288
  br label %.split.us

._crit_edge:                                      ; preds = %.split162.us, %1
  %17 = getelementptr inbounds i8, ptr %3, i64 288
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  tail call void @threadpool_wait_job_done(ptr noundef %18) #5
  %19 = getelementptr inbounds i8, ptr %3, i64 408
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  tail call void @transpose(ptr noundef %9, ptr noundef %20, i64 noundef %5, i64 noundef %5) #5
  tail call void @mat_add(ptr noundef %9, ptr noundef %20, ptr noundef %20, i64 noundef %5, i64 noundef %5) #5
  tail call void @mat_scalar_multiply(ptr noundef %20, ptr noundef %9, i64 noundef %5, i64 noundef %5, double noundef 2.500000e-01) #5
  %21 = load ptr, ptr %19, align 8, !tbaa !18
  tail call void @transpose(ptr noundef %11, ptr noundef %21, i64 noundef %5, i64 noundef %5) #5
  tail call void @mat_add(ptr noundef %11, ptr noundef %21, ptr noundef %21, i64 noundef %5, i64 noundef %5) #5
  tail call void @mat_scalar_multiply(ptr noundef %21, ptr noundef %11, i64 noundef %5, i64 noundef %5, double noundef 5.000000e-01) #5
  ret void

.split.us:                                        ; preds = %.split.us.lr.ph, %.split162.us
  %indvars.iv165 = phi i64 [ 1, %.split.us.lr.ph ], [ %indvars.iv.next166, %.split162.us ]
  %.0163 = phi i64 [ 0, %.split.us.lr.ph ], [ %23, %.split162.us ]
  %22 = mul i64 %.0163, %5
  %23 = add nuw i64 %.0163, 1
  %24 = mul i64 %23, %.0163
  %25 = lshr i64 %24, 1
  %26 = getelementptr double, ptr %7, i64 %22
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %._crit_edge.us, %.split.us
  %.0146160.us = phi i64 [ 0, %.split.us ], [ %105, %._crit_edge.us ]
  %27 = mul i64 %.0146160.us, %5
  %28 = add i64 %.0146160.us, %25
  %29 = icmp eq i64 %.0163, %.0146160.us
  %30 = getelementptr double, ptr %26, i64 %.0146160.us
  %31 = getelementptr double, ptr %7, i64 %27
  %32 = select i1 %29, i64 1, i64 2
  %33 = add i64 %.0146160.us, %22
  %34 = mul i64 %33, %5
  br label %35

35:                                               ; preds = %.lr.ph.us, %104
  %indvars.iv = phi i64 [ 1, %.lr.ph.us ], [ %indvars.iv.next, %104 ]
  %.0149159.us = phi i64 [ 0, %.lr.ph.us ], [ %37, %104 ]
  %36 = mul i64 %.0149159.us, %5
  %37 = add nuw i64 %.0149159.us, 1
  %38 = mul i64 %37, %.0149159.us
  %39 = lshr i64 %38, 1
  %40 = icmp eq i64 %.0163, %.0149159.us
  %41 = getelementptr double, ptr %7, i64 %36
  %42 = getelementptr double, ptr %26, i64 %.0149159.us
  %43 = getelementptr double, ptr %31, i64 %.0149159.us
  %44 = add i64 %.0149159.us, %34
  %45 = mul i64 %44, %5
  br label %46

46:                                               ; preds = %.critedge.us, %35
  %.0148158.us = phi i64 [ 0, %35 ], [ %103, %.critedge.us ]
  %47 = add i64 %.0148158.us, %39
  %48 = icmp eq i64 %.0149159.us, %.0148158.us
  %49 = icmp eq i64 %.0146160.us, %.0148158.us
  %or.cond.us = and i1 %40, %49
  %.0147.us = select i1 %or.cond.us, i64 1, i64 2
  %.not155.us = icmp ult i64 %28, %47
  br i1 %.not155.us, label %.critedge.us, label %50

50:                                               ; preds = %46
  %51 = load ptr, ptr %14, align 8, !tbaa !19
  %52 = getelementptr inbounds double, ptr %51, i64 %28
  %53 = load double, ptr %52, align 8, !tbaa !20
  %54 = tail call double @sqrt(double noundef %53) #5
  %55 = load ptr, ptr %14, align 8, !tbaa !19
  %56 = getelementptr inbounds double, ptr %55, i64 %47
  %57 = load double, ptr %56, align 8, !tbaa !20
  %58 = tail call double @sqrt(double noundef %57) #5
  %59 = load double, ptr %30, align 8, !tbaa !20
  %60 = fmul double %59, 4.000000e+00
  %61 = tail call double @llvm.fabs.f64(double %60)
  %62 = getelementptr double, ptr %41, i64 %.0148158.us
  %63 = load double, ptr %62, align 8, !tbaa !20
  %64 = fmul double %63, 4.000000e+00
  %65 = tail call double @llvm.fabs.f64(double %64)
  %66 = load double, ptr %42, align 8, !tbaa !20
  %67 = tail call double @llvm.fabs.f64(double %66)
  %68 = getelementptr double, ptr %26, i64 %.0148158.us
  %69 = load double, ptr %68, align 8, !tbaa !20
  %70 = tail call double @llvm.fabs.f64(double %69)
  %71 = load double, ptr %43, align 8, !tbaa !20
  %72 = tail call double @llvm.fabs.f64(double %71)
  %73 = getelementptr double, ptr %31, i64 %.0148158.us
  %74 = load double, ptr %73, align 8, !tbaa !20
  %75 = tail call double @llvm.fabs.f64(double %74)
  %76 = fcmp ogt double %61, 0.000000e+00
  %.1.us = select i1 %76, double %61, double 0.000000e+00
  %77 = fcmp ogt double %65, %.1.us
  %.1.us.1 = select i1 %77, double %65, double %.1.us
  %78 = fcmp ogt double %67, %.1.us.1
  %.1.us.2 = select i1 %78, double %67, double %.1.us.1
  %79 = fcmp ogt double %70, %.1.us.2
  %.1.us.3 = select i1 %79, double %70, double %.1.us.2
  %80 = fcmp ogt double %72, %.1.us.3
  %.1.us.4 = select i1 %80, double %72, double %.1.us.3
  %81 = fcmp ogt double %75, %.1.us.4
  %.1.us.5 = select i1 %81, double %75, double %.1.us.4
  %82 = fmul double %54, %58
  %83 = fmul double %82, %.1.us.5
  %84 = load double, ptr %15, align 8, !tbaa !21
  %85 = fcmp uge double %83, %84
  br i1 %85, label %86, label %.critedge.us

86:                                               ; preds = %50
  %87 = tail call ptr @x_malloc(i64 noundef 88) #5
  store ptr %3, ptr %87, align 8, !tbaa !22
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  store ptr %9, ptr %88, align 8, !tbaa !24
  %89 = getelementptr inbounds i8, ptr %87, i64 16
  store ptr %11, ptr %89, align 8, !tbaa !25
  %90 = getelementptr inbounds i8, ptr %87, i64 24
  store ptr %7, ptr %90, align 8, !tbaa !26
  %91 = getelementptr inbounds i8, ptr %87, i64 32
  store i64 %.0163, ptr %91, align 8, !tbaa !27
  %92 = getelementptr inbounds i8, ptr %87, i64 40
  store i64 %.0146160.us, ptr %92, align 8, !tbaa !28
  %93 = getelementptr inbounds i8, ptr %87, i64 48
  store i64 %.0149159.us, ptr %93, align 8, !tbaa !29
  %94 = getelementptr inbounds i8, ptr %87, i64 56
  store i64 %.0148158.us, ptr %94, align 8, !tbaa !30
  %95 = getelementptr inbounds i8, ptr %87, i64 64
  store i64 %32, ptr %95, align 8, !tbaa !31
  %96 = select i1 %48, i64 1, i64 2
  %97 = getelementptr inbounds i8, ptr %87, i64 72
  store i64 %96, ptr %97, align 8, !tbaa !32
  %98 = getelementptr inbounds i8, ptr %87, i64 80
  store i64 %.0147.us, ptr %98, align 8, !tbaa !33
  %99 = load ptr, ptr %16, align 8, !tbaa !17
  %100 = add i64 %.0148158.us, %45
  %101 = load i64, ptr %99, align 8, !tbaa !34
  %102 = urem i64 %100, %101
  tail call void @threadpool_add_task(ptr noundef nonnull %99, i64 noundef %102, ptr noundef nonnull @task_func_build_JK, ptr noundef nonnull %87) #5
  br label %.critedge.us

.critedge.us:                                     ; preds = %50, %86, %46
  %103 = add nuw i64 %.0148158.us, 1
  %exitcond = icmp eq i64 %103, %indvars.iv
  br i1 %exitcond, label %104, label %46, !llvm.loop !36

104:                                              ; preds = %.critedge.us
  %indvars.iv.next = add i64 %indvars.iv, 1
  %exitcond164.not = icmp eq i64 %37, %5
  br i1 %exitcond164.not, label %._crit_edge.us, label %35, !llvm.loop !38

._crit_edge.us:                                   ; preds = %104
  %105 = add nuw i64 %.0146160.us, 1
  %exitcond167 = icmp eq i64 %105, %indvars.iv165
  br i1 %exitcond167, label %.split162.us, label %.lr.ph.us, !llvm.loop !39

.split162.us:                                     ; preds = %._crit_edge.us
  %indvars.iv.next166 = add i64 %indvars.iv165, 1
  %exitcond168.not = icmp eq i64 %23, %5
  br i1 %exitcond168.not, label %._crit_edge, label %.split.us, !llvm.loop !40
}

; Function Attrs: nounwind uwtable
declare hidden void @task_func_build_JK(ptr noundef) #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 608}
!6 = !{!"molecular_grid_desc", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !7, i64 48, !7, i64 56, !10, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !10, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !10, i64 560, !10, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!13, !10, i64 8}
!13 = !{!"scf_context", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !11, i64 192, !10, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !10, i64 232, !11, i64 240, !11, i64 248, !10, i64 256, !11, i64 264, !10, i64 272, !10, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !11, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !10, i64 440}
!14 = !{!13, !7, i64 176}
!15 = !{!6, !7, i64 208}
!16 = !{!6, !7, i64 216}
!17 = !{!13, !7, i64 288}
!18 = !{!13, !7, i64 408}
!19 = !{!13, !7, i64 304}
!20 = !{!11, !11, i64 0}
!21 = !{!13, !11, i64 240}
!22 = !{!23, !7, i64 0}
!23 = !{!"task_func_build_JK_arg", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!24 = !{!23, !7, i64 8}
!25 = !{!23, !7, i64 16}
!26 = !{!23, !7, i64 24}
!27 = !{!23, !10, i64 32}
!28 = !{!23, !10, i64 40}
!29 = !{!23, !10, i64 48}
!30 = !{!23, !10, i64 56}
!31 = !{!23, !10, i64 64}
!32 = !{!23, !10, i64 72}
!33 = !{!23, !10, i64 80}
!34 = !{!35, !10, i64 0}
!35 = !{!"threadpool_context", !10, i64 0, !7, i64 8, !8, i64 16}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = distinct !{!39, !37}
!40 = distinct !{!40, !37}


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