; LLVM IR from reyadussalahin/problem-solving :: computational_geometry/convex_hull/loj/F1285 (Solution)

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @compare_point(ptr noundef, ptr 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 uwtable
define dso_local void @solve(i32 noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Point, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %62, %3
  %14 = load i32, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %17, label %65

17:                                               ; preds = %13
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds %struct.Point, ptr %18, i64 %20
  %22 = getelementptr inbounds %struct.Point, ptr %21, i32 0, i32 0
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %struct.Point, ptr %24, i64 %26
  %28 = getelementptr inbounds %struct.Point, ptr %27, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %30 = icmp slt i64 %23, %29
  br i1 %30, label %59, label %31

31:                                               ; preds = %17
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %struct.Point, ptr %32, i64 %34
  %36 = getelementptr inbounds %struct.Point, ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.Point, ptr %38, i64 %40
  %42 = getelementptr inbounds %struct.Point, ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = icmp eq i64 %37, %43
  br i1 %44, label %45, label %61

45:                                               ; preds = %31
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %struct.Point, ptr %46, i64 %48
  %50 = getelementptr inbounds %struct.Point, ptr %49, i32 0, i32 1
  %51 = load i64, ptr %50, align 8, !tbaa !14
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct.Point, ptr %52, i64 %54
  %56 = getelementptr inbounds %struct.Point, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !14
  %58 = icmp slt i64 %51, %57
  br i1 %58, label %59, label %61

59:                                               ; preds = %45, %17
  %60 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %60, ptr %9, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %59, %45, %31
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %7, align 4, !tbaa !5
  br label %13, !llvm.loop !15

65:                                               ; preds = %13
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %81

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %69 = load ptr, ptr %5, align 8, !tbaa !9
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.Point, ptr %69, i64 %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %72, i64 24, i1 false), !tbaa.struct !17
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.Point, ptr %73, i64 %75
  %77 = load ptr, ptr %5, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.Point, ptr %77, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %76, ptr align 8 %78, i64 24, i1 false), !tbaa.struct !17
  %79 = load ptr, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.Point, ptr %79, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %80, ptr align 8 %10, i64 24, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  br label %81

81:                                               ; preds = %68, %65
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %119, %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %122

86:                                               ; preds = %82
  %87 = load ptr, ptr %5, align 8, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct.Point, ptr %87, i64 %89
  %91 = getelementptr inbounds %struct.Point, ptr %90, i32 0, i32 0
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = load ptr, ptr %5, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.Point, ptr %93, i64 0
  %95 = getelementptr inbounds %struct.Point, ptr %94, i32 0, i32 0
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = sub nsw i64 %92, %96
  %98 = load ptr, ptr %5, align 8, !tbaa !9
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %struct.Point, ptr %98, i64 %100
  %102 = getelementptr inbounds %struct.Point, ptr %101, i32 0, i32 0
  store i64 %97, ptr %102, align 8, !tbaa !11
  %103 = load ptr, ptr %5, align 8, !tbaa !9
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.Point, ptr %103, i64 %105
  %107 = getelementptr inbounds %struct.Point, ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !14
  %109 = load ptr, ptr %5, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.Point, ptr %109, i64 0
  %111 = getelementptr inbounds %struct.Point, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !14
  %113 = sub nsw i64 %108, %112
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %struct.Point, ptr %114, i64 %116
  %118 = getelementptr inbounds %struct.Point, ptr %117, i32 0, i32 1
  store i64 %113, ptr %118, align 8, !tbaa !14
  br label %119

119:                                              ; preds = %86
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !19

122:                                              ; preds = %82
  %123 = load ptr, ptr %5, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.Point, ptr %123, i64 1
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  call void @qsort(ptr noundef %124, i64 noundef %127, i64 noundef 24, ptr noundef @compare_point)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 2
  store i32 %129, ptr %7, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %166, %122
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %133, label %169

133:                                              ; preds = %130
  %134 = load ptr, ptr %5, align 8, !tbaa !9
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds %struct.Point, ptr %134, i64 %137
  %139 = getelementptr inbounds %struct.Point, ptr %138, i32 0, i32 0
  %140 = load i64, ptr %139, align 8, !tbaa !11
  %141 = load ptr, ptr %5, align 8, !tbaa !9
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.Point, ptr %141, i64 %143
  %145 = getelementptr inbounds %struct.Point, ptr %144, i32 0, i32 1
  %146 = load i64, ptr %145, align 8, !tbaa !14
  %147 = mul nsw i64 %140, %146
  %148 = load ptr, ptr %5, align 8, !tbaa !9
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds %struct.Point, ptr %148, i64 %150
  %152 = getelementptr inbounds %struct.Point, ptr %151, i32 0, i32 0
  %153 = load i64, ptr %152, align 8, !tbaa !11
  %154 = load ptr, ptr %5, align 8, !tbaa !9
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = sub nsw i32 %155, 1
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %struct.Point, ptr %154, i64 %157
  %159 = getelementptr inbounds %struct.Point, ptr %158, i32 0, i32 1
  %160 = load i64, ptr %159, align 8, !tbaa !14
  %161 = mul nsw i64 %153, %160
  %162 = icmp ne i64 %147, %161
  br i1 %162, label %163, label %165

163:                                              ; preds = %133
  %164 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %164, ptr %11, align 4, !tbaa !5
  br label %169

165:                                              ; preds = %133
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %7, align 4, !tbaa !5
  %168 = add nsw i32 %167, -1
  store i32 %168, ptr %7, align 4, !tbaa !5
  br label %130, !llvm.loop !20

169:                                              ; preds = %163, %130
  %170 = load i32, ptr %11, align 4, !tbaa !5
  %171 = icmp eq i32 %170, 0
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load i32, ptr %4, align 4, !tbaa !5
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %173)
  store i32 1, ptr %12, align 4
  br label %218

175:                                              ; preds = %169
  %176 = load i32, ptr %4, align 4, !tbaa !5
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %176)
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %195, %175
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %182, label %198

182:                                              ; preds = %178
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %187

185:                                              ; preds = %182
  %186 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %187

187:                                              ; preds = %185, %182
  %188 = load ptr, ptr %5, align 8, !tbaa !9
  %189 = load i32, ptr %7, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds %struct.Point, ptr %188, i64 %190
  %192 = getelementptr inbounds %struct.Point, ptr %191, i32 0, i32 2
  %193 = load i32, ptr %192, align 8, !tbaa !21
  %194 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %193)
  br label %195

195:                                              ; preds = %187
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %7, align 4, !tbaa !5
  br label %178, !llvm.loop !22

198:                                              ; preds = %178
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  store i32 %200, ptr %7, align 4, !tbaa !5
  br label %201

201:                                              ; preds = %213, %198
  %202 = load i32, ptr %7, align 4, !tbaa !5
  %203 = load i32, ptr %11, align 4, !tbaa !5
  %204 = icmp sgt i32 %202, %203
  br i1 %204, label %205, label %216

205:                                              ; preds = %201
  %206 = load ptr, ptr %5, align 8, !tbaa !9
  %207 = load i32, ptr %7, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds %struct.Point, ptr %206, i64 %208
  %210 = getelementptr inbounds %struct.Point, ptr %209, i32 0, i32 2
  %211 = load i32, ptr %210, align 8, !tbaa !21
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %211)
  br label %213

213:                                              ; preds = %205
  %214 = load i32, ptr %7, align 4, !tbaa !5
  %215 = add nsw i32 %214, -1
  store i32 %215, ptr %7, align 4, !tbaa !5
  br label %201, !llvm.loop !23

216:                                              ; preds = %201
  %217 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %12, align 4
  br label %218

218:                                              ; preds = %216, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %219 = load i32, ptr %12, align 4
  switch i32 %219, label %221 [
    i32 0, label %220
    i32 1, label %220
  ]

220:                                              ; preds = %218, %218
  ret void

