; LLVM IR from osmart/hole2 :: src/retired_routines (surface)

; 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.base_line = type { i32, i32, i32, i32, i32, i32, ptr, ptr }

@max_dots = external dso_local global i32, align 4

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

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

; 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 i32 @calc_tri(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %7 = load i32, ptr @max_dots, align 4, !tbaa !9
  %8 = add nsw i32 %7, 1
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.base_line, ptr %9, i32 0, i32 2
  store i32 %8, ptr %10, align 8, !tbaa !11
  %11 = call double @cos(double noundef 1.020000e+02) #4
  store double %11, ptr %4, align 8, !tbaa !13
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load double, ptr %4, align 8, !tbaa !13
  %14 = call i32 @neighbour(ptr noundef %12, double noundef %13, ptr noundef %5)
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.base_line, ptr %15, i32 0, i32 2
  store i32 %14, ptr %16, align 8, !tbaa !11
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.base_line, ptr %17, i32 0, i32 2
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %20 = load i32, ptr @max_dots, align 4, !tbaa !9
  %21 = add nsw i32 %20, 1
  %22 = icmp eq i32 %19, %21
  br i1 %22, label %23, label %24

23:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %175

24:                                               ; preds = %1
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call i32 @gen_triangle(ptr noundef %25)
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.base_line, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.base_line, ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.base_line, ptr %33, i32 0, i32 4
  call void @destroy(i32 noundef %29, i32 noundef %32, ptr noundef %34)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.base_line, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.base_line, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.base_line, ptr %41, i32 0, i32 5
  call void @destroy(i32 noundef %37, i32 noundef %40, ptr noundef %42)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.base_line, ptr %43, i32 0, i32 5
  %45 = load i32, ptr %44, align 4, !tbaa !17
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %57

47:                                               ; preds = %24
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.base_line, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.base_line, ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.base_line, ptr %54, i32 0, i32 5
  %56 = call i32 @add_edge(i32 noundef %50, i32 noundef %53, ptr noundef %55, i32 noundef 2)
  br label %57

57:                                               ; preds = %47, %24
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.base_line, ptr %58, i32 0, i32 4
  %60 = load i32, ptr %59, align 8, !tbaa !18
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %120

62:                                               ; preds = %57
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.base_line, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !15
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.base_line, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !11
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.base_line, ptr %69, i32 0, i32 4
  %71 = call i32 @add_edge(i32 noundef %65, i32 noundef %68, ptr noundef %70, i32 noundef 1)
  %72 = call noalias ptr @malloc(i64 noundef 40) #5
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.base_line, ptr %73, i32 0, i32 6
  store ptr %72, ptr %74, align 8, !tbaa !19
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.base_line, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !15
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.base_line, ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !19
  %81 = getelementptr inbounds %struct.base_line, ptr %80, i32 0, i32 0
  store i32 %77, ptr %81, align 8, !tbaa !15
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.base_line, ptr %82, i32 0, i32 2
  %84 = load i32, ptr %83, align 8, !tbaa !11
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.base_line, ptr %85, i32 0, i32 6
  %87 = load ptr, ptr %86, align 8, !tbaa !19
  %88 = getelementptr inbounds %struct.base_line, ptr %87, i32 0, i32 1
  store i32 %84, ptr %88, align 4, !tbaa !16
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.base_line, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !16
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.base_line, ptr %92, i32 0, i32 6
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = getelementptr inbounds %struct.base_line, ptr %94, i32 0, i32 3
  store i32 %91, ptr %95, align 4, !tbaa !20
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.base_line, ptr %96, i32 0, i32 6
  %98 = load ptr, ptr %97, align 8, !tbaa !19
  %99 = getelementptr inbounds %struct.base_line, ptr %98, i32 0, i32 2
  store i32 0, ptr %99, align 8, !tbaa !11
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.base_line, ptr %100, i32 0, i32 6
  %102 = load ptr, ptr %101, align 8, !tbaa !19
  %103 = getelementptr inbounds %struct.base_line, ptr %102, i32 0, i32 4
  store i32 1, ptr %103, align 8, !tbaa !18
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.base_line, ptr %104, i32 0, i32 6
  %106 = load ptr, ptr %105, align 8, !tbaa !19
  %107 = getelementptr inbounds %struct.base_line, ptr %106, i32 0, i32 5
  store i32 1, ptr %107, align 4, !tbaa !17
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.base_line, ptr %108, i32 0, i32 6
  %110 = load ptr, ptr %109, align 8, !tbaa !19
  %111 = getelementptr inbounds %struct.base_line, ptr %110, i32 0, i32 7
  store ptr null, ptr %111, align 8, !tbaa !21
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.base_line, ptr %112, i32 0, i32 6
  %114 = load ptr, ptr %113, align 8, !tbaa !19
  %115 = getelementptr inbounds %struct.base_line, ptr %114, i32 0, i32 6
  store ptr null, ptr %115, align 8, !tbaa !19
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.base_line, ptr %116, i32 0, i32 6
  %118 = load ptr, ptr %117, align 8, !tbaa !19
  %119 = call i32 @calc_tri(ptr noundef %118)
  br label %120

120:                                              ; preds = %62, %57
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.base_line, ptr %121, i32 0, i32 5
  %123 = load i32, ptr %122, align 4, !tbaa !17
  %124 = icmp eq i32 %123, 1
  br i1 %124, label %125, label %174

125:                                              ; preds = %120
  %126 = call noalias ptr @malloc(i64 noundef 40) #5
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.base_line, ptr %127, i32 0, i32 7
  store ptr %126, ptr %128, align 8, !tbaa !21
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.base_line, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !11
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.base_line, ptr %132, i32 0, i32 7
  %134 = load ptr, ptr %133, align 8, !tbaa !21
  %135 = getelementptr inbounds %struct.base_line, ptr %134, i32 0, i32 0
  store i32 %131, ptr %135, align 8, !tbaa !15
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.base_line, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !16
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.base_line, ptr %139, i32 0, i32 7
  %141 = load ptr, ptr %140, align 8, !tbaa !21
  %142 = getelementptr inbounds %struct.base_line, ptr %141, i32 0, i32 1
  store i32 %138, ptr %142, align 4, !tbaa !16
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.base_line, ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !15
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.base_line, ptr %146, i32 0, i32 7
  %148 = load ptr, ptr %147, align 8, !tbaa !21
  %149 = getelementptr inbounds %struct.base_line, ptr %148, i32 0, i32 3
  store i32 %145, ptr %149, align 4, !tbaa !20
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.base_line, ptr %150, i32 0, i32 7
  %152 = load ptr, ptr %151, align 8, !tbaa !21
  %153 = getelementptr inbounds %struct.base_line, ptr %152, i32 0, i32 2
  store i32 0, ptr %153, align 8, !tbaa !11
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.base_line, ptr %154, i32 0, i32 7
  %156 = load ptr, ptr %155, align 8, !tbaa !21
  %157 = getelementptr inbounds %struct.base_line, ptr %156, i32 0, i32 4
  store i32 1, ptr %157, align 8, !tbaa !18
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.base_line, ptr %158, i32 0, i32 7
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  %161 = getelementptr inbounds %struct.base_line, ptr %160, i32 0, i32 5
  store i32 1, ptr %161, align 4, !tbaa !17
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.base_line, ptr %162, i32 0, i32 7
  %164 = load ptr, ptr %163, align 8, !tbaa !21
  %165 = getelementptr inbounds %struct.base_line, ptr %164, i32 0, i32 6
  store ptr null, ptr %165, align 8, !tbaa !19
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.base_line, ptr %166, i32 0, i32 7
  %168 = load ptr, ptr %167, align 8, !tbaa !21
  %169 = getelementptr inbounds %struct.base_line, ptr %168, i32 0, i32 7
  store ptr null, ptr %169, align 8, !tbaa !21
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.base_line, ptr %170, i32 0, i32 7
  %172 = load ptr, ptr %171, align 8, !tbaa !21
  %173 = call i32 @calc_tri(ptr noundef %172)
  br label %174

174:                                              ; preds = %125, %120
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %175

175:                                              ; preds = %174, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %176 = load i32, ptr %2, align 4
  ret i32 %176
}

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @neighbour(ptr noundef, double noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @gen_triangle(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @destroy(i32 noundef, i32 noundef, ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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 = !{!12, !10, i64 8}
!12 = !{!"base_line", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!12, !10, i64 0}
!16 = !{!12, !10, i64 4}
!17 = !{!12, !10, i64 20}
!18 = !{!12, !10, i64 16}
!19 = !{!12, !6, i64 24}
!20 = !{!12, !10, i64 12}
!21 = !{!12, !6, i64 32}


; 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"

@max_dots = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 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 noundef i32 @calc_tri(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %3 = load i32, ptr @max_dots, align 4, !tbaa !5
  %4 = add nsw i32 %3, 1
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %4, ptr %5, align 8, !tbaa !9
  %6 = call i32 @neighbour(ptr noundef %0, double noundef 0x3FBA01854B1E3E18, ptr noundef nonnull %2)
  store i32 %6, ptr %5, align 8, !tbaa !9
  %7 = load i32, ptr @max_dots, align 4, !tbaa !5
  %8 = add nsw i32 %7, 1
  %9 = icmp eq i32 %6, %8
  br i1 %9, label %59, label %10

10:                                               ; preds = %1
  %11 = call i32 @gen_triangle(ptr noundef nonnull %0)
  %12 = load i32, ptr %0, align 8, !tbaa !12
  %13 = load i32, ptr %5, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  call void @destroy(i32 noundef %12, i32 noundef %13, ptr noundef nonnull %14)
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !13
  %17 = load i32, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %0, i64 20
  call void @destroy(i32 noundef %16, i32 noundef %17, ptr noundef nonnull %18)
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %25

21:                                               ; preds = %10
  %22 = load i32, ptr %15, align 4, !tbaa !13
  %23 = load i32, ptr %5, align 8, !tbaa !9
  %24 = call i32 @add_edge(i32 noundef %22, i32 noundef %23, ptr noundef nonnull %18, i32 noundef 2)
  br label %25

25:                                               ; preds = %21, %10
  %26 = load i32, ptr %14, align 8, !tbaa !15
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %44

28:                                               ; preds = %25
  %29 = load i32, ptr %0, align 8, !tbaa !12
  %30 = load i32, ptr %5, align 8, !tbaa !9
  %31 = call i32 @add_edge(i32 noundef %29, i32 noundef %30, ptr noundef nonnull %14, i32 noundef 1)
  %32 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #5
  %33 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %32, ptr %33, align 8, !tbaa !16
  %34 = load i32, ptr %0, align 8, !tbaa !12
  store i32 %34, ptr %32, align 8, !tbaa !12
  %35 = load i32, ptr %5, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %32, i64 4
  store i32 %35, ptr %36, align 4, !tbaa !13
  %37 = load i32, ptr %15, align 4, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %32, i64 12
  store i32 %37, ptr %38, align 4, !tbaa !17
  %39 = getelementptr inbounds i8, ptr %32, i64 8
  store i32 0, ptr %39, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %32, i64 16
  store i32 1, ptr %40, align 8, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %32, i64 20
  store i32 1, ptr %41, align 4, !tbaa !14
  %42 = getelementptr inbounds i8, ptr %32, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %42, i8 0, i64 16, i1 false)
  %43 = call i32 @calc_tri(ptr noundef nonnull %32)
  br label %44

44:                                               ; preds = %28, %25
  %45 = load i32, ptr %18, align 4, !tbaa !14
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %59

47:                                               ; preds = %44
  %48 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #5
  %49 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %48, ptr %49, align 8, !tbaa !18
  %50 = load <2 x i32>, ptr %15, align 4, !tbaa !5
  %51 = shufflevector <2 x i32> %50, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %51, ptr %48, align 8, !tbaa !5
  %52 = load i32, ptr %0, align 8, !tbaa !12
  %53 = getelementptr inbounds i8, ptr %48, i64 12
  store i32 %52, ptr %53, align 4, !tbaa !17
  %54 = getelementptr inbounds i8, ptr %48, i64 8
  store i32 0, ptr %54, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %48, i64 16
  store i32 1, ptr %55, align 8, !tbaa !15
  %56 = getelementptr inbounds i8, ptr %48, i64 20
  store i32 1, ptr %56, align 4, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %48, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %57, i8 0, i64 16, i1 false)
  %58 = call i32 @calc_tri(ptr noundef nonnull %48)
  br label %59

59:                                               ; preds = %44, %47, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @neighbour(ptr noundef, double noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @gen_triangle(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @destroy(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @add_edge(i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"base_line", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !11, i64 24, !11, i64 32}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 4}
!14 = !{!10, !6, i64 20}
!15 = !{!10, !6, i64 16}
!16 = !{!10, !11, i64 24}
!17 = !{!10, !6, i64 12}
!18 = !{!10, !11, i64 32}


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