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

; 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_vvertice = type { i32, i32, i32, i32, i32, float, float, float, float, i32, i32, [4 x i32], [4 x ptr], [3 x float], float }

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

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @get_unique_atoms_DEPRECATED(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %14 = call noalias ptr @malloc(i64 noundef 80) #5
  store ptr %14, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 10, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %67, %3
  %16 = load i32, ptr %12, align 4, !tbaa !9
  %17 = load i32, ptr %5, align 4, !tbaa !9
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %19, label %70

19:                                               ; preds = %15
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load i32, ptr %12, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds ptr, ptr %20, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.s_vvertice, ptr %24, i32 0, i32 12
  %26 = getelementptr inbounds [4 x ptr], ptr %25, i64 0, i64 0
  store ptr %26, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %63, %19
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 4
  br i1 %29, label %30, label %66

30:                                               ; preds = %27
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds ptr, ptr %31, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  store ptr %35, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = call i32 @atom_in_list(ptr noundef %36, ptr noundef %37, i32 noundef %38)
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %62

41:                                               ; preds = %30
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  store ptr %42, ptr %46, align 8, !tbaa !5
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %11, align 4, !tbaa !9
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = icmp sge i32 %49, %50
  br i1 %51, label %52, label %61

52:                                               ; preds = %41
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = add nsw i32 %54, 10
  %56 = sext i32 %55 to i64
  %57 = mul i64 8, %56
  %58 = call ptr @realloc(ptr noundef %53, i64 noundef %57) #6
  store ptr %58, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 10
  store i32 %60, ptr %10, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %52, %41
  br label %62

62:                                               ; preds = %61, %30
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %13, align 4, !tbaa !9
  br label %27, !llvm.loop !11

66:                                               ; preds = %27
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %12, align 4, !tbaa !9
  br label %15, !llvm.loop !13

70:                                               ; preds = %15
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %71, ptr %72, align 4, !tbaa !9
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret ptr %73
}

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 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind allocsize(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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { nounwind allocsize(1) }

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

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


; 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
declare dso_local i32 @atom_in_list(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @get_unique_atoms_DEPRECATED(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2) local_unnamed_addr #0 {
  %4 = tail call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #3
  %5 = icmp sgt i32 %1, 0
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %67 ]
  %.02439 = phi i32 [ 0, %.lr.ph.preheader ], [ %.2.3, %67 ]
  %.02538 = phi i32 [ 10, %.lr.ph.preheader ], [ %.227.3, %67 ]
  %.02837 = phi ptr [ %4, %.lr.ph.preheader ], [ %.230.3, %67 ]
  %6 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 64
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @atom_in_list(ptr noundef %9, ptr noundef %.02837, i32 noundef %.02439)
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %22

12:                                               ; preds = %.lr.ph
  %13 = sext i32 %.02439 to i64
  %14 = getelementptr inbounds ptr, ptr %.02837, i64 %13
  store ptr %9, ptr %14, align 8, !tbaa !5
  %15 = add nsw i32 %.02439, 1
  %.not = icmp slt i32 %15, %.02538
  br i1 %.not, label %22, label %16

16:                                               ; preds = %12
  %17 = add nsw i32 %.02439, 11
  %18 = sext i32 %17 to i64
  %19 = shl nsw i64 %18, 3
  %20 = tail call ptr @realloc(ptr noundef nonnull %.02837, i64 noundef %19) #4
  %21 = add nsw i32 %.02538, 10
  br label %22

22:                                               ; preds = %.lr.ph, %16, %12
  %.230 = phi ptr [ %20, %16 ], [ %.02837, %12 ], [ %.02837, %.lr.ph ]
  %.227 = phi i32 [ %21, %16 ], [ %.02538, %12 ], [ %.02538, %.lr.ph ]
  %.2 = phi i32 [ %15, %16 ], [ %15, %12 ], [ %.02439, %.lr.ph ]
  %23 = getelementptr inbounds i8, ptr %7, i64 72
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call i32 @atom_in_list(ptr noundef %24, ptr noundef %.230, i32 noundef %.2)
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %37

27:                                               ; preds = %22
  %28 = sext i32 %.2 to i64
  %29 = getelementptr inbounds ptr, ptr %.230, i64 %28
  store ptr %24, ptr %29, align 8, !tbaa !5
  %30 = add nsw i32 %.2, 1
  %.not.1 = icmp slt i32 %30, %.227
  br i1 %.not.1, label %37, label %31

31:                                               ; preds = %27
  %32 = add nsw i32 %.2, 11
  %33 = sext i32 %32 to i64
  %34 = shl nsw i64 %33, 3
  %35 = tail call ptr @realloc(ptr noundef nonnull %.230, i64 noundef %34) #4
  %36 = add nsw i32 %.227, 10
  br label %37

37:                                               ; preds = %31, %27, %22
  %.230.1 = phi ptr [ %35, %31 ], [ %.230, %27 ], [ %.230, %22 ]
  %.227.1 = phi i32 [ %36, %31 ], [ %.227, %27 ], [ %.227, %22 ]
  %.2.1 = phi i32 [ %30, %31 ], [ %30, %27 ], [ %.2, %22 ]
  %38 = getelementptr inbounds i8, ptr %7, i64 80
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = tail call i32 @atom_in_list(ptr noundef %39, ptr noundef %.230.1, i32 noundef %.2.1)
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %52

42:                                               ; preds = %37
  %43 = sext i32 %.2.1 to i64
  %44 = getelementptr inbounds ptr, ptr %.230.1, i64 %43
  store ptr %39, ptr %44, align 8, !tbaa !5
  %45 = add nsw i32 %.2.1, 1
  %.not.2 = icmp slt i32 %45, %.227.1
  br i1 %.not.2, label %52, label %46

46:                                               ; preds = %42
  %47 = add nsw i32 %.2.1, 11
  %48 = sext i32 %47 to i64
  %49 = shl nsw i64 %48, 3
  %50 = tail call ptr @realloc(ptr noundef nonnull %.230.1, i64 noundef %49) #4
  %51 = add nsw i32 %.227.1, 10
  br label %52

52:                                               ; preds = %46, %42, %37
  %.230.2 = phi ptr [ %50, %46 ], [ %.230.1, %42 ], [ %.230.1, %37 ]
  %.227.2 = phi i32 [ %51, %46 ], [ %.227.1, %42 ], [ %.227.1, %37 ]
  %.2.2 = phi i32 [ %45, %46 ], [ %45, %42 ], [ %.2.1, %37 ]
  %53 = getelementptr inbounds i8, ptr %7, i64 88
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = tail call i32 @atom_in_list(ptr noundef %54, ptr noundef %.230.2, i32 noundef %.2.2)
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %67

57:                                               ; preds = %52
  %58 = sext i32 %.2.2 to i64
  %59 = getelementptr inbounds ptr, ptr %.230.2, i64 %58
  store ptr %54, ptr %59, align 8, !tbaa !5
  %60 = add nsw i32 %.2.2, 1
  %.not.3 = icmp slt i32 %60, %.227.2
  br i1 %.not.3, label %67, label %61

61:                                               ; preds = %57
  %62 = add nsw i32 %.2.2, 11
  %63 = sext i32 %62 to i64
  %64 = shl nsw i64 %63, 3
  %65 = tail call ptr @realloc(ptr noundef nonnull %.230.2, i64 noundef %64) #4
  %66 = add nsw i32 %.227.2, 10
  br label %67

67:                                               ; preds = %61, %57, %52
  %.230.3 = phi ptr [ %65, %61 ], [ %.230.2, %57 ], [ %.230.2, %52 ]
  %.227.3 = phi i32 [ %66, %61 ], [ %.227.2, %57 ], [ %.227.2, %52 ]
  %.2.3 = phi i32 [ %60, %61 ], [ %60, %57 ], [ %.2.2, %52 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %67, %3
  %.028.lcssa = phi ptr [ %4, %3 ], [ %.230.3, %67 ]
  %.024.lcssa = phi i32 [ 0, %3 ], [ %.2.3, %67 ]
  store i32 %.024.lcssa, ptr %2, align 4, !tbaa !11
  ret ptr %.028.lcssa
}

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

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


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