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

; 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.s_pdb = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, float, float, float, float, float, float, [83 x i8], [500 x i8], float, float, float, i32, i32 }

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @get_actual_pocket_DEPRECATED(ptr noundef %0, float noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.s_pdb, ptr %8, i32 0, i32 5
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.s_pdb, ptr %11, i32 0, i32 12
  %13 = load i32, ptr %12, align 4, !tbaa !14
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s_pdb, ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.s_pdb, ptr %17, i32 0, i32 10
  %19 = load i32, ptr %18, align 4, !tbaa !16
  %20 = load float, ptr %5, align 4, !tbaa !9
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call ptr @get_mol_atm_neigh(ptr noundef %10, i32 noundef %13, ptr noundef %16, i32 noundef %19, float noundef %20, ptr noundef %21)
  store ptr %22, ptr %7, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load i32, ptr %23, align 4, !tbaa !17
  %25 = icmp sle i32 %24, 0
  br i1 %25, label %26, label %88

26:                                               ; preds = %3
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %26
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  call void @my_free(ptr noundef %30)
  br label %31

31:                                               ; preds = %29, %26
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.s_pdb, ptr %32, i32 0, i32 5
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_pdb, ptr %35, i32 0, i32 12
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.s_pdb, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.s_pdb, ptr %41, i32 0, i32 10
  %43 = load i32, ptr %42, align 4, !tbaa !16
  %44 = load float, ptr %5, align 4, !tbaa !9
  %45 = fpext float %44 to double
  %46 = fadd double %45, 1.000000e+00
  %47 = fptrunc double %46 to float
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = call ptr @get_mol_atm_neigh(ptr noundef %34, i32 noundef %37, ptr noundef %40, i32 noundef %43, float noundef %47, ptr noundef %48)
  store ptr %49, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i32, ptr %50, align 4, !tbaa !17
  %52 = icmp sle i32 %51, 0
  br i1 %52, label %53, label %87

53:                                               ; preds = %31
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %58

56:                                               ; preds = %53
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  call void @my_free(ptr noundef %57)
  br label %58

58:                                               ; preds = %56, %53
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.s_pdb, ptr %59, i32 0, i32 5
  %61 = load ptr, ptr %60, align 8, !tbaa !11
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.s_pdb, ptr %62, i32 0, i32 12
  %64 = load i32, ptr %63, align 4, !tbaa !14
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.s_pdb, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !15
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.s_pdb, ptr %68, i32 0, i32 10
  %70 = load i32, ptr %69, align 4, !tbaa !16
  %71 = load float, ptr %5, align 4, !tbaa !9
  %72 = fpext float %71 to double
  %73 = fadd double %72, 2.000000e+00
  %74 = fptrunc double %73 to float
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = call ptr @get_mol_atm_neigh(ptr noundef %61, i32 noundef %64, ptr noundef %67, i32 noundef %70, float noundef %74, ptr noundef %75)
  store ptr %76, ptr %7, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = load i32, ptr %77, align 4, !tbaa !17
  %79 = icmp sle i32 %78, 0
  br i1 %79, label %80, label %86

80:                                               ; preds = %58
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %85

83:                                               ; preds = %80
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  call void @my_free(ptr noundef %84)
  br label %85

85:                                               ; preds = %83, %80
  store ptr null, ptr %7, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %85, %58
  br label %87

87:                                               ; preds = %86, %31
  br label %88

88:                                               ; preds = %87, %3
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret ptr %89
}

declare void @my_free(ptr noundef) #2

declare ptr @get_mol_atm_neigh(ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 40}
!12 = !{!"s_pdb", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !7, i64 116, !7, i64 199, !10, i64 700, !10, i64 704, !10, i64 708, !13, i64 712, !13, i64 716}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 84}
!15 = !{!12, !6, i64 24}
!16 = !{!12, !13, i64 76}
!17 = !{!13, !13, i64 0}


; 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: nounwind uwtable
define dso_local ptr @get_actual_pocket_DEPRECATED(ptr nocapture noundef readonly %0, float noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 84
  %7 = load i32, ptr %6, align 4, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %0, i64 76
  %11 = load i32, ptr %10, align 4, !tbaa !14
  %12 = tail call ptr @get_mol_atm_neigh(ptr noundef %5, i32 noundef %7, ptr noundef %9, i32 noundef %11, float noundef %1, ptr noundef %2) #2
  %13 = load i32, ptr %2, align 4, !tbaa !15
  %14 = icmp slt i32 %13, 1
  br i1 %14, label %15, label %39

15:                                               ; preds = %3
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %17, label %16

16:                                               ; preds = %15
  tail call void @my_free(ptr noundef nonnull %12) #2
  br label %17

17:                                               ; preds = %16, %15
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load i32, ptr %6, align 4, !tbaa !12
  %20 = load ptr, ptr %8, align 8, !tbaa !13
  %21 = load i32, ptr %10, align 4, !tbaa !14
  %22 = fadd float %1, 1.000000e+00
  %23 = tail call ptr @get_mol_atm_neigh(ptr noundef %18, i32 noundef %19, ptr noundef %20, i32 noundef %21, float noundef %22, ptr noundef nonnull %2) #2
  %24 = load i32, ptr %2, align 4, !tbaa !15
  %25 = icmp slt i32 %24, 1
  br i1 %25, label %26, label %39

26:                                               ; preds = %17
  %.not31 = icmp eq ptr %23, null
  br i1 %.not31, label %28, label %27

27:                                               ; preds = %26
  tail call void @my_free(ptr noundef nonnull %23) #2
  br label %28

28:                                               ; preds = %27, %26
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !12
  %31 = load ptr, ptr %8, align 8, !tbaa !13
  %32 = load i32, ptr %10, align 4, !tbaa !14
  %33 = fadd float %1, 2.000000e+00
  %34 = tail call ptr @get_mol_atm_neigh(ptr noundef %29, i32 noundef %30, ptr noundef %31, i32 noundef %32, float noundef %33, ptr noundef nonnull %2) #2
  %35 = load i32, ptr %2, align 4, !tbaa !15
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %37, label %39

37:                                               ; preds = %28
  %.not32 = icmp eq ptr %34, null
  br i1 %.not32, label %39, label %38

38:                                               ; preds = %37
  tail call void @my_free(ptr noundef nonnull %34) #2
  br label %39

39:                                               ; preds = %37, %38, %17, %28, %3
  %.0 = phi ptr [ %34, %28 ], [ %23, %17 ], [ %12, %3 ], [ null, %38 ], [ null, %37 ]
  ret ptr %.0
}

declare void @my_free(ptr noundef) local_unnamed_addr #1

declare ptr @get_mol_atm_neigh(ptr noundef, i32 noundef, ptr noundef, i32 noundef, float noundef, ptr noundef) local_unnamed_addr #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!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 40}
!6 = !{!"s_pdb", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !8, i64 116, !8, i64 199, !11, i64 700, !11, i64 704, !11, i64 708, !10, i64 712, !10, i64 716}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!6, !10, i64 84}
!13 = !{!6, !7, i64 24}
!14 = !{!6, !10, i64 76}
!15 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass