; LLVM IR from jingweizhanghuai/Morn :: src/image (morn_image_geometry2)

; 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.MImagePoint = type { float, float }
%struct.MChainNode = type { ptr, ptr, ptr }
%struct.MList = type { i32, ptr }

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 void @ConvexHull(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.MImagePoint, align 4
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %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
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.MChainNode, 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 8, ptr %8) #6
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.MChainNode, ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.MChainNode, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  store ptr %28, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.MList, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  store ptr %31, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.MImagePoint, ptr %32, i32 0, i32 0
  %34 = load float, ptr %33, align 4, !tbaa !15
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.MImagePoint, ptr %35, i32 0, i32 0
  %37 = load float, ptr %36, align 4, !tbaa !15
  %38 = fsub float %34, %37
  %39 = fpext float %38 to double
  store double %39, ptr %10, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.MImagePoint, ptr %40, i32 0, i32 1
  %42 = load float, ptr %41, align 4, !tbaa !20
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.MImagePoint, ptr %43, i32 0, i32 1
  %45 = load float, ptr %44, align 4, !tbaa !20
  %46 = fsub float %42, %45
  %47 = fpext float %46 to double
  store double %47, ptr %11, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %48 = load double, ptr %11, align 8, !tbaa !18
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MImagePoint, ptr %49, i32 0, i32 0
  %51 = load float, ptr %50, align 4, !tbaa !15
  %52 = fpext float %51 to double
  %53 = load double, ptr %10, align 8, !tbaa !18
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.MImagePoint, ptr %54, i32 0, i32 1
  %56 = load float, ptr %55, align 4, !tbaa !20
  %57 = fpext float %56 to double
  %58 = fmul double %53, %57
  %59 = fneg double %58
  %60 = call double @llvm.fmuladd.f64(double %48, double %52, double %59)
  store double %60, ptr %12, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store double 1.000000e-01, ptr %16, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !21
  br label %61

61:                                               ; preds = %128, %3
  %62 = load i32, ptr %17, align 4, !tbaa !21
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MList, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !22
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %131

68:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %69 = load double, ptr %11, align 8, !tbaa !18
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load i32, ptr %17, align 4, !tbaa !21
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %70, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MImagePoint, ptr %74, i32 0, i32 0
  %76 = load float, ptr %75, align 4, !tbaa !15
  %77 = fpext float %76 to double
  %78 = load double, ptr %10, align 8, !tbaa !18
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = load i32, ptr %17, align 4, !tbaa !21
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.MImagePoint, ptr %83, i32 0, i32 1
  %85 = load float, ptr %84, align 4, !tbaa !20
  %86 = fpext float %85 to double
  %87 = fmul double %78, %86
  %88 = fneg double %87
  %89 = call double @llvm.fmuladd.f64(double %69, double %77, double %88)
  %90 = load double, ptr %12, align 8, !tbaa !18
  %91 = fsub double %89, %90
  store double %91, ptr %18, align 8, !tbaa !18
  %92 = load double, ptr %18, align 8, !tbaa !18
  %93 = fcmp olt double %92, 0.000000e+00
  br i1 %93, label %94, label %127

94:                                               ; preds = %68
  %95 = load double, ptr %18, align 8, !tbaa !18
  %96 = load double, ptr %16, align 8, !tbaa !18
  %97 = fcmp olt double %95, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %94
  %99 = load double, ptr %18, align 8, !tbaa !18
  store double %99, ptr %16, align 8, !tbaa !18
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %17, align 4, !tbaa !21
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %104, i64 8, i1 false), !tbaa.struct !23
  br label %105

105:                                              ; preds = %98, %94
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load i32, ptr %15, align 4, !tbaa !21
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  store ptr %110, ptr %13, align 8, !tbaa !5
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load i32, ptr %17, align 4, !tbaa !21
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds ptr, ptr %111, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = load i32, ptr %15, align 4, !tbaa !21
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds ptr, ptr %116, i64 %118
  store ptr %115, ptr %119, align 8, !tbaa !5
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load i32, ptr %17, align 4, !tbaa !21
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %121, i64 %123
  store ptr %120, ptr %124, align 8, !tbaa !5
  %125 = load i32, ptr %15, align 4, !tbaa !21
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %15, align 4, !tbaa !21
  br label %127

