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

; 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.timespec = type { i64, i64 }
%struct.dft_context = type { ptr, ptr, double }
%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.cmd_line_args = type { i64, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, double, double, i64, i64 }
%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 }

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @dft_initialize(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.timespec, align 8
  %6 = alloca %struct.timespec, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [2 x i32], align 4
  %10 = alloca [2 x 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 16, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  call void @get_wall_time(ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %11 = call ptr @x_malloc(i64 noundef 24)
  store ptr %11, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %12 = call ptr @x_malloc(i64 noundef 616)
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = load ptr, ptr %8, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.dft_context, ptr %14, i32 0, i32 1
  store ptr %13, ptr %15, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.dft_context, ptr %17, i32 0, i32 0
  store ptr %16, ptr %18, align 8, !tbaa !12
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.scf_context, ptr %20, i32 0, i32 54
  store ptr %19, ptr %21, align 8, !tbaa !13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.cmd_line_args, ptr %22, i32 0, i32 10
  %24 = load i64, ptr %23, align 8, !tbaa !16
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.molecular_grid_desc, ptr %25, i32 0, i32 1
  store i64 %24, ptr %26, align 8, !tbaa !18
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.cmd_line_args, ptr %27, i32 0, i32 8
  %29 = load i64, ptr %28, align 8, !tbaa !20
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.molecular_grid_desc, ptr %30, i32 0, i32 4
  store i64 %29, ptr %31, align 8, !tbaa !21
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.cmd_line_args, ptr %32, i32 0, i32 9
  %34 = load i64, ptr %33, align 8, !tbaa !22
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.molecular_grid_desc, ptr %35, i32 0, i32 5
  store i64 %34, ptr %36, align 8, !tbaa !23
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.molecular_grid_desc, ptr %38, i32 0, i32 76
  store ptr %37, ptr %39, align 8, !tbaa !24
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  call void @build_molecular_grid(ptr noundef %40)
  br label %41

41:                                               ; preds = %2
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.scf_context, ptr %42, i32 0, i32 55
  %44 = load i64, ptr %43, align 8, !tbaa !25
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %51, label %46

46:                                               ; preds = %41
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.scf_context, ptr %47, i32 0, i32 1
  %49 = load i64, ptr %48, align 8, !tbaa !26
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %49)
  br label %51

51:                                               ; preds = %46, %41
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.scf_context, ptr %55, i32 0, i32 55
  %57 = load i64, ptr %56, align 8, !tbaa !25
  %58 = icmp ne i64 %57, 0
  br i1 %58, label %64, label %59

59:                                               ; preds = %54
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.molecular_grid_desc, ptr %60, i32 0, i32 8
  %62 = load i64, ptr %61, align 8, !tbaa !27
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %62)
  br label %64

64:                                               ; preds = %59, %54
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  call void @calc_bfvalues_derivatives(ptr noundef %67)
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  call void @calc_rho_sigma_lapl_tau(ptr noundef %68)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.cmd_line_args, ptr %69, i32 0, i32 6
  %71 = load i64, ptr %70, align 8, !tbaa !28
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %9, align 4, !tbaa !29
  %73 = getelementptr inbounds i32, ptr %9, i64 1
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.cmd_line_args, ptr %74, i32 0, i32 7
  %76 = load i64, ptr %75, align 8, !tbaa !31
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr %73, align 4, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.memset.p0.i64(ptr align 4 %10, i8 0, i64 8, i1 false)
  %78 = getelementptr inbounds [2 x i32], ptr %9, i64 0, i64 0
  %79 = getelementptr inbounds [2 x i32], ptr %10, i64 0, i64 0
  call void @libxc_initialize(ptr noundef %78, ptr noundef %79, i64 noundef 2)
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.cmd_line_args, ptr %80, i32 0, i32 6
  %82 = load i64, ptr %81, align 8, !tbaa !28
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.molecular_grid_desc, ptr %83, i32 0, i32 70
  store i64 %82, ptr %84, align 8, !tbaa !32
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.cmd_line_args, ptr %85, i32 0, i32 7
  %87 = load i64, ptr %86, align 8, !tbaa !31
  %88 = load ptr, ptr %8, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.molecular_grid_desc, ptr %88, i32 0, i32 71
  store i64 %87, ptr %89, align 8, !tbaa !33
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.cmd_line_args, ptr %90, i32 0, i32 6
  %92 = load i64, ptr %91, align 8, !tbaa !28
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.cmd_line_args, ptr %93, i32 0, i32 7
  %95 = load i64, ptr %94, align 8, !tbaa !31
  %96 = call i64 @get_xc_type(i64 noundef %92, i64 noundef %95)
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.molecular_grid_desc, ptr %97, i32 0, i32 35
  store i64 %96, ptr %98, align 8, !tbaa !34
  br label %99

99:                                               ; preds = %66
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.scf_context, ptr %100, i32 0, i32 55
  %102 = load i64, ptr %101, align 8, !tbaa !25
  %103 = icmp ne i64 %102, 0
  br i1 %103, label %115, label %104

104:                                              ; preds = %99
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.molecular_grid_desc, ptr %105, i32 0, i32 70
  %107 = load i64, ptr %106, align 8, !tbaa !32
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.molecular_grid_desc, ptr %108, i32 0, i32 71
  %110 = load i64, ptr %109, align 8, !tbaa !33
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.molecular_grid_desc, ptr %111, i32 0, i32 35
  %113 = load i64, ptr %112, align 8, !tbaa !34
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %107, i64 noundef %110, i64 noundef %113)
  br label %115