221:                                              ; preds = %218
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

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

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: readwrite) }
attributes #3 = { "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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !6, i64 16}
!13 = !{!"long long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !18, i64 16, i64 4, !5}
!18 = !{!13, !13, i64 0}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = !{!12, !6, i64 16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}


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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @solve(i32 noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.Point, align 8
  %5 = icmp sgt i32 %2, 1
  br i1 %5, label %.lr.ph.preheader, label %._crit_edge80

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %22
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %22 ]
  %.06476 = phi i32 [ 0, %.lr.ph.preheader ], [ %.1, %22 ]
  %6 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = sext i32 %.06476 to i64
  %9 = getelementptr inbounds %struct.Point, ptr %1, i64 %8
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = icmp slt i64 %7, %10
  br i1 %11, label %20, label %12

12:                                               ; preds = %.lr.ph
  %13 = icmp eq i64 %7, %10
  br i1 %13, label %14, label %22

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %9, i64 8
  %18 = load i64, ptr %17, align 8, !tbaa !11
  %19 = icmp slt i64 %16, %18
  br i1 %19, label %20, label %22

20:                                               ; preds = %14, %.lr.ph
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  br label %22

22:                                               ; preds = %12, %14, %20
  %.1 = phi i32 [ %21, %20 ], [ %.06476, %14 ], [ %.06476, %12 ]
  %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 !12

._crit_edge:                                      ; preds = %22
  %.not = icmp eq i32 %.1, 0
  br i1 %.not, label %26, label %23

23:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4)
  %24 = sext i32 %.1 to i64
  %25 = getelementptr inbounds %struct.Point, ptr %1, i64 %24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %25, i64 24, i1 false), !tbaa.struct !14
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 24, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4)
  br label %26

26:                                               ; preds = %23, %._crit_edge
  br i1 %5, label %.lr.ph79, label %._crit_edge80

.lr.ph79:                                         ; preds = %26
  %27 = load <2 x i64>, ptr %1, align 8, !tbaa !15
  %28 = add nsw i64 %wide.trip.count, -1
  %29 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %28, 3
  %30 = icmp ult i64 %29, 3
  br i1 %30, label %._crit_edge80.loopexit.unr-lcssa, label %.lr.ph79.new

.lr.ph79.new:                                     ; preds = %.lr.ph79
  %unroll_iter = and i64 %28, -4
  %invariant.gep = getelementptr inbounds i8, ptr %1, i64 24
  %invariant.gep118 = getelementptr inbounds i8, ptr %1, i64 48
  %invariant.gep120 = getelementptr inbounds i8, ptr %1, i64 72
  br label %31

31:                                               ; preds = %31, %.lr.ph79.new
  %indvars.iv94 = phi i64 [ 1, %.lr.ph79.new ], [ %indvars.iv.next95.3, %31 ]
  %niter = phi i64 [ 0, %.lr.ph79.new ], [ %niter.next.3, %31 ]
  %32 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv94
  %33 = load <2 x i64>, ptr %32, align 8, !tbaa !15
  %34 = sub nsw <2 x i64> %33, %27
  store <2 x i64> %34, ptr %32, align 8, !tbaa !15
  %gep = getelementptr inbounds %struct.Point, ptr %invariant.gep, i64 %indvars.iv94
  %35 = load <2 x i64>, ptr %gep, align 8, !tbaa !15
  %36 = sub nsw <2 x i64> %35, %27
  store <2 x i64> %36, ptr %gep, align 8, !tbaa !15
  %gep119 = getelementptr inbounds %struct.Point, ptr %invariant.gep118, i64 %indvars.iv94
  %37 = load <2 x i64>, ptr %gep119, align 8, !tbaa !15
  %38 = sub nsw <2 x i64> %37, %27
  store <2 x i64> %38, ptr %gep119, align 8, !tbaa !15
  %gep121 = getelementptr inbounds %struct.Point, ptr %invariant.gep120, i64 %indvars.iv94
  %39 = load <2 x i64>, ptr %gep121, align 8, !tbaa !15
  %40 = sub nsw <2 x i64> %39, %27
  store <2 x i64> %40, ptr %gep121, align 8, !tbaa !15
  %indvars.iv.next95.3 = add nuw nsw i64 %indvars.iv94, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge80.loopexit.unr-lcssa, label %31, !llvm.loop !17

._crit_edge80.loopexit.unr-lcssa:                 ; preds = %31, %.lr.ph79
  %indvars.iv94.unr = phi i64 [ 1, %.lr.ph79 ], [ %indvars.iv.next95.3, %31 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge80, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge80.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv94.epil = phi i64 [ %indvars.iv.next95.epil, %.epil.preheader ], [ %indvars.iv94.unr, %._crit_edge80.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge80.loopexit.unr-lcssa ]
  %41 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv94.epil
  %42 = load <2 x i64>, ptr %41, align 8, !tbaa !15
  %43 = sub nsw <2 x i64> %42, %27
  store <2 x i64> %43, ptr %41, align 8, !tbaa !15
  %indvars.iv.next95.epil = add nuw nsw i64 %indvars.iv94.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge80, label %.epil.preheader, !llvm.loop !18

._crit_edge80:                                    ; preds = %._crit_edge80.loopexit.unr-lcssa, %.epil.preheader, %3, %26
  %44 = getelementptr inbounds i8, ptr %1, i64 24
  %45 = add nsw i32 %2, -1
  %46 = sext i32 %45 to i64
  tail call void @qsort(ptr noundef nonnull %44, i64 noundef %46, i64 noundef 24, ptr noundef nonnull @compare_point) #6
  %47 = icmp sgt i32 %2, 2
  br i1 %47, label %.lr.ph83, label %._crit_edge84

.lr.ph83:                                         ; preds = %._crit_edge80
  %48 = add nsw i32 %2, -2
  %49 = getelementptr inbounds %struct.Point, ptr %1, i64 %46
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %49, i64 8
  %52 = load i64, ptr %51, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %.lr.ph83, %61
  %indvars.iv102 = phi i32 [ %45, %.lr.ph83 ], [ %indvars.iv.next103, %61 ]
  %.281 = phi i32 [ %48, %.lr.ph83 ], [ %62, %61 ]
  %54 = zext nneg i32 %.281 to i64
  %55 = getelementptr inbounds %struct.Point, ptr %1, i64 %54
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %58 = mul nsw i64 %57, %50
  %59 = load i64, ptr %55, align 8, !tbaa !5
  %60 = mul nsw i64 %52, %59
  %.not70 = icmp eq i64 %58, %60
  br i1 %.not70, label %61, label %65

61:                                               ; preds = %53
  %62 = add nsw i32 %.281, -1
  %63 = icmp sgt i32 %.281, 1
  %indvars.iv.next103 = add i32 %indvars.iv102, -1
  br i1 %63, label %53, label %._crit_edge84, !llvm.loop !20

._crit_edge84:                                    ; preds = %61, %._crit_edge80
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
  br label %80

65:                                               ; preds = %53
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
  %wide.trip.count105 = zext i32 %indvars.iv102 to i64
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 16
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !21
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.pre)
  %exitcond106.peel.not = icmp eq i32 %indvars.iv102, 1
  br i1 %exitcond106.peel.not, label %.preheader, label %.lr.ph88.peel.next

.preheader:                                       ; preds = %.lr.ph88.peel.next, %65
  %68 = icmp sgt i32 %45, %.281
  br i1 %68, label %.lr.ph90, label %._crit_edge91

.lr.ph88.peel.next:                               ; preds = %65, %.lr.ph88.peel.next
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph88.peel.next ], [ 1, %65 ]
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %70 = getelementptr inbounds %struct.Point, ptr %1, i64 %indvars.iv99, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %71)
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count105
  br i1 %exitcond106.not, label %.preheader, label %.lr.ph88.peel.next, !llvm.loop !22

.lr.ph90:                                         ; preds = %.preheader, %.lr.ph90
  %.489 = phi i32 [ %77, %.lr.ph90 ], [ %45, %.preheader ]
  %73 = zext nneg i32 %.489 to i64
  %74 = getelementptr inbounds %struct.Point, ptr %1, i64 %73, i32 2
  %75 = load i32, ptr %74, align 8, !tbaa !21
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %75)
  %77 = add nsw i32 %.489, -1
  %78 = icmp sgt i32 %77, %.281
  br i1 %78, label %.lr.ph90, label %._crit_edge91, !llvm.loop !24

._crit_edge91:                                    ; preds = %.lr.ph90, %.preheader
  %79 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %80

80:                                               ; preds = %._crit_edge91, %._crit_edge84
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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 = { nofree 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree "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 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i64 0, i64 8, !15, i64 8, i64 8, !15, i64 16, i64 4, !16}
!15 = !{!7, !7, i64 0}
!16 = !{!10, !10, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !13}
!21 = !{!6, !10, i64 16}
!22 = distinct !{!22, !13, !23}
!23 = !{!"llvm.loop.peeled.count", i32 1}
!24 = distinct !{!24, !13}


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