127:                                              ; preds = %105, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %17, align 4, !tbaa !21
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %17, align 4, !tbaa !21
  br label %61, !llvm.loop !25

131:                                              ; preds = %67
  %132 = load double, ptr %16, align 8, !tbaa !18
  %133 = fcmp olt double %132, -0.000000e+00
  br i1 %133, label %134, label %173

134:                                              ; preds = %131
  %135 = load i32, ptr %15, align 4, !tbaa !21
  %136 = icmp eq i32 %135, 1
  br i1 %136, label %137, label %148

137:                                              ; preds = %134
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = call i32 @memcmp(ptr noundef %14, ptr noundef %138, i64 noundef 8) #7
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %137
  store i32 1, ptr %19, align 4
  br label %174

142:                                              ; preds = %137
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = call i32 @memcmp(ptr noundef %14, ptr noundef %143, i64 noundef 8) #7
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %142
  store i32 1, ptr %19, align 4
  br label %174

147:                                              ; preds = %142
  br label %148

148:                                              ; preds = %147, %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = call ptr @mChainNode(ptr noundef %149, ptr noundef %14, i32 noundef 8)
  store ptr %150, ptr %20, align 8, !tbaa !5
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = load ptr, ptr %20, align 8, !tbaa !5
  call void @mChainNodeInsert(ptr noundef %151, ptr noundef %152, ptr noundef null)
  %153 = load i32, ptr %15, align 4, !tbaa !21
  %154 = icmp sgt i32 %153, 1
  br i1 %154, label %155, label %162

155:                                              ; preds = %148
  %156 = load i32, ptr %15, align 4, !tbaa !21
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.MList, ptr %157, i32 0, i32 0
  store i32 %156, ptr %158, align 8, !tbaa !22
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  call void @ConvexHull(ptr noundef %159, ptr noundef %160, ptr noundef %161)
  br label %162

162:                                              ; preds = %155, %148
  %163 = load i32, ptr %15, align 4, !tbaa !21
  %164 = icmp sgt i32 %163, 1
  br i1 %164, label %165, label %172

165:                                              ; preds = %162
  %166 = load i32, ptr %15, align 4, !tbaa !21
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.MList, ptr %167, i32 0, i32 0
  store i32 %166, ptr %168, align 8, !tbaa !22
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ConvexHull(ptr noundef %169, ptr noundef %170, ptr noundef %171)
  br label %172

172:                                              ; preds = %165, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %173

173:                                              ; preds = %172, %131
  store i32 0, ptr %19, align 4
  br label %174

174:                                              ; preds = %173, %146, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %175 = load i32, ptr %19, align 4
  switch i32 %175, label %177 [
    i32 0, label %176
    i32 1, label %176
  ]

176:                                              ; preds = %174, %174
  ret void

177:                                              ; preds = %174
  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) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

declare ptr @mChainNode(ptr noundef, ptr noundef, i32 noundef) #5

declare void @mChainNodeInsert(ptr noundef, ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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: readwrite) }
attributes #4 = { 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 #5 = { "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 = !{!"MChainNode", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!10, !6, i64 16}
!12 = !{!13, !6, i64 8}
!13 = !{!"MList", !14, i64 0, !6, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"MImagePoint", !17, i64 0, !17, i64 4}
!17 = !{!"float", !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!16, !17, i64 4}
!21 = !{!14, !14, i64 0}
!22 = !{!13, !14, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24}
!24 = !{!17, !17, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"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"

%struct.MImagePoint = type { float, float }

; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 void @ConvexHull(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.MImagePoint, align 8
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !10
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = load float, ptr %5, align 4, !tbaa !14
  %12 = load float, ptr %8, align 4, !tbaa !14
  %13 = fsub float %11, %12
  %14 = fpext float %13 to double
  %15 = getelementptr inbounds i8, ptr %5, i64 4
  %16 = load float, ptr %15, align 4, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %8, i64 4
  %18 = load float, ptr %17, align 4, !tbaa !17
  %19 = fsub float %16, %18
  %20 = fpext float %19 to double
  %21 = fpext float %12 to double
  %22 = fpext float %18 to double
  %23 = fneg double %14
  %24 = fmul double %23, %22
  %25 = tail call double @llvm.fmuladd.f64(double %20, double %21, double %24)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %26 = load i32, ptr %0, align 8, !tbaa !18
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph.preheader, label %.critedge

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

._crit_edge:                                      ; preds = %49
  %28 = fcmp olt double %.2, 0.000000e+00
  br i1 %28, label %50, label %.critedge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %49
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %49 ]
  %.062 = phi i32 [ 0, %.lr.ph.preheader ], [ %.1, %49 ]
  %.05561 = phi double [ 1.000000e-01, %.lr.ph.preheader ], [ %.2, %49 ]
  %29 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = load float, ptr %30, align 4, !tbaa !14
  %32 = fpext float %31 to double
  %33 = getelementptr inbounds i8, ptr %30, i64 4
  %34 = load float, ptr %33, align 4, !tbaa !17
  %35 = fpext float %34 to double
  %36 = fmul double %23, %35
  %37 = tail call double @llvm.fmuladd.f64(double %20, double %32, double %36)
  %38 = fsub double %37, %25
  %39 = fcmp olt double %38, 0.000000e+00
  br i1 %39, label %40, label %49

40:                                               ; preds = %.lr.ph
  %41 = fcmp olt double %38, %.05561
  br i1 %41, label %42, label %44

42:                                               ; preds = %40
  %43 = load i64, ptr %30, align 4
  store i64 %43, ptr %4, align 8
  br label %44

44:                                               ; preds = %42, %40
  %.156 = phi double [ %38, %42 ], [ %.05561, %40 ]
  %45 = sext i32 %.062 to i64
  %46 = getelementptr inbounds ptr, ptr %10, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !19
  store ptr %30, ptr %46, align 8, !tbaa !19
  store ptr %47, ptr %29, align 8, !tbaa !19
  %48 = add nsw i32 %.062, 1
  br label %49

49:                                               ; preds = %44, %.lr.ph
  %.2 = phi double [ %.156, %44 ], [ %.05561, %.lr.ph ]
  %.1 = phi i32 [ %48, %44 ], [ %.062, %.lr.ph ]
  %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 !20

50:                                               ; preds = %._crit_edge
  %51 = icmp eq i32 %.1, 1
  br i1 %51, label %52, label %56

52:                                               ; preds = %50
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %4, ptr noundef nonnull dereferenceable(8) %5, i64 8)
  %53 = icmp eq i32 %bcmp, 0
  br i1 %53, label %.critedge, label %54

54:                                               ; preds = %52
  %bcmp59 = call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %4, ptr noundef nonnull dereferenceable(8) %8, i64 8)
  %55 = icmp eq i32 %bcmp59, 0
  br i1 %55, label %.critedge, label %56

56:                                               ; preds = %54, %50
  %57 = call ptr @mChainNode(ptr noundef %1, ptr noundef nonnull %4, i32 noundef 8) #5
  call void @mChainNodeInsert(ptr noundef nonnull %2, ptr noundef %57, ptr noundef null) #5
  %58 = icmp sgt i32 %.1, 1
  br i1 %58, label %59, label %.critedge

59:                                               ; preds = %56
  store i32 %.1, ptr %0, align 8, !tbaa !18
  call void @ConvexHull(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %2)
  store i32 %.1, ptr %0, align 8, !tbaa !18
  call void @ConvexHull(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %57)
  br label %.critedge

.critedge:                                        ; preds = %3, %._crit_edge, %56, %59, %54, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret void
}

declare ptr @mChainNode(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @mChainNodeInsert(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { 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 = !{!"MChainNode", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!12, !7, i64 8}
!12 = !{!"MList", !13, i64 0, !7, i64 8}
!13 = !{!"int", !8, i64 0}
!14 = !{!15, !16, i64 0}
!15 = !{!"MImagePoint", !16, i64 0, !16, i64 4}
!16 = !{!"float", !8, i64 0}
!17 = !{!15, !16, i64 4}
!18 = !{!12, !13, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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