115:                                              ; preds = %104, %99
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  call void @get_wall_time(ptr noundef %6)
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.scf_context, ptr %119, i32 0, i32 55
  %121 = load i64, ptr %120, align 8, !tbaa !25
  %122 = icmp ne i64 %121, 0
  br i1 %122, label %126, label %123

123:                                              ; preds = %118
  %124 = call double @diff_time_ms(ptr noundef %5, ptr noundef %6)
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %124)
  br label %126

126:                                              ; preds = %123, %118
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  ret ptr %129
}

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

declare void @get_wall_time(ptr noundef) #2

declare ptr @x_malloc(i64 noundef) #2

declare void @build_molecular_grid(ptr noundef) #2

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

declare void @calc_bfvalues_derivatives(ptr noundef) #2

declare void @calc_rho_sigma_lapl_tau(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @libxc_initialize(ptr noundef, ptr noundef, i64 noundef) #2

declare i64 @get_xc_type(i64 noundef, i64 noundef) #2

declare double @diff_time_ms(ptr noundef, ptr noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"dft_context", !6, i64 0, !6, i64 8, !11, i64 16}
!11 = !{!"double", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !6, i64 432}
!14 = !{!"scf_context", !6, i64 0, !15, i64 8, !15, i64 16, !15, 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, !11, i64 192, !15, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !15, i64 232, !11, i64 240, !11, i64 248, !15, i64 256, !11, i64 264, !15, i64 272, !15, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !15, i64 312, !15, i64 320, !15, 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, !11, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !15, i64 440}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !15, i64 80}
!17 = !{!"cmd_line_args", !15, i64 0, !6, i64 8, !6, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !15, i64 120, !15, i64 128}
!18 = !{!19, !15, i64 8}
!19 = !{!"molecular_grid_desc", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !6, i64 48, !6, i64 56, !15, 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, !11, i64 224, !11, i64 232, !11, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !15, 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, !15, i64 560, !15, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608}
!20 = !{!17, !15, i64 64}
!21 = !{!19, !15, i64 32}
!22 = !{!17, !15, i64 72}
!23 = !{!19, !15, i64 40}
!24 = !{!19, !6, i64 608}
!25 = !{!14, !15, i64 440}
!26 = !{!14, !15, i64 8}
!27 = !{!19, !15, i64 64}
!28 = !{!17, !15, i64 48}
!29 = !{!30, !30, i64 0}
!30 = !{!"int", !7, i64 0}
!31 = !{!17, !15, i64 56}
!32 = !{!19, !15, i64 560}
!33 = !{!19, !15, i64 568}
!34 = !{!19, !15, i64 280}


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

%struct.timespec = type { i64, i64 }

@.str = external hidden unnamed_addr constant [32 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @dft_initialize(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.timespec, align 8
  %4 = alloca %struct.timespec, align 8
  %5 = alloca [2 x i32], align 8
  %6 = alloca [2 x i32], align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @get_wall_time(ptr noundef nonnull %3) #4
  %7 = call ptr @x_malloc(i64 noundef 24) #4
  %8 = call ptr @x_malloc(i64 noundef 616) #4
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %8, ptr %9, align 8, !tbaa !5
  store ptr %0, ptr %7, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %0, i64 432
  store ptr %7, ptr %10, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %1, i64 80
  %12 = load i64, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %8, i64 8
  store i64 %12, ptr %13, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %1, i64 64
  %15 = getelementptr inbounds i8, ptr %8, i64 32
  %16 = load <2 x i64>, ptr %14, align 8, !tbaa !19
  store <2 x i64> %16, ptr %15, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %8, i64 608
  store ptr %0, ptr %17, align 8, !tbaa !20
  call void @build_molecular_grid(ptr noundef %8) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 440
  %19 = load i64, ptr %18, align 8, !tbaa !21
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %20, label %.thread

20:                                               ; preds = %2
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = load i64, ptr %21, align 8, !tbaa !22
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %22)
  %.pr = load i64, ptr %18, align 8, !tbaa !21
  %.not36 = icmp eq i64 %.pr, 0
  br i1 %.not36, label %24, label %.thread

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %8, i64 64
  %26 = load i64, ptr %25, align 8, !tbaa !23
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %26)
  br label %.thread

.thread:                                          ; preds = %2, %24, %20
  call void @calc_bfvalues_derivatives(ptr noundef nonnull %8) #4
  call void @calc_rho_sigma_lapl_tau(ptr noundef nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %28 = getelementptr inbounds i8, ptr %1, i64 48
  %29 = getelementptr inbounds i8, ptr %1, i64 56
  %30 = load <2 x i64>, ptr %28, align 8, !tbaa !19
  %31 = trunc <2 x i64> %30 to <2 x i32>
  store <2 x i32> %31, ptr %5, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store i64 0, ptr %6, align 8
  call void @libxc_initialize(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef 2) #4
  %32 = load i64, ptr %28, align 8, !tbaa !26
  %33 = getelementptr inbounds i8, ptr %8, i64 560
  store i64 %32, ptr %33, align 8, !tbaa !27
  %34 = load i64, ptr %29, align 8, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %8, i64 568
  store i64 %34, ptr %35, align 8, !tbaa !29
  %36 = call i64 @get_xc_type(i64 noundef %32, i64 noundef %34) #4
  %37 = getelementptr inbounds i8, ptr %8, i64 280
  store i64 %36, ptr %37, align 8, !tbaa !30
  %38 = load i64, ptr %18, align 8, !tbaa !21
  %.not37 = icmp eq i64 %38, 0
  br i1 %.not37, label %39, label %43

39:                                               ; preds = %.thread
  %40 = load i64, ptr %33, align 8, !tbaa !27
  %41 = load i64, ptr %35, align 8, !tbaa !29
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %40, i64 noundef %41, i64 noundef %36)
  br label %43

43:                                               ; preds = %39, %.thread
  call void @get_wall_time(ptr noundef nonnull %4) #4
  %44 = load i64, ptr %18, align 8, !tbaa !21
  %.not38 = icmp eq i64 %44, 0
  br i1 %.not38, label %45, label %48

45:                                               ; preds = %43
  %46 = call double @diff_time_ms(ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %46)
  br label %48

48:                                               ; preds = %45, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret ptr %7
}

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

declare void @get_wall_time(ptr noundef) local_unnamed_addr #2

declare ptr @x_malloc(i64 noundef) local_unnamed_addr #2

declare void @build_molecular_grid(ptr noundef) local_unnamed_addr #2

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

declare void @calc_bfvalues_derivatives(ptr noundef) local_unnamed_addr #2

declare void @calc_rho_sigma_lapl_tau(ptr noundef) local_unnamed_addr #2

declare void @libxc_initialize(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i64 @get_xc_type(i64 noundef, i64 noundef) local_unnamed_addr #2

declare double @diff_time_ms(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"dft_context", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !7, i64 432}
!13 = !{!"scf_context", !7, i64 0, !14, i64 8, !14, i64 16, !14, 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, !10, i64 192, !14, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !14, i64 232, !10, i64 240, !10, i64 248, !14, i64 256, !10, i64 264, !14, i64 272, !14, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !14, i64 312, !14, i64 320, !14, 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, !10, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !14, i64 440}
!14 = !{!"long", !8, i64 0}
!15 = !{!16, !14, i64 80}
!16 = !{!"cmd_line_args", !14, i64 0, !7, i64 8, !7, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !14, i64 120, !14, i64 128}
!17 = !{!18, !14, i64 8}
!18 = !{!"molecular_grid_desc", !7, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !7, i64 48, !7, i64 56, !14, 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, !10, i64 224, !10, i64 232, !10, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !14, 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, !14, i64 560, !14, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608}
!19 = !{!14, !14, i64 0}
!20 = !{!18, !7, i64 608}
!21 = !{!13, !14, i64 440}
!22 = !{!13, !14, i64 8}
!23 = !{!18, !14, i64 64}
!24 = !{!25, !25, i64 0}
!25 = !{!"int", !8, i64 0}
!26 = !{!16, !14, i64 48}
!27 = !{!18, !14, i64 560}
!28 = !{!16, !14, i64 56}
!29 = !{!18, !14, i64 568}
!30 = !{!18, !14, i64 280}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass