; LLVM IR from Discngine/fpocket :: src (energy)

; 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.c_lst_pockets = type { ptr, ptr, ptr, i64, ptr }
%struct.s_fparams = type { [2000 x i8], [2000 x i8], [2000 x i8], [8000 x i8], ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, i8, i8, i32, i32, i16, i32, i32, i32, i16, i32, i32, i32, i16, float, float, float, float, float, [20 x ptr], i16, i16, [20 x ptr], i32, [10 x i8] }
%struct.node_pocket = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@stdout = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @calculate_pocket_energy_grids(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca [350 x i8], align 16
  %10 = alloca [350 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [350 x i8], align 16
  %14 = alloca [350 x i8], align 16
  %15 = alloca [350 x i8], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.c_lst_pockets, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 350, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 350, ptr %13) #6
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr %14) #6
  call void @llvm.memset.p0.i64(ptr align 16 %14, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %24 = getelementptr inbounds [350 x i8], ptr %13, i64 0, i64 0
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.s_fparams, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds [2000 x i8], ptr %26, i64 0, i64 0
  %28 = call ptr @strcpy(ptr noundef %24, ptr noundef %27) #6
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.s_fparams, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds [2000 x i8], ptr %30, i64 0, i64 0
  %32 = getelementptr inbounds [350 x i8], ptr %14, i64 0, i64 0
  call void @extract_path(ptr noundef %31, ptr noundef %32)
  %33 = getelementptr inbounds [350 x i8], ptr %13, i64 0, i64 0
  call void @remove_ext(ptr noundef %33)
  %34 = getelementptr inbounds [350 x i8], ptr %13, i64 0, i64 0
  call void @remove_path(ptr noundef %34)
  %35 = getelementptr inbounds [350 x i8], ptr %14, i64 0, i64 0
  %36 = call i64 @strlen(ptr noundef %35) #7
  %37 = icmp ugt i64 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %3
  %39 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %40 = getelementptr inbounds [350 x i8], ptr %14, i64 0, i64 0
  %41 = getelementptr inbounds [350 x i8], ptr %13, i64 0, i64 0
  %42 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %39, ptr noundef @.str, ptr noundef %40, ptr noundef %41) #6
  br label %47

43:                                               ; preds = %3
  %44 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %45 = getelementptr inbounds [350 x i8], ptr %13, i64 0, i64 0
  %46 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %44, ptr noundef @.str.1, ptr noundef %45) #6
  br label %47

47:                                               ; preds = %43, %38
  %48 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %49 = call i32 @mkdir(ptr noundef %48, i32 noundef 493) #6
  store i32 %49, ptr %16, align 4, !tbaa !12
  %50 = getelementptr inbounds [350 x i8], ptr %10, i64 0, i64 0
  %51 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %52 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %50, ptr noundef @.str.2, ptr noundef %51) #6
  %53 = getelementptr inbounds [350 x i8], ptr %10, i64 0, i64 0
  %54 = call i32 @mkdir(ptr noundef %53, i32 noundef 493) #6
  store i32 %54, ptr %16, align 4, !tbaa !12
  %55 = load i32, ptr %16, align 4, !tbaa !12
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %47
  store i32 1, ptr %17, align 4
  br label %103

58:                                               ; preds = %47
  br label %59

59:                                               ; preds = %62, %58
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %102

62:                                               ; preds = %59
  %63 = load ptr, ptr @stdout, align 8, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !12
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.3, i32 noundef %64) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.node_pocket, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  store ptr %68, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  %70 = call ptr @init_pocket_grid(ptr noundef %69)
  store ptr %70, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %71 = load ptr, ptr %18, align 8, !tbaa !5
  %72 = call ptr @init_pocket_grid(ptr noundef %71)
  store ptr %72, ptr %20, align 8, !tbaa !5
  %73 = load ptr, ptr %20, align 8, !tbaa !5
  %74 = load ptr, ptr %19, align 8, !tbaa !5
  %75 = load ptr, ptr %18, align 8, !tbaa !5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  call void @assign_energies(ptr noundef %73, ptr noundef %74, ptr noundef %75, ptr noundef %76)
  %77 = getelementptr inbounds [350 x i8], ptr %15, i64 0, i64 0
  %78 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %79 = load i32, ptr %8, align 4, !tbaa !12
  %80 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %77, ptr noundef @.str.4, ptr noundef %78, i32 noundef %79) #6
  %81 = getelementptr inbounds [350 x i8], ptr %15, i64 0, i64 0
  %82 = call noalias ptr @fopen(ptr noundef %81, ptr noundef @.str.5)
  store ptr %82, ptr %11, align 8, !tbaa !5
  %83 = load ptr, ptr %19, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  call void @write_grid(ptr noundef %83, ptr noundef %84)
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = call i32 @fclose(ptr noundef %85)
  %87 = getelementptr inbounds [350 x i8], ptr %15, i64 0, i64 0
  %88 = getelementptr inbounds [350 x i8], ptr %9, i64 0, i64 0
  %89 = load i32, ptr %8, align 4, !tbaa !12
  %90 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %87, ptr noundef @.str.6, ptr noundef %88, i32 noundef %89) #6
  %91 = getelementptr inbounds [350 x i8], ptr %15, i64 0, i64 0
  %92 = call noalias ptr @fopen(ptr noundef %91, ptr noundef @.str.5)
  store ptr %92, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %20, align 8, !tbaa !5
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  call void @write_grid(ptr noundef %93, ptr noundef %94)
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = call i32 @fclose(ptr noundef %95)
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.node_pocket, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  store ptr %99, ptr %7, align 8, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !12
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %59, !llvm.loop !17

102:                                              ; preds = %59
  store i32 0, ptr %17, align 4
  br label %103

103:                                              ; preds = %102, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %104 = load i32, ptr %17, align 4
  switch i32 %104, label %106 [
    i32 0, label %105
    i32 1, label %105
  ]

105:                                              ; preds = %103, %103
  ret void

106:                                              ; preds = %103
  unreachable
}

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

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

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

declare void @extract_path(ptr noundef, ptr noundef) #4

declare void @remove_ext(ptr noundef) #4

declare void @remove_path(ptr noundef) #4

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @init_pocket_grid(ptr noundef) #0

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

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

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

declare i32 @fclose(ptr noundef) #4

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

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

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


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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @calculate_pocket_energy_grids(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [350 x i8], align 16
  %5 = alloca [350 x i8], align 16
  %6 = alloca [350 x i8], align 16
  %7 = alloca [350 x i8], align 16
  %8 = alloca [350 x i8], align 16
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 350, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(350) %4, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(350) %5, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(350) %6, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(350) %7, i8 0, i64 350, i1 false)
  call void @llvm.lifetime.start.p0(i64 350, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(350) %8, i8 0, i64 350, i1 false)
  %10 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) %1) #6
  call void @extract_path(ptr noundef %1, ptr noundef nonnull %7) #6
  call void @remove_ext(ptr noundef nonnull %6) #6
  call void @remove_path(ptr noundef nonnull %6) #6
  %char0 = load i8, ptr %7, align 16
  %.not = icmp eq i8 %char0, 0
  br i1 %.not, label %13, label %11

11:                                               ; preds = %3
  %12 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %7, ptr noundef nonnull %6) #6
  br label %15

13:                                               ; preds = %3
  %14 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %6) #6
  br label %15

15:                                               ; preds = %13, %11
  %16 = call i32 @mkdir(ptr noundef nonnull %4, i32 noundef 493) #6
  %17 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %4) #6
  %18 = call i32 @mkdir(ptr noundef nonnull %5, i32 noundef 493) #6
  %.not23 = icmp ne i32 %18, 0
  %.not2425 = icmp eq ptr %9, null
  %or.cond = select i1 %.not23, i1 true, i1 %.not2425
  br i1 %or.cond, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %15, %.lr.ph
  %.027 = phi ptr [ %31, %.lr.ph ], [ %9, %15 ]
  %.02226 = phi i32 [ %32, %.lr.ph ], [ 1, %15 ]
  %19 = load ptr, ptr @stdout, align 8, !tbaa !11
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.3, i32 noundef %.02226) #6
  %21 = getelementptr inbounds i8, ptr %.027, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = call ptr @init_pocket_grid(ptr noundef %22)
  %24 = call ptr @init_pocket_grid(ptr noundef %22)
  call void @assign_energies(ptr noundef %24, ptr noundef %23, ptr noundef %22, ptr noundef %2)
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %4, i32 noundef %.02226) #6
  %26 = call noalias ptr @fopen(ptr noundef nonnull %8, ptr noundef nonnull @.str.5)
  call void @write_grid(ptr noundef %23, ptr noundef %26)
  %27 = call i32 @fclose(ptr noundef %26)
  %28 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef nonnull %4, i32 noundef %.02226) #6
  %29 = call noalias ptr @fopen(ptr noundef nonnull %8, ptr noundef nonnull @.str.5)
  call void @write_grid(ptr noundef %24, ptr noundef %29)
  %30 = call i32 @fclose(ptr noundef %29)
  %31 = load ptr, ptr %.027, align 8, !tbaa !14
  %32 = add nuw nsw i32 %.02226, 1
  %.not24 = icmp eq ptr %31, null
  br i1 %.not24, label %.loopexit, label %.lr.ph, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph, %15
  call void @llvm.lifetime.end.p0(i64 350, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 350, ptr nonnull %4) #6
  ret void
}

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

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

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

declare void @extract_path(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @remove_ext(ptr noundef) local_unnamed_addr #4

declare void @remove_path(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @mkdir(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #5

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

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

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

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

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

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

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #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, !7, i64 0}
!6 = !{!"c_lst_pockets", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 16}
!13 = !{!"node_pocket", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = !{!13, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass