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

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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.KSwapKick = external hidden unnamed_addr constant [20 x i8], align 1
@FirstNode = external dso_local global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local void @KSwapKick(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = mul i64 %8, 8
  %10 = call noalias ptr @malloc(i64 noundef %9) #7
  store ptr %10, ptr %3, align 8, !tbaa !9
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  br label %14

13:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 22, ptr noundef @__PRETTY_FUNCTION__.KSwapKick) #8
  unreachable

14:                                               ; preds = %12
  store i32 0, ptr %5, align 4, !tbaa !5
  %15 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  store ptr %15, ptr %4, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %23, %14
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %5, align 4, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.Node, ptr %19, i32 0, i32 2
  store i32 %18, ptr %20, align 8, !tbaa !11
  %21 = load ptr, ptr %4, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.Node, ptr %21, i32 0, i32 3
  store i32 0, ptr %22, align 4, !tbaa !14
  br label %23

23:                                               ; preds = %16
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.Node, ptr %24, i32 0, i32 16
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  store ptr %26, ptr %4, align 8, !tbaa !9
  %27 = load ptr, ptr @FirstNode, align 8, !tbaa !9
  %28 = icmp ne ptr %26, %27
  br i1 %28, label %16, label %29, !llvm.loop !16

29:                                               ; preds = %23
  %30 = call ptr @RandomNode()
  %31 = load ptr, ptr %3, align 8, !tbaa !9
  %32 = getelementptr inbounds ptr, ptr %31, i64 0
  store ptr %30, ptr %32, align 8, !tbaa !9
  store ptr %30, ptr %4, align 8, !tbaa !9
  %33 = load ptr, ptr %4, align 8, !tbaa !9
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %29
  br label %124

36:                                               ; preds = %29
  %37 = load ptr, ptr %4, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.Node, ptr %37, i32 0, i32 3
  store i32 1, ptr %38, align 4, !tbaa !14
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %57, %36
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %60

43:                                               ; preds = %39
  %44 = call ptr @RandomNode()
  %45 = load ptr, ptr %3, align 8, !tbaa !9
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  store ptr %44, ptr %48, align 8, !tbaa !9
  store ptr %44, ptr %4, align 8, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !9
  %50 = icmp ne ptr %49, null
  br i1 %50, label %53, label %51

51:                                               ; preds = %43
  %52 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %56

53:                                               ; preds = %43
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.Node, ptr %54, i32 0, i32 3
  store i32 1, ptr %55, align 4, !tbaa !14
  br label %56

56:                                               ; preds = %53, %51
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !5
  br label %39, !llvm.loop !18

60:                                               ; preds = %39
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = icmp slt i32 %61, 3
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  br label %124

64:                                               ; preds = %60
  %65 = load ptr, ptr %3, align 8, !tbaa !9
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  call void @qsort(ptr noundef %65, i64 noundef %67, i64 noundef 8, ptr noundef @compare)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %86, %64
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %89

72:                                               ; preds = %68
  %73 = load ptr, ptr %3, align 8, !tbaa !9
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %73, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.Node, ptr %77, i32 0, i32 16
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = load ptr, ptr %3, align 8, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.Node, ptr %84, i32 0, i32 18
  store ptr %79, ptr %85, align 8, !tbaa !19
  br label %86

86:                                               ; preds = %72
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %68, !llvm.loop !20

89:                                               ; preds = %68
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %120, %89
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %123

94:                                               ; preds = %90
  %95 = load ptr, ptr %3, align 8, !tbaa !9
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = add nsw i32 %96, 2
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = srem i32 %97, %98
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds ptr, ptr %95, i64 %100
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = load ptr, ptr %3, align 8, !tbaa !9
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.Node, ptr %107, i32 0, i32 18
  %109 = load ptr, ptr %108, align 8, !tbaa !19
  %110 = load ptr, ptr %3, align 8, !tbaa !9
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = add nsw i32 %111, 2
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = srem i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %110, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.Node, ptr %117, i32 0, i32 16
  store ptr %109, ptr %118, align 8, !tbaa !15
  %119 = getelementptr inbounds %struct.Node, ptr %109, i32 0, i32 15
  store ptr %102, ptr %119, align 8, !tbaa !21
  br label %120

120:                                              ; preds = %94
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %6, align 4, !tbaa !5
  br label %90, !llvm.loop !22

123:                                              ; preds = %90
  br label %124

124:                                              ; preds = %123, %63, %35
  %125 = load ptr, ptr %3, align 8, !tbaa !9
  call void @free(ptr noundef %125) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void
}

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

; 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
declare hidden ptr @RandomNode() #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn 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 = { "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 = { 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 }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { noreturn 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, !6, i64 8}
!12 = !{!"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, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !13, i64 312, !13, i64 320, !13, i64 328, !13, i64 336, !13, i64 344, !13, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 12}
!15 = !{!12, !10, i64 72}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!12, !10, i64 88}
!20 = distinct !{!20, !17}
!21 = !{!12, !10, i64 64}
!22 = distinct !{!22, !17}


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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@__PRETTY_FUNCTION__.KSwapKick = external hidden unnamed_addr constant [20 x i8], align 1
@FirstNode = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local void @KSwapKick(i32 noundef %0) local_unnamed_addr #0 {
  %2 = sext i32 %0 to i64
  %3 = shl nsw i64 %2, 3
  %4 = tail call noalias ptr @malloc(i64 noundef %3) #5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %6

5:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 22, ptr noundef nonnull @__PRETTY_FUNCTION__.KSwapKick) #6
  unreachable

6:                                                ; preds = %1
  %7 = load ptr, ptr @FirstNode, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %8, %6
  %.038 = phi ptr [ %7, %6 ], [ %13, %8 ]
  %.037 = phi i32 [ 0, %6 ], [ %9, %8 ]
  %9 = add nuw nsw i32 %.037, 1
  %10 = getelementptr inbounds i8, ptr %.038, i64 8
  store i32 %9, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %.038, i64 12
  store i32 0, ptr %11, align 4, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %.038, i64 72
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %.not44 = icmp eq ptr %13, %7
  br i1 %.not44, label %14, label %8, !llvm.loop !15

14:                                               ; preds = %8
  %15 = tail call ptr @RandomNode()
  store ptr %15, ptr %4, align 8, !tbaa !5
  %.not45 = icmp eq ptr %15, null
  br i1 %.not45, label %.loopexit, label %16

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %15, i64 12
  store i32 1, ptr %17, align 4, !tbaa !13
  %18 = icmp sgt i32 %0, 1
  br i1 %18, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %16, %24
  %indvars.iv = phi i64 [ %indvars.iv.next, %24 ], [ 1, %16 ]
  %.03947 = phi i32 [ %.140, %24 ], [ %0, %16 ]
  %19 = tail call ptr @RandomNode()
  %20 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv
  store ptr %19, ptr %20, align 8, !tbaa !5
  %.not46 = icmp eq ptr %19, null
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  br i1 %.not46, label %24, label %22

22:                                               ; preds = %.lr.ph
  %23 = getelementptr inbounds i8, ptr %19, i64 12
  store i32 1, ptr %23, align 4, !tbaa !13
  br label %24

24:                                               ; preds = %.lr.ph, %22
  %.140 = phi i32 [ %.03947, %22 ], [ %21, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = sext i32 %.140 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %24
  %27 = icmp slt i32 %.140, 3
  br i1 %27, label %.loopexit, label %28

28:                                               ; preds = %._crit_edge
  %29 = zext nneg i32 %.140 to i64
  tail call void @qsort(ptr noundef nonnull %4, i64 noundef %29, i64 noundef 8, ptr noundef nonnull @compare) #7
  %xtraiter = and i64 %29, 3
  %30 = icmp eq i32 %.140, 3
  br i1 %30, label %.lr.ph51.preheader.unr-lcssa, label %.new

.new:                                             ; preds = %28
  %unroll_iter = and i64 %29, 2147483644
  br label %31

31:                                               ; preds = %31, %.new
  %indvars.iv53 = phi i64 [ 0, %.new ], [ %indvars.iv.next54.3, %31 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %31 ]
  %32 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv53
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 72
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %33, i64 88
  store ptr %35, ptr %36, align 8, !tbaa !18
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %37 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next54
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 72
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = getelementptr inbounds i8, ptr %38, i64 88
  store ptr %40, ptr %41, align 8, !tbaa !18
  %indvars.iv.next54.1 = or disjoint i64 %indvars.iv53, 2
  %42 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next54.1
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 72
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds i8, ptr %43, i64 88
  store ptr %45, ptr %46, align 8, !tbaa !18
  %indvars.iv.next54.2 = or disjoint i64 %indvars.iv53, 3
  %47 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next54.2
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 72
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %48, i64 88
  store ptr %50, ptr %51, align 8, !tbaa !18
  %indvars.iv.next54.3 = add nuw nsw i64 %indvars.iv53, 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 %.lr.ph51.preheader.unr-lcssa, label %31, !llvm.loop !19

.lr.ph51.preheader.unr-lcssa:                     ; preds = %31, %28
  %indvars.iv53.unr = phi i64 [ 0, %28 ], [ %indvars.iv.next54.3, %31 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph51.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.lr.ph51.preheader.unr-lcssa, %.epil.preheader
  %indvars.iv53.epil = phi i64 [ %indvars.iv.next54.epil, %.epil.preheader ], [ %indvars.iv53.unr, %.lr.ph51.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.lr.ph51.preheader.unr-lcssa ]
  %52 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv53.epil
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 72
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %53, i64 88
  store ptr %55, ptr %56, align 8, !tbaa !18
  %indvars.iv.next54.epil = add nuw nsw i64 %indvars.iv53.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 %.lr.ph51.preheader, label %.epil.preheader, !llvm.loop !20

.lr.ph51.preheader:                               ; preds = %.epil.preheader, %.lr.ph51.preheader.unr-lcssa
  %xtraiter62 = and i64 %29, 1
  %unroll_iter65 = and i64 %29, 2147483646
  br label %.lr.ph51

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader
  %indvars.iv56 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next57.1, %.lr.ph51 ]
  %niter66 = phi i64 [ 0, %.lr.ph51.preheader ], [ %niter66.next.1, %.lr.ph51 ]
  %57 = trunc i64 %indvars.iv56 to i32
  %58 = add i32 %57, 2
  %59 = urem i32 %58, %.140
  %60 = zext nneg i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %4, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv56
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 88
  %66 = load ptr, ptr %65, align 8, !tbaa !18
  %67 = getelementptr inbounds i8, ptr %62, i64 72
  store ptr %66, ptr %67, align 8, !tbaa !14
  %68 = getelementptr inbounds i8, ptr %66, i64 64
  store ptr %62, ptr %68, align 8, !tbaa !22
  %indvars.iv.next57 = or disjoint i64 %indvars.iv56, 1
  %69 = trunc i64 %indvars.iv.next57 to i32
  %70 = add i32 %69, 2
  %71 = urem i32 %70, %.140
  %72 = zext nneg i32 %71 to i64
  %73 = getelementptr inbounds ptr, ptr %4, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next57
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 88
  %78 = load ptr, ptr %77, align 8, !tbaa !18
  %79 = getelementptr inbounds i8, ptr %74, i64 72
  store ptr %78, ptr %79, align 8, !tbaa !14
  %80 = getelementptr inbounds i8, ptr %78, i64 64
  store ptr %74, ptr %80, align 8, !tbaa !22
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2
  %niter66.next.1 = add i64 %niter66, 2
  %niter66.ncmp.1 = icmp eq i64 %niter66.next.1, %unroll_iter65
  br i1 %niter66.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph51, !llvm.loop !23

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph51
  %lcmp.mod64.not = icmp eq i64 %xtraiter62, 0
  br i1 %lcmp.mod64.not, label %.loopexit, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %.loopexit.loopexit.unr-lcssa
  %81 = trunc i64 %indvars.iv.next57.1 to i32
  %82 = add i32 %81, 2
  %83 = urem i32 %82, %.140
  %84 = zext nneg i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %4, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv.next57.1
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %88, i64 88
  %90 = load ptr, ptr %89, align 8, !tbaa !18
  %91 = getelementptr inbounds i8, ptr %86, i64 72
  store ptr %90, ptr %91, align 8, !tbaa !14
  %92 = getelementptr inbounds i8, ptr %90, i64 64
  store ptr %86, ptr %92, align 8, !tbaa !22
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph51.epil, %.loopexit.loopexit.unr-lcssa, %16, %._crit_edge, %14
  tail call void @free(ptr noundef nonnull %4) #7
  ret void
}

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden ptr @RandomNode() local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn 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 #3 = { 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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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, !11, i64 8}
!10 = !{!"Node", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, 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, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !12, i64 344, !12, i64 352, !7, i64 360, !7, i64 361, !7, i64 362}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!10, !6, i64 72}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!10, !6, i64 88}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = !{!10, !6, i64 64}
!23 = distinct !{!23, !16}


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