; LLVM IR from fcimeson/cbTSP :: cbLKH/SRC (Sequence)

; 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.Node = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double, double, double, double, i8, i8, i8 }
%struct.Segment = type { i8, ptr, ptr, ptr, ptr, i32, i32, ptr }

@Reversed = external dso_local global i16, align 2
@t = external dso_local global ptr, align 8
@p = external dso_local global ptr, align 8
@tp1 = external hidden global ptr, align 8
@q = external dso_local global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local void @FindPermutation(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %59, %1
  %6 = load i32, ptr %4, align 4, !tbaa !5
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp sle i32 %6, %7
  br i1 %8, label %9, label %64

9:                                                ; preds = %5
  %10 = load i16, ptr @Reversed, align 2, !tbaa !9
  %11 = sext i16 %10 to i32
  %12 = load ptr, ptr @t, align 8, !tbaa !11
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds ptr, ptr %12, i64 %14
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct.Node, ptr %16, i32 0, i32 45
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = getelementptr inbounds %struct.Segment, ptr %18, i32 0, i32 0
  %20 = load i8, ptr %19, align 8, !tbaa !16
  %21 = sext i8 %20 to i32
  %22 = icmp eq i32 %11, %21
  br i1 %22, label %23, label %31

23:                                               ; preds = %9
  %24 = load ptr, ptr @t, align 8, !tbaa !11
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %24, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.Node, ptr %28, i32 0, i32 16
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  br label %39

31:                                               ; preds = %9
  %32 = load ptr, ptr @t, align 8, !tbaa !11
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.Node, ptr %36, i32 0, i32 15
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  br label %39

39:                                               ; preds = %31, %23
  %40 = phi ptr [ %30, %23 ], [ %38, %31 ]
  %41 = load ptr, ptr @t, align 8, !tbaa !11
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %41, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = icmp eq ptr %40, %46
  br i1 %47, label %48, label %50

48:                                               ; preds = %39
  %49 = load i32, ptr %3, align 4, !tbaa !5
  br label %53

50:                                               ; preds = %39
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  br label %53

53:                                               ; preds = %50, %48
  %54 = phi i32 [ %49, %48 ], [ %52, %50 ]
  %55 = load ptr, ptr @p, align 8, !tbaa !11
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %55, i64 %57
  store i32 %54, ptr %58, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %53
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = add nsw i32 %60, 2
  store i32 %61, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %5, !llvm.loop !20

64:                                               ; preds = %5
  %65 = load ptr, ptr @t, align 8, !tbaa !11
  %66 = load ptr, ptr @p, align 8, !tbaa !11
  %67 = getelementptr inbounds i32, ptr %66, i64 1
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds ptr, ptr %65, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  store ptr %71, ptr @tp1, align 8, !tbaa !11
  %72 = load ptr, ptr @p, align 8, !tbaa !11
  %73 = getelementptr inbounds i32, ptr %72, i64 2
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  call void @qsort(ptr noundef %73, i64 noundef %76, i64 noundef 4, ptr noundef @compare)
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = mul nsw i32 2, %77
  store i32 %78, ptr %4, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %109, %64
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = icmp sge i32 %80, 2
  br i1 %81, label %82, label %112

82:                                               ; preds = %79
  %83 = load ptr, ptr @p, align 8, !tbaa !11
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sdiv i32 %84, 2
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %83, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  store i32 %88, ptr %3, align 4, !tbaa !5
  %89 = load ptr, ptr @p, align 8, !tbaa !11
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr %89, i64 %92
  store i32 %88, ptr %93, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = and i32 %94, 1
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %100

97:                                               ; preds = %82
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  br label %103

100:                                              ; preds = %82
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  br label %103

103:                                              ; preds = %100, %97
  %104 = phi i32 [ %99, %97 ], [ %102, %100 ]
  %105 = load ptr, ptr @p, align 8, !tbaa !11
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  store i32 %104, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %103
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 2
  store i32 %111, ptr %4, align 4, !tbaa !5
  br label %79, !llvm.loop !22

112:                                              ; preds = %79
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %128, %112
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = mul nsw i32 2, %115
  %117 = icmp sle i32 %114, %116
  br i1 %117, label %118, label %131

118:                                              ; preds = %113
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = load ptr, ptr @q, align 8, !tbaa !11
  %121 = load ptr, ptr @p, align 8, !tbaa !11
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %120, i64 %126
  store i32 %119, ptr %127, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %118
  %129 = load i32, ptr %3, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %3, align 4, !tbaa !5
  br label %113, !llvm.loop !23

131:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret void
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 304}
!14 = !{!"Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !15, i64 312, !15, i64 320, !15, i64 328, !15, i64 336, !15, i64 344, !15, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !7, i64 0}
!17 = !{!"Segment", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !6, i64 40, !6, i64 44, !12, i64 48}
!18 = !{!14, !12, i64 72}
!19 = !{!14, !12, i64 64}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}


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

@Reversed = external dso_local local_unnamed_addr global i16, align 2
@t = external dso_local local_unnamed_addr global ptr, align 8
@p = external dso_local local_unnamed_addr global ptr, align 8
@tp1 = external hidden local_unnamed_addr global ptr, align 8
@q = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: nofree nounwind uwtable
define dso_local void @FindPermutation(i32 noundef %0) local_unnamed_addr #0 {
  %.not31 = icmp slt i32 %0, 1
  %.pre = load ptr, ptr @t, align 8, !tbaa !5
  %.pre54 = load ptr, ptr @p, align 8, !tbaa !5
  br i1 %.not31, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %2 = load i16, ptr @Reversed, align 2, !tbaa !9
  %3 = add nuw i32 %0, 1
  %wide.trip.count = zext i32 %3 to i64
  %invariant.gep = getelementptr inbounds i8, ptr %.pre, i64 8
  br label %4

4:                                                ; preds = %.lr.ph, %4
  %indvars.iv41 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next42, %4 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %4 ]
  %indvars45 = trunc i64 %indvars.iv41 to i32
  %5 = getelementptr inbounds ptr, ptr %.pre, i64 %indvars.iv41
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 304
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = load i8, ptr %8, align 8, !tbaa !15
  %10 = sext i8 %9 to i16
  %11 = icmp eq i16 %2, %10
  %.in.v = select i1 %11, i64 72, i64 64
  %.in = getelementptr inbounds i8, ptr %6, i64 %.in.v
  %12 = load ptr, ptr %.in, align 8, !tbaa !5
  %gep = getelementptr inbounds ptr, ptr %invariant.gep, i64 %indvars.iv41
  %13 = load ptr, ptr %gep, align 8, !tbaa !5
  %14 = icmp ne ptr %12, %13
  %15 = zext i1 %14 to i32
  %16 = add nuw nsw i32 %indvars45, %15
  %17 = getelementptr inbounds i32, ptr %.pre54, i64 %indvars.iv
  store i32 %16, ptr %17, align 4, !tbaa !17
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 2
  %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 %4, !llvm.loop !18

._crit_edge:                                      ; preds = %4, %1
  %18 = getelementptr inbounds i8, ptr %.pre54, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !17
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds ptr, ptr %.pre, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %22, ptr @tp1, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %.pre54, i64 8
  %24 = add nsw i32 %0, -1
  %25 = sext i32 %24 to i64
  tail call void @qsort(ptr noundef nonnull %23, i64 noundef %25, i64 noundef 4, ptr noundef nonnull @compare) #4
  %26 = shl i32 %0, 1
  %27 = icmp sgt i32 %0, 0
  br i1 %27, label %.lr.ph36, label %._crit_edge40

.lr.ph36:                                         ; preds = %._crit_edge
  %28 = load ptr, ptr @p, align 8, !tbaa !5
  %29 = zext i32 %26 to i64
  br label %34

.preheader:                                       ; preds = %34
  br i1 %.not31, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %.preheader
  %30 = load ptr, ptr @q, align 8, !tbaa !5
  %31 = load ptr, ptr @p, align 8, !tbaa !5
  %smax = tail call i32 @llvm.smax.i32(i32 %26, i32 1)
  %32 = zext nneg i32 %smax to i64
  %xtraiter = and i64 %32, 3
  %33 = icmp slt i32 %26, 4
  br i1 %33, label %._crit_edge40.loopexit.unr-lcssa, label %.lr.ph39.new

.lr.ph39.new:                                     ; preds = %.lr.ph39
  %unroll_iter = and i64 %32, 2147483644
  br label %45

34:                                               ; preds = %.lr.ph36, %34
  %indvars.iv46 = phi i64 [ %29, %.lr.ph36 ], [ %indvars.iv.next47, %34 ]
  %35 = trunc nuw i64 %indvars.iv46 to i32
  %36 = lshr exact i64 %indvars.iv46, 1
  %37 = and i64 %36, 2147483647
  %38 = getelementptr inbounds i32, ptr %28, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !17
  %40 = getelementptr i32, ptr %28, i64 %indvars.iv46
  %41 = getelementptr i8, ptr %40, i64 -4
  store i32 %39, ptr %41, align 4, !tbaa !17
  %42 = and i32 %39, 1
  %.not30 = icmp eq i32 %42, 0
  %.v = select i1 %.not30, i32 -1, i32 1
  %43 = add nsw i32 %.v, %39
  store i32 %43, ptr %40, align 4, !tbaa !17
  %indvars.iv.next47 = add nsw i64 %indvars.iv46, -2
  %44 = icmp sgt i32 %35, 3
  br i1 %44, label %34, label %.preheader, !llvm.loop !20

45:                                               ; preds = %45, %.lr.ph39.new
  %indvars.iv49 = phi i64 [ 1, %.lr.ph39.new ], [ %indvars.iv.next50.3, %45 ]
  %niter = phi i64 [ 0, %.lr.ph39.new ], [ %niter.next.3, %45 ]
  %46 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv49
  %47 = load i32, ptr %46, align 4, !tbaa !17
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr %30, i64 %48
  %50 = trunc nuw nsw i64 %indvars.iv49 to i32
  store i32 %50, ptr %49, align 4, !tbaa !17
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %51 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next50
  %52 = load i32, ptr %51, align 4, !tbaa !17
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr %30, i64 %53
  %55 = trunc nuw nsw i64 %indvars.iv.next50 to i32
  store i32 %55, ptr %54, align 4, !tbaa !17
  %indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 2
  %56 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next50.1
  %57 = load i32, ptr %56, align 4, !tbaa !17
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr %30, i64 %58
  %60 = trunc nuw nsw i64 %indvars.iv.next50.1 to i32
  store i32 %60, ptr %59, align 4, !tbaa !17
  %indvars.iv.next50.2 = add nuw nsw i64 %indvars.iv49, 3
  %61 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv.next50.2
  %62 = load i32, ptr %61, align 4, !tbaa !17
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %30, i64 %63
  %65 = trunc nuw nsw i64 %indvars.iv.next50.2 to i32
  store i32 %65, ptr %64, align 4, !tbaa !17
  %indvars.iv.next50.3 = add nuw nsw i64 %indvars.iv49, 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_edge40.loopexit.unr-lcssa, label %45, !llvm.loop !21

._crit_edge40.loopexit.unr-lcssa:                 ; preds = %45, %.lr.ph39
  %indvars.iv49.unr = phi i64 [ 1, %.lr.ph39 ], [ %indvars.iv.next50.3, %45 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge40, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge40.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv49.epil = phi i64 [ %indvars.iv.next50.epil, %.epil.preheader ], [ %indvars.iv49.unr, %._crit_edge40.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge40.loopexit.unr-lcssa ]
  %66 = getelementptr inbounds i32, ptr %31, i64 %indvars.iv49.epil
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %30, i64 %68
  %70 = trunc nuw nsw i64 %indvars.iv49.epil to i32
  store i32 %70, ptr %69, align 4, !tbaa !17
  %indvars.iv.next50.epil = add nuw nsw i64 %indvars.iv49.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_edge40, label %.epil.preheader, !llvm.loop !22

._crit_edge40:                                    ; preds = %._crit_edge40.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge, %.preheader
  ret void
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

attributes #0 = { 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 #1 = { 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 #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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 304}
!12 = !{!"Node", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !14, i64 312, !14, i64 320, !14, i64 328, !14, i64 336, !14, i64 344, !14, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"Segment", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 44, !6, i64 48}
!17 = !{!13, !13, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}


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